CN112381756B - Hyperspectral data analysis method and system based on block smoothing neural network - Google Patents

Hyperspectral data analysis method and system based on block smoothing neural network Download PDF

Info

Publication number
CN112381756B
CN112381756B CN202011059204.4A CN202011059204A CN112381756B CN 112381756 B CN112381756 B CN 112381756B CN 202011059204 A CN202011059204 A CN 202011059204A CN 112381756 B CN112381756 B CN 112381756B
Authority
CN
China
Prior art keywords
block
neural network
smooth
sample
spectrum
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
CN202011059204.4A
Other languages
Chinese (zh)
Other versions
CN112381756A (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.)
Institute of Intelligent Manufacturing of Guangdong Academy of Sciences
Original Assignee
Institute of Intelligent Manufacturing of Guangdong Academy of Sciences
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 Institute of Intelligent Manufacturing of Guangdong Academy of Sciences filed Critical Institute of Intelligent Manufacturing of Guangdong Academy of Sciences
Priority to CN202011059204.4A priority Critical patent/CN112381756B/en
Publication of CN112381756A publication Critical patent/CN112381756A/en
Application granted granted Critical
Publication of CN112381756B publication Critical patent/CN112381756B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • G06V10/267Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • General Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • Biophysics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Molecular Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Health & Medical Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Multimedia (AREA)
  • Quality & Reliability (AREA)
  • Investigating Or Analysing Materials By Optical Means (AREA)

Abstract

The embodiment of the invention provides a hyperspectral data analysis method and system based on a block smooth neural network, wherein a set of neural network weight is shared by a total average spectrum and a plurality of block average spectrums, and the mean-square error of the total average spectrum and the mean-square error of a block average predicted value are reduced simultaneously in the training process; a block smooth loss function is designed, and the addition of the loss function can improve the continuity and smoothness of block prediction, inhibit the sudden change of the predicted values of adjacent blocks and enable the predicted values of the adjacent blocks to be in smooth transition; by utilizing the prior spatial information, the anti-noise capability of the network can be further improved, and the prediction precision and the model robustness are improved.

Description

Hyperspectral data analysis method and system based on block smoothing neural network
Technical Field
The embodiment of the invention relates to the technical field of hyperspectral data analysis, in particular to a hyperspectral data analysis method and system based on a block smoothing neural network.
Background
The hyperspectral sensing technology has wide application scenes and comprises food adulteration detection, fruit sugar degree detection, medicine component analysis, fake medicine identification, microorganism content detection, organic matter content detection and the like. However, in the field of hyperspectral nondestructive detection, the precision and robustness of a detection algorithm are to be improved all the time, and practical application and popularization of the detection algorithm are hindered. One of the problems is that in hyperspectral nondestructive testing, spatial information of hyperspectral data is not fully utilized, and most of the algorithms still adopt an average spectrum of an effective area for modeling at present. The model obtained by the method is poor in robustness and very sensitive to spectral noise, and noise disturbance can cause a prediction result to generate large deviation. In recent years, some studies extract morphological information of hyperspectral data as spatial information, and perform modeling in combination with average spectral information. The method belongs to the preliminary exploration of a 'space-spectrum combined' model, but the 'space-spectrum combined' modeling still has huge research space because morphological information belongs to lower-level image information.
The spatial smoothness of the model prediction result is important prior information in the field of hyperspectral modeling, and the accuracy and robustness of modeling can be remarkably improved by fully utilizing the prior information. In the field of hyperspectral remote sensing, for a pixel level classification task of ground object target classification, in the existing research at the present stage, neighborhood voting or a spectrum block is adopted as modeling information of a central pixel, so that the aims of enhancing the predicted spatial smoothness and reducing salt and pepper noise in prediction are fulfilled. However, in the field of hyperspectral nondestructive detection, since object-level hyperspectral signals are predicted, how to utilize the prior information of spatial smoothness needs to be further researched.
Disclosure of Invention
The embodiment of the invention provides a hyperspectral data analysis method and system based on a block smoothing neural network.
In a first aspect, an embodiment of the present invention provides a hyperspectral data analysis method based on a block smooth neural network, including:
collecting a hyperspectral image of each sample to be analyzed;
segmenting the hyperspectral image to obtain effective pixels of each sample to be analyzed;
obtaining an overall average spectrum based on effective pixels of all samples to be analyzed, selecting n effective pixel rectangular blocks at random positions within the effective pixel range of each sample to be analyzed, and obtaining the average value of the effective pixel rectangular blocks in the spectrum dimension to obtain n block average spectra;
and taking the total average spectrum and the n block average spectra as data of a sample to be analyzed, constructing a training set and a testing set, and performing neural network training to obtain a block smooth neural network for predicting the sample to be analyzed.
Preferably, the neural network training is performed, and specifically includes:
constructing a smooth neural network, wherein the smooth neural network comprises a one-dimensional convolution layer, a one-dimensional pooling layer, a full-connection layer and an output layer;
constructing a smooth neural network loss function:
L=α*L mean +β*L patch +γ*L smooth
wherein L is mean As a function of the overall average spectral loss, L patch As a function of the block spectral loss, L smooth A block smoothing loss function; alpha, beta and gamma are values of [0, 1')]Constant coefficient of between;
and training a block smoothing neural network loss function by adopting a gradient descent method.
Preferably, the overall average spectral loss function is a loss function between the average spectral prediction output and the label value of the sample to be analyzed:
Figure BDA0002711833930000021
wherein the content of the first and second substances,
Figure BDA0002711833930000022
and y is a true value of the sample to be analyzed.
Preferably, the block spectrum loss function is a loss function between the block spectrum prediction output mean value and the label value of the sample to be analyzed:
Figure BDA0002711833930000023
wherein, the first and the second end of the pipe are connected with each other,
Figure BDA0002711833930000024
and obtaining a predicted value after each block of average spectrum passes through the network, wherein y is a true value of the sample to be analyzed.
Preferably, the block smoothing loss function is to pair spectral blocks pairwise, and constrain the predicted value difference by using the block distance as a coefficient:
Figure BDA0002711833930000031
Figure BDA0002711833930000032
wherein the content of the first and second substances,
Figure BDA0002711833930000033
and
Figure BDA0002711833930000034
respectively, the preset values of the mean spectra of two different blocks, D ij The Euclidean distance between the block average spectrum i and the block average spectrum j; y is a true value of a sample to be analyzed;
Figure BDA0002711833930000035
is the center coordinate of the block averaged spectrum i,
Figure BDA0002711833930000036
is the center coordinate of the block averaged spectrum j.
Preferably, when the neural network training is performed, the block average spectrum and the ensemble average spectrum share a set of neural network parameters.
Preferably, the method further comprises the following steps:
and (3) carrying out sample prediction based on the trained block smooth neural network, wherein the sample prediction result is a fusion result of the overall average spectrum prediction value and the block average spectrum prediction value, and the prediction output is as follows:
Figure BDA0002711833930000037
wherein, y mean The predicted value obtained by the block smoothing neural network for the overall average spectrum,
Figure BDA0002711833930000038
and (3) obtaining a predicted value for each block average spectrum through a block smoothing neural network, wherein the values of alpha 'and beta' are 0.5.
In a second aspect, an embodiment of the present invention provides a hyperspectral data analysis system based on a block smoothing neural network, including:
the hyperspectral image acquisition module is used for acquiring a hyperspectral image of each sample to be analyzed;
the spectrum processing module is used for segmenting the hyperspectral image to obtain effective pixels of each sample to be analyzed;
obtaining a total average spectrum based on effective pixels of all samples to be analyzed, selecting n effective pixel rectangular blocks at random positions within the effective pixel range of each sample to be analyzed, and obtaining the average value of the effective pixel rectangular blocks in the spectrum dimension to obtain n block average spectra;
and a block smoothing neural network, wherein the overall average spectrum and the n block average spectra are used as data of a sample to be analyzed, a training set and a testing set are constructed, and neural network training is performed to obtain the block smoothing neural network for predicting the sample to be analyzed.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor, when executing the program, implements the steps of the block smoothing neural network-based hyperspectral data analysis method according to the embodiment of the first aspect of the present invention.
In a fourth aspect, an embodiment of the present invention provides a non-transitory computer readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the block smoothing neural network-based hyperspectral data analysis method according to the embodiment of the first aspect of the present invention.
According to the hyperspectral data analysis method and system based on the block smooth neural network, the overall average spectrum and the block average spectra share the same neural network weight, the mean square error of the overall average spectrum and the mean square error of the block average predicted value are reduced simultaneously in the training process, and compared with a traditional average spectrum modeling method, the method can achieve a regularization effect on network parameters, inhibit overfitting of the weight and enhance network anti-interference performance; a block smooth loss function is designed, and the addition of the loss function can improve the continuity and smoothness of block prediction, inhibit the sudden change of the predicted values of adjacent blocks and enable the predicted values of the adjacent blocks to be in smooth transition; by utilizing the prior spatial information, the anti-noise capability of the network can be further improved, and the prediction precision and the model robustness are improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a block diagram of a flow chart of a hyperspectral data analysis method based on a block smooth neural network according to an embodiment of the invention;
FIG. 2 is a schematic structural diagram of a block smoothing neural network-based hyperspectral data analysis system according to an embodiment of the invention;
fig. 3 is a schematic physical structure diagram according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments of the present invention, are within the scope of protection of the present invention.
In the embodiments of the present application, the term "and/or" is only one kind of association relation describing an associated object, and indicates that three kinds of relations may exist, for example, a and/or B, and may indicate: a exists alone, A and B exist simultaneously, and B exists alone.
The terms "first" and "second" in the embodiments of the present application are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present application, the terms "comprise" and "have", as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a system, product or apparatus that comprises a list of elements or components is not limited to only those elements or components but may alternatively include other elements or components not expressly listed or inherent to such product or apparatus. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless explicitly specified otherwise.
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 the field of hyperspectral remote sensing, for a pixel level classification task of ground object target classification, the existing research in the prior stage adopts neighborhood voting or adopts a spectrum block as modeling information of a central pixel to achieve the purposes of enhancing the predicted space smoothness and reducing the salt and pepper noise in prediction. However, in the field of hyperspectral nondestructive detection, since object-level hyperspectral signals are predicted, how to utilize the prior information of spatial smoothness needs to be further researched.
Therefore, the embodiment of the invention provides a hyperspectral data analysis method and system based on a block smooth neural network, a global average spectrum and a plurality of block average spectrums share the same set of neural network weight, the mean square error of the global average spectrum and the mean square error of a block average predicted value are reduced simultaneously in the training process, and compared with the traditional method adopting average spectrum modeling, the method can achieve the regularization effect on network parameters, inhibit overfitting of the weight and enhance the network anti-interference performance. The following description and description will proceed with reference being made to various embodiments.
Fig. 1 is a block smooth neural network-based hyperspectral data analysis method, which can be applied to hyperspectral nondestructive testing, food adulteration testing, fruit sugar content testing, drug component analysis and counterfeit drug identification, microorganism content testing and organic matter content testing, and includes:
s1, collecting a hyperspectral image of each sample to be analyzed;
s2, segmenting the hyperspectral image to obtain effective pixels of each sample to be analyzed;
s3, obtaining an overall average spectrum based on effective pixels of all samples to be analyzed, selecting n effective pixel rectangular blocks at random positions within the effective pixel range of each sample to be analyzed, obtaining the average value of the effective pixel rectangular blocks in the spectrum dimension, and obtaining n block average spectra;
and S4, taking the overall average spectrum and the n block average spectra as data of a sample to be analyzed, constructing a training set and a testing set, and carrying out neural network training to obtain a block smooth neural network for predicting the sample to be analyzed.
Specifically, in step S2, the specific steps of constructing sample data are as follows:
s201, segmenting the hyperspectral data by using a watershed algorithm to obtain effective pixels of each sample.
S202, averaging the spectrums of all effective pixels to obtain an overall average spectrum;
s203, in the effective pixel range of the sample, selecting n effective pixel rectangular blocks at random positions, wherein the size of each rectangular block is w multiplied by w, and the position coordinate of the center point of each block is (c) 1 ,c 2 ). Averaging the spectrum dimensions of each rectangular block to obtain n block average spectra;
and S204, taking the overall average spectrum and the n block average spectrums as sample data.
In step S4, a block smoothing neural network is constructed, which is composed of a one-dimensional convolutional layer, a one-dimensional pooling layer, a full-link layer, and an output layer, as shown in fig. 2. The concrete structure is as follows: one-dimensional convolutional layer, one-dimensional pooling layer, full-connected layer and output layer. Wherein the thickness of the one-dimensional convolution layer is 32, and the size of the convolution kernel is 5 multiplied by 1; the pooling window and the step length of the one-dimensional pooling layer are 2 multiplied by 1; the number of nodes of the full connection layer is 32; and the output layer obtains a predicted value through a softmax nonlinear excitation function.
In the embodiment, the overall average spectrum and the block average spectrums share the same set of neural network weight, the mean square error of the overall average spectrum and the mean square error of the block average predicted value are reduced simultaneously in the training process, and compared with a traditional modeling method adopting the average spectrums, the method can achieve a regularization effect on network parameters, inhibit overfitting of the weight, and enhance network anti-interference performance.
In one embodiment, the neural network training specifically includes:
constructing a smooth neural network, wherein the smooth neural network comprises a one-dimensional convolution layer, a one-dimensional pooling layer, a full-connection layer and an output layer;
constructing a smooth neural network loss function:
L=α*L mean +β*L patch +γ*L smooth
wherein L is mean As a function of the overall average spectral loss, L patch As a function of block spectral loss, L smooth A block smoothing loss function; alpha, beta and gamma are values of [0, 1')]Constant coefficient of between;
and training a block smoothing neural network loss function by adopting a gradient descent method.
Specifically, in this embodiment, a block smoothing neural network loss function is constructed, and specifically, the block smoothing neural network loss function is composed of an overall average spectral loss function, a block spectral loss function, and a block smoothing loss function; the overall average spectrum loss function is a loss function between the average spectrum prediction output and the sample label value, the block spectrum loss function is a loss function between the block spectrum prediction output average value and the sample label value, the block smooth loss function is formed by pairing every two spectral blocks, and the difference of predicted values is constrained by taking the block distance as a coefficient.
In one embodiment, the overall average spectral loss function is a loss function between the average spectral prediction output and the value of the sample label to be analyzed:
Figure BDA0002711833930000071
wherein the content of the first and second substances,
Figure BDA0002711833930000072
and y is a true value of the sample to be analyzed.
In one embodiment, the block spectral loss function is a loss function between a block spectral prediction output mean and a sample label value to be analyzed:
Figure BDA0002711833930000073
wherein the content of the first and second substances,
Figure BDA0002711833930000074
and obtaining a predicted value after each block of average spectrum passes through the network, wherein y is a true value of the sample to be analyzed.
In one embodiment, the block smoothing loss function L smooth The purpose is to improve the continuity and smoothness between predicted values of blocks, that is, blocks with similar spatial positions should have similar predicted values, specifically, every two spectral blocks are paired,and (3) constraining the predicted value difference by taking the block distance as a coefficient:
Figure BDA0002711833930000075
Figure BDA0002711833930000076
wherein the content of the first and second substances,
Figure BDA0002711833930000077
and
Figure BDA0002711833930000078
respectively, the preset values of the mean spectra of two different blocks, D ij Is the Euclidean distance between the block average spectrum i and the block average spectrum j; y is a true value of a sample to be analyzed;
Figure BDA0002711833930000079
is the center coordinate of the block averaged spectrum i,
Figure BDA00027118339300000710
is the center coordinate of the block averaged spectrum j.
In one embodiment, a gradient descent method is employed to train a block smooth neural network loss function, wherein the block spectra and the average spectra share the same set of neural network parameters.
In one embodiment, further comprising:
and (3) carrying out sample prediction based on the trained block smooth neural network, wherein the sample prediction result is a fusion result of the overall average spectrum prediction value and the block average spectrum prediction value, and the prediction output is as follows:
Figure BDA0002711833930000081
wherein, y mean The predicted value obtained by the block smoothing neural network for the overall average spectrum,
Figure BDA0002711833930000082
and alpha 'and beta' are values of 0.5 for the predicted value obtained by each block average spectrum through the block smoothing neural network.
The following is a prediction of the total number of salmon colonies according to the method of the present invention. The method comprises the following specific steps:
s1, hyperspectral imaging data acquisition is carried out on a sample: 200 salmon samples are collected in total, the hyperspectral wave band is 900nm-1700nm, 256 channels are collected in total, 100nm high-noise bands at the head and the tail are removed, and 180 spectral characteristics are used for modeling. The salmon sample is stored for 0-7 days at 0-4 ℃ to obtain a sample with the total colony number ranging from 2.5-8.9 Log CFU/g.
S2, constructing sample data, and specifically comprising the following steps:
s201, segmenting the hyperspectral data by using a watershed algorithm to obtain effective pixels of each sample. And placing the obtained effective hyperspectral image of the salmon in a blank background of 200 multiplied by 200 pixel.
S202, averaging the spectrums of all effective pixels to obtain an overall average spectrum, and obtaining an overall average spectrum of 200 samples;
s3, in the effective pixel range of the samples, selecting an effective pixel rectangular block with 100 random positions for each sample, wherein the size of each rectangular block is 10 multiplied by 10, and the position coordinate of the center point of the block is (c) 1 ,c 2 ) Specifically, the number of rows and columns in the hyperspectral image obtained by segmentation is the center point. Averaging each rectangular block in the spectrum dimension, and obtaining 100 block average spectra for each sample;
s401, taking the overall average spectrum and the 100 block average spectra as data of a sample;
constructing a training set and a testing set: wherein 150 samples are randomly selected as a training set and 50 samples are selected as a testing set.
S402, constructing a block smooth neural network, wherein the network consists of a one-dimensional convolutional layer, a one-dimensional pooling layer, a connecting layer and an output layer. The concrete structure is as follows: one-dimensional convolution layer-one-dimensional pooling layer-full connection layer-output layer. Wherein the thickness of the one-dimensional convolution layer is 32, and the size of the convolution kernel is 5 multiplied by 1; the pooling window and the step length of the one-dimensional pooling layer are 2 multiplied by 1; the number of nodes of the full connection layer is 32; and the output layer obtains a predicted value through a softmax nonlinear excitation function.
S403, constructing a block smooth neural network loss function, which specifically comprises an average spectrum loss function, a block spectrum loss function and a block smooth loss function:
L=α*L mean +β*L patch +γ*L smooth
L mean 、L patch 、L smooth respectively, the overall average spectral loss function, the block spectral loss function and the block smoothing loss function, wherein the values of alpha, beta and gamma are respectively 0.5,0.5 and 0.1.
Wherein the overall average spectral loss function L mean A loss function between the predicted output and the sample label value for the average spectrum:
Figure BDA0002711833930000091
Figure BDA0002711833930000092
the predicted value obtained after the overall average spectrum passes through the network is y, which is the true value of the sample.
Block spectral loss function L patch Predicting a loss function between the output mean and the sample label value for the block spectrum:
Figure BDA0002711833930000093
wherein
Figure BDA0002711833930000094
And averaging the predicted values obtained after the spectrum passes through the network for each block. In order to improve the network computing speed, 4 spectrum blocks are randomly selected from 100 spectrum blocks to compute a block spectrum loss function and a block spectrum average value in each gradient descent processA slip loss function.
Block smoothing loss function L smooth The specific constraint mode is that every two spectral blocks are paired, and the difference of the predicted values is constrained by taking the block distance as a coefficient:
Figure BDA0002711833930000095
wherein
Figure BDA0002711833930000096
And
Figure BDA0002711833930000097
prediction values of two different blocks, D ij The Euclidean distance between the block i and the block j is calculated by the following specific method:
Figure BDA0002711833930000098
wherein (c) 1 ,c 2 ) The position coordinates of the center point pixel of each block.
S404, training a block smooth neural network loss function by adopting a gradient descent method, wherein a block spectrum and an average spectrum share the same set of neural network parameters, 5000 epochs are trained in total, and the learning rate is 1 multiplied by 10 -3
S405, sample prediction is carried out by using the trained block smooth neural network, and the result is the fusion result of the overall average spectrum predicted value and the block average spectrum predicted value. The predicted output is:
Figure BDA0002711833930000101
wherein the content of the first and second substances,
Figure BDA0002711833930000102
is the overall averageThe predicted value of the spectrum through the network,
Figure BDA0002711833930000103
alpha 'and beta' are values of 0.5 for the predicted value obtained by each hyperspectral block through the network. In the prediction process, the output of the block spectrum is the average of the 100 block spectrum outputs.
And (5) carrying out 10 times of random sampling and corresponding training, and averaging classification results for model evaluation. Partial least squares regression (PLS) and Convolutional Neural Networks (CNN) using ensemble averaged spectra as input features are two comparative methods. The number of the main components in the PLS method is obtained by cross validation of a training set, and the parameter setting in the CNN method is consistent with the method of the invention, so that fair result comparison is obtained. The results of 10 modeling calculations are compared in table 1.
Figure BDA0002711833930000104
TABLE 1 comparison of predicted results
As can be seen from the calculation results, the average error of the method of the embodiment of the invention for the data set is 0.61 +/-0.08, the average error of the prediction of the PLS method is 0.69 +/-0.12, the average error of the prediction of the CNN method is 0.71 +/-0.15, and the prediction precision is remarkably improved.
The embodiment of the invention also provides a hyperspectral data analysis system based on the block smooth neural network, and the hyperspectral data analysis method based on the block smooth neural network in the embodiments comprises the following steps:
the hyperspectral image acquisition module is used for acquiring a hyperspectral image of each sample to be analyzed;
the spectrum processing module is used for segmenting the hyperspectral image to obtain effective pixels of each sample to be analyzed;
obtaining an overall average spectrum based on effective pixels of all samples to be analyzed, selecting n effective pixel rectangular blocks at random positions within the effective pixel range of each sample to be analyzed, and obtaining the average value of the effective pixel rectangular blocks in the spectrum dimension to obtain n block average spectra;
and a block smoothing neural network, wherein the overall average spectrum and the n block average spectra are used as data of a sample to be analyzed, a training set and a testing set are constructed, and neural network training is performed to obtain the block smoothing neural network for predicting the sample to be analyzed.
Based on the same concept, an embodiment of the present invention further provides an entity structure schematic diagram, as shown in fig. 3, the server may include: a processor (processor) 810, a communication Interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication Interface 820 and the memory 830 communicate with each other via the communication bus 840. The processor 810 may invoke logic instructions in the memory 830 to perform the steps of the block-smooth neural-network-based hyperspectral data analysis method according to various embodiments described above. Examples include:
collecting a hyperspectral image of each sample to be analyzed;
segmenting the hyperspectral image to obtain effective pixels of each sample to be analyzed;
obtaining a total average spectrum based on effective pixels of all samples to be analyzed, selecting n effective pixel rectangular blocks at random positions within the effective pixel range of each sample to be analyzed, and obtaining the average value of the effective pixel rectangular blocks in the spectrum dimension to obtain n block average spectra;
and taking the total average spectrum and the n block average spectra as data of a sample to be analyzed, constructing a training set and a testing set, and performing neural network training to obtain a block smooth neural network for predicting the sample to be analyzed.
In addition, the logic instructions in the memory 830 may be implemented in software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention or a part thereof which substantially contributes to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Based on the same concept, embodiments of the present invention further provide a non-transitory computer-readable storage medium storing a computer program, where the computer program includes at least one code, and the at least one code is executable by a master control device to control the master control device to implement the steps of the block smooth neural network-based hyperspectral data analysis method according to the embodiments. Examples include:
collecting a hyperspectral image of each sample to be analyzed;
segmenting the hyperspectral image to obtain effective pixels of each sample to be analyzed;
obtaining an overall average spectrum based on effective pixels of all samples to be analyzed, selecting n effective pixel rectangular blocks at random positions within the effective pixel range of each sample to be analyzed, and obtaining the average value of the effective pixel rectangular blocks in the spectrum dimension to obtain n block average spectra;
and taking the total average spectrum and the n block average spectra as data of a sample to be analyzed, constructing a training set and a testing set, and performing neural network training to obtain a block smooth neural network for predicting the sample to be analyzed.
Based on the same technical concept, the embodiment of the present application further provides a computer program, which is used to implement the above method embodiment when the computer program is executed by the main control device.
The program may be stored in whole or in part on a storage medium packaged with the processor, or in part or in whole on a memory not packaged with the processor.
Based on the same technical concept, the embodiment of the present application further provides a processor, and the processor is configured to implement the above method embodiment. The processor may be a chip.
In summary, according to the hyperspectral data analysis method and system based on the block smooth neural network provided by the embodiment of the invention, the overall average spectrum and the plurality of block average spectra share the same set of neural network weight, the mean square error of the overall average spectrum and the mean square error of the block average predicted value are reduced simultaneously in the training process, and compared with the traditional mean spectrum modeling method, the method can achieve the regularization effect on network parameters, inhibit overfitting of the weight, and enhance the network anti-interference performance; a block smooth loss function is designed, and the addition of the loss function can improve the continuity and smoothness of block prediction, inhibit the sudden change of the predicted values of adjacent blocks and enable the predicted values of the adjacent blocks to be in smooth transition; by utilizing the prior spatial information, the anti-noise capability of the network can be further improved, and the prediction precision and the model robustness are improved.
The embodiments of the present invention can be arbitrarily combined to achieve different technical effects.
In the above embodiments, all or part of the implementation may be realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the procedures or functions described in accordance with the present application are generated, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital subscriber line) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk), among others.
One of ordinary skill in the art will appreciate that all or part of the processes in the methods of the above embodiments may be implemented by hardware related to instructions of a computer program, which may be stored in a computer-readable storage medium, and when executed, may include the processes of the above method embodiments. And the aforementioned storage medium includes: various media capable of storing program codes, such as ROM or RAM, magnetic or optical disks, etc.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (9)

1. A hyperspectral data analysis method based on a block smoothing neural network is characterized by comprising the following steps:
collecting a hyperspectral image of each sample to be analyzed;
segmenting the hyperspectral image to obtain effective pixels of each sample to be analyzed;
obtaining a total average spectrum based on effective pixels of all samples to be analyzed, selecting n effective pixel rectangular blocks at random positions within the effective pixel range of each sample to be analyzed, and obtaining the average value of the effective pixel rectangular blocks in the spectrum dimension to obtain n block average spectra;
taking the total average spectrum and the n block average spectra as data of a sample to be analyzed, constructing a training set and a testing set, and performing neural network training, wherein the method specifically comprises the following steps:
constructing a smooth neural network, wherein the smooth neural network comprises a one-dimensional convolution layer, a one-dimensional pooling layer, a full-connection layer and an output layer;
constructing a smooth neural network loss function:
L=α*L mean +β*L patch +γ*L smooth
wherein L is mean As a function of the overall average spectral loss, L patch As a function of block spectral loss, L smooth A block smoothing loss function; alpha, beta and gamma are values of [0, 1')]Constant coefficient of between;
and training a block smooth neural network loss function by adopting a gradient descent method to obtain a block smooth neural network for predicting the sample to be analyzed.
2. The block-smooth-neural-network-based hyperspectral data analysis method according to claim 1, wherein the ensemble average spectral loss function is a loss function between the average spectral prediction output and the label value of the sample to be analyzed:
Figure FDA0003898002710000011
wherein the content of the first and second substances,
Figure FDA0003898002710000012
and y is a true value of the sample to be analyzed.
3. The block smoothing neural network-based hyperspectral data analysis method according to claim 1, wherein the block spectrum loss function is a loss function between a block spectrum prediction output mean and a sample label value to be analyzed:
Figure FDA0003898002710000013
wherein the content of the first and second substances,
Figure FDA0003898002710000014
and obtaining a predicted value after each block of average spectrum passes through the network, wherein y is a true value of the sample to be analyzed.
4. The method for analyzing hyperspectral data based on a block smoothing neural network according to claim 1, wherein the block smoothing loss function is to pair spectral blocks pairwise and constrain the predicted value gap with the block distance as a coefficient:
Figure FDA0003898002710000021
Figure FDA0003898002710000022
wherein the content of the first and second substances,
Figure FDA0003898002710000023
and
Figure FDA0003898002710000024
respectively, the preset values of the mean spectra of two different blocks, D ij Is the Euclidean distance between the block average spectrum i and the block average spectrum j; y is a true value of a sample to be analyzed;
Figure FDA0003898002710000025
is the center coordinate of the block averaged spectrum i,
Figure FDA0003898002710000026
is the center coordinate of the block averaged spectrum j.
5. The method for analyzing hyperspectral data based on a block smoothing neural network according to claim 1, wherein the block average spectrum and the ensemble average spectrum share a set of neural network parameters when training the neural network.
6. The block-smooth-neural-network-based hyperspectral data analysis method according to claim 1, further comprising:
and (3) carrying out sample prediction based on the trained block smooth neural network, wherein the sample prediction result is a fusion result of the overall average spectrum prediction value and the block average spectrum prediction value, and the prediction output is as follows:
Figure FDA0003898002710000027
wherein, y mean The predicted value obtained by the block smoothing neural network for the overall average spectrum,
Figure FDA0003898002710000028
and (3) obtaining a predicted value for each block average spectrum through a block smoothing neural network, wherein the values of alpha 'and beta' are 0.5.
7. A hyperspectral data analysis system based on a block smoothing neural network, comprising:
the hyperspectral image acquisition module is used for acquiring a hyperspectral image of each sample to be analyzed;
the spectrum processing module is used for segmenting the hyperspectral image to obtain effective pixels of each sample to be analyzed;
obtaining a total average spectrum based on effective pixels of all samples to be analyzed, selecting n effective pixel rectangular blocks at random positions within the effective pixel range of each sample to be analyzed, and obtaining the average value of the effective pixel rectangular blocks in the spectrum dimension to obtain n block average spectra;
the block smoothing neural network is used for constructing a training set and a testing set by taking the overall average spectrum and the n block average spectra as data of a sample to be analyzed, and performing neural network training, and specifically comprises the following steps:
constructing a smooth neural network, wherein the smooth neural network comprises a one-dimensional convolution layer, a one-dimensional pooling layer, a full-connection layer and an output layer;
constructing a smooth neural network loss function:
L=α*L mean +β*L patch +γ*L smooth
wherein L is mean As a function of the overall average spectral loss, L patch As a function of the block spectral loss, L smooth A block smoothing loss function; alpha, beta and gamma are values of [0,1 ]]Constant coefficient of between;
and training a block smooth neural network loss function by adopting a gradient descent method to obtain a block smooth neural network for predicting the sample to be analyzed.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the program performs the steps of the block smooth neural network based hyperspectral data analysis method of any of claims 1 to 6.
9. A non-transitory computer-readable storage medium, on which a computer program is stored, wherein the computer program, when being executed by a processor, implements the steps of the block-smooth neural network-based hyperspectral data analysis method according to any of claims 1 to 6.
CN202011059204.4A 2020-09-30 2020-09-30 Hyperspectral data analysis method and system based on block smoothing neural network Active CN112381756B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011059204.4A CN112381756B (en) 2020-09-30 2020-09-30 Hyperspectral data analysis method and system based on block smoothing neural network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011059204.4A CN112381756B (en) 2020-09-30 2020-09-30 Hyperspectral data analysis method and system based on block smoothing neural network

Publications (2)

Publication Number Publication Date
CN112381756A CN112381756A (en) 2021-02-19
CN112381756B true CN112381756B (en) 2022-12-16

Family

ID=74580924

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011059204.4A Active CN112381756B (en) 2020-09-30 2020-09-30 Hyperspectral data analysis method and system based on block smoothing neural network

Country Status (1)

Country Link
CN (1) CN112381756B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112580547A (en) * 2020-12-24 2021-03-30 武汉欧铭达科技有限公司 Automatic identification method and system for aviation image feature points
CN113762333B (en) * 2021-07-20 2023-02-28 广东省科学院智能制造研究所 Unsupervised anomaly detection method and system based on double-flow joint density estimation
CN113887561B (en) * 2021-09-03 2022-08-09 广东履安实业有限公司 Face recognition method, device, medium and product based on data analysis
CN113933248A (en) * 2021-10-12 2022-01-14 广东省科学院智能制造研究所 Hyperspectral online detection system and method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016091017A1 (en) * 2014-12-09 2016-06-16 山东大学 Extraction method for spectral feature cross-correlation vector in hyperspectral image classification
CN109766858A (en) * 2019-01-16 2019-05-17 中国人民解放军国防科技大学 Three-dimensional convolution neural network hyperspectral image classification method combined with bilateral filtering
CN110320162A (en) * 2019-05-20 2019-10-11 广东省智能制造研究所 A kind of semi-supervised high-spectral data quantitative analysis method based on generation confrontation network
CN110555395A (en) * 2019-08-19 2019-12-10 浙江大学 Classified evaluation method for nitrogen content grade of rape canopy

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016091017A1 (en) * 2014-12-09 2016-06-16 山东大学 Extraction method for spectral feature cross-correlation vector in hyperspectral image classification
CN109766858A (en) * 2019-01-16 2019-05-17 中国人民解放军国防科技大学 Three-dimensional convolution neural network hyperspectral image classification method combined with bilateral filtering
CN110320162A (en) * 2019-05-20 2019-10-11 广东省智能制造研究所 A kind of semi-supervised high-spectral data quantitative analysis method based on generation confrontation network
CN110555395A (en) * 2019-08-19 2019-12-10 浙江大学 Classified evaluation method for nitrogen content grade of rape canopy

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Hyperspectral Image Classification with Markov Random Fields and a Convolutional Neural Network;Xiangyong Cao 等;《Computer Science》;20171112;全文 *

Also Published As

Publication number Publication date
CN112381756A (en) 2021-02-19

Similar Documents

Publication Publication Date Title
CN112381756B (en) Hyperspectral data analysis method and system based on block smoothing neural network
CN111738244B (en) Image detection method, image detection device, computer equipment and storage medium
Jiang et al. Weakly supervised discriminative learning with spectral constrained generative adversarial network for hyperspectral anomaly detection
Sun et al. UL-Isomap based nonlinear dimensionality reduction for hyperspectral imagery classification
Hu et al. Hyperspectral anomaly detection using deep learning: A review
Adla et al. Deep learning-based computer aided diagnosis model for skin cancer detection and classification
CN110472525A (en) A kind of noise detecting method of time series remote sensing vegetation index
CN113095409B (en) Hyperspectral image classification method based on attention mechanism and weight sharing
Du et al. A hyperspectral target detection framework with subtraction pixel pair features
Liu et al. High-throughput rice density estimation from transplantation to tillering stages using deep networks
Babaei et al. A simple, robust, and automatic approach to extract water body from Landsat images (case study: Lake Urmia, Iran)
Sujithra et al. CRUN‐Based Leaf Disease Segmentation and Morphological‐Based Stage Identification
Taghipour et al. Hyperspectral anomaly detection using spectral–spatial features based on the human visual system
Hou et al. Detecting diseases in apple tree leaves using FPN–ISResNet–Faster RCNN
CN113591816B (en) Hyperspectral anomaly detection method and system based on self-supervision guide coding network
Mustafa et al. RETRACTED: Water surface area detection using remote sensing temporal data processed using MATLAB
El Massi et al. Automatic recognition of vegetable crops diseases based on neural network classifier
Liu et al. Enhanced crop classification through integrated optical and SAR data: a deep learning approach for multi-source image fusion
Esmaeili et al. ResMorCNN Model: Hyperspectral Images Classification Using Residual-Injection Morphological Features & 3D-CNN Layers
CN112801187B (en) Hyperspectral data analysis method and system based on attention mechanism and ensemble learning
Sahu et al. Classification and activation map visualization of banana diseases using deep learning models
Arslan et al. Dimension reduction methods applied to coastline extraction on hyperspectral imagery
Singh et al. Smart agriculture framework for automated detection of leaf blast disease in paddy crop using colour slicing and GLCM features based random forest approach
CN109460788B (en) Hyperspectral image classification method based on low-rank-sparse information combination network
CN116486263A (en) Hyperspectral anomaly detection method based on depth features and double-tributary isolated forest

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