CN118135205A - A hyperspectral image anomaly detection method - Google Patents
A hyperspectral image anomaly detection method Download PDFInfo
- Publication number
- CN118135205A CN118135205A CN202410544586.1A CN202410544586A CN118135205A CN 118135205 A CN118135205 A CN 118135205A CN 202410544586 A CN202410544586 A CN 202410544586A CN 118135205 A CN118135205 A CN 118135205A
- Authority
- CN
- China
- Prior art keywords
- pixel
- matrix
- hyperspectral image
- point
- mahalanobis distance
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 64
- 239000011159 matrix material Substances 0.000 claims abstract description 80
- 230000002159 abnormal effect Effects 0.000 claims abstract description 29
- 238000000034 method Methods 0.000 claims description 49
- 239000013598 vector Substances 0.000 claims description 29
- 238000004422 calculation algorithm Methods 0.000 claims description 16
- 238000004590 computer program Methods 0.000 claims description 16
- 230000008569 process Effects 0.000 claims description 10
- 230000005856 abnormality Effects 0.000 claims description 9
- 238000001914 filtration Methods 0.000 claims description 7
- 238000012216 screening Methods 0.000 claims description 7
- 238000004364 calculation method Methods 0.000 claims description 6
- 230000009467 reduction Effects 0.000 claims description 6
- 238000000513 principal component analysis Methods 0.000 claims description 5
- 238000004458 analytical method Methods 0.000 claims description 4
- 230000001174 ascending effect Effects 0.000 claims description 4
- 238000006243 chemical reaction Methods 0.000 claims 1
- 230000017105 transposition Effects 0.000 claims 1
- 238000010586 diagram Methods 0.000 description 14
- 230000000052 comparative effect Effects 0.000 description 7
- 230000003595 spectral effect Effects 0.000 description 5
- 230000006870 function Effects 0.000 description 3
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 2
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 108010035322 rhamnogalacturonan acetylesterase Proteins 0.000 description 2
- 230000011218 segmentation Effects 0.000 description 2
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000011109 contamination Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 238000003709 image segmentation Methods 0.000 description 1
- 238000003331 infrared imaging Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/25—Determination of region of interest [ROI] or a volume of interest [VOI]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/26—Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/10—Terrestrial scenes
- G06V20/194—Terrestrial scenes using hyperspectral data, i.e. more or other wavelengths than RGB
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V2201/00—Indexing scheme relating to image or video recognition or understanding
- G06V2201/07—Target detection
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Remote Sensing (AREA)
- Spectroscopy & Molecular Physics (AREA)
- Image Analysis (AREA)
Abstract
Description
技术领域Technical Field
本发明涉及一种高光谱图像异常检测方法,属于高光谱图像处理技术领域。The invention relates to a hyperspectral image anomaly detection method and belongs to the technical field of hyperspectral image processing.
背景技术Background technique
高光谱图像包含几十甚至上百个光谱波段,具有较高的光谱分辨率,其包含丰富的地物光谱特征信息,可极大地提高准确检测与识别地物类别的能力。在高光谱图像中,将与周围背景存在很大光谱差异的像素定义为异常。Hyperspectral images contain dozens or even hundreds of spectral bands and have high spectral resolution. They contain rich spectral feature information of ground objects, which can greatly improve the ability to accurately detect and identify ground object categories. In hyperspectral images, pixels with large spectral differences from the surrounding background are defined as anomalies.
RX算法是最典型的高光谱异常检测方法之一。RX算法将图像建模为多元高斯分布,估计全局图像的均值和协方差矩阵,然后将待测像元与背景之间的马氏距离作为异常决策准则。但是,RX算法仍然存在一些缺点,RX算法使用所有像素来计算背景统计(均值和协方差矩阵)往往会导致污染,因为计算中使用了异常像素(与背景差异很大),因此背景统计不完全准确;RX算法基于高斯分布假设,但在实际应用中,很多高光谱图像数据并不符合高斯分布。针对RX算法的一些缺点,人们对RX算法进行了许多改进,如Local RX (LRX)算法和Kernel RX (KRX)算法。LRX是最典型的基于窗口的方法,LRX算法引入了局部信息的概念,即在计算协方差矩阵时只考虑一个像素点周围一定范围内的数据,而不考虑整个图像。LRX的检测性能通常优于RX,因为局部窗口的背景像素更倾向于服从高斯分布。但LRX算法对稀疏数据处理能力较差,当高光谱数据稀疏时,LRX算法的性能可能会受到影响。The RX algorithm is one of the most typical hyperspectral anomaly detection methods. The RX algorithm models the image as a multivariate Gaussian distribution, estimates the mean and covariance matrix of the global image, and then uses the Mahalanobis distance between the pixel to be tested and the background as the anomaly decision criterion. However, the RX algorithm still has some shortcomings. The RX algorithm uses all pixels to calculate the background statistics (mean and covariance matrix), which often leads to contamination because abnormal pixels (which are very different from the background) are used in the calculation, so the background statistics are not completely accurate; the RX algorithm is based on the Gaussian distribution assumption, but in practical applications, many hyperspectral image data do not conform to the Gaussian distribution. In response to some shortcomings of the RX algorithm, many improvements have been made to the RX algorithm, such as the Local RX (LRX) algorithm and the Kernel RX (KRX) algorithm. LRX is the most typical window-based method. The LRX algorithm introduces the concept of local information, that is, only the data within a certain range around a pixel is considered when calculating the covariance matrix, without considering the entire image. The detection performance of LRX is usually better than that of RX because the background pixels in the local window tend to obey the Gaussian distribution. However, the LRX algorithm has poor processing capabilities for sparse data. When the hyperspectral data is sparse, the performance of the LRX algorithm may be affected.
发明内容Summary of the invention
目的:鉴于以上技术问题中的至少一项,本发明提供一种高光谱图像异常检测方法,能够提高高光谱图像异常检测结果准确率。Objective: In view of at least one of the above technical problems, the present invention provides a hyperspectral image anomaly detection method, which can improve the accuracy of hyperspectral image anomaly detection results.
技术方案:为解决上述技术问题,本发明采用的技术方案为:Technical solution: To solve the above technical problems, the technical solution adopted by the present invention is:
第一方面,本发明提供一种高光谱图像异常检测方法,包括:In a first aspect, the present invention provides a method for detecting anomalies in a hyperspectral image, comprising:
对待检测的高光谱图像矩阵进行分割,获取固定窗口区域和超像素的区域;Segment the hyperspectral image matrix to be detected to obtain the fixed window area and super-pixel area;
将待检测的高光谱图像矩阵转换为全局二维图像矩阵;Converting the hyperspectral image matrix to be detected into a global two-dimensional image matrix;
针对全局二维图像矩阵、固定窗口区域和超像素的区域,分别使用锚点生成模型处理和局部马氏距离模型处理,获得三种异常检测结果;For the global two-dimensional image matrix, fixed window area and superpixel area, the anchor point generation model and local Mahalanobis distance model are used to process respectively, and three types of anomaly detection results are obtained;
其中使用锚点生成模型处理包括:计算目标区域内每个像素点与均值向量的马氏距离;根据每个像素点与均值向量的马氏距离对所有像素点进行升序排序,获得图像矩阵;循环计算所述图像矩阵/>中每个像素点与其他像素点之间的马氏距离,筛选马氏距离小于距离阈值的像素点获得点集/>;筛选出像素点的数量大于数量阈值的点集进行分析平均值,获得锚点和锚点集;The anchor point generation model processing includes: calculating the Mahalanobis distance between each pixel point and the mean vector in the target area; sorting all pixels in ascending order according to the Mahalanobis distance between each pixel point and the mean vector to obtain the image matrix ; Loop to calculate the image matrix/> The Mahalanobis distance between each pixel and other pixels in the point set is obtained by filtering pixels whose Mahalanobis distance is less than the distance threshold. ; Filter out the point set whose number of pixels is greater than the number threshold, analyze the average value, and obtain the anchor point and anchor point set;
其中使用局部马氏距离模型处理包括:计算像素点与最近锚点的马氏距离,得到该像素点的异常分数,从而得到异常检测结果;The processing using the local Mahalanobis distance model includes: calculating the Mahalanobis distance between the pixel point and the nearest anchor point to obtain the anomaly score of the pixel point, thereby obtaining an anomaly detection result;
将三种异常检测结果考虑逻辑“或”“与”操作进行融合,得到最终异常检测结果。The three anomaly detection results are merged by considering the logical “OR” and “AND” operations to obtain the final anomaly detection result.
在一些实施例中,获取固定窗口区域的方法包括:将高光谱图像矩阵划分为z个/>的非重叠块的固定窗口区域/>;其中,L、M、B分别表示高光谱图像的长、宽和波段数量,/>,/>表示固定窗口区域的长、宽;In some embodiments, the method for obtaining a fixed window area includes: Divide into z/> Fixed window area of non-overlapping blocks of /> ; Where L, M, and B represent the length, width, and number of bands of the hyperspectral image, respectively./> ,/> Indicates the length and width of the fixed window area;
在一些实施例中,获取超像素的区域的方法包括:In some embodiments, a method for obtaining a region of a superpixel includes:
利用主成分分析PCA对高光谱图像矩阵进行降维,其中,L、M、B分别表示高光谱图像的长、宽和波段数量;The hyperspectral image matrix is analyzed using principal component analysis (PCA). Dimensionality reduction is performed, where L, M, and B represent the length, width, and number of bands of the hyperspectral image, respectively;
利用超像素分割算法SLIC将降维后的高光谱图像矩阵分割为c个超像素的区域。The superpixel segmentation algorithm SLIC is used to segment the hyperspectral image matrix after dimensionality reduction into c superpixel regions. .
在一些实施例中,将待检测的高光谱图像矩阵转换为全局二维图像矩阵,包括:In some embodiments, converting the hyperspectral image matrix to be detected into a global two-dimensional image matrix includes:
将高光谱图像矩阵转换为全局二维图像矩阵,其中,L、M、B分别表示高 光谱图像的长、宽和波段数量,所述全局二维图像矩阵是由K个1×B的像素点组成,其中,K= L*M。 The hyperspectral image matrix Convert to a global 2D image matrix , where L, M, and B represent the length, width, and number of bands of the hyperspectral image, respectively. The global two-dimensional image matrix is composed of K 1×B pixels, where K = L*M.
在一些实施例中,计算目标区域内每个像素点与均值向量的马氏距离,包括:In some embodiments, calculating the Mahalanobis distance between each pixel point in the target area and the mean vector includes:
其中,为像素点X与均值向量的马氏距离,μ为均值向量,T表示矩阵的转置,为协方差矩阵,为协方差矩阵的逆矩阵;M表示高光谱图像的宽;所述均值向量的表达 式为: in, is the Mahalanobis distance between pixel point X and mean vector, μ is the mean vector, T represents the transpose of the matrix, is the covariance matrix, is the inverse matrix of the covariance matrix; M represents the width of the hyperspectral image; the expression of the mean vector is:
其中,表示第l个像素点,K=L*M。 in, Represents the lth pixel, K=L*M.
在一些实施例中,计算所述图像矩阵中每个像素点与其他像素点之间的马氏 距离,包括: In some embodiments, the image matrix is calculated The Mahalanobis distance between each pixel and other pixels in includes:
两个像素点之间的马氏距离的计算公式为:The calculation formula of the Mahalanobis distance between two pixels is:
其中,为像素点X和像素点Y之间的马氏距离;M表示高光谱图像的宽; 为协方差矩阵,为协方差矩阵的逆矩阵。 in, is the Mahalanobis distance between pixel X and pixel Y; M represents the width of the hyperspectral image; is the covariance matrix, is the inverse of the covariance matrix.
在一些实施例中,筛选马氏距离小于距离阈值的像素点获得点集,包括: In some embodiments, pixel points whose Mahalanobis distance is less than a distance threshold are selected to obtain a point set. ,include:
其中,表示第g个点集,表示所述图像矩阵中的第h个向量,表示所述图 像矩阵中的第个向量, 为非负数,gamma为距离阈值。 in, represents the g-th point set, Represents the image matrix The hth vector in , Represents the first vectors, is a non-negative number, and gamma is the distance threshold.
在一些实施例中,筛选出像素点的数量大于数量阈值的点集进行分析平均值,获得锚点Sg和锚点集S,包括:In some embodiments, a point set whose number of pixel points is greater than a number threshold is screened out for analysis and average value to obtain an anchor point Sg and an anchor point set S, including:
其中,表示通过数量阈值筛选后的第g个点集的元素个数,表示通过数量阈值 筛选后的第g个点集中的第q个元素, 表示1到的全部元素之和; in, Represents the number of elements in the g-th point set after filtering by the quantity threshold, represents the qth element in the gth point set after filtering by the quantity threshold, Indicates 1 to The sum of all the elements of
所有锚点的集合称为锚点集;所述锚点集S的表达式为:The set of all anchor points is called an anchor point set; the expression of the anchor point set S is:
其中,表示筛选后的第p个点集的平均值,即第p个锚点。 in, Represents the average value of the p-th point set after screening, that is, the p-th anchor point.
在一些实施例中,计算像素点与最近锚点的马氏距离,得到该像素点的异常分数,包括:In some embodiments, calculating the Mahalanobis distance between a pixel point and a nearest anchor point to obtain an abnormality score of the pixel point includes:
其中,K为像素点总数,为第l个像素点与最近锚点的马氏距离,为第l个像素点与第g个锚点Sg的马氏距离;M表示高光谱图像的宽。 Among them, K is the total number of pixels, is the lth pixel The Mahalanobis distance to the nearest anchor point, is the lth pixel The Mahalanobis distance with the g-th anchor point S g ; M represents the width of the hyperspectral image.
在一些实施例中,将三种异常检测结果考虑逻辑“或”“与”操作进行融合,得到最终异常检测结果,包括:In some embodiments, the three anomaly detection results are merged by considering logical “OR” and “AND” operations to obtain a final anomaly detection result, including:
其中,Final表示最终异常检测结果,OR表示逻辑“或”,AND表示逻辑“与”,R1、R2、R3 分别表示三种异常检测结果,代表权重参数。 Among them, Final represents the final anomaly detection result, OR represents logical "or", AND represents logical "and", R 1 , R 2 , and R 3 represent three types of anomaly detection results respectively. Represents the weight parameter.
第二方面,本发明提供了一种高光谱图像异常检测装置,包括处理器及存储介质;In a second aspect, the present invention provides a hyperspectral image anomaly detection device, including a processor and a storage medium;
所述存储介质用于存储指令;The storage medium is used to store instructions;
所述处理器用于根据所述指令进行操作以执行根据第一方面所述的方法。The processor is configured to operate according to the instructions to execute the method according to the first aspect.
第三方面,本发明提供了一种设备,包括,In a third aspect, the present invention provides a device, comprising:
存储器;Memory;
处理器;processor;
以及as well as
计算机程序;Computer program;
其中,所述计算机程序存储在所述存储器中,并被配置为由所述处理器执行以实现上述第一方面所述的方法。The computer program is stored in the memory and is configured to be executed by the processor to implement the method described in the first aspect above.
第四方面,本发明提供了一种存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现第一方面所述的方法。In a fourth aspect, the present invention provides a storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method described in the first aspect.
有益效果:本发明提供的高光谱图像异常检测方法,对原始图像进行分割,将图像矩阵划分非重叠块的固定窗口区域和超像素的区域两种局部区域;通过锚点生成算法模型获取锚点集,首先对区域内的所有像素点的光谱向量求平均值,分析区域内每个像素点与均值向量的马氏距离,获得每个像素点与均值向量的马氏距离,根据每个像素点与均值向量的马氏距离对像素点进行升序排序,获得图像矩阵;根据图像矩阵,循环分析区域内每个像素点与其他像素点之间的马氏距离,并分析该马氏距离是否小于距离阈值,获得点集,分析点集中像素点的数量是否大于数量阈值,大于数量阈值就对所述点集分析平均值,获得锚点集;通过局部马氏局部模型分析每个像素点与最近锚点的马氏距离为对应的异常分数,确定异常检测结果;分别以全局区域中的像素点、固定窗口区域像素块中的像素点和超像素的区域超像素块中的像素点为输入,采用所述锚点生成模型和局部马氏距离模型获得三种异常检测结果;将三种异常检测结果考虑逻辑“或”和逻辑“与”操作,然后进行融合,得到最终异常检测结果。由此,该方法通过图像分割、锚点生成、局部马氏距离分析和逻辑融合等步骤,提升了高光谱图像异常检测检测的准确性。Beneficial effects: The hyperspectral image anomaly detection method provided by the present invention segments the original image, and divides the image matrix into two local areas: a fixed window area of non-overlapping blocks and an area of superpixels; an anchor point set is obtained through an anchor point generation algorithm model, and the spectral vectors of all pixels in the area are averaged first, and the Mahalanobis distance between each pixel point and the mean vector in the area is analyzed to obtain the Mahalanobis distance between each pixel point and the mean vector, and the pixels are sorted in ascending order according to the Mahalanobis distance between each pixel point and the mean vector to obtain an image matrix; according to the image matrix, the Mahalanobis distance between each pixel point in the area and other pixels is cyclically analyzed, and the Mahalanobis distance is analyzed whether the Mahalanobis distance Less than the distance threshold, obtain the point set, analyze whether the number of pixels in the point set is greater than the number threshold, if greater than the number threshold, analyze the average value of the point set to obtain the anchor point set; analyze the Mahalanobis distance between each pixel and the nearest anchor point as the corresponding abnormal score through the local Mahalanobis local model to determine the abnormality detection result; take the pixels in the global area, the pixels in the fixed window area pixel block and the pixels in the super pixel block of the super pixel area as input, and use the anchor point generation model and the local Mahalanobis distance model to obtain three abnormality detection results; consider the logical "or" and logical "and" operations of the three abnormality detection results, and then fuse them to obtain the final abnormality detection result. Therefore, this method improves the accuracy of abnormality detection in hyperspectral images through the steps of image segmentation, anchor point generation, local Mahalanobis distance analysis and logical fusion.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为本发明实施例高光谱图像异常检测方法的示意图。FIG1 is a schematic diagram of a method for detecting anomalies in a hyperspectral image according to an embodiment of the present invention.
图2为本发明实施例Urban城市高光谱图像的RGB伪彩色图像。FIG. 2 is an RGB pseudo-color image of an Urban city hyperspectral image according to an embodiment of the present invention.
图3为本发明对比例Urban城市高光谱图像的真实地物位置图。FIG3 is a map showing the real location of objects in an Urban city hyperspectral image of a comparative example of the present invention.
图4为本发明对比例Urban城市高光谱图像的异常目标检测结构图(Method1)。FIG. 4 is a structural diagram of abnormal target detection of an Urban city hyperspectral image according to a comparative example of the present invention (Method 1).
图5为本发明对比例Urban城市高光谱图像的异常目标检测结果图(Method2)。FIG. 5 is a diagram showing abnormal target detection results of an Urban city hyperspectral image according to a comparative example of the present invention (Method 2).
图6为本发明对比例Urban城市高光谱图像的异常目标检测结构图(Method3)FIG6 is a diagram showing the abnormal target detection structure of the Urban city hyperspectral image of the comparative example of the present invention (Method 3)
图7为本发明对比例Urban城市高光谱图像的异常目标检测结构图(Method4)。FIG. 7 is a structural diagram of abnormal target detection of an Urban city hyperspectral image according to a comparative example of the present invention (Method 4).
图8为本发明对比例Urban城市高光谱图像的异常目标检测结构图(Method5。FIG8 is a structural diagram of abnormal target detection of an Urban city hyperspectral image according to a comparative example of the present invention (Method 5.
图9为本发明对比例Urban城市高光谱图像的异常目标检测结构图(Method6)。FIG9 is a structural diagram of abnormal target detection of an Urban city hyperspectral image according to a comparative example of the present invention (Method 6).
图10为本发明实施例Urban城市高光谱图像异常目标检测结果图。FIG. 10 is a diagram showing abnormal target detection results of an Urban city hyperspectral image according to an embodiment of the present invention.
具体实施方式Detailed ways
下面结合附图和实施例对本发明作进一步描述。以下实施例仅用于更加清楚地说明本发明的技术方案,而不能以此来限制本发明的保护范围。The present invention will be further described below in conjunction with the accompanying drawings and embodiments. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.
在本发明的描述中,若干的含义是一个以上,多个的含义是两个以上,大于、小于、超过等理解为不包括本数,以上、以下、以内等理解为包括本数。如果有描述到第一、第二只是用于区分技术特征为目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量或者隐含指明所指示的技术特征的先后关系。In the description of the present invention, "several" means more than one, "many" means more than two, "greater than", "less than", "exceed", etc. are understood to exclude the number itself, and "above", "below", "within", etc. are understood to include the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
本发明的描述中,参考术语“一个实施例”、“一些实施例”、“示意性实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。In the description of the present invention, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
实施例1Example 1
第一方面,如图1所示,本实施例提供了一种高光谱图像异常检测方法,包括:In a first aspect, as shown in FIG1 , this embodiment provides a method for detecting anomalies in a hyperspectral image, including:
S1、对待检测的高光谱图像矩阵进行分割,获取固定窗口区域和超像素的区域;S1. Segment the hyperspectral image matrix to be detected to obtain the fixed window area and the super-pixel area;
在一些实施例中,获取固定窗口区域的方法包括:将高光谱图像矩阵划分为 z个的非重叠块的固定窗口区域;其中,L、M、B分别表示高光谱图像的长、宽和波段 数量,,表示固定窗口区域的长、宽; In some embodiments, the method for obtaining a fixed window area includes: Divide into z Fixed window area of non-overlapping blocks of ; Where L, M, and B represent the length, width, and number of bands of the hyperspectral image, respectively. , Indicates the length and width of the fixed window area;
在一些实施例中,获取超像素的区域的方法包括:In some embodiments, a method for obtaining a region of a superpixel includes:
利用主成分分析PCA对高光谱图像矩阵进行降维,其中,L、M、B分别表示高光 谱图像的长、宽和波段数量; The hyperspectral image matrix is analyzed using principal component analysis (PCA). Dimensionality reduction is performed, where L, M, and B represent the length, width, and number of bands of the hyperspectral image, respectively;
利用超像素分割算法SLIC将降维后的高光谱图像矩阵分割为c个超像素的区域。 The superpixel segmentation algorithm SLIC is used to segment the hyperspectral image matrix after dimensionality reduction into c superpixel regions. .
S2、将待检测的高光谱图像矩阵转换为全局二维图像矩阵;S2, converting the hyperspectral image matrix to be detected into a global two-dimensional image matrix;
为便于并行计算,需要将三维的高光谱图像矩阵转换为全局二维图像矩阵。 In order to facilitate parallel computing, the three-dimensional hyperspectral image matrix needs to be Convert to a global 2D image matrix.
在一些实施例中,将待检测的高光谱图像矩阵转换为全局二维图像矩阵,包括:In some embodiments, converting the hyperspectral image matrix to be detected into a global two-dimensional image matrix includes:
将高光谱图像矩阵转换为全局二维图像矩阵,其中,L、M、B分别表示高 光谱图像的长、宽和波段数量,所述全局二维图像矩阵是由K个1×B的像素点组成,其中,K= L*M。 The hyperspectral image matrix Convert to a global 2D image matrix , where L, M, and B represent the length, width, and number of bands of the hyperspectral image, respectively. The global two-dimensional image matrix is composed of K 1×B pixels, where K = L*M.
S3、针对全局二维图像矩阵、固定窗口区域和超像素的区域,分别使用锚点生成模型处理和局部马氏距离模型处理,获得三种异常检测结果;S3, for the global two-dimensional image matrix, fixed window area and superpixel area, the anchor point generation model and the local Mahalanobis distance model are used to process respectively, and three types of anomaly detection results are obtained;
在该步骤中,分别以全局二维图像矩阵中的像素点、固定窗口区域像素块中的 像素点和超像素的区域超像素块中的像素点为输入,采用所述锚点生成模型和局部马氏 距离模型获得三种异常检测结果; In this step, the pixel points in the global two-dimensional image matrix and the pixel blocks in the fixed window area are respectively The pixel points and superpixel regions in the superpixel block The pixel points in are taken as input, and three anomaly detection results are obtained by using the anchor point generation model and the local Mahalanobis distance model;
其中,为固定窗口区域中的第i个窗口区域,为超像素的区域中的第j个像素 块。 in, is the i-th window area in the fixed window area, is the jth pixel block in the superpixel region.
S31、其中使用锚点生成模型处理包括:计算目标区域内每个像素点与均值向量的 马氏距离;根据每个像素点与均值向量的马氏距离对所有像素点进行升序排序,获得图像 矩阵;循环计算所述图像矩阵中每个像素点与其他像素点之间的马氏距离,筛选马 氏距离小于距离阈值的像素点获得点集;筛选出像素点的数量大于数量阈值的点集进行 分析平均值,获得锚点和锚点集; S31, wherein the anchor point generation model processing includes: calculating the Mahalanobis distance between each pixel point and the mean vector in the target area; sorting all the pixels in ascending order according to the Mahalanobis distance between each pixel point and the mean vector, and obtaining an image matrix ; Loop to calculate the image matrix The Mahalanobis distance between each pixel and other pixels in the point set is obtained by filtering pixels whose Mahalanobis distance is less than the distance threshold. ; Filter out the point set whose number of pixels is greater than the number threshold, analyze the average value, and obtain the anchor point and anchor point set;
进一步地,在一些实施例中,计算目标区域内每个像素点与均值向量的马氏距离,包括:Furthermore, in some embodiments, calculating the Mahalanobis distance between each pixel point in the target area and the mean vector includes:
其中,为像素点X与均值向量的马氏距离,μ为均值向量,T表示矩阵的转置,为协方差矩阵,为协方差矩阵的逆矩阵;M表示高光谱图像的宽;所述均值向量的表达 式为: in, is the Mahalanobis distance between pixel point X and mean vector, μ is the mean vector, T represents the transpose of the matrix, is the covariance matrix, is the inverse matrix of the covariance matrix; M represents the width of the hyperspectral image; the expression of the mean vector is:
其中,表示第l个像素点,K=L*M。 in, Represents the lth pixel, K=L*M.
在一些实施例中,计算所述图像矩阵中每个像素点与其他像素点之间的马氏 距离,包括: In some embodiments, the image matrix is calculated The Mahalanobis distance between each pixel and other pixels in includes:
两个像素点之间的马氏距离的计算公式为:The calculation formula of the Mahalanobis distance between two pixels is:
其中,为像素点X和像素点Y之间的马氏距离;M表示高光谱图像的宽; 为协方差矩阵,为协方差矩阵的逆矩阵。 in, is the Mahalanobis distance between pixel X and pixel Y; M represents the width of the hyperspectral image; is the covariance matrix, is the inverse of the covariance matrix.
进一步地,所述的协方差矩阵的计算方法包括:Furthermore, the calculation method of the covariance matrix includes:
(1)首先对样本的所有波段分析平均值;(1) First, analyze the average value of all bands of the sample;
(2)分别分析两个像素点的所有波段与其均值的差值向量;(2) Analyze the difference vectors between all bands of two pixels and their mean values respectively;
(3)求出像素点X和像素点Y所有波段的协方差;(3) Calculate the covariance of all bands of pixel point X and pixel point Y;
(4)构成协方差矩阵。(4) Construct the covariance matrix.
所述波段的平均值计算公式为:The average value of the band is calculated as:
所述协方差计算公式为:The covariance calculation formula is:
, ,
所述协方差矩阵的公式为:The formula of the covariance matrix is:
, ,
其中,表示像素点X的第i个维度,表示像素点Y的第j个维度,表示 和之间的协方差,表示期望值,表示X所有波段的平均值,表示Y所有波段的平均 值。 in, represents the i-th dimension of pixel X, represents the j-th dimension of pixel Y, express and The covariance between represents the expected value, represents the average value of all bands of X, Represents the average value of all bands of Y.
在一些实施例中,筛选马氏距离小于距离阈值的像素点获得点集,包括: In some embodiments, pixel points whose Mahalanobis distance is less than a distance threshold are selected to obtain a point set. ,include:
其中,表示第g个点集,表示所述图像矩阵中的第h个向量,表示所述图 像矩阵中的第个向量, 为非负数,gamma为距离阈值。 in, represents the g-th point set, Represents the image matrix The hth vector in , Represents the first vectors, is a non-negative number, and gamma is the distance threshold.
在一些实施例中,筛选出像素点的数量大于数量阈值的点集进行分析平均值,获得锚点Sg和锚点集S,包括:In some embodiments, a point set whose number of pixel points is greater than a number threshold is screened out for analysis and average value to obtain an anchor point Sg and an anchor point set S, including:
其中,表示通过数量阈值筛选后的第g个点集的元素个数,表示通过数量阈值 筛选后的第g个点集中的第q个元素, 表示1到的全部元素之和; in, Represents the number of elements in the g-th point set after filtering by the quantity threshold, represents the qth element in the gth point set after filtering by the quantity threshold, Indicates 1 to The sum of all the elements of
所有锚点的集合称为锚点集;所述锚点集S的表达式为:The set of all anchor points is called an anchor point set; the expression of the anchor point set S is:
其中,表示筛选后的第p个点集的平均值,即第p个锚点。 in, Represents the average value of the p-th point set after screening, that is, the p-th anchor point.
S32、其中使用局部马氏距离模型处理包括:计算像素点与最近锚点的马氏距离,得到该像素点的异常分数,从而得到异常检测结果;S32, wherein the processing using the local Mahalanobis distance model includes: calculating the Mahalanobis distance between the pixel point and the nearest anchor point to obtain an anomaly score of the pixel point, thereby obtaining an anomaly detection result;
在一些实施例中,计算像素点与最近锚点的马氏距离,得到该像素点的异常分数,包括:In some embodiments, calculating the Mahalanobis distance between a pixel point and a nearest anchor point to obtain an abnormality score of the pixel point includes:
其中,K为像素点总数,为第l个像素点与最近锚点的马氏距离,为第l个像素点与第g个锚点Sg的马氏距离;M表示高光谱图像的宽。 Among them, K is the total number of pixels, is the lth pixel The Mahalanobis distance to the nearest anchor point, is the lth pixel The Mahalanobis distance with the g-th anchor point S g ; M represents the width of the hyperspectral image.
S4、将三种异常检测结果考虑逻辑“或”“与”操作进行融合,得到最终异常检测结果。S4. The three anomaly detection results are merged by considering the logical “OR” and “AND” operations to obtain the final anomaly detection result.
在一些实施例中,将三种异常检测结果考虑逻辑“或”“与”操作进行融合,得到最终异常检测结果,包括:In some embodiments, the three anomaly detection results are merged by considering logical “OR” and “AND” operations to obtain a final anomaly detection result, including:
其中,Final表示最终异常检测结果,OR表示逻辑“或”,AND表示逻辑“与”,R1、R2、R3 分别表示三种异常检测结果,代表权重参数。 Among them, Final represents the final anomaly detection result, OR represents logical "or", AND represents logical "and", R 1 , R 2 , and R 3 represent three types of anomaly detection results respectively. Represents the weight parameter.
具体应用例:采用通过机载可见光/红外成像光谱仪(AVIRIS)获取的飞机场高光谱图像,如图2所示,Urban城市高光谱图像伪彩色图像,简称为Urban城市高光谱图像,Urban城市高光谱图像的空间分辨率为17.2米/像素,包含204个波段用于异常目标检测。Urban城市图像的实验区域数据大小为100×100。图3为Urban城市高光谱图像的真实地物位置(图3中的白光点即为异常目标)。分别采用现有的RX、LRX、CRD、LSMAD、FrFE、RGAE和本申请的高光谱图像异常检测方法对实施例Beach海滩高光谱图像进行异常目标检测,其异常目标检测准确率如表1所示:Specific application example: The airport hyperspectral image obtained by the airborne visible light/infrared imaging spectrometer (AVIRIS) is used, as shown in Figure 2, the Urban city hyperspectral image pseudo-color image, referred to as the Urban city hyperspectral image, the spatial resolution of the Urban city hyperspectral image is 17.2 meters/pixel, and it contains 204 bands for abnormal target detection. The experimental area data size of the Urban city image is 100×100. Figure 3 is the real location of the ground object in the Urban city hyperspectral image (the white light spot in Figure 3 is the abnormal target). The existing RX, LRX, CRD, LSMAD, FrFE, RGAE and the hyperspectral image anomaly detection method of the present application are used to detect abnormal targets on the Beach hyperspectral image of the embodiment, and the abnormal target detection accuracy is shown in Table 1:
表1 高光谱异常目标检测准确率对比表Table 1 Comparison of hyperspectral abnormal target detection accuracy
从表1的可知,本申请的高光谱图像异常检测方法异常目标检测准确率高达99.80%,其明显优于现有的其他几种方法。比准确率AUC得分第二的高LRX方法高0.51%。As can be seen from Table 1, the abnormal target detection accuracy of the hyperspectral image anomaly detection method of the present application is as high as 99.80%, which is significantly better than several other existing methods and 0.51% higher than the high LRX method with the second highest accuracy AUC score.
并且从图4、图5、图6、图7、图8、图9和图10中的异常目标的清楚程度、与背景的分离性程度可以看出,本申请的高光谱图像异常检测方法的异常目标检测效果明显比其他几种方法好。And from the clarity of the abnormal targets and the degree of separation from the background in Figures 4, 5, 6, 7, 8, 9 and 10, it can be seen that the abnormal target detection effect of the hyperspectral image anomaly detection method of the present application is significantly better than that of the other methods.
以上证实了本申请可有效提升异常目标检测准确率,其在高光谱的异常目标检测上可行。The above proves that the present invention can effectively improve the accuracy of abnormal target detection, and is feasible for abnormal target detection in hyperspectral images.
实施例2Example 2
第二方面,基于实施例1,本实施例提供了一种高光谱图像异常检测装置,包括处理器及存储介质;In a second aspect, based on embodiment 1, this embodiment provides a hyperspectral image anomaly detection device, including a processor and a storage medium;
所述存储介质用于存储指令;The storage medium is used to store instructions;
所述处理器用于根据所述指令进行操作以执行根据实施例1所述的方法。The processor is configured to operate according to the instructions to execute the method according to embodiment 1.
实施例3Example 3
第三方面,基于实施例1,本实施例提供了一种设备,包括,In a third aspect, based on embodiment 1, this embodiment provides a device, including:
存储器;Memory;
处理器;processor;
以及as well as
计算机程序;Computer program;
其中,所述计算机程序存储在所述存储器中,并被配置为由所述处理器执行以实现实施例1所述的方法。The computer program is stored in the memory and is configured to be executed by the processor to implement the method described in Example 1.
实施例4Example 4
第四方面,基于实施例1,本实施例提供了一种存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现实施例1所述的方法。In a fourth aspect, based on Embodiment 1, this embodiment provides a storage medium on which a computer program is stored, and when the computer program is executed by a processor, the method described in Embodiment 1 is implemented.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to the flowcharts and/or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and/or box in the flowchart and/or block diagram, as well as the combination of the processes and/or boxes in the flowchart and/or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate a device for implementing the functions specified in one process or multiple processes in the flowchart and/or one box or multiple boxes in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
以上所述仅是本发明的优选实施方式,应当指出:对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410544586.1A CN118135205B (en) | 2024-05-06 | 2024-05-06 | A hyperspectral image anomaly detection method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410544586.1A CN118135205B (en) | 2024-05-06 | 2024-05-06 | A hyperspectral image anomaly detection method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN118135205A true CN118135205A (en) | 2024-06-04 |
CN118135205B CN118135205B (en) | 2024-07-16 |
Family
ID=91246799
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410544586.1A Active CN118135205B (en) | 2024-05-06 | 2024-05-06 | A hyperspectral image anomaly detection method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118135205B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118379295A (en) * | 2024-06-25 | 2024-07-23 | 南京信息工程大学 | Hyperspectral anomaly detection method based on registration |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017190542A1 (en) * | 2016-05-04 | 2017-11-09 | 山东大学 | Partition-based vca end-member extraction method |
WO2021036267A1 (en) * | 2019-08-23 | 2021-03-04 | 华为技术有限公司 | Image detection method and related device |
CN114202539A (en) * | 2021-12-18 | 2022-03-18 | 南京理工大学 | An end-to-end RX-based hyperspectral image anomaly detection method |
CN117237618A (en) * | 2023-11-15 | 2023-12-15 | 南京信息工程大学 | Hyperspectral image anomaly detection method |
-
2024
- 2024-05-06 CN CN202410544586.1A patent/CN118135205B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017190542A1 (en) * | 2016-05-04 | 2017-11-09 | 山东大学 | Partition-based vca end-member extraction method |
WO2021036267A1 (en) * | 2019-08-23 | 2021-03-04 | 华为技术有限公司 | Image detection method and related device |
CN114202539A (en) * | 2021-12-18 | 2022-03-18 | 南京理工大学 | An end-to-end RX-based hyperspectral image anomaly detection method |
CN117237618A (en) * | 2023-11-15 | 2023-12-15 | 南京信息工程大学 | Hyperspectral image anomaly detection method |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118379295A (en) * | 2024-06-25 | 2024-07-23 | 南京信息工程大学 | Hyperspectral anomaly detection method based on registration |
Also Published As
Publication number | Publication date |
---|---|
CN118135205B (en) | 2024-07-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Yang et al. | Clustered object detection in aerial images | |
CN110084292B (en) | Target detection method based on DenseNet and multi-scale feature fusion | |
CN102938072B (en) | A kind of high-spectrum image dimensionality reduction and sorting technique based on the tensor analysis of piecemeal low-rank | |
CN113420640B (en) | Mangrove hyperspectral image classification method, device, electronic equipment and storage medium | |
CN115690542B (en) | Aerial insulator orientation identification method based on improvement yolov5 | |
CN111340831B (en) | Point cloud edge detection method and device | |
CN118135205B (en) | A hyperspectral image anomaly detection method | |
CN106503727A (en) | A kind of method and device of classification hyperspectral imagery | |
CN105701493A (en) | Image extraction and foreground estimation method and system based on hierarchical graph | |
CN113343900A (en) | Combined nuclear remote sensing image target detection method based on combination of CNN and superpixel | |
CN114882011A (en) | Fabric flaw detection method based on improved Scaled-YOLOv4 model | |
CN105913451A (en) | Natural image super pixel segmentation method based on graph model | |
CN109903246B (en) | Method and device for detecting image change | |
Rahman et al. | On the real-time semantic segmentation of aphid clusters in the wild | |
KR101906663B1 (en) | Collaborative facial color feature learning method of multiple color spaces for face recognition and apparatus therefor | |
Huang et al. | S 2 GFormer: A Transformer and Graph Convolution Combing Framework for Hyperspectral Image Classification | |
CN118485822A (en) | A target detection method based on improved YOLOv8 | |
CN117237618A (en) | Hyperspectral image anomaly detection method | |
Rao et al. | Classification of land cover usage from satellite images using deep learning algorithms | |
Zhou et al. | Hierarchical unified spectral-spatial aggregated transformer for hyperspectral image classification | |
CN113191259B (en) | Dynamic data expansion method and image classification method for hyperspectral image classification | |
Srinivasan et al. | Sugarcane leaf disease classification using deep neural network approach | |
Kanthi et al. | A 3D-Inception CNN for Hyperspectral Image Classification | |
CN113378683B (en) | A residual-driven band selection method for anomaly detection | |
Singh et al. | Image processing based Wheat spike detection using YOLO |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |