Sea surface floating oil detection method based on space-spectrum joint knowledge distillation
Through the spatial-spectral joint knowledge distillation method, 3-D spatial geometric transformation and scale-adaptive superpixel segmentation are used, combined with the spatial-spectral bilateral self-attention mechanism, to solve the problem of insufficient samples in hyperspectral image classification and realize sea surface oil slick detection. Efficient feature extraction and accurate classification.
Patent Information
- Application Number
- CN202410646363.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-22
- Publication Date
- 2024-10-01
AI Technical Summary
The application of deep learning in hyperspectral image classification has not been fully explored, and it is challenging to obtain a sufficient number of training samples to meet the needs of deep neural networks. Existing methods cannot effectively solve the problem of insufficient samples.
Using a method based on spatial-spectral joint knowledge distillation, data enhancement is performed through 3-D spatial geometric transformation, combined with scale-adaptive superpixel segmentation and spatial-spectral bilateral self-attention mechanism, to generate adaptive soft labels and perform feature extraction to achieve sea surface floating. Oil testing.
Mining supervised information from large-scale unsupervised data improves the accuracy and computational efficiency of hyperspectral image classification, and provides a robust solution to the problem of insufficient samples.
Smart Images

Figure CN118736400A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of self-supervised learning (SSL) and relates to a sea surface oil slick detection method based on spatial spectrum joint knowledge distillation. Background Art
[0002] Hyperspectral images (HSI) usually consist of hundreds of spectral channels, and each pixel in the image corresponds to a spectral curve. HSI classification plays a pivotal role in many applications in remote sensing. In recent years, many hyperspectral image classification methods have been proposed, including spectral matching-based methods, which determine the predefined type of samples according to the matching degree of spectral curves. Considering the spatial homogeneity and heterogeneity characteristics of HSI, it is difficult to fully utilize the inherent diversity characteristics of HSI by relying solely on spectral feature extraction. Current deep learning techniques have achieved automatic parameter learning in HSI classification tasks, and the accuracy and computational efficiency of HSI classification are constantly improving. However, the application of deep learning in hyperspectral image classification has not been fully explored, and it is challenging to obtain a sufficient number of training samples to meet the needs of deep neural networks. Few-sample learning is an important branch of machine learning that is specifically designed to solve problems caused by limited training samples. Metric learning and meta-learning strategies are usually used to learn the features of HSI, and the absolute distance or relative distance between features is used to identify the category of the object for each unlabeled pixel in HSI. However, these methods have not yet provided a robust solution to the problem of insufficient samples. Summary of the invention
[0003] In order to solve the above problems, the technical solution adopted by the present invention is: a method for detecting oil spills on the sea surface based on spatial spectrum combined with knowledge distillation, comprising the following steps:
[0004] The original hyperspectral image is enhanced by using 3-D space geometric transformation to obtain an enhanced hyperspectral image.
[0005] Perform scale-adaptive superpixel segmentation on the data-enhanced hyperspectral image, extract RGB image from the hyperspectral image, input the RGB image into the adaptive superpixel segmentation model, and generate superpixels with spatial texture prior information;
[0006] By considering spectral divergence and spatial Euclidean distance, the spatial-spectral joint distance is calculated to quantify the distance between unlabeled superpixel units in hyperspectral images and predefined object classes; the distance-probability conversion method is used to generate adaptive soft labels for each superpixel unit;
[0007] The enhanced hyperspectral image data is input into the spatial spectral bilateral self-attention mechanism module to obtain the area rich in important feature information; the soft label samples and the area data rich in important feature information are respectively sent to the dense progressive convolutional network for feature extraction to realize the detection of oil spills on the sea surface.
[0008] Further: the process of performing data enhancement on the original hyperspectral image by using geometric transformation in 3-D space to obtain the enhanced hyperspectral image is as follows:
[0009] S11. HSI rotation and mirror transformation in two-dimensional space domain;
[0010] S12. A mirror transformation is applied to the HSI in the spectral domain, and two spectral sequences are defined: one is arranged in descending order of sequence frequency, and the other is arranged in ascending order of sequence frequency, which is used to enhance the spectral dimension.
[0011] Further: the process of HSI rotation and mirror transformation in the two-dimensional space domain is as follows:
[0012] S111. Four different horizontal rotation angles of 0°, 90°, 180°, and 270° are defined in the spatial domain, and four corresponding copies are obtained by performing horizontal rotation operations at four different angles;
[0013] S112. Perform horizontal mirror transformation on the original hyperspectral cube in the two-dimensional space domain, and then perform rotation operations of 0°, 90°, 180°, and 270° to generate a corresponding mirrored hyperspectral cube.
[0014] Further: the process of performing scale-adaptive superpixel segmentation on the data-enhanced hyperspectral image, extracting an RGB image from the hyperspectral image, and inputting the RGB image into an adaptive superpixel segmentation model to generate superpixels with spatial texture prior information is as follows:
[0015] S21. Convert CIELAB color space data to sRGB color space and use spatial uniformity constraint; first generate a seed center point, usually using the center position of the image as the initial reference point;
[0016] S22. Arrange the pixels in ascending order according to the distance from the adjacent pixels to the center position;
[0017] S23. When the cumulative distance of pixels in the corresponding superpixel block exceeds the set threshold, the final Adaptel value is obtained;
[0018] S24. Average superpixel color p in the given color space in the kth Adaptel kThe initial size of is equal to the selected seed pixel. As the number of adjacent pixels increases, the value of pk will be continuously updated. The initial Adaptel value is obtained by arbitrarily selecting a pixel position in the center of the image. The subsequent initialization center of Adaptel is obtained from the boundary pixel where the previous initialization center ends.
[0019] Further: the process of using SSJD to calculate the distance between the unlabeled superpixel unit in HSI and the predefined object class and using the distance-probability conversion method to generate an adaptive soft label for each superpixel unit is as follows:
[0020] S31. The input HSI data is denoted as H, and the labeled sample data set, the unlabeled sample data set and the class label set are defined as L, U and C respectively;
[0021] S32. Use SSJD as sample adaptive soft labeling metric;
[0022] S33. Based on the SSJD between each pair of sample points, define the SSJD between the sample point and each class;
[0023] S34. After obtaining the distance between a given sample and each category, obtain the probability value between the unlabeled category in the class set and each category.
[0024] Further: the spatial-spectral bilateral self-attention mechanism module includes a spatial self-attention module and a spectral self-attention module;
[0025] The process of inputting the enhanced hyperspectral image data into the spatial-spectral bilateral self-attention mechanism module to obtain the region rich in important feature information is as follows:
[0026] The process of inputting the enhanced hyperspectral image data into the spectral self-attention module for data processing is as follows:
[0027] S411. The input size of the spectral channel attention block is expressed as Where H×W represents the size of the input HSI, D represents the number of spectral channels in the input HSI, and then the matrix A is combined with the transformed matrix A T Multiply them together to get the energy matrix
[0028] S412. Add a softmax layer to the head layer of the neural network and reshape the output through matrix multiplication to obtain
[0029] S413.Yes Figure 2 The spectral energy matrix in b is assigned weight γ after training and reconstructed, and then summed with the input matrix to finally obtain the spectral self-attention mapping result;
[0030] The process of inputting the enhanced hyperspectral image data into the spatial self-attention module for data processing is as follows:
[0031] S421. For a given input feature Use two different 2D convolutional layers to get two different feature maps B and C. B and C are transformed by matrix multiplication, and the product is passed through the softmax layer to get the spatial attention map.
[0032] S422. Synchronize and feed back the initial input feature A to a new 3D convolutional layer branch to obtain the column feature map D, whose dimension can be expressed as
[0033] S423. Add matrix D to matrix S T Perform matrix multiplication and obtain the feature matrix by dimension reconstruction The present invention provides a method for detecting oil slicks on the sea surface based on spatial-spectral joint knowledge distillation, which can mine its own supervised information from large-scale unsupervised data. In the field of HSI classification, a superpixel-based SSL method has been proposed to make full use of each labeled sample. Since superpixel segmentation has the advantages of low computational complexity and good segmentation effect, this method modifies the superpixel segmentation to make it compatible with hyperspectral input. At the same time, soft labels are generated from unlabeled samples for network training. In terms of training data conversion, the current self-supervised learning (SSL) methods for image classification mainly rely on the conversion of two-dimensional space. Given that hyperspectral data is a three-dimensional cube containing two-dimensional spatial and spectral dimensions, it is necessary to transition from SSL with two-dimensional conversion to SSL containing three-dimensional conversion.
[0034] It has the following advantages: 1) A 3-D transform SSL is proposed to improve the original hyperspectral image (HSI) through data enhancement in the spectral spatial domain.
[0035] 2) A superpixel-based scale-adaptive knowledge distillation strategy is proposed. This strategy can consider both spectral distance and spatial distance. It can generate the similarity between each unlabeled sample and the predefined object category.
[0036] 3) A dual-branch dense PCN is proposed, which integrates the self-attention mechanism in spatial and spectral domains. The channel attention part is specifically used to emphasize the information-rich spectral bands, while the spatial attention part is used to highlight the information-rich pixels. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0038] Figure 1 Schematic diagram of the scale-adaptive knowledge distillation method with three-dimensional transformation and dense convolutional network;
[0039] Figure 2 Detailed diagram of the spectral self-attention block and the spatial self-attention block, where (a) the spectral self-attention mechanism block, (b) the spatial self-attention mechanism block, and (c) the corresponding annotations;
[0040] Figure 3 Pipeline diagram for superpixel-based scale-adaptive knowledge distillation. DETAILED DESCRIPTION
[0041] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0042] In order to make the purpose, 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 in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and is by no means intended to limit the present invention and its application or use. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] Figure 1 Schematic diagram of the scale-adaptive knowledge distillation method with three-dimensional transformation and dense convolutional network;
[0044] A method for detecting oil spills on sea surface based on spatial spectrum combined with knowledge distillation, comprising the following steps:
[0045] S1: The original hyperspectral image is enhanced by using geometric transformation in 3-D space to obtain an enhanced hyperspectral image;
[0046] S2: Performing scale-adaptive superpixel segmentation on the data-enhanced hyperspectral image, extracting an RGB image from the hyperspectral image, and inputting the RGB image into an adaptive superpixel segmentation model to generate superpixels with spatial texture prior information;
[0047] S3: By considering the spectral Kullback-Leibler (KL) divergence and the spatial Euclidean distance, the spatial-spectral joint distance (SSJD) is calculated to quantify the distance between the unlabeled superpixel units of the hyperspectral image (HSI) and the predefined object class; the distance-probability conversion method is used to generate an adaptive soft label for each superpixel unit;
[0048] S4 inputs the hyperspectral image data enhanced by S1 into the spatial-spectral bilateral self-attention mechanism module to obtain the areas rich in important feature information and ignore the irrelevant feature areas;
[0049] S5: The soft label samples and the regional data rich in important feature information obtained in S4 are respectively sent to the dense progressive convolutional network PCN for feature extraction to achieve sea surface oil spill detection. The dense PCN includes two attention mechanism branches, namely the spatial dimension and the spectral dimension.
[0050] Furthermore, the proposed 3-D space geometric transformation not only considers the 2-D space dimension of HSI, but also considers the 1-D spectral dimension. The process of using the 3-D space geometric transformation to perform data enhancement on the original hyperspectral image to obtain the enhanced hyperspectral image is as follows:
[0051] S11. HSI rotation and mirror transformation in two-dimensional space domain;
[0052] The process of HSI rotation and mirror transformation in the two-dimensional space domain is as follows:
[0053] S111. Four different horizontal rotation angles of 0°, 90°, 180°, and 270° are defined in the spatial domain, and four corresponding copies are obtained by performing horizontal rotation operations at four different angles;
[0054] S112. Perform horizontal mirror transformation on the original hyperspectral cube in the two-dimensional space domain, and then perform rotation operations of 0°, 90°, 180°, and 270° to generate a corresponding mirrored hyperspectral cube.
[0055] S12. A mirror transformation is applied to the HSI in the spectral domain, and two spectral sequences are defined: one is arranged in descending order of sequence frequency, and the other is arranged in ascending order of sequence frequency. This is an operation of data enhancement in the spectral dimension.
[0056] Further: the process of performing scale-adaptive superpixel segmentation on the data-enhanced hyperspectral image, extracting an RGB image from the hyperspectral image, and inputting the RGB image into an adaptive superpixel segmentation model to generate superpixels with spatial texture prior information is as follows:
[0057] S21. Convert CIELAB color space data to sRGB color space and use spatial uniformity constraint; first generate a seed center point, usually using the center position of the image as the initial reference point;
[0058] S22. Arrange the adjacent pixels in ascending order according to the distance from the center position; each pixel is continuously added to the super pixel block;
[0059] S23. When the cumulative distance of pixels in the corresponding superpixel block exceeds the set threshold, the final Adaptel value is obtained; as a new superpixel segmentation algorithm, the Adaptels algorithm achieves scale adaptation while maintaining compactness, limited adjacency, tight boundary adhesion and computational efficiency;
[0060] S24.P k The initial size of (pk is the average superpixel color in the given color space in the kth Adaptel (Ak)) is equal to the selected seed pixel. As the number of neighboring pixels increases, P k The value of will be continuously updated. The initial Adaptel is obtained by arbitrarily selecting a pixel position in the center of the image. The subsequent initialization center of Adaptel is obtained from the boundary pixel where the previous initialization center ends.
[0061] Further: the process of using SSJD to calculate the distance between the unlabeled superpixel unit in HSI and the predefined object class and using the distance-probability conversion method to generate an adaptive soft label for each superpixel unit is as follows:
[0062] S31. The input HSI data is denoted as H, and the labeled sample data set, the unlabeled sample data set and the class label set are defined as L, U and C respectively;
[0063] S32. Use SSJD as sample adaptive soft labeling metric;
[0064] SSJD is mainly defined by the two-dimensional spatial distance and one-dimensional spectral distance between pixels, which can be expressed as:
[0065]
[0066] In the formula, l i ∈L,u i ∈U,ED(u i ,l i ) is l i with u i The Euclidean distance between i ,l i ) indicates l i and ui The spectral information divergence between
[0067] S33. Based on the SSJD between each pair of sample points, define the SSJD between the sample point and each class;
[0068]
[0069] Where: c i ∈C,Φ(l r ) represents the labeled class dataset, each sample is denoted as l r ; |C| represents the total number of classes; Indicates category c i The total number of labeled samples; n(u i ,l r ) represents the unlabeled sample u i Same category r The SSJD between all labeled samples in the ; the sequence number obtained by sorting by size is in
[0070] S34. After obtaining the distance between a given sample and each category, the unlabeled category u in the cluster is obtained. i With each category c i The probability value between .
[0071] Figure 2 Detailed diagram of the spectral self-attention block and the spatial self-attention block, where (a) the spectral self-attention mechanism block, (b) the spatial self-attention mechanism block, and (c) the corresponding annotations;
[0072] The spatial-spectral bilateral self-attention mechanism module includes a spatial self-attention module and a spectral self-attention module;
[0073] The process of inputting the enhanced hyperspectral image data into the spatial-spectral bilateral self-attention mechanism module to obtain the region rich in important feature information is as follows:
[0074] The process of inputting the enhanced hyperspectral image data into the spectral self-attention module for data processing is as follows:
[0075] S411. The input size of the spectral channel attention block is expressed as Where H×W represents the size of the input HSI, D represents the number of spectral channels in the input HSI, and then the matrix A is combined with the transformed matrix A T Multiply them together to get the energy matrix
[0076] S412. Add a softmax layer to the head layer of the neural network and reshape the output through matrix multiplication to obtain
[0077] S413.Yes Figure 2 The spectral energy matrix in (b) is trained and the reconstruction result is assigned weight γ and summed with the input matrix to finally obtain the spectral self-attention mapping result;
[0078] The process of inputting the enhanced hyperspectral image data into the spatial self-attention module for data processing is as follows:
[0079] S421. For a given input feature Use two different 2D convolutional layers to get two different feature maps B and C. B and C are transformed by matrix multiplication, and the product is passed through the softmax layer to get the spatial attention map.
[0080] S422. Synchronize and feed back the initial input feature A to a new 3D convolutional layer branch to obtain the column feature map D, whose dimension can be expressed as
[0081] S423. Add matrix D to matrix S T Perform matrix multiplication and obtain the feature matrix by dimension reconstruction
[0082] Dense PCN includes two branches of attention mechanism, namely spatial dimension and spectral dimension. The proposed deep learning neural network is trained to label each unlabeled sample by minimizing the cross entropy between the probabilities generated by PCN and adaptive software. PCN is a relatively lightweight network among deep learning neural networks;
[0083] Figure 3 Pipeline diagram for superpixel-based scale-adaptive knowledge distillation.
[0084] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A sea surface oil spill detection method based on spatial spectrum joint knowledge distillation, Features: The following steps are involved: The original hyperspectral image is enhanced by using 3-D space geometric transformation to obtain an enhanced hyperspectral image. Perform scale-adaptive superpixel segmentation on the data-enhanced hyperspectral image, extract RGB image from the hyperspectral image, input the RGB image into the adaptive superpixel segmentation model, and generate superpixels with spatial texture prior information; By considering spectral divergence and spatial Euclidean distance, the spatial-spectral joint distance is calculated to quantify the distance between unlabeled superpixel units in hyperspectral images and predefined object classes; the distance-probability conversion method is used to generate adaptive soft labels for each superpixel unit; The enhanced hyperspectral image data is input into the spatial-spectral bilateral self-attention mechanism module to obtain the area rich in important feature information; The soft label samples and regional data rich in important feature information are respectively sent to the dense progressive convolutional network for feature extraction to realize sea surface oil spill detection.
2. According to the method for detecting oil spills on sea surface based on spatial spectrum combined with knowledge distillation according to claim 1, Features: The process of performing data enhancement on the original hyperspectral image by using geometric transformation in 3-D space to obtain the enhanced hyperspectral image is as follows: S11. HSI rotation and mirror transformation in two-dimensional space domain; S12. A mirror transformation is applied to the HSI in the spectral domain, and two spectral sequences are defined: one is arranged in descending order of sequence frequency, and the other is arranged in ascending order of sequence frequency, which is used to enhance the spectral dimension.
3. According to the method for detecting oil spills on sea surface based on spatial spectrum combined with knowledge distillation according to claim 2, Features: The process of HSI rotation and mirror transformation in the two-dimensional space domain is as follows: S111. Four different horizontal rotation angles of 0°, 90°, 180°, and 270° are defined in the spatial domain, and four corresponding copies are obtained by performing horizontal rotation operations at four different angles; S112. Perform horizontal mirror transformation on the original hyperspectral cube in the two-dimensional space domain, and then perform rotation operations of 0°, 90°, 180°, and 270° to generate a corresponding mirrored hyperspectral cube.
4. According to claim 2, a method for detecting oil spills on the sea surface based on spatial spectrum combined with knowledge distillation, Features: The process of performing scale-adaptive superpixel segmentation on the data-enhanced hyperspectral image, extracting an RGB image from the hyperspectral image, and inputting the RGB image into an adaptive superpixel segmentation model to generate superpixels with spatial texture prior information is as follows: S21. Convert CIELAB color space data to sRGB color space and use spatial uniformity constraint; first generate a seed center point, usually using the center position of the image as the initial reference point; S22. Arrange the pixels in ascending order according to the distance from the adjacent pixels to the center position; S23. When the cumulative distance of pixels in the corresponding superpixel block exceeds the set threshold, the final Adaptel value is obtained; S24. Average superpixel color p in the given color space in the kth Adaptel k The initial size of P is equal to the selected seed pixel. As the number of adjacent pixels increases, k The value of will be continuously updated. The initial Adaptel value is obtained by arbitrarily selecting a pixel position in the center of the image. The subsequent initialization center of Adaptel is obtained from the boundary pixel where the previous initialization center ends.
5. According to the method for detecting oil spills on sea surface based on spatial spectrum combined with knowledge distillation according to claim 2, Features: The process of using SSJD to calculate the distance between the unlabeled superpixel unit in HSI and the predefined object class and using the distance-probability conversion method to generate an adaptive soft label for each superpixel unit is as follows: S31. The input HSI data is denoted as H, and the labeled sample data set, the unlabeled sample data set and the class label set are defined as L, U and C respectively; S32. Use SSJD as sample adaptive soft labeling metric; S33. Based on the SSJD between each pair of sample points, define the SSJD between the sample point and each class; S34. After obtaining the distance between a given sample and each category, the distance between the unlabeled category ui in the cluster and each category c is obtained. i The probability value between .
6. According to claim 2, a method for detecting oil spills on the sea surface based on spatial spectrum combined with knowledge distillation, Features: The spatial-spectral bilateral self-attention mechanism module includes a spatial self-attention module and a spectral self-attention module; The process of inputting the enhanced hyperspectral image data into the spatial-spectral bilateral self-attention mechanism module to obtain the region rich in important feature information is as follows: The process of inputting the enhanced hyperspectral image data into the spectral self-attention module for data processing is as follows: S411. The input size of the spectral channel attention block is expressed as Where H×W represents the size of the input HSI, D represents the number of spectral channels in the input HSI, and then the matrix A is combined with the transformed matrix A T Multiply them together to get the energy matrix S412. Add a softmax layer to the head layer of the neural network and reshape the output through matrix multiplication to obtain S413. Assign a weight γ to the reconstruction result obtained by training the spectral energy matrix and sum it with the input matrix, and finally obtain the spectral self-attention mapping result; The process of inputting the enhanced hyperspectral image data into the spatial self-attention module for data processing is as follows: S421. For a given input feature Use two different 2D convolutional layers to get two different feature maps B and C. B and C are transformed by matrix multiplication, and the product is passed through the softmax layer to get the spatial attention map. S422. Synchronize and feed back the initial input feature A to a new 3D convolutional layer branch to obtain the column feature map D, whose dimension can be expressed as S423. Add matrix D to matrix S T Perform matrix multiplication and obtain the feature matrix by dimension reconstruction
