CN112990313B - 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 PDF

Info

Publication number
CN112990313B
CN112990313B CN202110279231.0A CN202110279231A CN112990313B CN 112990313 B CN112990313 B CN 112990313B CN 202110279231 A CN202110279231 A CN 202110279231A CN 112990313 B CN112990313 B CN 112990313B
Authority
CN
China
Prior art keywords
image data
hyperspectral image
sub
score
pixel
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.)
Active
Application number
CN202110279231.0A
Other languages
Chinese (zh)
Other versions
CN112990313A (en
Inventor
宋向宇
何斌
龙勇机
聂婷
邵帅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Changchun Institute of Optics Fine Mechanics and Physics of CAS
Original Assignee
Changchun Institute of Optics Fine Mechanics and Physics of CAS
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Changchun Institute of Optics Fine Mechanics and Physics of CAS filed Critical Changchun Institute of Optics Fine Mechanics and Physics of CAS
Priority to CN202110279231.0A priority Critical patent/CN112990313B/en
Publication of CN112990313A publication Critical patent/CN112990313A/en
Application granted granted Critical
Publication of CN112990313B publication Critical patent/CN112990313B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/243Classification techniques relating to the number of classes
    • G06F18/2433Single-class perspective, e.g. one-against-all classification; Novelty detection; Outlier detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/243Classification techniques relating to the number of classes
    • G06F18/24323Tree-organised classifiers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/34Smoothing or thinning of the pattern; Morphological operations; Skeletonisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10032Satellite or aerial image; Remote sensing
    • G06T2207/10036Multispectral image; Hyperspectral image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A40/00Adaptation technologies in agriculture, forestry, livestock or agroalimentary production
    • Y02A40/10Adaptation 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

Hyperspectral image anomaly detection method and device, computer equipment and storage medium
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, the 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 conventional hyperspectral image anomaly detection methods are based on the fact that an abnormal pixel and a background pixel are compared in a spectrum dimension and belong to a low-probability occurrence event, namely, the spectrum anomaly is the argument, the difference degree of the abnormal pixel and the background pixel in the spectrum dimension is calculated, namely, an anomaly detection algorithm is designed based on the spectrum dimension, but in a space dimension, the abnormal pixel is compared with the background pixel and usually belongs to the low-probability occurrence event, so that the spatial relationship between the pixels is ignored, and anomaly detection is performed only depending on the characteristics of the space dimension, so that the conventional methods mostly have the problems of relatively serious omission phenomenon or relatively high 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, the document "Zhang Xing, wen Gongjian, dai weii.a temporal composition Based analysis Detection for Hyperspectral Image [ J ]. IEEE Transactions on Geoscience and Remote Sensing, vol.54, no.10, pp: 5801-5820" discloses a Hyperspectral Image Anomaly Detection method Based on Tensor Decomposition (temporal composition), which analyzes different dimensional information of multidimensional data simultaneously by means of Tensor. The method comprises the steps of firstly, expressing a hyperspectral image cube by using a third-Order tensor, and carrying out High Order Singular Value Decomposition (HOSVD) on a data real Shi Sanjie tensor, wherein the HOSVD 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, an isolated Forest algorithm is often introduced into a Hyperspectral image Anomaly detection task to avoid accurate estimation and modeling of a background and obtain a good detection effect, wherein a Hyperspectral image spatial spectrum joint characteristic Anomaly detection algorithm Based on an isolated Forest model is disclosed in a document' 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. 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 data by using an isolated forest model respectively, then 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 an index of each first sub-region in the first set of sub-regions, and using the index 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.
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:
original set { x) is constructed based on principal component analysis algorithm 1 ,x 2 ,…,x N In which x 1 ,x 2 ,…,x N Is the original input quantity;
computing a covariance matrix of the original set, wherein the covariance matrix is represented as:
Figure GDA0003854333360000041
wherein the content of the first and second substances,
Figure GDA0003854333360000042
calculating a unit eigenvector v corresponding to the maximum eigenvalue of the covariance matrix 1
Based on feature vectors v 1 Form a projection matrix V, where V = [ V = 1 ];
When in use
Figure GDA0003854333360000051
When it is needed, will->
Figure GDA0003854333360000052
As an original input quantity x 1 ,x 2 ,…,x N The 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 abnormality 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 spatial distribution characteristic extraction operation on the intermediate hyperspectral image data based on a Gabor filter to obtain hyperspectral image spatial 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.
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, 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; 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 flow chart 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 diagram of a conventional RXD algorithm, a detection result diagram of a conventional isolated forest model and a detection result diagram 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 detecting an abnormality of a hyperspectral image according to an embodiment of the present application is shown. The hyperspectral image anomaly detection method comprises the following steps of:
in the step S1, responding to a hyperspectral image anomaly detection request carrying original hyperspectral image data;
in step S2, the original 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 method
Figure GDA0003854333360000111
Carrying out normalization treatment, namely carrying out normalization treatment on each pixel in the original hyperspectral image data in each wave bandGray value mapping to (0,1)]The image data in (i), the specific (0,1) normalization method, is represented as:
Figure GDA0003854333360000112
wherein, X min Is its minimum value, X max Is 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 data
Figure GDA0003854333360000113
Three airplanes with different sizes in the image are taken as abnormal targets, wherein, FIG. 10 (a) is used for representing a grayscale 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 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 data
Figure GDA0003854333360000114
Is processed, i.e. converted into a matrix [ X ] of 10000 rows and 191 columns] 10000×191 Processing 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×191 Reducing dimensions to data [ X ] containing only first principal component] 10000×1 (ii) a Further, the present embodiment can be as followsComparing the image represented by the first principal component obtained after dimensionality reduction with fig. 11 (a) and fig. 10 (a), it can be seen that the image data of the first principal component obtained after dimensionality reduction can well retain the spatial information of the original hyperspectral image data while greatly reducing the data dimensionality.
In step S4, 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;
in step S5, the index of each first sub-area in the first set of sub-areas is recorded and used as the 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 reduction 1 The division is performed, so that a first sub-region set composed of a plurality of first sub-regions is obtained.
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 each of the 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, abnormal detection is carried out on the spectrum dimensional characteristics based on the isolated forest optimization model, and a first spectrum abnormal score of each pixel in the original hyperspectral image data is obtained.
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):
Figure GDA0003854333360000131
wherein, T i (x) Refers to the leaf node where the pixel x is located after being segmented by the ith binary tree,
Figure GDA0003854333360000132
is leaf node T i (x) The direct parent node of (a); m (-) is the number of pixels contained in the node; />
Figure GDA0003854333360000133
Is a normalized coefficient, the effect being such that gs is i The value range of (0,1)]。
Further, the average value GS (x) of the spectrum abnormality scores of the pixel x in the isolated forest is calculated by formula (2):
Figure GDA0003854333360000134
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 the pixel element x will differ significantly in the spectral dimension from most of the pixel elements.
In step S8, the first principal component image data is segmented 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 and used as the second index.
In this embodiment of the present application, the segmentation processing is performed on the first principal component image data based on the threshold segmentation algorithm to obtain the second sub-region set, specifically, the segmentation method based on the threshold may be performed on the first principal component image data X by using a threshold-based segmentation method 1 The division is performed, thereby obtaining a second sub-area set composed of a plurality of second sub-areas.
In the embodiment of the present 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 respectively obtained in each second sub-region 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 second 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, the second spatial anomaly score is a spatial anomaly score of each pixel in the second sub-region, which is 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):
Figure GDA0003854333360000151
wherein, T i (x) Refers to the leaf node where the pixel x is divided by the ith binary tree,
Figure GDA0003854333360000152
is leaf node T i (x) The direct parent node of (a); m (-) is the number of pixels contained in the node; />
Figure GDA0003854333360000153
Is a normalized coefficient, the effect being such that ks i The value range of (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):
Figure GDA0003854333360000154
wherein t is the number of binary trees preset in the isolated forest.
It can be appreciated that the greater the value of the spatial abnormality score KS (x), the greater the probability that pixel element x will differ significantly in the spatial dimension from most 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×191 Segmentation into [ X ] based on edge detection C1 ] 1109×191 、[X C2 ] 1526×191 、[X C3 ] 3440×191 、[X C4 ] 3925×191 Four first sub-regions; and applying an isolated forest algorithm which is improved based on hyperspectral data in each first sub-area to calculate the spectrum abnormality score of each pixel in the first sub-area so as to obtain the spectrum abnormality score of 10000 pixels of the whole image,i.e. the first spectral anomaly score.
Further, in the aspect of spatial dimension, based on a threshold segmentation method, gabor-extracted spatial features are combined
Figure GDA0003854333360000155
Is divided into [ Y C1 ] 896×160 、[Y C2 ] 1590×160 、[Y C3 ] 2105×160 、[Y C4 ] 1565×160 、[Y C5 ] 1536×160 、[Y C6 ] 1145×160 、[Y C7 ] 1163×160 And 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 subjected to weighted summation according to the weight of S =0.618 × GS (x) +0.382 × KS (y), and the abnormality scores of all pixels under the multi-scale and multi-dimensional spatial spectrum combination characteristic, namely the target abnormality score of each pixel, are obtained. 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 classic algorithm RXD in the hyperspectral image abnormality detection field shown in fig. 12 (a) and better than the detection result obtained by a traditional hyperspectral image space-spectrum combined characteristic abnormality detection method based on an isolated forest model 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 utilizes a box plot to represent the degree of separation between the abnormal target and the background feature 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; output target and (6) scoring the abnormality. 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 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 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 continuing reference to fig. 2, a flowchart of an implementation of step S3 in fig. 1 is shown, and for ease of illustration, only the portions relevant to the present application are shown.
In some optional implementation manners 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 algorithm 1 ,x 2 ,…,x N In which x 1 ,x 2 ,…,x N Is the original input quantity;
in step S302, a covariance matrix of the original set is calculated, wherein the covariance matrix is expressed as:
Figure GDA0003854333360000191
wherein the content of the first and second substances,
Figure GDA0003854333360000192
in step S303, a unit eigenvector v corresponding to the maximum eigenvalue of the covariance matrix is calculated 1
In step S304, based on the feature vector v 1 Form a projection matrix V, where V = [ V = 1 ];
In step S305, when
Figure GDA0003854333360000193
When it is needed, will->
Figure GDA0003854333360000194
As an original input quantity x 1 ,x 2 ,…,x N The 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 algorithm 1 ,x 2 ,…,x N In which x 1 ,x 2 ,…,x N For the original input quantities, then, the covariance matrix Σ of the original set is calculated:
Figure GDA0003854333360000195
in the formula (I), the compound is shown in the specification,
Figure GDA0003854333360000196
further, the unit eigenvector v corresponding to the maximum eigenvalue based on the acquired covariance matrix Σ 1 And using the feature vector v 1 Composition projection matrix V = [ V ] 1 ];
Further, calculate
Figure GDA0003854333360000201
The resulting->
Figure GDA0003854333360000202
Are respectively the input quantity x 1 ,x 2 ,…,x N The vector after dimension reduction is used for acquiring the first principal component image data>
Figure GDA0003854333360000203
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 implementation manners 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 continuing reference to fig. 4, a flowchart of an implementation of step S8 in fig. 1 is shown, and for ease of illustration, only the portions relevant to the present application are shown.
In some optional implementation manners 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 implementation manners 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 data
Figure GDA0003854333360000221
In the method, 30% of pixels are randomly selected, it needs to be noted that the selected pixels can be selected more or less, but too many pixels are selected, the accuracy is improved to a limited extent, too few pixels influence the accuracy, and in 30%, the calculated amount and the detection accuracy are good in performance price, namely 0.3 × N pixels are used as training subsets (or/and/or subsets)>
Figure GDA0003854333360000222
This 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 vector
Figure GDA0003854333360000223
Wherein it is present>
Figure GDA0003854333360000224
Figure GDA0003854333360000225
Optionally selecting p j Is mixing X sub Is greater than p j Is classified into right subset->
Figure GDA0003854333360000226
In, is less than p j Is classified into a left subset->
Figure GDA0003854333360000227
Then, the i-th band (i e [1,D) is calculated based on the formula (5)]) Subset X sub The 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 Δ i The 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 = D/2) wave bands with better separation of the background and the abnormal image element according to the index delta.
Figure GDA0003854333360000228
Wherein the content of the first and second substances,
Figure GDA0003854333360000229
σ (·) is a method function, avg (a, b) = (a + b)/2.
3) Constructing random vectors satisfying Gaussian distributions
Figure GDA00038543333600002210
And based on the randomly determined d bands in step8.1.2, the vector is->
Figure GDA00038543333600002211
The 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 selected sub The 3 rd, 6 th and 7 th bands, then the vector @ispresent>
Figure GDA00038543333600002212
The corresponding coordinates are not changed, and the rest coordinates are set to 0, namely
Figure GDA00038543333600002213
/>
4) X is paired according to a discrimination formula (5) sub All the pixels in
Figure GDA00038543333600002214
Classifying to obtain pixels x satisfying the discrimination formula (6) subi 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 determined
Figure GDA0003854333360000231
Pixel less than or equal to zero>
Figure GDA0003854333360000232
Placing the result at the left subnode and determining the value delta i Larger than zero is placed on the right child node.
Figure GDA0003854333360000233
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; 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 dimension in each second sub-area based on second indexes and hyperspectral image space distribution characteristicsPerforming sign; 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, normalization processing is carried out on original hyperspectral image data X ∈ R ^ (N multiplied by D), and the gray value of each pixel in each wave band can be changed 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 reduction 1 Dividing to obtain a first sub-area set consisting of a plurality of first sub-areas; 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 X 1 Dividing 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. Not only can accurately and quickly acquire interesting information of an abnormal target, but also can effectively acquire interesting information of the abnormal targetThe detection of the abnormal estimation values of the pixels in the hyperspectral image data with different scales and dimensions by the model is improved, the accuracy of obtaining the abnormal estimation values of the pixels is improved, the abnormal target detection rate is improved, the background can be suppressed, the false alarm rate is reduced, and the condition of missing detection is reduced.
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 based on (0,1) standardizationMethod for processing original hyperspectral image data
Figure GDA0003854333360000261
Carrying out normalization treatment, namely mapping the gray value of each pixel in the original hyperspectral image data in each wave band to (0,1)]The image data in (i), the specific (0,1) normalization method, is represented as:
Figure GDA0003854333360000271
wherein, X min Is its minimum value, X max Is 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 data
Figure GDA0003854333360000272
Three airplanes with different sizes in the image are taken as abnormal targets, wherein, FIG. 10 (a) is used for representing a grayscale 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, based on a Principal Component Analysis (PCA) method, the intermediate hyperspectral image data is subjected to dimensionality reduction and a 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 data
Figure GDA0003854333360000273
Is processed, i.e. converted into a matrix [ X ] of 10000 rows and 191 columns] 10000×191 A process is performed in which 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, corresponding to 191 hyperspectral dataA wave band; 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×191 Dimensionality reduction to data [ X ] containing only the 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 reduction 1 The 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):
Figure GDA0003854333360000281
wherein, T i (x) Refers to the leaf node where the pixel x is divided by the ith binary tree,
Figure GDA0003854333360000282
is leaf node T i (x) The direct parent node of (2); m (-) is the number of pixels contained in the node; />
Figure GDA0003854333360000283
Is a normalized coefficient, the effect being such that gs is i The value range of (0,1)]。
Further, the average value GS (x) of the spectrum abnormality scores of the pixel x in the isolated forest is calculated by formula (2):
Figure GDA0003854333360000291
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 the pixel element x will differ significantly in the spectral dimension from most of the pixel elements.
A threshold segmentation processing module 108, 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 threshold 1 And performing segmentation, thereby obtaining a second sub-area set consisting 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 configured to perform a spatial distribution feature extraction operation on the intermediate hyperspectral image data based on a Gabor filter 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.
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 second 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):
Figure GDA0003854333360000301
wherein, T i (x) Refers to the leaf node where the pixel x is divided by the ith binary tree,
Figure GDA0003854333360000302
is leaf node T i (x) The direct parent node of (2); m (-) is the number of pixels contained in the node; />
Figure GDA0003854333360000303
Is a normalized coefficient, the effect being such that ks i The value range of (0,1)]。/>
Further, an average value KS (x) of spatial abnormality scores of pixel x in the isolated forest is calculated by formula (4):
Figure GDA0003854333360000304
wherein t is the number of binary trees preset in the isolated forest.
It can be appreciated that the greater the value of the spatial abnormality score KS (x), the greater the probability that pixel element x will differ significantly in the spatial dimension from most 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, see fig. 12 (c), for example, according to the first index obtained in fig. 11 (b), the second index is obtainedA main component image data [ X ]] 10000×191 Segmentation into [ X ] based on edge detection C1 ] 1109×191 、[X C2 ] 1526×191 、[X C3 ] 3440×191 、[X C4 ] 3925×191 Four 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 the method of threshold segmentation, gabor-extracted spatial features are combined
Figure GDA0003854333360000311
Is divided into [ Y C1 ] 896×160 、[Y C2 ] 1590×160 、[Y C3 ] 2105×160 、[Y C4 ] 1565×160 、[Y C5 ] 1536×160 、[Y C6 ] 1145×160 、[Y C7 ] 1163×160 And 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 subjected to weighted summation according to the weight of S =0.618 × GS (x) +0.382 × KS (y), and the abnormality scores of all pixels under the multi-scale and multi-dimensional spatial spectrum combination characteristic, namely the target abnormality score of each pixel, are obtained. 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 combined 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 algorithm 1 ,x 2 ,…,x N In which x 1 ,x 2 ,…,x N Is the original input quantity;
a matrix calculation unit for calculating a covariance matrix of the original set, wherein the covariance matrix is represented as:
Figure GDA0003854333360000341
wherein the content of the first and second substances,
Figure GDA0003854333360000342
a unit vector calculation unit for calculating a unit eigenvector v corresponding to the maximum eigenvalue of the covariance matrix 1
A vector projection unit for projecting a vector based on the feature vector v 1 Form a projection matrix V, where V = [ V = 1 ];
A dimension-reduced vector acquisition unit for
Figure GDA0003854333360000343
When in use, respectively will
Figure GDA0003854333360000344
As an original input quantity x 1 ,x 2 ,…,x N The 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 image data are subjected to dimensionality reduction processing based on a principal component analysis algorithm, specifically, an original set { x } is constructed based on the principal component analysis algorithm 1 ,x 2 ,…,x N In which x 1 ,x 2 ,…,x N For the original input quantities, then, the covariance matrix Σ of the original set is calculated:
Figure GDA0003854333360000345
in the formula (I), the compound is shown in the specification,
Figure GDA0003854333360000346
further, the unit eigenvector v corresponding to the maximum eigenvalue based on the acquired covariance matrix Σ 1 And using the feature vector v 1 Composition projection matrix V = [ V ] 1 ];
Further, calculating
Figure GDA0003854333360000351
The resulting->
Figure GDA0003854333360000352
Are respectively the input quantity x 1 ,x 2 ,…,x N The reduced-dimension vector to obtain the first principal component image data->
Figure GDA0003854333360000353
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: convolution processing section 701, gradient calculation section 702, edge detection section 703, and edge segmentation section 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 present application, an image segmentation algorithm based on edge detection performs segmentation processing on the first principal component image data, specifically, convolution processing may be performed by applying a gaussian filter template, so as to smooth an image of the obtained smooth image data, and remove noise; further, calculating the amplitude and direction of the gradient by using a differential operator; then, performing non-maximum value suppression 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 pixel in the gradient direction is less than a set value, setting the pixel value as 0, namely not being 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 original isolated forest 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 data
Figure GDA0003854333360000371
In 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 many pixels are selected, the accuracy is improved to a limited extent, too few pixels influence the accuracy, and in 30%, the calculated amount and the detection accuracy are good in cost performance, namely 0.3 multiplied by N pixelsPixel as training subset->
Figure GDA0003854333360000372
This 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 vector
Figure GDA0003854333360000373
Wherein it is present>
Figure GDA0003854333360000374
Figure GDA0003854333360000375
Optionally selecting p j Is mixing X sub Is greater than p j Is classified into right subset->
Figure GDA0003854333360000376
In, is less than p j Is classified into a left subset->
Figure GDA0003854333360000377
Then, the i-th band (i ∈ [1,D ]) is calculated based on formula (5)]) Subset X sub The 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 Δ i The 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 = D/2) wave bands with better separation of the background and the abnormal image element according to the index delta.
Figure GDA0003854333360000378
Wherein the content of the first and second substances,
Figure GDA0003854333360000379
σ (·) is a method function, avg (a, b) = (a + b)/2.
3) Structure of the deviceRandom vector satisfying Gaussian distribution
Figure GDA00038543333600003710
And based on the randomly determined d bands in step8.1.2, the vector is->
Figure GDA00038543333600003711
The 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 selected sub The 3 rd, 6 th and 7 th bands, then the vector @ispresent>
Figure GDA00038543333600003712
The corresponding coordinates are not changed, and the rest coordinates are set to 0, namely
Figure GDA00038543333600003713
4) According to the discrimination formula (5) to X sub All the pixels in
Figure GDA00038543333600003714
Classifying, and collecting the pixels meeting the discrimination formula (6)>
Figure GDA00038543333600003715
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 determined
Figure GDA00038543333600003716
Pixel less than or equal to zero>
Figure GDA00038543333600003717
Placing the result at the left subnode and determining the value delta i Larger than zero is placed on the right child node.
Figure GDA0003854333360000381
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: request response moduleThe hyperspectral image anomaly detection system is used for responding to 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. Based on a (0,1) standardization method, normalization processing is carried out on original hyperspectral image data X ∈ R ^ (N multiplied by D), and the gray value of each pixel in each wave band can be changed to (0,1)]In the interior, inAccurately 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 Canny operator-based edge detection method is used for carrying out dimension reduction on the obtained first principal component image data X 1 Dividing 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 X 1 Dividing 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.
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 (ASIC), 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 modifications can be made to the embodiments described in the foregoing detailed description, or equivalents can be substituted for some of the features described therein. 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, and segmenting background ground objects into a plurality of first sub-regions to obtain a first sub-region set;
recording pixel coordinate indexes of all first subregions in the first subregion set, and taking the pixel coordinate 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, and segmenting the background ground object into a plurality of second subregions to obtain a second subregion set;
recording pixel coordinate indexes of all second subregions in the second subregion set, and taking the pixel coordinate 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;
outputting the target anomaly score;
the isolated forest optimization model is obtained by training each binary tree in the isolated forest original model through a hyperspectral image optimization training set.
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 algorithm 1 ,x 2 ,…,x N In which x 1 ,x 2 ,…,x N Is the original input quantity;
computing a covariance matrix of the original set, wherein the covariance matrix is represented as:
Figure FDA0003854333350000021
wherein the content of the first and second substances,
Figure FDA0003854333350000022
/>
calculating a unit eigenvector v corresponding to the largest eigenvalue of the covariance matrix 1
Based on the feature vector v 1 Form a projection matrix V, where V = [ V = 1 ];
When in use
Figure FDA0003854333350000023
i =1,2, …, N, will->
Figure FDA0003854333350000024
As the original input quantity x 1 ,x 2 ,…,x N The 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 each binary tree in the original isolated forest 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, and segmenting a background feature into a plurality of first sub-regions to obtain a first sub-region set;
the first index acquisition module is used for recording the pixel coordinate index of each first sub-area in the first sub-area set and taking the pixel coordinate index as a first index;
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;
a first anomaly detection module for performing anomaly detection on the spectral dimensional features based on an isolated forest optimization model, obtaining a first spectrum 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, and segmenting the background ground object into a plurality of second sub-regions to obtain a second sub-region set;
the second index acquisition module is used for recording the pixel coordinate index of each second subregion in the second subregion set and taking the pixel coordinate 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;
a score output module for outputting the target abnormality score;
the isolated forest optimization model is obtained by training each binary tree in the isolated forest original model through a hyperspectral image optimization training set.
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.
CN202110279231.0A 2021-03-16 2021-03-16 Hyperspectral image anomaly detection method and device, computer equipment and storage medium Active CN112990313B (en)

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 CN112990313A (en) 2021-06-18
CN112990313B true 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)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN115082865B (en) * 2022-07-27 2022-11-11 国能大渡河检修安装有限公司 Bridge crane intrusion dangerous behavior early warning method and system based on visual image recognition
CN116758361B (en) * 2023-08-22 2023-10-27 中国铁路设计集团有限公司 Engineering rock group remote sensing classification method and system based on spatial and spectral joint characteristics
CN117688500B (en) * 2024-02-02 2024-06-14 山东万洋石油科技有限公司 Three-dimensional resistivity abnormal data extraction method
CN117853931B (en) * 2024-03-04 2024-05-14 中国铁路设计集团有限公司 Hyperspectral image isolated anomaly detection method based on nearest neighbor distance

Citations (3)

* Cited by examiner, † Cited by third party
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
CN109493338A (en) * 2018-11-16 2019-03-19 西安电子科技大学 Hyperspectral image abnormal detection method based on combined extracting sky spectrum signature
CN112396066A (en) * 2020-11-27 2021-02-23 广东电网有限责任公司肇庆供电局 Feature extraction method suitable for hyperspectral image

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8559719B2 (en) * 2010-03-12 2013-10-15 The United States Of America, As Represented By The Secretary Of The Navy Spectral anomaly detection in deep shadows
US9147265B2 (en) * 2012-06-04 2015-09-29 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
CN103559715B (en) * 2013-11-07 2016-04-27 中国科学院对地观测与数字地球科学中心 A kind of method for detecting abnormality of high spectrum image and device
CN106023218B (en) * 2016-05-27 2018-10-26 哈尔滨工程大学 Hyperspectral abnormity detection method based on the empty spectrum common rarefaction representation of joint background
WO2018081929A1 (en) * 2016-11-01 2018-05-11 深圳大学 Hyperspectral remote sensing image feature extraction and classification method and system thereof
CN107895361A (en) * 2017-10-24 2018-04-10 中国电子科技集团公司第二十八研究所 A kind of hyperspectral abnormity detection method based on local density's purifying background
US11417090B2 (en) * 2019-02-18 2022-08-16 Nec Corporation 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
CN110570395B (en) * 2019-08-06 2022-04-29 西安电子科技大学 Hyperspectral anomaly detection method based on spatial-spectral combined collaborative representation
CN110929643B (en) * 2019-11-21 2022-04-26 西北工业大学 Hyperspectral anomaly detection method based on multiple features and isolated trees
CN112067129B (en) * 2020-09-24 2022-06-14 江苏集萃苏科思科技有限公司 Hyperspectral processing method and waveband selection method

Patent Citations (3)

* Cited by examiner, † Cited by third party
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
CN109493338A (en) * 2018-11-16 2019-03-19 西安电子科技大学 Hyperspectral image abnormal detection method based on combined extracting sky spectrum signature
CN112396066A (en) * 2020-11-27 2021-02-23 广东电网有限责任公司肇庆供电局 Feature extraction method suitable for hyperspectral image

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Xiangyu Song等.Spectral–Spatial Anomaly Detection of Hyperspectral Data Based on Improved Isolation Forest.《IEEE TRANSACTIONS ON GEOSCIENCE AND REMOTE SENSING》.2021,第60卷1-16. *

Also Published As

Publication number Publication date
CN112990313A (en) 2021-06-18

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
CN108510467B (en) SAR image target identification method based on depth deformable convolution neural network
Li et al. Contextual hypergraph modeling for salient object detection
Tu et al. Hyperspectral anomaly detection via density peak clustering
Sirmacek et al. Urban-area and building detection using SIFT keypoints and graph theory
CN107451614B (en) Hyperspectral classification method based on fusion of space coordinates and space spectrum features
Tu et al. Hyperspectral anomaly detection using dual window density
CN108427913B (en) Hyperspectral image classification method combining spectral, spatial and hierarchical structure information
Johnson et al. AutoGAD: An improved ICA-based hyperspectral anomaly detection algorithm
Zhang et al. Robust image corner detection based on scale evolution difference of planar curves
Deng et al. Cloud detection in satellite images based on natural scene statistics and gabor features
Yue et al. Texture extraction for object-oriented classification of high spatial resolution remotely sensed images using a semivariogram
CN105512622B (en) A kind of visible remote sensing image sea land dividing method based on figure segmentation and supervised learning
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
Elmikaty et al. Car detection in aerial images of dense urban areas
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
CN112819753A (en) Building change detection method and device, intelligent terminal and storage medium
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
LU500715B1 (en) Hyperspectral Image Classification Method Based on Discriminant Gabor Network
Rezaeilouyeh et al. A microscopic image classification method using shearlet transform
Vafadar et al. Hyperspectral anomaly detection using Modified Principal component analysis reconstruction error

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