CN112990313A - Hyperspectral image anomaly detection method and device, computer equipment and storage medium - Google Patents
Hyperspectral image anomaly detection method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN112990313A CN112990313A CN202110279231.0A CN202110279231A CN112990313A CN 112990313 A CN112990313 A CN 112990313A CN 202110279231 A CN202110279231 A CN 202110279231A CN 112990313 A CN112990313 A CN 112990313A
- Authority
- CN
- China
- Prior art keywords
- image data
- hyperspectral image
- sub
- score
- principal component
- 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 183
- 230000005856 abnormality Effects 0.000 claims abstract description 149
- 238000012545 processing Methods 0.000 claims abstract description 107
- 230000011218 segmentation Effects 0.000 claims abstract description 92
- 230000003595 spectral effect Effects 0.000 claims abstract description 80
- 238000000034 method Methods 0.000 claims abstract description 76
- 238000001228 spectrum Methods 0.000 claims abstract description 62
- 238000009826 distribution Methods 0.000 claims abstract description 54
- 230000009467 reduction Effects 0.000 claims abstract description 45
- 238000004364 calculation method Methods 0.000 claims abstract description 39
- 238000000605 extraction Methods 0.000 claims abstract description 18
- 238000010606 normalization Methods 0.000 claims abstract description 14
- 230000002159 abnormal effect Effects 0.000 claims description 98
- 238000005457 optimization Methods 0.000 claims description 60
- 239000013598 vector Substances 0.000 claims description 45
- 238000000513 principal component analysis Methods 0.000 claims description 35
- 239000011159 matrix material Substances 0.000 claims description 34
- 238000003708 edge detection Methods 0.000 claims description 33
- 238000003709 image segmentation Methods 0.000 claims description 19
- 238000012549 training Methods 0.000 claims description 16
- 230000001629 suppression Effects 0.000 claims description 8
- 230000004044 response Effects 0.000 claims description 5
- 238000001914 filtration Methods 0.000 claims description 4
- 238000010586 diagram Methods 0.000 description 13
- 230000006870 function Effects 0.000 description 10
- 230000000007 visual effect Effects 0.000 description 10
- 230000000694 effects Effects 0.000 description 9
- 230000009466 transformation Effects 0.000 description 8
- 238000000354 decomposition reaction Methods 0.000 description 7
- 238000000926 separation method Methods 0.000 description 6
- 230000008901 benefit Effects 0.000 description 4
- 238000011156 evaluation Methods 0.000 description 4
- 230000006872 improvement Effects 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 238000011425 standardization method Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 3
- 102100027094 Echinoderm microtubule-associated protein-like 1 Human genes 0.000 description 2
- 101001057941 Homo sapiens Echinoderm microtubule-associated protein-like 1 Proteins 0.000 description 2
- 101000653787 Mus musculus Protein S100-A11 Proteins 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 2
- 230000000903 blocking effect Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 238000010276 construction Methods 0.000 description 2
- 238000007796 conventional method Methods 0.000 description 2
- 230000001186 cumulative effect Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000003331 infrared imaging Methods 0.000 description 2
- 230000005764 inhibitory process Effects 0.000 description 2
- 238000013507 mapping Methods 0.000 description 2
- 238000007781 pre-processing Methods 0.000 description 2
- 238000012935 Averaging Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000000701 chemical imaging Methods 0.000 description 1
- 230000007123 defense Effects 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000002955 isolation Methods 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 238000002156 mixing Methods 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000000877 morphologic effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000002123 temporal effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/243—Classification techniques relating to the number of classes
- G06F18/2433—Single-class perspective, e.g. one-against-all classification; Novelty detection; Outlier detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/50—Information retrieval; Database structures therefor; File system structures therefor of still image data
- G06F16/51—Indexing; Data structures therefor; Storage structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/243—Classification techniques relating to the number of classes
- G06F18/24323—Tree-organised classifiers
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
-
- 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/34—Smoothing or thinning of the pattern; Morphological operations; Skeletonisation
-
- 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/40—Extraction of image or video features
- G06V10/44—Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10032—Satellite or aerial image; Remote sensing
- G06T2207/10036—Multispectral image; Hyperspectral image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02A—TECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
- Y02A40/00—Adaptation technologies in agriculture, forestry, livestock or agroalimentary production
- Y02A40/10—Adaptation technologies in agriculture, forestry, livestock or agroalimentary production in agriculture
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Data Mining & Analysis (AREA)
- General Engineering & Computer Science (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Evolutionary Computation (AREA)
- Evolutionary Biology (AREA)
- Bioinformatics & Computational Biology (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Multimedia (AREA)
- Software Systems (AREA)
- Databases & Information Systems (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
Abstract
The embodiment of the application belongs to the technical field of hyperspectral remote sensing image anomaly detection, and relates to a hyperspectral image anomaly detection method which comprises the steps of carrying out normalization processing and dimension reduction processing on original hyperspectral image data to obtain first principal component image data; performing edge segmentation on the first principal component image data; acquiring spectral dimensional characteristics; performing anomaly detection on the spectrum dimensional characteristics to obtain a first spectrum anomaly score; performing threshold segmentation on the first principal component image data; performing space distribution feature extraction operation and space dimension feature acquisition on the intermediate hyperspectral image data; carrying out anomaly detection on the space dimensional characteristics to obtain a second space anomaly score; and performing weighted calculation on the first spectrum abnormality score and the second space abnormality score to obtain a target abnormality score of each pixel. The application also provides a hyperspectral image anomaly detection device, computer equipment and a storage medium. The method and the device can improve the accuracy of obtaining the pixel estimation value in the hyperspectral image.
Description
Technical Field
The application relates to the technical field of hyperspectral remote sensing image anomaly detection, in particular to a hyperspectral image anomaly detection method and device, computer equipment and a storage medium.
Background
High spectral resolution remote sensing, referred to as high spectral remote sensing for short, realizes the combination of imaging technology and spectrum technology, and can synchronously acquire ground object space information and fine spectrum information. The hyperspectral remote sensing data is an image cube, the two-dimensional spatial distribution characteristics of the ground features can be described, the spectral reflection characteristics of the ground features can be provided, and the hyperspectral image has the characteristics of nanoscale spectral resolution, hundreds of wave bands, wide-range spectral coverage from visible light to short-wave infrared wave bands and the like, so that the hyperspectral remote sensing data plays an increasingly important role in the fields of national defense and military, precise agriculture, environmental detection and the like in recent years. The hyperspectral image anomaly detection method has the characteristics of no need of any prior spectral information, strong practicability and the like, and is gradually one of the hot problems researched by scholars at home and abroad. In particular, anomaly detection is widely applied to scenes such as maritime search and rescue, rapid battlefield target prompting, fire disaster detection and the like.
Most of the traditional hyperspectral image anomaly detection methods are based on the argument that an anomaly pixel and a background pixel are compared in the spectral dimension and belong to a low-probability occurrence event, namely, the spectrum anomaly is the basis, the difference degree of the anomaly pixel and the background pixel in the spectral dimension is calculated, namely, an anomaly detection algorithm is designed based on the spectral dimension, but in the spatial dimension, the anomaly pixel is compared with the background pixel and usually belongs to a low-probability occurrence event, so that the spatial relationship between the pixels is ignored, anomaly detection is carried out only depending on the characteristics of the spatial dimension, and the traditional methods mostly have the problems of more serious omission phenomenon or higher false alarm rate and the like.
For example, in recent years, tensors (tensors) have been introduced as a multi-dimensional data representation tool in the field of hyperspectral anomaly detection, and spatial information and spectral information of hyperspectral images are processed at the same time, resulting in better results. Among them, in the document "Zhang Xing, Wen Gongjian, Dai weii.a temporal composition Based analysis Detection for Hyperspectral Image [ J ]. IEEE Transactions on geo science and Remote Sensing, vol.54, No.10, pp: 5801-. The method comprises the steps of firstly, expressing a hyperspectral image cube by using a third-Order tensor, and performing High Order Singular Value Decomposition (HOSVD) of the third-Order tensor on data, which is also called Tucker decomposition; then, removing background information in the hyperspectral image through main components of each dimension after decomposition; and finally, reconstructing abnormal data of the hyperspectral image by using the residual characteristic components, and detecting by using a Constant False-Alarm Rate (CFAR) algorithm. According to the method, spatial dimension and spectral dimension data of the hyperspectral data are analyzed simultaneously by tensor decomposition, spatial features and spectral features are comprehensively utilized, and the anomaly detection precision is improved to a certain extent. However, the method continues to use the idea of the traditional hyperspectral image anomaly detection method, and separates the abnormal pixels from the background ground objects by accurately modeling the background ground objects, however, due to the existence of abnormal targets in the hyperspectral data background ground objects and the influence of various small-area backgrounds under complex backgrounds, the background modeling precision is greatly limited, and the differentiability between the abnormal targets and the background ground objects is influenced; in addition, the number of main characteristic vectors of three dimensions in the tensor decomposition process is difficult to determine, so that the spatial information and the spectral information of the hyperspectral data are utilized in the same proportion, and the advantage that the hyperspectral data has fine spectral information cannot be fully exerted; and applying a Constant False Alarm Rate (CFAR) method to perform anomaly detection on the processed data, wherein the mathematical principle of the method is similar to that of an RX algorithm based on Mahalanobis distance; and the accuracy of most pixel estimation values in the data to be detected is easily influenced, so that the detection performance of the data to be detected is greatly influenced.
In recent years, isolated Forest algorithms are often introduced into a Hyperspectral image Anomaly detection task for avoiding accurate estimation and modeling of a background and obtaining a good detection effect, wherein a Hyperspectral image space spectrum combination characteristic Anomaly detection algorithm Based on a Forest isolated model is disclosed in the documents 'Wang R, Nie F, Wang Z, et al, multiple Features and Isolation for rest-Based Fast analysis Detector for Hyperspectral imaging [ J ]. IEEE Transactions on Geoscience and Remote Sensing,2020, PP (99):1-13.DOI: 10.1109/TGRS.2020.2978491'. According to the method, original hyperspectral data, Gabor filtered data, data processed by an extended morphological section method (EMP) and data processed by an extended multi-attribute section method (EMAP) are used as input data, anomaly detection is carried out on the four parts of the data by using an isolated forest model respectively, four corresponding groups of results are obtained, and the final anomaly target detection result is obtained by averaging the four groups of results. The method comprises the steps of performing anomaly detection by using an isolated algorithm by taking original hyperspectral data as input, and using the spectral characteristics of a hyperspectral image; data processed by Gabor, EMP and EMAP are used as input, spatial features of a hyperspectral image are utilized, although the method utilizes the spatial-spectral combination characteristic of the hyperspectral image to detect an abnormal target, better detection performance is obtained, but when the method utilizes an isolated forest model to detect the abnormality, because only one wave band can be randomly selected in each segmentation operation, a large number of spectral features are not utilized, and early warning and missing detection phenomena are caused to a certain extent; the final abnormal score of the method is mainly determined by the spatial characteristics of the hyperspectral image, and the spectral characteristics only play a role in auxiliary detection, so that the advantage that the hyperspectral data has fine spectral information cannot be fully exerted; and the anomaly detection algorithm based on the isolated forest model is only sensitive to global anomaly points and is not good at processing local anomaly points.
Disclosure of Invention
The embodiment of the application aims to provide a hyperspectral image anomaly detection method, a hyperspectral image anomaly detection device, computer equipment and a storage medium, so as to solve the problems that the traditional hyperspectral image anomaly detection method is low in accuracy of pixel anomaly estimation value detection and has a missing detection phenomenon.
In order to solve the above technical problem, an embodiment of the present application provides a hyperspectral image anomaly detection method, which adopts the following technical scheme:
responding a hyperspectral image anomaly detection request carrying original hyperspectral image data;
normalizing the original hyperspectral image data to obtain intermediate hyperspectral image data;
performing dimensionality reduction processing on the intermediate hyperspectral image data based on a principal component analysis algorithm to obtain first principal component image data;
carrying out segmentation processing on the first principal component image data based on an image segmentation algorithm of edge detection to obtain a first subregion set;
recording indexes of all first sub-areas in the first sub-area set, and taking the indexes as first indexes;
acquiring spectral dimensional features corresponding to the intermediate hyperspectral image data in each first sub-area based on the first index;
performing anomaly detection on the spectral dimensional characteristics based on an isolated forest optimization model to obtain a first spectral anomaly score of each pixel in the original hyperspectral image data;
based on a threshold segmentation algorithm, carrying out segmentation processing on the first principal component image data to obtain a second subregion set;
recording indexes of all second sub-areas in the second sub-area set, and taking the indexes as second indexes;
performing spatial distribution characteristic extraction operation on the intermediate hyperspectral image data based on a Gabor filter to obtain hyperspectral image spatial distribution characteristics;
respectively acquiring space dimensional features in each second sub-area based on the second indexes and the hyperspectral image space distribution features;
anomaly detection is carried out on the spatial dimensional characteristics based on an isolated forest optimization model, and a second spatial anomaly score of each pixel is obtained;
performing weighted calculation on the first spectrum abnormality score and the second space abnormality score based on a weighted algorithm to obtain a target abnormality score of each pixel;
and outputting the target abnormality score.
Further, the step of performing dimensionality reduction processing on the intermediate hyperspectral image data based on a principal component analysis algorithm to obtain first principal component image data specifically comprises:
constructing an original set { x) based on a principal component analysis algorithm1,x2,…,xNIn which x1,x2,…,xNIs the original input quantity;
computing a covariance matrix of the original set, wherein the covariance matrix is represented as:
calculating a unit eigenvector v corresponding to the largest eigenvalue of the covariance matrix1;
Based on feature vectors v1Forming a projection matrix V, where V ═ V1];
When in useWhen i is 1, 2, …, N, respectivelyAs an original input quantity x1,x2,…,xNThe reduced dimension vector of (2);
and taking a set formed by the dimensionality reduction vectors as first principal component image data.
Further, the step of performing segmentation processing on the first principal component image data based on an image segmentation algorithm for edge detection to obtain a first sub-region set specifically includes:
performing convolution processing on the first principal component image data based on a Gaussian filtering template to obtain smooth image data;
calculating a gradient amplitude value and a gradient direction corresponding to the smoothed image data based on a differential operator;
carrying out non-maximum suppression on the gradient amplitude and the gradient direction, and determining edges in the smooth image data based on a dual-threshold algorithm;
and carrying out segmentation processing on the smooth image data based on the edge to obtain a first sub-region set.
Further, the step of performing segmentation processing on the first principal component image data based on a threshold segmentation algorithm to obtain a second sub-region set specifically includes:
calculating an original threshold corresponding to the first principal component image data based on a maximum inter-class variance method;
comparing the gray value of the first main component image data with an original threshold, taking the pixel corresponding to the gray value which is greater than or equal to the original threshold as a target class, and taking the pixel corresponding to the gray value which is less than the original threshold as a background class;
and repeatedly executing the steps of calculating the covariance matrix and the unit feature vector on the background class to acquire the maximum background class to realize the segmentation processing of the first main component image data and obtain a second sub-region set.
Further, the step of performing anomaly detection on the spatial dimension characteristics based on the isolated forest optimization model to obtain a second spatial anomaly score of each pixel specifically comprises:
training a plurality of binary trees in the original isolated forest model based on the hyperspectral image optimization training set to obtain an isolated forest optimization model;
inputting the space dimension characteristics into an isolated forest optimization model to calculate a space abnormality score corresponding to each space dimension characteristic;
and respectively calculating the average value of the spatial abnormality scores as a second spatial abnormality score of each pixel element.
Further, the weighting algorithm is expressed as:
S(x)=0.618×GS(x)+0.382×KS(x)
wherein S (x) is the target abnormality score, GS (x) is the first spectral abnormality score, and KS (x) is the second spatial abnormality score.
In order to solve the above technical problem, an embodiment of the present application further provides a hyperspectral image anomaly detection apparatus, which adopts the following technical scheme:
the request response module is used for responding a hyperspectral image anomaly detection request carrying original hyperspectral image data;
the data acquisition module is used for carrying out normalization processing on the original hyperspectral image data to obtain intermediate hyperspectral image data;
the dimensionality reduction processing module is used for carrying out dimensionality reduction processing on the intermediate hyperspectral image data based on a principal component analysis algorithm to obtain first principal component image data;
the edge segmentation processing module is used for carrying out segmentation processing on the first main component image data based on an image segmentation algorithm of edge detection to obtain a first sub-region set;
the first index acquisition module is used for recording the index of each first sub-area in the first sub-area set and taking the index as a first index;
the spectral dimensional feature acquisition module is used for acquiring spectral dimensional features corresponding to the intermediate hyperspectral image data in each first sub-area based on the first index;
the first anomaly detection module is used for carrying out anomaly detection on the spectral dimensional characteristics based on the isolated forest optimization model to obtain a first spectral anomaly score of each pixel in the original hyperspectral image data;
the threshold segmentation processing module is used for carrying out segmentation processing on the first main component image data based on a threshold segmentation algorithm to obtain a second subregion set;
the second index acquisition module is used for recording the index of each second sub-area in the second sub-area set and taking the index as a second index;
the characteristic extraction module is used for carrying out space distribution characteristic extraction operation on the intermediate hyperspectral image data based on a Gabor filter to obtain a hyperspectral image space distribution characteristic;
the spatial dimension characteristic acquisition module is used for respectively acquiring spatial dimension characteristics in each second sub-area based on the second indexes and the spatial distribution characteristics of the hyperspectral image;
the second anomaly detection module is used for carrying out anomaly detection on the spatial dimensional characteristics based on the isolated forest optimization model to obtain a second spatial anomaly score of each pixel;
the abnormal score calculation module is used for carrying out weighted calculation on the first spectrum abnormal score and the second space abnormal score based on a weighting algorithm to obtain a target abnormal score of each pixel;
and the score output module is used for outputting the target abnormal score.
Further, the edge segmentation processing module comprises:
the convolution processing unit is used for performing convolution processing on the first principal component image data based on the Gaussian filtering template to obtain smooth image data;
a gradient calculation unit for calculating a gradient magnitude and a gradient direction corresponding to the smoothed image data based on the differential operator;
the edge detection unit is used for carrying out non-maximum value suppression on the gradient amplitude and the gradient direction and determining an edge in the smooth image data based on a dual-threshold algorithm;
and the edge segmentation unit is used for carrying out segmentation processing on the smooth image data based on the edge to obtain a first sub-region set.
In order to solve the above technical problem, an embodiment of the present application further provides a computer device, which adopts the following technical solutions:
the computer device comprises a memory and a processor, wherein the memory is stored with computer readable instructions, and the processor realizes the steps of the hyperspectral image abnormality detection method when executing the computer readable instructions.
In order to solve the above technical problem, an embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solutions:
the computer readable storage medium has stored thereon computer readable instructions which, when executed by a processor, implement the steps of the hyperspectral image abnormality detection method as described above.
Compared with the prior art, the embodiment of the application mainly has the following beneficial effects:
the application provides a hyperspectral image anomaly detection method, which comprises the following steps: responding a hyperspectral image anomaly detection request carrying original hyperspectral image data; normalizing the original hyperspectral image data to obtain intermediate hyperspectral image data; performing dimensionality reduction processing on the intermediate hyperspectral image data based on a principal component analysis algorithm to obtain first principal component image data; carrying out segmentation processing on the first principal component image data based on an image segmentation algorithm of edge detection to obtain a first subregion set; recording indexes of all first sub-areas in the first sub-area set, and taking the indexes as first indexes; acquiring spectral dimensional features corresponding to the intermediate hyperspectral image data in each first sub-area based on the first index; performing anomaly detection on the spectral dimensional characteristics based on an isolated forest optimization model to obtain a first spectral anomaly score of each pixel in the original hyperspectral image data; based on a threshold segmentation algorithm, carrying out segmentation processing on the first principal component image data to obtain a second subregion set; recording indexes of all second sub-areas in the second sub-area set, and taking the indexes as second indexes; performing spatial distribution characteristic extraction operation on the intermediate hyperspectral image data based on a Gabor filter to obtain hyperspectral image spatial distribution characteristics; respectively acquiring space dimensional features in each second sub-area based on the second indexes and the hyperspectral image space distribution features; anomaly detection is carried out on the spatial dimensional characteristics based on an isolated forest optimization model, and a second spatial anomaly score of each pixel is obtained; performing weighted calculation on the first spectrum abnormality score and the second space abnormality score based on a weighted algorithm to obtain a target abnormality score of each pixel; and outputting the target abnormality score. By carrying out normalization processing on the original hyperspectral image data, the gray value of each pixel in each wave band can be mapped so as to accurately acquire intermediate hyperspectral image data; then reducing the dimension of the intermediate hyperspectral image data of a plurality of wave bands based on a principal component analysis algorithm to obtain first principal component image data; then, based on an image segmentation algorithm of edge detection, segmenting the first main component image data into a first sub-region set consisting of a plurality of first sub-regions according to boundary lines among various background ground features; marking the first indexes of the first subregions, and applying the spectral dimensional characteristics acquired in the first subregions to anomaly detection in an isolated forest optimization model based on the first indexes so as to acquire a first spectral anomaly score of each pixel in the original hyperspectral image data; meanwhile, the first principal component image data is divided into a second sub-region set consisting of a plurality of second sub-regions based on a threshold value division method; marking a second index of each first sub-region; extracting spatial distribution characteristics of the intermediate hyperspectral image data based on a Gabor filter, and acquiring spatial dimensional characteristics by combining a second index; further applying the spatial three-dimensional characteristics to an isolated forest optimization model for anomaly detection, so as to obtain a second spatial anomaly score of each pixel in the original hyperspectral image data; and finally, performing weighted calculation on the first spectrum abnormality score and the second space abnormality score based on a weighted algorithm to obtain a target abnormality score of each pixel, and outputting a final target abnormality score as an abnormality detection result. The detection of the model on the abnormal estimation values of the pixels in the hyperspectral image data with different scales and dimensions can be effectively improved, the accuracy of obtaining the abnormal estimation values of the pixels is improved, and the condition of missing detection is reduced.
Drawings
In order to more clearly illustrate the solution of the present application, the drawings needed for describing the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
FIG. 1 is a flowchart illustrating an implementation of a hyperspectral image anomaly detection method according to an embodiment of the present application;
FIG. 2 is a flowchart of an implementation of step S3 in FIG. 1;
FIG. 3 is a flowchart of an implementation of step S4 in FIG. 1;
FIG. 4 is a flowchart of an implementation of step S8 in FIG. 1;
FIG. 5 is a flowchart of an implementation of step S12 in FIG. 1;
FIG. 6 is a schematic structural diagram of a hyperspectral image anomaly detection device provided in the second application embodiment;
FIG. 7 is a block diagram of the computing module of FIG. 6;
FIG. 8 is a schematic block diagram of one embodiment of a computer device according to the present application;
FIG. 9 is a schematic diagram of a structure of a binary tree in an exemplary isolated forest model to which the present application may be applied;
10(a) and 10(b) are respectively an exemplary airport hyperspectral remote sensing image and an abnormal target true distribution diagram to which the application can be applied;
11(a), 11(b) and 11(c) are respectively a first principal component gray scale map, an edge segmentation result schematic diagram and a threshold segmentation result schematic diagram of an exemplary airport hyperspectral remote sensing image to which the present application can be applied;
12(a), 12(b) and 12(c) are a detection result schematic of a conventional RXD algorithm, a detection result schematic of a conventional isolated forest model and a detection result schematic of an exemplary airport hyperspectral remote sensing image to which the present application can be applied;
FIG. 13 is a schematic representation of an ROC curve for an exemplary airport hyperspectral remote sensing image to which the present application may be applied;
FIG. 14 is a box line schematic of an exemplary airport hyperspectral remote sensing image to which the present application may be applied;
FIG. 15 is a graphical illustration of AUC values for an exemplary airport hyperspectral remote sensing image to which the present application may be applied.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "including" and "having," and any variations thereof, in the description and claims of this application and the description of the above figures are intended to cover non-exclusive inclusions. The terms "first," "second," and the like in the description and claims of this application or in the above-described drawings are used for distinguishing between different objects and not for describing a particular order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
Example one
Referring to fig. 1, a flowchart of an embodiment of a method for hyperspectral image anomaly detection according to an embodiment of the present application is shown. The hyperspectral image anomaly detection method comprises the following steps of:
in step S1, responding to a hyperspectral image anomaly detection request carrying original hyperspectral image data;
in step S2, the raw hyperspectral image data is normalized to obtain intermediate hyperspectral image data.
In the embodiment of the application, the original hyperspectral image data is a hyperspectral remote sensing image experimental data set collected in advance, and referring to fig. 10(a), the original hyperspectral image data may be specifically image data collected in the los angeles airport area through an airborne visible light/infrared imaging spectrometer AVIRIS sensor.
In the embodiment of the application, the intermediate hyperspectral image data is the original hyperspectral image data based on a (0, 1) standardization methodPerforming normalization processing, namely mapping the gray value of each pixel in the original hyperspectral image data in each wave band to (0, 1)]The specific (0, 1) normalization method for the image data is expressed as:
wherein, XminIs its minimum value, XmaxIs its maximum value.
For example, referring to fig. 10(a) and 10(b), it is assumed that the spatial resolution of the hyperspectral image is 7.1m, the acquisition time is 2011 for 9 months, the image size is 100 × 100 pixels, and 191 bands are included after preprocessing; the experimental dataThree airplanes of different sizes in the image are taken as abnormal targets, wherein, FIG. 10(a) is used for representing a gray scale map of the 37 th wave band of the data set; fig. 10(b) is for showing the abnormal target reference position.
In step S3, dimension reduction processing is performed on the intermediate hyperspectral image data based on a principal component analysis algorithm to obtain first principal component image data.
In the embodiment of the application, the intermediate hyperspectral image data is subjected to dimensionality reduction based on Principal Component Analysis (PCA) and the second Principal Component Analysis (PCA)A principal component image data, referring to FIG. 11(a), first converting the original hyperspectral image data intoIs processed, i.e. converted into a matrix [ X ] of 10000 rows and 191 columns]10000×191Processing is carried out, wherein 10000 rows of the matrix represent 10000 pixels of the image, in other words, each row vector represents one pixel of the image, and each row vector consists of 191 coordinates and corresponds to 191 wave bands of the hyperspectral data; then, normalizing the original hyperspectral image data to obtain intermediate hyperspectral image data, and analyzing the intermediate hyperspectral image data [ X ] based on Principal Component Analysis (PCA)]10000×191Reducing dimensions to data [ X ] containing only first principal component]10000×1(ii) a Furthermore, in this embodiment, the image represented by the first principal component obtained after dimensionality reduction can be compared with fig. 11(a) and fig. 10(a), and it can be seen that the first principal component image data after dimensionality reduction can well retain the spatial information of the original hyperspectral image data while greatly reducing the data dimensionality.
In step S4, an image segmentation algorithm based on edge detection performs segmentation processing on the first principal component image data to obtain a first sub-region set;
in step S5, the index of each first sub-region in the first set of sub-regions is recorded as a first index.
In the embodiment of the present application, the image segmentation algorithm based on edge detection performs segmentation processing on the first principal component image data, specifically, the edge detection method based on Canny operator may be used to perform dimension reduction on the first principal component image data X obtained after dimension reduction1The segmentation is performed so as to obtain a first set of sub-regions consisting of several first sub-regions.
In this embodiment of the application, the first index is obtained by dividing the background feature into a plurality of first sub-regions based on the result obtained by the edge detection, and recording the pixel coordinate index of each first sub-region.
For example, referring to fig. 11(b), based on the first principal component image data of fig. 11(a), the first principal component image data is segmented based on an edge detection method, by dividing the original 100 × 100 size image into four first sub-regions, and then the coordinate index of the pixel in each first sub-region can be accurately recorded as the first index of the first sub-region for performing anomaly detection on the spectral feature of the image locally based on the isolated forest optimization model.
In step S6, spectral dimensional features corresponding to the intermediate hyperspectral image data are acquired in the respective first sub-regions based on the first index.
In the embodiment of the application, the spectrum dimensional characteristics corresponding to the intermediate hyperspectral image data in each first sub-area based on the first index are obtained in each sub-area according to the pixel coordinate index of each first sub-area after the obtained blocks are partitioned, so that the spectrum dimensional characteristics corresponding to the intermediate hyperspectral image data are applied to an isolated forest optimization model for anomaly detection.
In step S7, performing anomaly detection on the spectral dimensional characteristics based on the isolated forest optimization model to obtain a first spectral anomaly score of each pixel in the original hyperspectral image data.
In this embodiment, the first spectrum abnormality score is a spectrum abnormality score of each pixel in the first sub-area obtained based on the ratio of the number of pixels in the leaf node and the direct parent node.
Specifically, spectral abnormality scores of all pixels in original hyperspectral image data after being segmented by each binary tree are calculated, and then the average value of the spectral abnormality scores of the pixels after being segmented by all binary trees in an isolated forest is calculated. Specifically, the spectrum abnormality score of each pixel in the ith tree can be calculated by applying formula (1):
wherein, Ti(x) Refers to the leaf node where the pixel x is divided by the ith binary tree,is leaf node Ti(x) The direct parent node of (a); m (-) is the number of pixels contained in the node;is a normalized coefficient, the effect being such that gs isiThe value range of (DEG) is (0, 1)]。
Further, the average value ks (x) of the spectrum abnormality scores of the pixel x in the isolated forest is calculated by formula (2):
wherein t is the number of binary trees preset in the isolated forest.
It will be appreciated that the greater the value of the spectral abnormality score gs (x), the greater the probability that pixel element x will differ significantly in the spectral dimension from most pixel elements.
In step S8, performing segmentation processing on the first principal component image data based on a threshold segmentation algorithm to obtain a second sub-region set;
in step S9, the index of each second sub-area in the second set of sub-areas is recorded as the second index.
In the embodiment of the present application, the obtaining of the second sub-region set by performing segmentation processing on the first principal component image data based on the threshold segmentation algorithm may specifically be that the first principal component image data X is subjected to segmentation processing by a segmentation method based on a threshold1The division is performed, thereby obtaining a second sub-area set composed of a plurality of second sub-areas.
In this embodiment of the application, the second index is obtained by dividing the background feature into a plurality of second sub-regions based on the result obtained by the threshold division, and recording the pixel coordinate index of each second sub-region.
For example, referring to fig. 11(c), based on the first principal component image data of fig. 11(a), the first principal component image data is segmented based on a threshold segmentation algorithm, and the original first principal component image is divided into seven second sub-regions, so that the coordinate index of the pixel in each second sub-region can be accurately recorded as the second index of the second sub-region for performing anomaly detection on the spatial feature of the image locally based on the isolated forest optimization model.
In step S10, a Gabor filter is used to perform a spatial distribution feature extraction operation on the intermediate hyperspectral image data, so as to obtain a hyperspectral image spatial distribution feature.
In the embodiment of the application, a Gabor filter is used for extracting spatial distribution characteristics of intermediate hyperspectral image data to obtain hyperspectral image spatial distribution characteristics, specifically, Gabor transformation of short-time windowed Fourier transformation is adopted, namely Fourier transformation is carried out in a specific time window, and the special condition that a window function in the short-time Fourier transformation is taken as a Gaussian function is adopted; therefore, the spatial distribution feature extraction method can extract the spatial distribution feature of the intermediate hyperspectral image data in different scales and different directions in the frequency domain through the Gabor filter so as to accurately acquire the hyperspectral image spatial distribution feature. In addition, the Gabor function is similar to the human eye function, is usually used for texture recognition, and achieves better effect.
In step S11, spatial dimension features are acquired in each of the second sub-regions based on the second index and the hyperspectral image spatial distribution feature.
In the embodiment of the application, the step of respectively obtaining the space dimensional characteristics in each second sub-area based on the second indexes and the hyperspectral image space distribution characteristics is to respectively obtain the space dimensional characteristics corresponding to the intermediate hyperspectral image data in each sub-area according to the obtained pixel coordinate indexes of each first sub-area after blocking and the hyperspectral image space distribution characteristics, so that the space dimensional characteristics are applied to an isolated forest optimization model for anomaly detection.
In step S12, anomaly detection is performed on the spatial dimension features based on the isolated forest optimization model, so as to obtain a second spatial anomaly score of each pixel element.
In this embodiment of the present application, the second spatial anomaly score is a spatial anomaly score of each pixel in the second sub-area obtained based on a ratio of the number of pixels in the leaf node and the direct parent node.
Specifically, the spatial abnormality scores of all pixels in the original hyperspectral image data after being segmented by each binary tree are calculated, and then the average value of the spatial abnormality scores of the pixels after being segmented by all binary trees in the isolated forest is calculated. Specifically, the spatial abnormality score of each pixel in the ith tree can be calculated by applying formula (3):
wherein, Ti(x) Refers to the leaf node where the pixel x is divided by the ith binary tree,is leaf node Ti(x) The direct parent node of (a); m (-) is the number of pixels contained in the node;is a normalized coefficient, the effect being such that ksiThe value range of (DEG) is (0, 1)]。
Further, the average value ks (x) of the spatial abnormality scores of the pixel x in the isolated forest is calculated by formula (4):
wherein t is the number of binary trees preset in the isolated forest.
It will be appreciated that the greater the value of the spatial anomaly score KS (x), the greater the probability that pixel element x will differ significantly in the spatial dimension from the majority of pixel elements.
In step S13, performing weighted calculation on the first spectrum abnormality score and the second spatial abnormality score based on a weighted algorithm to obtain a target abnormality score of each pixel;
in step S14, a target abnormality score is output.
In this embodiment of the application, the first spectrum abnormality score and the second spatial abnormality score are weighted and calculated based on a weighting algorithm to obtain a target abnormality score of each pixel, specifically, referring to fig. 12(c), for example, according to the first index obtained in fig. 11(b), the first principal component image data [ X ] is obtained]10000×191Segmentation into [ X ] based on edge detectionC1]1109×191、[XC2]1526×191、[XC3]3440×191、[XC4]3925×191Four first sub-regions; and applying an isolated forest algorithm which is improved based on hyperspectral data in each first sub-area, calculating the spectrum abnormality score of each pixel in the first sub-area, and further obtaining the spectrum abnormality score of 10000 pixels of the whole image, namely the first spectrum abnormality score.
Further, in the aspect of spatial dimension, based on a threshold segmentation method, Gabor-extracted spatial features are combinedIs divided into [ YC1]896×160、[YC2]1590×160、[YC3]2105×160、[YC4]1565×160、[YC5]1536×160、[YC6]1145×160、[YC7]1163×160And seven second subregions, wherein an isolated forest algorithm improved in a hyperspectral data mode is applied to each subregion, the spatial abnormality score of each pixel in each second subregion is calculated, and further the spatial abnormality scores of 10000 pixels of the whole image, namely the second spatial abnormality score, are obtained.
Further, the first spectrum abnormality score and the second spatial abnormality score are weighted and summed according to the weight of S ═ 0.618 × gs (x) +0.382 × ks (y), so as to obtain the abnormality scores of all pixels under the multi-scale and multi-dimensional spatial spectrum combination characteristic, that is, the target abnormality score of each pixel. Finally, the abnormal target detection result of the hyperspectral image shown in fig. 12(c) can be obtained.
It can be understood that, referring to fig. 12(c), dark color pixels represent background terrain, light color pixels represent abnormal pixels, and lighter pixels represent higher abnormality. As shown in fig. 12(c), the detection result obtained in this embodiment has the characteristics of clearer abnormal target (three airplanes), better background information suppression effect and fewer false alarm pixels in vision, and the visual effect is obviously better than the detection result obtained by a classical algorithm RXD in the hyperspectral image abnormality detection field as shown in fig. 12(a) and better than the detection result obtained by a traditional hyperspectral image space-spectrum combination characteristic abnormality detection method based on an isolated forest model as shown in fig. 12 (b).
Further, referring to fig. 13, the embodiment is superior to the conventional algorithm in terms of subjective visual effect, and also has an advantage in terms of objective evaluation index. Specifically, compared with the conventional method, when the abscissa is constant, the ordinate value obtained in this embodiment is larger; when the ordinate is constant, the abscissa value obtained in this embodiment is smaller. That is, the present embodiment has a higher detection rate of abnormal targets at the same false alarm rate; the present embodiment has a lower false alarm rate at the same abnormal target detection rate. The RXD represents a classical algorithm RX detector (Reed-Xiiolet detector) in the field of hyperspectral image anomaly detection, the MFIFD represents a traditional hyperspectral image space spectrum combined characteristic anomaly detection method based on an isolated forest model, and the SSMMD represents the method provided by the embodiment of the application.
Further, referring to fig. 14, the present embodiment uses a box plot to represent the separation degree between the abnormal target and the background ground object in the hyperspectral image. By using the reference position information of the abnormal target in fig. 10(b), statistics is performed on the abnormal target pixels and the background pixels, respectively, and parameters such as the maximum value, the minimum value, the median, the main value, and the like of the two categories are counted. As shown in fig. 14, the upper tentacles in the box plot are the maximum values of the data, the lower tentacles are the minimum values of the data, the box represents the main value of the data accounting for 50% of the total data, and the horizontal lines in the box represent the median of the data. Wherein, the thick solid line part represents an abnormal target, the thin solid line part represents a background ground object, and the degree of separation between the background and the abnormal target under different methods is analyzed through a box diagram, so that the following results are obtained: the RXD method can restrain the background in a small range, but a serious crossing phenomenon exists between the background and the abnormity, namely, the minimum value of the abnormity score of the abnormal pixel element and the maximum value of the abnormity score of the background pixel element are crossed, which indicates that the RXD cannot well separate the abnormal pixel element from the background and reflects the abnormal pixel element in a visual reference to figure 12(a), and two smaller airplanes are not detected. When the boxplot of the existing MFIFD method is observed, no intersection exists between the abnormity and the background, which indicates that the method can well detect the abnormal target, but the box body of the thin solid line representing the background is larger, which indicates that the method cannot well inhibit the background, namely, when the abnormal pixel is detected, more false alarm pixels appear, which is reflected in the visual reference of FIG. 12(b), and more bright spots exist in the background, which brings higher false alarm rate. The method provided by the embodiment of the application can well distinguish the abnormal pixel from the background pixel; and the thin solid line box representing the background is very small, which shows that the method provided by the invention well inhibits the background, improves the ubiquitous high false alarm phenomenon to a certain extent, and with reference to fig. 12(c) in the visual effect, under the condition of detecting abnormal pixels at a higher level, the number of false alarm pixels is reduced to a great extent, and the method has better detection performance.
Further, referring to fig. 15, the method is used for examining a certain amount of index of evaluating an abnormal detection effect, namely Area Under ROC Curve (AUC), as shown in fig. 13, the method provided by the embodiment of the application simultaneously realizes multi-scale utilization of spatial characteristics of a hyperspectral image and multi-dimensional utilization of spectral characteristics, and performs directional improvement on an isolated forest model facing hyperspectral data; therefore, under the condition that tensor decomposition is not used and the calculation complexity is further greatly reduced, the detection capability is still superior to that of a traditional hyperspectral image space spectrum combined characteristic abnormality detection method based on an isolated forest model and that of a classical algorithm RXD method for hyperspectral abnormality detection.
The application provides a hyperspectral image anomaly detection method, which comprises the following steps: responding a hyperspectral image anomaly detection request carrying original hyperspectral image data; normalizing the original hyperspectral image data to obtain intermediate hyperspectral image data; performing dimensionality reduction processing on the intermediate hyperspectral image data based on a principal component analysis algorithm to obtain first principal component image data; carrying out segmentation processing on the first principal component image data based on an image segmentation algorithm of edge detection to obtain a first subregion set; recording indexes of all first sub-areas in the first sub-area set, and taking the indexes as first indexes; acquiring spectral dimensional features corresponding to the intermediate hyperspectral image data in each first sub-area based on the first index; performing anomaly detection on the spectral dimensional characteristics based on an isolated forest optimization model to obtain a first spectral anomaly score of each pixel in the original hyperspectral image data; based on a threshold segmentation algorithm, carrying out segmentation processing on the first principal component image data to obtain a second subregion set; recording indexes of all second sub-areas in the second sub-area set, and taking the indexes as second indexes; performing spatial distribution characteristic extraction operation on the intermediate hyperspectral image data based on a Gabor filter to obtain hyperspectral image spatial distribution characteristics; respectively acquiring space dimensional features in each second sub-area based on the second indexes and the hyperspectral image space distribution features; anomaly detection is carried out on the spatial dimensional characteristics based on an isolated forest optimization model, and a second spatial anomaly score of each pixel is obtained; performing weighted calculation on the first spectrum abnormality score and the second space abnormality score based on a weighted algorithm to obtain a target abnormality score of each pixel; and outputting the target abnormality score. By carrying out normalization processing on the original hyperspectral image data, the gray value of each pixel in each wave band can be mapped so as to accurately acquire intermediate hyperspectral image data; then reducing the dimension of the intermediate hyperspectral image data of a plurality of wave bands based on a principal component analysis algorithm to obtain first principal component image data; then, based on an image segmentation algorithm of edge detection, segmenting the first main component image data into a first sub-region set consisting of a plurality of first sub-regions according to boundary lines among various background ground features; marking the first indexes of the first subregions, and applying the spectral dimensional characteristics acquired in the first subregions to anomaly detection in an isolated forest optimization model based on the first indexes so as to acquire a first spectral anomaly score of each pixel in the original hyperspectral image data; meanwhile, the first principal component image data is divided into a second sub-region set consisting of a plurality of second sub-regions based on a threshold value division method; marking a second index of each first sub-region; extracting spatial distribution characteristics of the intermediate hyperspectral image data based on a Gabor filter, and acquiring spatial dimensional characteristics by combining a second index; further applying the spatial three-dimensional characteristics to an isolated forest optimization model for anomaly detection, so as to obtain a second spatial anomaly score of each pixel in the original hyperspectral image data; and finally, performing weighted calculation on the first spectrum abnormality score and the second space abnormality score based on a weighted algorithm to obtain a target abnormality score of each pixel, and outputting a final target abnormality score as an abnormality detection result. The detection of the model on the abnormal estimation values of the pixels in the hyperspectral image data with different scales and dimensions can be effectively improved, the accuracy of obtaining the abnormal estimation values of the pixels is improved, and the condition of missing detection is reduced.
With continued reference to fig. 2, a flowchart for implementing step S3 in fig. 1 is shown, and for convenience of explanation, only the parts relevant to the present application are shown.
In some optional implementations of the first embodiment of the present application, the step S3 specifically includes: step S301, step S302, step S303, step S304, step S305, and step S306.
In step S301, an original set { x } is constructed based on a principal component analysis algorithm1,x2,…,xNIn which x1,x2,…,xNIs the original input quantity;
in step S302, a covariance matrix of the original set is calculated, wherein the covariance matrix is expressed as:
in step S303, a unit eigenvector v corresponding to the maximum eigenvalue of the covariance matrix is calculated1;
In step S304, based on the feature vector v1Forming a projection matrix V, where V ═ V1];
In step S305, whenWhen i is 1, 2, …, N, respectivelyAs an original input quantity x1,x2,…,xNThe reduced dimension vector of (2);
in step S306, a set of reduced-dimension vectors is made as first principal component image data.
In the embodiment of the application, the dimensionality reduction processing is performed on the intermediate hyperspectral image data based on the principal component analysis algorithm, and specifically, the original set { x } is constructed based on the principal component analysis algorithm1,x2,…,xNIn which x1,x2,…,xNAs the original input, the covariance matrix Σ of the original set is then calculated:
further, the unit eigenvector v corresponding to the maximum eigenvalue of the covariance matrix sigma is obtained1And using the feature vector v1Forming a projection matrix V ═ V1];
Further, calculating1, 2, …, N, obtainedAre respectively the input quantity x1,x2,…,xNThe vector after dimensionality reduction is used for obtaining first principal component image data
With continuing reference to fig. 3, a flowchart of an implementation of step S4 in fig. 1 is shown, and for ease of illustration, only the portions relevant to the present application are shown.
In some optional implementations of the first embodiment of the present application, the step S4 specifically includes: step S401, step S402, step S403, and step S404.
In step S401, performing convolution processing on the first principal component image data based on the gaussian filter template to obtain smooth image data;
in step S402, a gradient magnitude and a gradient direction corresponding to the smoothed image data are calculated based on a differential operator;
in step S403, performing non-maximum suppression on the gradient magnitude and the gradient direction, and determining an edge in the smoothed image data based on a dual-threshold algorithm;
in step S404, the smoothed image data is subjected to segmentation processing based on the edge, resulting in a first subregion set.
In the embodiment of the application, the image segmentation algorithm based on edge detection performs segmentation processing on the first principal component image data, specifically, convolution processing is performed by applying a gaussian filter template, so that an image of the obtained smooth image data is smooth, and noise is removed; further, calculating the amplitude and direction of the gradient by using a differential operator; then, carrying out non-maximum value inhibition on the gradient amplitude, namely traversing the image, and if the difference value between the gray value of a certain pixel and the gray values of two pixels in front and at the back of the certain pixel in the gradient direction is less than a set value, setting the pixel value as 0, namely not an edge; finally, a double-threshold algorithm is applied to detect and connect edges, namely two thresholds are calculated based on the cumulative histogram, wherein the edges which are larger than the high threshold are determined; less than the low threshold must not be an edge. If the detection result is larger than the low threshold but smaller than the high threshold, it is necessary to determine whether there is an edge pixel exceeding the high threshold in the adjacent pixels of the pixel, if so, the pixel is an edge, otherwise, the pixel is not an edge, and the smooth image data is divided into a first sub-region set composed of a plurality of first sub-regions based on the determined edge.
With continued reference to fig. 4, a flowchart for implementing step S8 in fig. 1 is shown, and for convenience of explanation, only the parts relevant to the present application are shown.
In some optional implementations of the first embodiment of the present application, the step S8 specifically includes: step S801, step S802, and step S803.
In step S801, an original threshold corresponding to the first principal component image data is calculated based on the maximum inter-class variance method;
in step S802, comparing the gray value of the first principal component image data with an original threshold, and taking the pixel corresponding to the gray value greater than or equal to the original threshold as a target class, and taking the pixel corresponding to the gray value smaller than the original threshold as a background class;
in step S803, the steps of calculating the covariance matrix and calculating the unit feature vector are repeatedly performed on the background class to obtain the largest background class to implement the segmentation processing on the first principal component image data, so as to obtain the second sub-region set.
In the embodiment of the application, the first principal component image data is segmented based on a threshold segmentation algorithm, specifically, a threshold T corresponding to the first principal component image data is obtained by calculation based on an inter-class variance method (OTSU) maximum; further, pixels corresponding to the gray value of the first principal component image data larger than or equal to the threshold T are classified into a target class, and pixels corresponding to the gray value of the first principal component image data smaller than the threshold T are classified into a background class; then, the steps of calculating the covariance matrix and calculating the unit feature vector are repeated again for the background class until the maximum background class number B is reached, so as to divide the first principal component image data into a second sub-region set composed of a plurality of second sub-regions based on the maximum background class number B.
With continuing reference to fig. 5, a flowchart of an implementation of step S12 in fig. 1 is shown, and for ease of illustration, only the portions relevant to the present application are shown.
In some optional implementations of the first embodiment of the present application, the step S12 specifically includes: step S1201, step S1202, and step S1203.
In step S1201, training a plurality of binary trees in the isolated forest original model based on the hyperspectral image optimization training set to obtain an isolated forest optimization model.
In the embodiment of the application, the hyperspectral image optimization training set is obtained by improving the isolated forest original model facing to hyperspectral data.
The soliton original model comprises a plurality of trees, each tree is a binary tree called iTree, and a schematic structural diagram of the binary tree is shown in fig. 9. The nodes in the binary tree iTree are divided into leaf nodes (leaf nodes), internal child nodes (internalnodes) and root nodes (rootnodes). Wherein, the root node is the topmost node of the tree and is the starting point of the tree; each internal sub-node can be divided into a left sub-node and a right sub-node; the subdivision continues until no further sub-nodes can be separated out, called leaf nodes. After the original algorithm is improved by orienting to hyperspectral data, training a plurality of binary trees iTrees in an isolated forest to obtain an isolated forest optimization model, and the method specifically comprises the following steps:
1) from intermediate hyperspectral image dataIn the method, 30% of pixels are randomly selected, it needs to be noted that the selection of pixels can be selected more or less, but too much selection of pixels results in large calculation amount and limited precision improvement, too little selection of pixels results in influence on precision, and 30% of the selection of pixels results in better cost performance of calculation amount and detection precision, namely 0.3 × N pixels are used as training subsetsThis random selection is repeated once per tree trainingThe step of taking subsets, i.e. each tree in the soliton forest is trained from different subsets selected randomly, so that each tree is different.
2) Randomly determining a vectorWherein,j ═ 1, 2, …, D; randomly selecting pj, and classifying the pixels which are larger than pj in Xsub into a right subsetIn, is less than pjTo the left subsetThen, the ith band (i e [1, D ]) is calculated based on the formula (5)]) Subset XsubThe separability evaluation index delta of the background pixel and the abnormal target pixel in all the 0.3 multiplied by N pixels; wherein the index ΔiThe larger the value of (b), the better the separability between the background pixel and the abnormal pixel in the ith wave band is; and determining the first D (D is D/2) wave bands with better separation of the background and the abnormal image element according to the index delta.
3) Constructing random vectors satisfying Gaussian distributionsAnd vector is divided according to d wave bands randomly determined in step8.1.2The corresponding coordinates are set to 1, and the remaining coordinates are set to 0. If a certain random characteristic selection operation is performed, X is selectedsubThe 3 rd, 6 th and 7 th bands, then the vector is nowThe corresponding coordinates are not changed, and the rest coordinates are set to 0, namely
4) X is paired according to a discrimination formula (5)subAll the pixels inClassifying the pixels satisfying the discriminant formula (6)Classifying to a left sub-node, and classifying the pixels which are not satisfied to a right sub-node; that is to say, the value will be determinedPixels less than or equal to zeroPlacing the result at the left subnode and determining the value deltaiLarger than zero is placed on the right child node.
5) Repeating the step 2), the step 3) and the step 4) for the left sub-node and the right sub-node respectively until the following conditions are met:
condition (a): the number of pixels in the node reaches a preset minimum number K.
Condition (b): the maximum height of the tree has reached a preset maximum height L.
6) And (3) constructing each tree in the original model of the isolated forest according to the steps 1) to 5) to form a forest, namely, obtaining an optimized model of the isolated forest after the original model of the isolated forest is trained.
In step S1202, inputting the spatial dimension features into an isolated forest optimization model to calculate a spatial abnormality score corresponding to each spatial dimension feature;
in step S1203, an average value of the spatial abnormality scores is calculated as a second spatial abnormality score for each pixel, respectively.
In the embodiment of the application, the spatial dimension features are input into the isolated forest optimization model, that is, all N pixels of the spatial dimension features are input into the isolated forest optimization model, spatial abnormality scores of all pixels in an original hyperspectral image after being segmented by each binary tree are calculated first, and then an average value of the spatial abnormality scores of the pixels after being segmented by all binary trees in the isolated forest, that is, a second spatial abnormality score of each pixel is calculated.
In some optional implementations as the first embodiment of the present application, the weighting algorithm is expressed as:
S(x)=0.618×GS(x)+0.382×KS(x)
wherein S (x) is the target abnormality score, GS (x) is the first spectral abnormality score, and KS (x) is the second spatial abnormality score.
In the embodiment of the application, the first spectrum abnormal score and the second spatial abnormal score are weighted and calculated based on a weighting algorithm, specifically, the final spatial spectrum joint feature abnormal score S of each pixel is weighted and obtained by giving a spectrum abnormal score, that is, more weights to the first spectrum abnormal score, so as to generate a final abnormal detection result.
In summary, the present application provides a hyperspectral image anomaly detection method, including: responding a hyperspectral image anomaly detection request carrying original hyperspectral image data; normalizing the original hyperspectral image data to obtain intermediate hyperspectral image data; performing dimensionality reduction processing on the intermediate hyperspectral image data based on a principal component analysis algorithm to obtain first principal component image data; carrying out segmentation processing on the first principal component image data based on an image segmentation algorithm of edge detection to obtain a first subregion set; record the firstTaking the index of each first sub-area in the sub-area set as a first index; acquiring spectral dimensional features corresponding to the intermediate hyperspectral image data in each first sub-area based on the first index; performing anomaly detection on the spectral dimensional characteristics based on an isolated forest optimization model to obtain a first spectral anomaly score of each pixel in the original hyperspectral image data; based on a threshold segmentation algorithm, carrying out segmentation processing on the first principal component image data to obtain a second subregion set; recording indexes of all second sub-areas in the second sub-area set, and taking the indexes as second indexes; performing spatial distribution characteristic extraction operation on the intermediate hyperspectral image data based on a Gabor filter to obtain hyperspectral image spatial distribution characteristics; respectively acquiring space dimensional features in each second sub-area based on the second indexes and the hyperspectral image space distribution features; anomaly detection is carried out on the spatial dimensional characteristics based on an isolated forest optimization model, and a second spatial anomaly score of each pixel is obtained; performing weighted calculation on the first spectrum abnormality score and the second space abnormality score based on a weighted algorithm to obtain a target abnormality score of each pixel; and outputting the target abnormality score. Based on a (0, 1) standardization method, the original hyperspectral image data X ∈ R ^ (N multiplied by D) is subjected to normalization processing, and the gray value of each pixel in each wave band can be adjusted to (0, 1)]Accurately acquiring intermediate hyperspectral image data; then, dimension reduction is carried out on the intermediate hyperspectral image data of a plurality of wave bands based on a principal component analysis algorithm to obtain first principal component image data, so that the data dimension can be greatly reduced, and meanwhile, the spatial information of the original hyperspectral image data can be well kept; then, the edge detection method based on Canny operator is used for carrying out dimension reduction on the first principal component image data X obtained after dimension reduction1Dividing to obtain a first subregion set consisting of a plurality of first subregions; marking the first indexes of the first subregions, and applying the spectral dimension characteristics acquired in the first subregions to anomaly detection in an isolated forest optimization model based on the first indexes, so that a first spectral anomaly score of each pixel in original hyperspectral image data is acquired, and multi-dimensional anomaly detection by using the spectral characteristics is realized; at the same time, based on thresholdsValue division method for first principal component image data X1Dividing to obtain a second subregion set consisting of a plurality of second subregions; marking a second index of each first sub-region; extracting spatial distribution characteristics of the intermediate hyperspectral image data based on a Gabor filter, and acquiring spatial dimensional characteristics by combining a second index; further, the spatial dimension characteristics are applied to an isolated and standing optimization model for anomaly detection, so that a second spatial anomaly score of each pixel in the original hyperspectral image data is obtained; and finally, performing weighted calculation on the first spectrum abnormality score and the second space abnormality score based on a weighted algorithm to obtain a target abnormality score of each pixel, and outputting a final target abnormality score as an abnormality detection result. The method can accurately and quickly acquire the interest information of the abnormal target, can effectively improve the detection of the abnormal estimation value of the pixel in the hyperspectral image data with different scales and dimensions by the model, improve the accuracy of acquiring the abnormal estimation value of the pixel, improve the detection rate of the abnormal target, suppress the background, reduce the false alarm rate and reduce the missing detection condition.
It should be appreciated that the subject application is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware associated with computer readable instructions, which can be stored in a computer readable storage medium, and when executed, can include processes of the embodiments of the methods described above. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random Access Memory (RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
Example two
With further reference to fig. 6, as an implementation of the method shown in fig. 1, the present application provides an embodiment of a hyperspectral image abnormality detection apparatus, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be applied to various electronic devices.
As shown in fig. 6, the hyperspectral image abnormality detection apparatus 100 according to the present embodiment includes: the system comprises a request response module 101, a data acquisition module 102, a dimension reduction processing module 103, an edge segmentation processing module 104, a first index acquisition module 105, a spectral dimension feature acquisition module 106, a first anomaly detection module 107, a threshold segmentation processing module 108, a second index acquisition module 109, a feature extraction module 1010, a spatial dimension feature acquisition module 1011, a second anomaly detection module 1012, an anomaly score calculation module 1013, and a score output module 1014. Wherein:
the request response module 101 is configured to respond to a hyperspectral image anomaly detection request carrying original hyperspectral image data;
the data acquisition module 102 is configured to perform normalization processing on the original hyperspectral image data to obtain intermediate hyperspectral image data;
in the embodiment of the application, the original hyperspectral image data is a hyperspectral remote sensing image experimental data set collected in advance, and referring to fig. 10(a), the original hyperspectral image data may be specifically image data collected in the los angeles airport area through an airborne visible light/infrared imaging spectrometer AVIRIS sensor.
In the embodiment of the application, the intermediate hyperspectral image data is the original hyperspectral image data based on a (0, 1) standardization methodPerforming normalization processing, namely mapping the gray value of each pixel in the original hyperspectral image data in each wave band to (0, 1)]The specific (0, 1) normalization method for the image data is expressed as:
wherein, XminIs its minimum value, XmaxIs its maximum value.
For example, referring to fig. 10(a) and 10(b), it is assumed that the spatial resolution of the hyperspectral image is 7.1m, the acquisition time is 2011 for 9 months, the image size is 100 × 100 pixels, and 191 bands are included after preprocessing; the experimental dataThree airplanes of different sizes in the image are taken as abnormal targets, wherein, FIG. 10(a) is used for representing a gray scale map of the 37 th wave band of the data set; fig. 10(b) is for showing the abnormal target reference position.
The dimensionality reduction processing module 103 is used for performing dimensionality reduction processing on the intermediate hyperspectral image data based on a principal component analysis algorithm to obtain first principal component image data;
in the embodiment of the present application, the intermediate hyperspectral image data is subjected to dimensionality reduction based on a Principal Component Analysis (PCA) and the first Principal Component image data is selected, referring to fig. 11(a), and the original hyperspectral image data is first converted into the original hyperspectral image dataIs processed, i.e. converted into a matrix [ X ] of 10000 rows and 191 columns]10000×191Processing is carried out, wherein 10000 rows of the matrix represent 10000 pixels of the image, in other words, each row vector represents one pixel of the image, and each row vector consists of 191 coordinates and corresponds to 191 wave bands of the hyperspectral data; then, normalizing the original hyperspectral image data to obtain intermediate hyperspectral image data, and analyzing the intermediate hyperspectral image data [ X ] based on Principal Component Analysis (PCA)]10000×191Reducing dimensions to data [ X ] containing only first principal component]10000×1(ii) a Furthermore, in this embodiment, the image represented by the first principal component obtained after dimensionality reduction can be compared with fig. 11(a) and fig. 10(a), and it can be seen that the first principal component image data after dimensionality reduction can well retain the spatial information of the original hyperspectral image data while greatly reducing the data dimensionality.
An edge segmentation processing module 104, configured to perform segmentation processing on the first principal component image data based on an image segmentation algorithm for edge detection to obtain a first sub-region set;
a first index obtaining module 105, configured to record an index of each first sub-area in the first sub-area set, and use the index as a first index;
in the embodiment of the present application, the image segmentation algorithm based on edge detection performs segmentation processing on the first principal component image data, specifically, the edge detection method based on Canny operator may be used to perform dimension reduction on the first principal component image data X obtained after dimension reduction1The segmentation is performed so as to obtain a first set of sub-regions consisting of several first sub-regions.
In this embodiment of the application, the first index is obtained by dividing the background feature into a plurality of first sub-regions based on the result obtained by the edge detection, and recording the pixel coordinate index of each first sub-region.
For example, referring to fig. 11(b), based on the first principal component image data of fig. 11(a), the first principal component image data is segmented based on an edge detection method, by dividing the original 100 × 100 size image into four first sub-regions, and then the coordinate index of the pixel in each first sub-region can be accurately recorded as the first index of the first sub-region for performing anomaly detection on the spectral feature of the image locally based on the isolated forest optimization model.
A spectral dimension feature obtaining module 106, configured to obtain spectral dimension features corresponding to the intermediate hyperspectral image data in each first sub-region based on the first index;
in the embodiment of the application, the spectrum dimensional characteristics corresponding to the intermediate hyperspectral image data in each first sub-area based on the first index are obtained in each sub-area according to the pixel coordinate index of each first sub-area after the obtained blocks are partitioned, so that the spectrum dimensional characteristics corresponding to the intermediate hyperspectral image data are applied to an isolated forest optimization model for anomaly detection.
The first anomaly detection module 107 is used for carrying out anomaly detection on the spectral dimensional characteristics based on the isolated forest optimization model to obtain a first spectral anomaly score of each pixel in the original hyperspectral image data;
in this embodiment, the first spectrum abnormality score is a spectrum abnormality score of each pixel in the first sub-area obtained based on the ratio of the number of pixels in the leaf node and the direct parent node.
Specifically, spectral abnormality scores of all pixels in original hyperspectral image data after being segmented by each binary tree are calculated, and then the average value of the spectral abnormality scores of the pixels after being segmented by all binary trees in an isolated forest is calculated. Specifically, the spectrum abnormality score of each pixel in the ith tree can be calculated by applying formula (1):
wherein, Ti(x) Refers to the leaf node where the pixel x is divided by the ith binary tree,is leaf node Ti(x) The direct parent node of (a); m (-) is the number of pixels contained in the node;is a normalized coefficient, the effect being such that gs isiThe value range of (DEG) is (0, 1)]。
Further, the average value ks (x) of the spectrum abnormality scores of the pixel x in the isolated forest is calculated by formula (2):
wherein t is the number of binary trees preset in the isolated forest.
It will be appreciated that the greater the value of the spectral abnormality score gs (x), the greater the probability that pixel element x will differ significantly in the spectral dimension from most pixel elements.
The threshold segmentation processing module 108 is configured to perform segmentation processing on the first principal component image data based on a threshold segmentation algorithm to obtain a second sub-region set;
a second index obtaining module 109, configured to record an index of each second sub-area in the second sub-area set, and use the index as a second index;
in the embodiment of the present application, the obtaining of the second sub-region set by performing segmentation processing on the first principal component image data based on the threshold segmentation algorithm may specifically be that the first principal component image data X is subjected to segmentation processing by a segmentation method based on a threshold1The division is performed, thereby obtaining a second sub-area set composed of a plurality of second sub-areas.
In this embodiment of the application, the second index is obtained by dividing the background feature into a plurality of second sub-regions based on the result obtained by the threshold division, and recording the pixel coordinate index of each second sub-region.
For example, referring to fig. 11(c), based on the first principal component image data of fig. 11(a), the first principal component image data is segmented based on a threshold segmentation algorithm, and the original first principal component image is divided into seven second sub-regions, so that the coordinate index of the pixel in each second sub-region can be accurately recorded as the second index of the second sub-region for performing anomaly detection on the spatial feature of the image locally based on the isolated forest optimization model.
The feature extraction module 1010 is used for performing spatial distribution feature extraction operation on the intermediate hyperspectral image data based on a Gabor filter to obtain hyperspectral image spatial distribution features;
in the embodiment of the application, a Gabor filter is used for extracting spatial distribution characteristics of intermediate hyperspectral image data to obtain hyperspectral image spatial distribution characteristics, specifically, Gabor transformation of short-time windowed Fourier transformation is adopted, namely Fourier transformation is carried out in a specific time window, and the special condition that a window function in the short-time Fourier transformation is taken as a Gaussian function is adopted; therefore, the spatial distribution feature extraction method can extract the spatial distribution feature of the intermediate hyperspectral image data in different scales and different directions in the frequency domain through the Gabor filter so as to accurately acquire the hyperspectral image spatial distribution feature. In addition, the Gabor function is similar to the human eye function, is usually used for texture recognition, and achieves better effect.
A space dimension feature obtaining module 1011, configured to obtain space dimension features in each second sub-region based on the second index and the hyperspectral image space distribution feature respectively;
in the embodiment of the application, the step of respectively obtaining the space dimensional characteristics in each second sub-area based on the second indexes and the hyperspectral image space distribution characteristics is to respectively obtain the space dimensional characteristics corresponding to the intermediate hyperspectral image data in each sub-area according to the obtained pixel coordinate indexes of each first sub-area after blocking and the hyperspectral image space distribution characteristics, so that the space dimensional characteristics are applied to an isolated forest optimization model for anomaly detection.
A second anomaly detection module 1012, configured to perform anomaly detection on the spatial dimension features based on the isolated forest optimization model, to obtain a second spatial anomaly score for each pixel element;
in this embodiment of the present application, the second spatial anomaly score is a spatial anomaly score of each pixel in the second sub-area obtained based on a ratio of the number of pixels in the leaf node and the direct parent node.
Specifically, the spatial abnormality scores of all pixels in the original hyperspectral image data after being segmented by each binary tree are calculated, and then the average value of the spatial abnormality scores of the pixels after being segmented by all binary trees in the isolated forest is calculated. Specifically, the spatial abnormality score of each pixel in the ith tree can be calculated by applying formula (3):
wherein, Ti(x) Refers to the leaf node where the pixel x is divided by the ith binary tree,is leaf node Ti(x) The direct parent node of (a); m (-) is the number of pixels contained in the node;is a normalized coefficient, the effect being such that ksiThe value range of (DEG) is (0, 1)]。
Further, the average value ks (x) of the spatial abnormality scores of the pixel x in the isolated forest is calculated by formula (4):
wherein t is the number of binary trees preset in the isolated forest.
It will be appreciated that the greater the value of the spatial anomaly score KS (x), the greater the probability that pixel element x will differ significantly in the spatial dimension from the majority of pixel elements.
The abnormal score calculating module 1013 is configured to perform weighted calculation on the first spectrum abnormal score and the second spatial abnormal score based on a weighting algorithm to obtain a target abnormal score of each pixel;
and a score output module 1014 for outputting the target abnormality score.
In this embodiment of the application, the first spectrum abnormality score and the second spatial abnormality score are weighted and calculated based on a weighting algorithm to obtain a target abnormality score of each pixel, specifically, referring to fig. 12(c), for example, according to the first index obtained in fig. 11(b), the first principal component image data [ X ] is obtained]10000×191Segmentation into [ X ] based on edge detectionC1]1109×191、[XC2]1526×191、[XC3]3440×191、[XC4]3925×191Four first sub-regions; and applying an isolated forest algorithm which is improved based on hyperspectral data in each first sub-area, calculating the spectrum abnormality score of each pixel in the first sub-area, and further obtaining the spectrum abnormality score of 10000 pixels of the whole image, namely the first spectrum abnormality score.
Further, in the aspect of spatial dimension, based on a threshold segmentation method, Gabor-extracted spatial features are combinedIs divided into [ YC1]896×160、[YC2]1590×160、[YC3]2105×160、[YC4]1565×160、[YC5]1536×160、[YC6]1145×160、[YC7]1163×160Seven second subregions are adopted, an isolated forest algorithm which is improved in a hyperspectral data mode is applied to each subregion, the space abnormality score of each pixel in each second subregion is calculated, and then 10000 pixels of the whole image are obtainedThe spatial anomaly score, i.e., the second spatial anomaly score.
Further, the first spectrum abnormality score and the second spatial abnormality score are weighted and summed according to the weight of S ═ 0.618 × gs (x) +0.382 × ks (y), so as to obtain the abnormality scores of all pixels under the multi-scale and multi-dimensional spatial spectrum combination characteristic, that is, the target abnormality score of each pixel. Finally, the abnormal target detection result of the hyperspectral image shown in fig. 12(c) can be obtained.
It can be understood that, referring to fig. 12(c), dark color pixels represent background terrain, light color pixels represent abnormal pixels, and lighter pixels represent higher abnormality. As shown in fig. 12(c), the detection result obtained in this embodiment has the characteristics of clearer abnormal target (three airplanes), better background information suppression effect and fewer false alarm pixels in vision, and the visual effect is obviously better than the detection result obtained by a classical algorithm RXD in the hyperspectral image abnormality detection field as shown in fig. 12(a) and better than the detection result obtained by a traditional hyperspectral image space-spectrum combination characteristic abnormality detection method based on an isolated forest model as shown in fig. 12 (b).
Further, referring to fig. 13, the embodiment is superior to the conventional algorithm in terms of subjective visual effect, and also has an advantage in terms of objective evaluation index. Specifically, compared with the conventional method, when the abscissa is constant, the ordinate value obtained in this embodiment is larger; when the ordinate is constant, the abscissa value obtained in this embodiment is smaller. That is, the present embodiment has a higher detection rate of abnormal targets at the same false alarm rate; the present embodiment has a lower false alarm rate at the same abnormal target detection rate. The RXD represents a classical algorithm RX detector (Reed-Xiiolet detector) in the field of hyperspectral image anomaly detection, the MFIFD represents a traditional hyperspectral image space spectrum combined characteristic anomaly detection method based on an isolated forest model, and the SSMMD represents the method provided by the embodiment of the application.
Further, referring to fig. 14, the present embodiment uses a box plot to represent the separation degree between the abnormal target and the background ground object in the hyperspectral image. By using the reference position information of the abnormal target in fig. 10(b), statistics is performed on the abnormal target pixels and the background pixels, respectively, and parameters such as the maximum value, the minimum value, the median, the main value, and the like of the two categories are counted. As shown in fig. 14, the upper tentacles in the box plot are the maximum values of the data, the lower tentacles are the minimum values of the data, the box represents the main value of the data accounting for 50% of the total data, and the horizontal lines in the box represent the median of the data. Wherein, the thick solid line part represents an abnormal target, the thin solid line part represents a background ground object, and the degree of separation between the background and the abnormal target under different methods is analyzed through a box diagram, so that the following results are obtained: the RXD method can restrain the background in a small range, but a serious crossing phenomenon exists between the background and the abnormity, namely, the minimum value of the abnormity score of the abnormal pixel element and the maximum value of the abnormity score of the background pixel element are crossed, which indicates that the RXD cannot well separate the abnormal pixel element from the background and reflects the abnormal pixel element in a visual reference to figure 12(a), and two smaller airplanes are not detected. When the boxplot of the existing MFIFD method is observed, no intersection exists between the abnormity and the background, which indicates that the method can well detect the abnormal target, but the box body of the thin solid line representing the background is larger, which indicates that the method cannot well inhibit the background, namely, when the abnormal pixel is detected, more false alarm pixels appear, which is reflected in the visual reference of FIG. 12(b), and more bright spots exist in the background, which brings higher false alarm rate. The method provided by the embodiment of the application can well distinguish the abnormal pixel from the background pixel; and the thin solid line box representing the background is very small, which shows that the method provided by the invention well inhibits the background, improves the ubiquitous high false alarm phenomenon to a certain extent, and with reference to fig. 12(c) in the visual effect, under the condition of detecting abnormal pixels at a higher level, the number of false alarm pixels is reduced to a great extent, and the method has better detection performance.
Further, referring to fig. 15, the method is used for examining a certain amount of index of evaluating an abnormal detection effect, namely Area Under ROC Curve (AUC), as shown in fig. 13, the method provided by the embodiment of the application simultaneously realizes multi-scale utilization of spatial characteristics of a hyperspectral image and multi-dimensional utilization of spectral characteristics, and performs directional improvement on an isolated forest model facing hyperspectral data; therefore, under the condition that tensor decomposition is not used and the calculation complexity is further greatly reduced, the detection capability is still superior to that of a traditional hyperspectral image space spectrum combined characteristic abnormality detection method based on an isolated forest model and that of a classical algorithm RXD method for hyperspectral abnormality detection.
The application provides a hyperspectral image anomaly detection device, including: by carrying out normalization processing on the original hyperspectral image data, the gray value of each pixel in each wave band can be mapped so as to accurately acquire intermediate hyperspectral image data; then reducing the dimension of the intermediate hyperspectral image data of a plurality of wave bands based on a principal component analysis algorithm to obtain first principal component image data; then, based on an image segmentation algorithm of edge detection, segmenting the first main component image data into a first sub-region set consisting of a plurality of first sub-regions according to boundary lines among various background ground features; marking the first indexes of the first subregions, and applying the spectral dimensional characteristics acquired in the first subregions to anomaly detection in an isolated forest optimization model based on the first indexes so as to acquire a first spectral anomaly score of each pixel in the original hyperspectral image data; meanwhile, the first principal component image data is divided into a second sub-region set consisting of a plurality of second sub-regions based on a threshold value division method; marking a second index of each first sub-region; extracting spatial distribution characteristics of the intermediate hyperspectral image data based on a Gabor filter, and acquiring spatial dimensional characteristics by combining a second index; further, the spatial dimension characteristics are applied to an isolated and standing optimization model for anomaly detection, so that a second spatial anomaly score of each pixel in the original hyperspectral image data is obtained; and finally, performing weighted calculation on the first spectrum abnormality score and the second space abnormality score based on a weighted algorithm to obtain a target abnormality score of each pixel, and outputting a final target abnormality score as an abnormality detection result. The detection of the model on the abnormal estimation values of the pixels in the hyperspectral image data with different scales and dimensions can be effectively improved, the accuracy of obtaining the abnormal estimation values of the pixels is improved, and the condition of missing detection is reduced.
In some optional implementations of the second embodiment of the present application, the dimension reduction processing module 103 includes: the device comprises a set construction unit, a matrix calculation unit, a unit vector calculation unit, a vector projection unit, a dimension reduction vector acquisition unit and a vector set unit. Wherein:
a set construction unit for constructing an original set { x ] based on a principal component analysis algorithm1,x2,…,xNIn which x1,x2,…,xNIs the original input quantity;
a matrix calculation unit for calculating a covariance matrix of the original set, wherein the covariance matrix is represented as:
a unit vector calculation unit for calculating a unit eigenvector v corresponding to the maximum eigenvalue of the covariance matrix1;
A vector projection unit for projecting a vector based on the feature vector v1Forming a projection matrix V, where V ═ V1];
A dimension reduction vector obtaining unit for obtaining a dimension reduction vectorWhen i is 1, 2, …, N, respectivelyAs an original input quantity x1,x2,…,xNThe reduced dimension vector of (2);
and the vector collection unit is used for taking a set formed by the dimension reduction vectors as the first main component image data.
In the embodiment of the application, the intermediate hyperspectral images are analyzed based on a principal component analysis algorithmThe image data is subjected to dimension reduction processing, and specifically, an original set { x } is constructed based on a principal component analysis algorithm1,x2,…,xNIn which x1,x2,…,xNAs the original input, the covariance matrix Σ of the original set is then calculated:
further, the unit eigenvector v corresponding to the maximum eigenvalue of the covariance matrix sigma is obtained1And using the feature vector v1Forming a projection matrix V ═ V1];
Further, calculating1, 2, …, N, obtainedAre respectively the input quantity x1,x2,…,xNThe vector after dimensionality reduction is used for obtaining first principal component image data
Continuing to refer to fig. 7, a schematic structural diagram of the edge segmentation processing module 104 provided in the second embodiment of the present application is shown, and for convenience of description, only the portions related to the present application are shown.
In some optional implementations of the second embodiment of the present application, as shown in fig. 7, the edge segmentation processing module 104 includes: a convolution processing unit 701, a gradient calculation unit 702, an edge detection unit 703, and an edge segmentation unit 704. Wherein:
a convolution processing unit 701, configured to perform convolution processing on the first principal component image data based on a gaussian filter template to obtain smooth image data;
a gradient calculation unit 702 for calculating a gradient magnitude and a gradient direction corresponding to the smoothed image data based on a differential operator;
an edge detection unit 703, configured to perform non-maximum suppression on the gradient amplitude and the gradient direction, and determine an edge in the smoothed image data based on a dual-threshold algorithm;
an edge segmentation unit 704, configured to perform segmentation processing on the smoothed image data based on an edge, so as to obtain a first sub-region set.
In the embodiment of the application, the image segmentation algorithm based on edge detection performs segmentation processing on the first principal component image data, specifically, convolution processing is performed by applying a gaussian filter template, so that an image of the obtained smooth image data is smooth, and noise is removed; further, calculating the amplitude and direction of the gradient by using a differential operator; then, carrying out non-maximum value inhibition on the gradient amplitude, namely traversing the image, and if the difference value between the gray value of a certain pixel and the gray values of two pixels in front and at the back of the certain pixel in the gradient direction is less than a set value, setting the pixel value as 0, namely not an edge; finally, a double-threshold algorithm is applied to detect and connect edges, namely two thresholds are calculated based on the cumulative histogram, wherein the edges which are larger than the high threshold are determined; less than the low threshold must not be an edge. If the detection result is larger than the low threshold but smaller than the high threshold, it is necessary to determine whether there is an edge pixel exceeding the high threshold in the adjacent pixels of the pixel, if so, the pixel is an edge, otherwise, the pixel is not an edge, and the smooth image data is divided into a first sub-region set composed of a plurality of first sub-regions based on the determined edge.
In some optional implementations of the second embodiment of the present application, the threshold segmentation processing module 108 includes: the device comprises an original threshold calculation unit, a category determination unit and a maximum background category segmentation unit. Wherein:
an original threshold calculation unit for calculating an original threshold corresponding to the first principal component image data based on a variance method between the maximum classes;
the category determination unit is used for comparing the gray value of the first main component image data with an original threshold, taking the pixels corresponding to the gray value which is greater than or equal to the original threshold as a target category, and taking the pixels corresponding to the gray value which is less than the original threshold as a background category;
and the maximum background class segmentation unit is used for repeatedly executing the steps of calculating the covariance matrix and calculating the unit feature vector on the background class so as to obtain the maximum background class to realize the segmentation processing of the first main component image data and obtain the second subregion set.
In the embodiment of the application, the first principal component image data is segmented based on a threshold segmentation algorithm, specifically, a threshold T corresponding to the first principal component image data is obtained by calculation based on an inter-class variance method (OTSU) maximum; further, pixels corresponding to the gray value of the first principal component image data larger than or equal to the threshold T are classified into a target class, and pixels corresponding to the gray value of the first principal component image data smaller than the threshold T are classified into a background class; then, the steps of calculating the covariance matrix and calculating the unit feature vector are repeated again for the background class until the maximum background class number B is reached, so as to divide the first principal component image data into a second sub-region set composed of a plurality of second sub-regions based on the maximum background class number B.
In some optional implementations of the second embodiment of the present application, the second anomaly detection module 1012 includes: the device comprises a model training unit, a score calculating unit and an average value calculating unit. Wherein:
and the model training unit is used for training a plurality of binary trees in the isolated forest original model based on the hyperspectral image optimization training set to obtain the isolated forest optimization model.
In the embodiment of the application, the hyperspectral image optimization training set is obtained by improving the isolated forest original model facing to hyperspectral data.
The soliton original model comprises a plurality of trees, each tree is a binary tree called iTree, and a schematic structural diagram of the binary tree is shown in fig. 9. The nodes in the binary tree iTree are divided into leaf nodes (leaf nodes), internal child nodes (internalnodes) and root nodes (rootnodes). Wherein, the root node is the topmost node of the tree and is the starting point of the tree; each internal sub-node can be divided into a left sub-node and a right sub-node; the subdivision continues until no further sub-nodes can be separated out, called leaf nodes. After the original algorithm is improved by orienting to hyperspectral data, training a plurality of binary trees iTrees in an isolated forest to obtain an isolated forest optimization model, and the method specifically comprises the following steps:
1) from intermediate hyperspectral image dataIn the method, 30% of pixels are randomly selected, it needs to be noted that the selection of pixels can be selected more or less, but too much selection of pixels results in large calculation amount and limited precision improvement, too little selection of pixels results in influence on precision, and 30% of the selection of pixels results in better cost performance of calculation amount and detection precision, namely 0.3 × N pixels are used as training subsetsThis randomly selecting subset step is repeated once per tree, i.e., each tree in the soliton forest is trained from a different randomly selected subset, and thus each tree is different.
2) Randomly determining a vectorWherein,j ═ 1, 2, …, D; optionally selecting pjIs mixing XsubIs greater than pjTo the right subsetIn, is less than pjTo the left subsetThen, the ith band (i e [1, D ]) is calculated based on the formula (5)]) Subset XsubBackground in all 0.3 XN pixelsThe separability evaluation index delta of the pixel and the abnormal target pixel; wherein the index ΔiThe larger the value of (b), the better the separability between the background pixel and the abnormal pixel in the ith wave band is; and determining the first D (D is D/2) wave bands with better separation of the background and the abnormal image element according to the index delta.
3) Constructing random vectors satisfying Gaussian distributionsAnd vector is divided according to d wave bands randomly determined in step8.1.2The corresponding coordinates are set to 1, and the remaining coordinates are set to 0. If a certain random characteristic selection operation is performed, X is selectedsubThe 3 rd, 6 th and 7 th bands, then the vector is nowThe corresponding coordinates are not changed, and the rest coordinates are set to 0, namely
4) X is paired according to a discrimination formula (5)subAll the pixels inClassifying the pixels satisfying the discriminant formula (6)Classifying to a left sub-node, and classifying the pixels which are not satisfied to a right sub-node; that is to say, the value will be determinedPixels less than or equal to zeroPlacing the result at the left subnode and determining the value deltaiLarger than zero is placed on the right child node.
5) Repeating the step 2), the step 3) and the step 4) for the left sub-node and the right sub-node respectively until the following conditions are met:
condition (a): the number of pixels in the node reaches a preset minimum number K.
Condition (b): the maximum height of the tree has reached a preset maximum height L.
6) And (3) constructing each tree in the original model of the isolated forest according to the steps 1) to 5) to form a forest, namely, obtaining an optimized model of the isolated forest after the original model of the isolated forest is trained.
The score calculating unit is used for inputting the spatial dimensional features into the isolated forest optimization model to calculate a spatial abnormality score corresponding to each spatial dimensional feature;
and the average value calculating unit is used for calculating the average value of the spatial abnormality scores as a second spatial abnormality score of each pixel respectively.
In the embodiment of the application, the spatial dimension features are input into the isolated forest optimization model, that is, all N pixels of the spatial dimension features are input into the isolated forest optimization model, spatial abnormality scores of all pixels in an original hyperspectral image after being segmented by each binary tree are calculated first, and then an average value of the spatial abnormality scores of the pixels after being segmented by all binary trees in the isolated forest, that is, a second spatial abnormality score of each pixel is calculated.
In some optional implementations of the second embodiment of the present application, the weighting algorithm is expressed as:
S(x)=0.618×GS(x)+0.382×KS(x)
wherein S (x) is the target abnormality score, GS (x) is the first spectral abnormality score, and KS (x) is the second spatial abnormality score.
In the embodiment of the application, the first spectrum abnormal score and the second spatial abnormal score are weighted and calculated based on a weighting algorithm, specifically, the final spatial spectrum joint feature abnormal score S of each pixel is weighted and obtained by giving a spectrum abnormal score, that is, more weights to the first spectrum abnormal score, so as to generate a final abnormal detection result.
To sum up, the application provides a hyperspectral image anomaly detection device, includes: the request response module is used for responding a hyperspectral image anomaly detection request carrying original hyperspectral image data; the data acquisition module is used for carrying out normalization processing on the original hyperspectral image data to obtain intermediate hyperspectral image data; the dimensionality reduction processing module is used for carrying out dimensionality reduction processing on the intermediate hyperspectral image data based on a principal component analysis algorithm to obtain first principal component image data; the edge segmentation processing module is used for carrying out segmentation processing on the first main component image data based on an image segmentation algorithm of edge detection to obtain a first sub-region set; the first index acquisition module is used for recording the index of each first sub-area in the first sub-area set and taking the index as a first index; the spectral dimensional feature acquisition module is used for acquiring spectral dimensional features corresponding to the intermediate hyperspectral image data in each first sub-area based on the first index; the first anomaly detection module is used for carrying out anomaly detection on the spectral dimensional characteristics based on the isolated forest optimization model to obtain a first spectral anomaly score of each pixel in the original hyperspectral image data; the threshold segmentation processing module is used for carrying out segmentation processing on the first main component image data based on a threshold segmentation algorithm to obtain a second subregion set; the second index acquisition module is used for recording the index of each second sub-area in the second sub-area set and taking the index as a second index; a feature extraction module for performing space distribution feature extraction operation on the intermediate hyperspectral image data based on a Gabor filter to obtain a hyperspectral image spaceInter-distribution characteristics; the spatial dimension characteristic acquisition module is used for respectively acquiring spatial dimension characteristics in each second sub-area based on the second indexes and the spatial distribution characteristics of the hyperspectral image; the second anomaly detection module is used for carrying out anomaly detection on the spatial dimensional characteristics based on the isolated forest optimization model to obtain a second spatial anomaly score of each pixel; the abnormal score calculation module is used for carrying out weighted calculation on the first spectrum abnormal score and the second space abnormal score based on a weighting algorithm to obtain a target abnormal score of each pixel; and the score output module is used for outputting the target abnormal score. Based on a (0, 1) standardization method, the original hyperspectral image data X ∈ R ^ (N multiplied by D) is subjected to normalization processing, and the gray value of each pixel in each wave band can be adjusted to (0, 1)]Accurately acquiring intermediate hyperspectral image data; then, dimension reduction is carried out on the intermediate hyperspectral image data of a plurality of wave bands based on a principal component analysis algorithm to obtain first principal component image data, so that the data dimension can be greatly reduced, and meanwhile, the spatial information of the original hyperspectral image data can be well kept; then, the edge detection method based on Canny operator is used for carrying out dimension reduction on the first principal component image data X obtained after dimension reduction1Dividing to obtain a first subregion set consisting of a plurality of first subregions; marking the first indexes of the first subregions, and applying the spectral dimension characteristics acquired in the first subregions to anomaly detection in an isolated forest optimization model based on the first indexes, so that a first spectral anomaly score of each pixel in original hyperspectral image data is acquired, and multi-dimensional anomaly detection by using the spectral characteristics is realized; meanwhile, the threshold-based segmentation method is used for the first principal component image data X1Dividing to obtain a second subregion set consisting of a plurality of second subregions; marking a second index of each first sub-region; extracting spatial distribution characteristics of the intermediate hyperspectral image data based on a Gabor filter, and acquiring spatial dimensional characteristics by combining a second index; further, the spatial dimension characteristics are applied to an isolated and standing optimization model for anomaly detection, so that a second spatial anomaly score of each pixel in the original hyperspectral image data is obtained; finally, based on the weighted algorithm pairAnd performing weighted calculation on the first spectrum abnormality score and the second space abnormality score to obtain a target abnormality score of each pixel, and outputting a final target abnormality score as an abnormality detection result. The method can accurately and quickly acquire the interest information of the abnormal target, can effectively improve the detection of the abnormal estimation value of the pixel in the hyperspectral image data with different scales and dimensions by the model, improve the accuracy of acquiring the abnormal estimation value of the pixel, improve the detection rate of the abnormal target, suppress the background, reduce the false alarm rate and reduce the missing detection condition.
In order to solve the technical problem, an embodiment of the present application further provides a computer device. Referring to fig. 8, fig. 8 is a block diagram of a basic structure of a computer device according to the present embodiment.
The computer device 8 comprises a memory 81, a processor 82, a network interface 83 communicatively connected to each other via a system bus. It is noted that only computer device 8 having components 81-83 is shown, but it is understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead. AS will be understood by those skilled in the art, the computer device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (AS industry C), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The computer device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The computer equipment can carry out man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch panel or voice control equipment and the like.
The memory 81 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the storage 81 may be an internal storage unit of the computer device 8, such as a hard disk or a memory of the computer device 8. In other embodiments, the memory 81 may also be an external storage device of the computer device 8, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the computer device 8. Of course, the memory 81 may also comprise both an internal storage unit of the computer device 8 and an external storage device thereof. In this embodiment, the memory 81 is generally used for storing an operating system installed in the computer device 8 and various types of application software, such as computer readable instructions of a hyperspectral image anomaly detection method. Further, the memory 81 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 82 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 82 is typically used to control the overall operation of the computer device 8. In this embodiment, the processor 82 is configured to execute computer readable instructions stored in the memory 81 or process data, for example, execute computer readable instructions of the hyperspectral image abnormality detection method.
The network interface 83 may comprise a wireless network interface or a wired network interface, and the network interface 83 is generally used for establishing communication connections between the computer device 8 and other electronic devices.
The present application further provides another embodiment, which is to provide a computer-readable storage medium storing computer-readable instructions, which are executable by at least one processor to cause the at least one processor to perform the steps of the hyperspectral image abnormality detection method as described above.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
It is to be understood that the above-described embodiments are merely illustrative of some, but not restrictive, of the broad invention, and that the appended drawings illustrate preferred embodiments of the invention and do not limit the scope of the invention. This application is capable of embodiments in many different forms and is provided for the purpose of enabling a thorough understanding of the disclosure of the application. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to one skilled in the art that the present application may be practiced without modification or with equivalents of some of the features described in the foregoing embodiments. All equivalent structures made by using the contents of the specification and the drawings of the present application are directly or indirectly applied to other related technical fields and are within the protection scope of the present application.
Claims (10)
1. A hyperspectral image anomaly detection method is characterized by comprising the following steps:
responding a hyperspectral image anomaly detection request carrying original hyperspectral image data;
normalizing the original hyperspectral image data to obtain intermediate hyperspectral image data;
performing dimensionality reduction processing on the intermediate hyperspectral image data based on a principal component analysis algorithm to obtain first principal component image data;
carrying out segmentation processing on the first principal component image data based on an image segmentation algorithm of edge detection to obtain a first sub-region set;
recording indexes of all first sub-areas in the first sub-area set, and taking the indexes as first indexes;
acquiring spectral dimensional features corresponding to the intermediate hyperspectral image data in each first sub-area based on the first index;
performing anomaly detection on the spectrum dimensional characteristics based on an isolated forest optimization model to obtain a first spectrum anomaly score of each pixel in the original hyperspectral image data;
based on a threshold segmentation algorithm, carrying out segmentation processing on the first principal component image data to obtain a second subregion set;
recording indexes of all second sub-areas in the second sub-area set, and taking the indexes as second indexes;
performing spatial distribution characteristic extraction operation on the intermediate hyperspectral image data based on a Gabor filter to obtain hyperspectral image spatial distribution characteristics;
respectively acquiring space dimensional features in each second sub-area based on the second indexes and the hyperspectral image space distribution features;
anomaly detection is carried out on the spatial dimensional characteristics based on an isolated forest optimization model, and a second spatial anomaly score of each pixel is obtained;
performing weighting calculation on the first spectrum abnormality score and the second space abnormality score based on a weighting algorithm to obtain a target abnormality score of each pixel;
and outputting the target abnormality score.
2. The hyperspectral image anomaly detection method according to claim 1, wherein the step of performing dimensionality reduction processing on the intermediate hyperspectral image data based on a principal component analysis algorithm to obtain first principal component image data specifically comprises:
constructing an original set { x) based on the principal component analysis algorithm1,x2,…,xNIn which x1,x2,…,xNIs the original input quantity;
computing a covariance matrix of the original set, wherein the covariance matrix is represented as:
calculating a unit eigenvector v1 corresponding to the largest eigenvalue of the covariance matrix;
based on the feature vector v1Forming a projection matrix V, where V ═ V1];
When in useWhen i is 1, 2, …, N, respectivelyAs the original input quantity x1,x2,…,xNThe reduced dimension vector of (2);
and taking the set formed by the dimensionality reduction vectors as the first main component image data.
3. The hyperspectral image anomaly detection method according to claim 1, wherein the step of performing segmentation processing on the first principal component image data by using an image segmentation algorithm based on edge detection to obtain a first sub-region set specifically comprises:
performing convolution processing on the first principal component image data based on a Gaussian filtering template to obtain smooth image data;
calculating a gradient magnitude and a gradient direction corresponding to the smoothed image data based on a differential operator;
carrying out non-maximum suppression on the gradient amplitude and the gradient direction, and determining edges in the smooth image data based on a dual-threshold algorithm;
and performing segmentation processing on the smooth image data based on the edge to obtain the first sub-region set.
4. The hyperspectral image anomaly detection method according to claim 2, wherein the step of segmenting the first principal component image data based on a threshold segmentation algorithm to obtain a second sub-region set specifically comprises:
calculating an original threshold corresponding to the first principal component image data based on a maximum inter-class variance method;
comparing the gray value of the first main component image data with the original threshold, taking the pixel corresponding to the gray value which is greater than or equal to the original threshold as a target class, and taking the pixel corresponding to the gray value which is less than the original threshold as a background class;
and repeatedly executing the steps of calculating the covariance matrix and the unit feature vector on the background class to acquire the maximum background class to realize the segmentation processing of the first principal component image data to obtain the second subregion set.
5. The hyperspectral image anomaly detection method according to claim 1, wherein the step of performing anomaly detection on the spatial dimensional features based on an isolated forest optimization model to obtain a second spatial anomaly score of each pixel specifically comprises:
training a plurality of binary trees in an isolated forest original model based on a hyperspectral image optimization training set to obtain an isolated forest optimization model;
inputting the spatial dimension characteristics into the isolated forest optimization model to calculate a spatial abnormality score corresponding to each spatial dimension characteristic;
and respectively calculating the average value of the spatial abnormality scores as a second spatial abnormality score of each pixel.
6. The hyperspectral image anomaly detection method according to claim 1, characterized in that the weighting algorithm is expressed as:
S(x)=0.618×GS(x)+0.382×KS(x)
wherein S (x) is the target abnormality score, GS (x) is the first spectral abnormality score, and KS (x) is the second spatial abnormality score.
7. A hyperspectral image abnormality detection apparatus characterized by comprising:
the request response module is used for responding a hyperspectral image anomaly detection request carrying original hyperspectral image data;
the data acquisition module is used for carrying out normalization processing on the original hyperspectral image data to obtain intermediate hyperspectral image data;
the dimensionality reduction processing module is used for carrying out dimensionality reduction processing on the intermediate hyperspectral image data based on a principal component analysis algorithm to obtain first principal component image data;
the edge segmentation processing module is used for carrying out segmentation processing on the first principal component image data based on an image segmentation algorithm of edge detection to obtain a first sub-region set;
the first index acquisition module is used for recording indexes of all first sub-areas in the first sub-area set and taking the indexes as first indexes;
a spectral dimension characteristic acquisition module, configured to acquire a spectral dimension characteristic corresponding to the intermediate hyperspectral image data in each of the first sub-regions based on the first index;
the first anomaly detection module is used for carrying out anomaly detection on the spectral dimensional characteristics based on an isolated forest optimization model to obtain a first spectral anomaly score of each pixel in the original hyperspectral image data;
the threshold segmentation processing module is used for carrying out segmentation processing on the first main component image data based on a threshold segmentation algorithm to obtain a second subregion set;
the second index acquisition module is used for recording the index of each second sub-area in the second sub-area set and taking the index as a second index;
the characteristic extraction module is used for carrying out space distribution characteristic extraction operation on the intermediate hyperspectral image data based on a Gabor filter to obtain a hyperspectral image space distribution characteristic;
a spatial dimension feature obtaining module, configured to obtain spatial dimension features in each second sub-region based on the second index and the hyperspectral image spatial distribution feature respectively;
the second anomaly detection module is used for carrying out anomaly detection on the spatial dimension characteristics based on an isolated forest optimization model to obtain a second spatial anomaly score of each pixel element;
the abnormal score calculation module is used for carrying out weighted calculation on the first spectrum abnormal score and the second space abnormal score based on a weighting algorithm to obtain a target abnormal score of each pixel;
and the score output module is used for outputting the target abnormal score.
8. The apparatus according to claim 7, wherein the edge segmentation processing module comprises:
the convolution processing unit is used for performing convolution processing on the first principal component image data based on a Gaussian filtering template to obtain smooth image data;
a gradient calculation unit for calculating a gradient magnitude and a gradient direction corresponding to the smoothed image data based on a differential operator;
the edge detection unit is used for carrying out non-maximum suppression on the gradient amplitude and the gradient direction and determining an edge in the smooth image data based on a dual-threshold algorithm;
and the edge segmentation unit is used for carrying out segmentation processing on the smooth image data based on the edge to obtain the first sub-region set.
9. A computer device, characterized in that it comprises a memory having computer readable instructions stored therein and a processor implementing the steps of the hyperspectral image abnormality detection method according to any of claims 1 to 6 when executing said computer readable instructions.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon computer readable instructions which, when executed by a processor, implement the steps of the hyperspectral image abnormality detection method according to any of the claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110279231.0A CN112990313B (en) | 2021-03-16 | 2021-03-16 | Hyperspectral image anomaly detection method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110279231.0A CN112990313B (en) | 2021-03-16 | 2021-03-16 | Hyperspectral image anomaly detection method and device, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112990313A true CN112990313A (en) | 2021-06-18 |
CN112990313B CN112990313B (en) | 2023-04-07 |
Family
ID=76336065
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110279231.0A Active CN112990313B (en) | 2021-03-16 | 2021-03-16 | Hyperspectral image anomaly detection method and device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112990313B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113553914A (en) * | 2021-06-30 | 2021-10-26 | 核工业北京地质研究院 | Abnormal target detection method for CASI (computer aided design) hyperspectral data |
CN113627322A (en) * | 2021-08-09 | 2021-11-09 | 台州市污染防治工程技术中心 | Method and system for eliminating abnormal points and electronic equipment |
CN115082865A (en) * | 2022-07-27 | 2022-09-20 | 国能大渡河检修安装有限公司 | Bridge crane intrusion dangerous behavior early warning method and system based on visual image recognition |
CN116758361A (en) * | 2023-08-22 | 2023-09-15 | 中国铁路设计集团有限公司 | Engineering rock group remote sensing classification method and system based on spatial and spectral joint characteristics |
CN117688500A (en) * | 2024-02-02 | 2024-03-12 | 山东万洋石油科技有限公司 | Three-dimensional resistivity abnormal data extraction method |
CN117853931A (en) * | 2024-03-04 | 2024-04-09 | 中国铁路设计集团有限公司 | Hyperspectral image isolated anomaly detection method based on nearest neighbor distance |
Citations (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7593587B1 (en) * | 2005-04-12 | 2009-09-22 | The United States Of America As Represented By The Secretary Of The Army | Spectral feature generation using high-pass filtering for scene anomaly detection |
US20110221926A1 (en) * | 2010-03-12 | 2011-09-15 | Kanaev Andrey V | Spectral Anomaly Detection in Deep Shadows |
CN102938151A (en) * | 2012-11-22 | 2013-02-20 | 中国人民解放军电子工程学院 | Method for detecting anomaly of hyperspectral image |
US20130322760A1 (en) * | 2012-06-04 | 2013-12-05 | Raytheon Company | System and method for rapid cluster analysis of hyperspectral images |
CN103559715A (en) * | 2013-11-07 | 2014-02-05 | 中国科学院对地观测与数字地球科学中心 | Abnormal detection method and device for hyper-spectral image |
CN106023218A (en) * | 2016-05-27 | 2016-10-12 | 哈尔滨工程大学 | Hyperspectral abnormity detection method based on spatial spectrum combined background co-sparse representation |
CN107895361A (en) * | 2017-10-24 | 2018-04-10 | 中国电子科技集团公司第二十八研究所 | A kind of hyperspectral abnormity detection method based on local density's purifying background |
US20180260657A1 (en) * | 2016-11-01 | 2018-09-13 | Shenzhen University | Method and system for extracting and classifying features of hyperspectral remote sensing image |
CN109493338A (en) * | 2018-11-16 | 2019-03-19 | 西安电子科技大学 | Hyperspectral image abnormal detection method based on combined extracting sky spectrum signature |
CN110443125A (en) * | 2019-06-27 | 2019-11-12 | 武汉大学 | A kind of EO-1 hyperion method for detecting abnormal based on the selection of differentiation forest subspace |
CN110570395A (en) * | 2019-08-06 | 2019-12-13 | 西安电子科技大学 | Hyperspectral anomaly detection method based on spatial-spectral combined collaborative representation |
CN110929643A (en) * | 2019-11-21 | 2020-03-27 | 西北工业大学 | Hyperspectral anomaly detection method based on multiple features and isolated trees |
US20200265227A1 (en) * | 2019-02-18 | 2020-08-20 | Nec Laboratories America, Inc. | Background suppression for anomaly detection |
CN112067129A (en) * | 2020-09-24 | 2020-12-11 | 江苏集萃苏科思科技有限公司 | Hyperspectral processing method and waveband selection method |
CN112396066A (en) * | 2020-11-27 | 2021-02-23 | 广东电网有限责任公司肇庆供电局 | Feature extraction method suitable for hyperspectral image |
-
2021
- 2021-03-16 CN CN202110279231.0A patent/CN112990313B/en active Active
Patent Citations (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7593587B1 (en) * | 2005-04-12 | 2009-09-22 | The United States Of America As Represented By The Secretary Of The Army | Spectral feature generation using high-pass filtering for scene anomaly detection |
US20110221926A1 (en) * | 2010-03-12 | 2011-09-15 | Kanaev Andrey V | Spectral Anomaly Detection in Deep Shadows |
US20130322760A1 (en) * | 2012-06-04 | 2013-12-05 | Raytheon Company | System and method for rapid cluster analysis of hyperspectral images |
CN102938151A (en) * | 2012-11-22 | 2013-02-20 | 中国人民解放军电子工程学院 | Method for detecting anomaly of hyperspectral image |
CN103559715A (en) * | 2013-11-07 | 2014-02-05 | 中国科学院对地观测与数字地球科学中心 | Abnormal detection method and device for hyper-spectral image |
CN106023218A (en) * | 2016-05-27 | 2016-10-12 | 哈尔滨工程大学 | Hyperspectral abnormity detection method based on spatial spectrum combined background co-sparse representation |
US20180260657A1 (en) * | 2016-11-01 | 2018-09-13 | Shenzhen University | Method and system for extracting and classifying features of hyperspectral remote sensing image |
CN107895361A (en) * | 2017-10-24 | 2018-04-10 | 中国电子科技集团公司第二十八研究所 | A kind of hyperspectral abnormity detection method based on local density's purifying background |
CN109493338A (en) * | 2018-11-16 | 2019-03-19 | 西安电子科技大学 | Hyperspectral image abnormal detection method based on combined extracting sky spectrum signature |
US20200265227A1 (en) * | 2019-02-18 | 2020-08-20 | Nec Laboratories America, Inc. | Background suppression for anomaly detection |
CN110443125A (en) * | 2019-06-27 | 2019-11-12 | 武汉大学 | A kind of EO-1 hyperion method for detecting abnormal based on the selection of differentiation forest subspace |
CN110570395A (en) * | 2019-08-06 | 2019-12-13 | 西安电子科技大学 | Hyperspectral anomaly detection method based on spatial-spectral combined collaborative representation |
CN110929643A (en) * | 2019-11-21 | 2020-03-27 | 西北工业大学 | Hyperspectral anomaly detection method based on multiple features and isolated trees |
CN112067129A (en) * | 2020-09-24 | 2020-12-11 | 江苏集萃苏科思科技有限公司 | Hyperspectral processing method and waveband selection method |
CN112396066A (en) * | 2020-11-27 | 2021-02-23 | 广东电网有限责任公司肇庆供电局 | Feature extraction method suitable for hyperspectral image |
Non-Patent Citations (5)
Title |
---|
RONG WANG等: "Multiple Features and Isolation Forest-Based Fast Anomaly Detector for Hyperspectral Imagery", 《IEEE TRANSACTIONS ON GEOSCIENCE AND REMOTE SENSING》, vol. 58, no. 9, 18 March 2020 (2020-03-18), pages 6664 - 6676 * |
SHIZHEN CHANG等: "A Subspace Selection-Based Discriminative Forest Method for Hyperspectral Anomaly Detection", 《IEEE TRANSACTIONS ON GEOSCIENCE AND REMOTE SENSING》, vol. 58, no. 6, 15 January 2020 (2020-01-15), pages 4033 - 4046, XP011789761, DOI: 10.1109/TGRS.2019.2960391 * |
XIANGYU SONG等: "Spectral–Spatial Anomaly Detection of Hyperspectral Data Based on Improved Isolation Forest", vol. 60, pages 1 - 16, XP011898965, DOI: 10.1109/TGRS.2021.3104998 * |
李敏等: "基于多孔径映射的高光谱异常检测算法", 《测绘学报》, vol. 45, no. 10, 31 October 2016 (2016-10-31), pages 4033 - 4046 * |
聂婷: "大幅宽光学遥感图像目标检测技术研究", 《中国优秀博硕士学位论文全文数据库(博士)工程科技Ⅱ辑》, no. 2019, 15 August 2019 (2019-08-15), pages 028 - 12 * |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113553914A (en) * | 2021-06-30 | 2021-10-26 | 核工业北京地质研究院 | Abnormal target detection method for CASI (computer aided design) hyperspectral data |
CN113553914B (en) * | 2021-06-30 | 2024-03-19 | 核工业北京地质研究院 | CASI hyperspectral data abnormal target detection method |
CN113627322A (en) * | 2021-08-09 | 2021-11-09 | 台州市污染防治工程技术中心 | Method and system for eliminating abnormal points and electronic equipment |
CN115082865A (en) * | 2022-07-27 | 2022-09-20 | 国能大渡河检修安装有限公司 | Bridge crane intrusion dangerous behavior early warning method and system based on visual image recognition |
CN115082865B (en) * | 2022-07-27 | 2022-11-11 | 国能大渡河检修安装有限公司 | Bridge crane intrusion dangerous behavior early warning method and system based on visual image recognition |
CN116758361A (en) * | 2023-08-22 | 2023-09-15 | 中国铁路设计集团有限公司 | Engineering rock group remote sensing classification method and system based on spatial and spectral joint characteristics |
CN116758361B (en) * | 2023-08-22 | 2023-10-27 | 中国铁路设计集团有限公司 | Engineering rock group remote sensing classification method and system based on spatial and spectral joint characteristics |
CN117688500A (en) * | 2024-02-02 | 2024-03-12 | 山东万洋石油科技有限公司 | Three-dimensional resistivity abnormal data extraction method |
CN117853931A (en) * | 2024-03-04 | 2024-04-09 | 中国铁路设计集团有限公司 | Hyperspectral image isolated anomaly detection method based on nearest neighbor distance |
CN117853931B (en) * | 2024-03-04 | 2024-05-14 | 中国铁路设计集团有限公司 | Hyperspectral image isolated anomaly detection method based on nearest neighbor distance |
Also Published As
Publication number | Publication date |
---|---|
CN112990313B (en) | 2023-04-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112990313B (en) | Hyperspectral image anomaly detection method and device, computer equipment and storage medium | |
Kang et al. | Hyperspectral anomaly detection with attribute and edge-preserving filters | |
CN101763507B (en) | Face recognition method and face recognition system | |
Li et al. | Contextual hypergraph modeling for salient object detection | |
Zhang et al. | Corner detection based on gradient correlation matrices of planar curves | |
CN106503739A (en) | The target in hyperspectral remotely sensed image svm classifier method and system of combined spectral and textural characteristics | |
Tu et al. | Hyperspectral anomaly detection using dual window density | |
CN108427913B (en) | Hyperspectral image classification method combining spectral, spatial and hierarchical structure information | |
EP2273424A1 (en) | Automated target detection and recognition system and method | |
Zhang et al. | Robust image corner detection based on scale evolution difference of planar curves | |
CN107341505B (en) | Scene classification method based on image significance and Object Bank | |
CN103617413B (en) | Method for identifying object in image | |
Yue et al. | Texture extraction for object-oriented classification of high spatial resolution remotely sensed images using a semivariogram | |
Kumar et al. | Spectral–spatial classification of hyperspectral imagery based on moment invariants | |
Tasdemir et al. | ROI detection in mammogram images using wavelet-based Haralick and HOG features | |
Kowkabi et al. | A fast spatial–spectral preprocessing module for hyperspectral endmember extraction | |
CN112990314A (en) | Hyperspectral image anomaly detection method and device based on improved isolated forest algorithm | |
Raza Shah et al. | Hyperspectral anomaly detection: a performance comparison of existing techniques | |
Giannarou et al. | Optimal edge detection using multiple operators for image understanding | |
Al-Ghrairi et al. | Classification of satellite images based on color features using remote sensing | |
Lin et al. | Edge detection in the feature space | |
CN108764112A (en) | A kind of Remote Sensing Target object detecting method and equipment | |
Zhang et al. | Region-of-interest extraction based on spectrum saliency analysis and coherence-enhancing diffusion model in remote sensing images | |
Yang et al. | Hyperspectral image classification based on spatial and spectral features and sparse representation | |
Wo et al. | A saliency detection model using aggregation degree of color and texture |
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 |