Hyperspectral remote sensing image classification method for sea fog area identification
By using the pre-trained sea fog image recognition model, combined with one-dimensional residual neural network and attention mechanism, the problem of waste of computing resources in sea fog area recognition is solved, and efficient sea fog area recognition and monitoring is achieved.
Patent Information
- Application Number
- CN202510085552.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-20
- Publication Date
- 2025-05-16
AI Technical Summary
In sea fog area identification, the prior art uses too much redundant data, resulting in waste of computing resources, making it difficult to effectively identify and monitor sea fog areas.
A hyperspectral remote sensing image classification method is used to classify and identify hyperspectral remote sensing images using a pre-trained sea fog image recognition model. This model is based on a one-dimensional residual neural network model, and introduces a channel attention mechanism and a spatial attention mechanism after the convolution layer, and modify the input channel to a single channel to reduce waste of computing resources.
This method can automatically identify whether there is a sea fog area in the hyperspectral remote sensing image and determine its range, improving the recognition accuracy of the sea fog image recognition model, and effectively avoiding waste of computing resources.
Smart Images

Figure CN120014455A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of hyperspectral image processing, and in particular to a hyperspectral remote sensing image classification method for sea fog area identification. Background Art
[0002] Sea fog is a common weather phenomenon on the sea surface. Accumulated sea fog will reduce visibility on the sea surface, causing ships sailing in the sea fog area to lose their way, which is prone to navigation accidents such as ship collision and grounding. Conventional surface image collectors are also affected by sea fog. They cannot determine the size and change trend of the sea fog area, and it is difficult to identify ships sailing in the sea fog area, resulting in the inability to monitor the sea fog area.
[0003] Hyperspectral imagers carried on satellites and aircraft can obtain large-scale hyperspectral remote sensing images of the sea surface, providing a new solution for sea fog monitoring; hyperspectral remote sensing images contain image data of a large number of wavelengths and can reflect different ground objects through data of different wavelengths, providing information for the identification and monitoring of sea fog areas.
[0004] At present, in order to ensure the accuracy and diversity of ground object recognition in the classification and recognition of hyperspectral remote sensing images, feature extraction is usually performed on the full-band images of hyperspectral remote sensing images to obtain classification results; in the recognition of sea fog areas, the images of sea fog areas are relatively smooth and the sea fog has a characteristic spectrum. If this method is still used for classification and recognition, it will lead to a waste of computing resources due to the use of too much redundant data. Summary of the invention
[0005] Based on this, it is necessary to provide a hyperspectral remote sensing image classification method for sea fog area identification in response to the above technical problems.
[0006] In a first aspect, the present application provides a hyperspectral remote sensing image classification method for sea fog area identification, comprising:
[0007] Acquire a hyperspectral remote sensing image to be identified;
[0008] A pre-trained sea fog image recognition model is used to classify and identify the hyperspectral remote sensing images, and the recognition results of the sea fog area are output; the pre-trained sea fog image recognition model is trained based on a one-dimensional residual neural network model with a single input channel.
[0009] In one embodiment, the method further comprises:
[0010] A sea fog area hyperspectral image dataset is obtained and divided into a training set and a test set; the sea fog area hyperspectral image dataset includes a data sequence and label data corresponding to the characteristic wavelengths of the sea fog area hyperspectral image; the characteristic wavelengths include the absorption wavelength and the reflection wavelength of the sea fog; the label data is used to indicate the sea fog and other ground objects in the sea fog area hyperspectral image;
[0011] Constructing an initial sea fog image recognition model, and training the initial sea fog image recognition model based on the training set;
[0012] The classification accuracy of the trained sea fog image recognition model is judged based on the test set; if the classification accuracy is qualified, the sea fog image recognition model is used as the pre-trained sea fog image recognition model; if the classification accuracy is unqualified, the sea fog image recognition model continues to be trained.
[0013] In one embodiment, the method further comprises:
[0014] The hyperspectral image of the sea fog area is normalized and multi-scale guided filtering is performed to obtain the characteristic wavelength image;
[0015] The image data of the characteristic wavelength image is expanded into a data sequence of the characteristic wavelength.
[0016] In one embodiment, the step of constructing an initial sea fog image recognition model includes:
[0017] The input dimension of the obtained ResNet-18 model was modified to one dimension, the number of input channels was modified to single channel, and the channel attention mechanism and spatial attention mechanism were introduced after the convolution layer; the output dimension of the fully connected layer was modified to the number of categories; the number of categories includes the number of types of objects contained in the hyperspectral remote sensing image;
[0018] The adjusted ResNet-18 model is obtained as the initial sea fog image recognition model.
[0019] In one embodiment, the steps of introducing a channel attention mechanism and a spatial attention mechanism after the convolution layer include:
[0020] The feature sequences obtained after multi-layer convolution of the data sequence are subjected to global average pooling and maximum pooling respectively to obtain two corresponding channel feature vectors;
[0021] Connect two channel feature vectors to generate channel weights, and apply the channel weights to the feature sequence to obtain the channel weighted sequence, that is, the channel attention mechanism;
[0022] Perform global average pooling and global maximum pooling on the channel weighted sequence to obtain two corresponding spatial feature vectors;
[0023] Connecting two spatial feature vectors generates spatial weights, and applying the spatial weights to the channel weighted sequence obtains the output feature sequence, that is, the spatial attention mechanism.
[0024] In one embodiment, during the training of the sea fog image recognition model, the loss function for measuring the classification accuracy of the model includes a cross entropy loss function, and the optimizer for optimizing the learning rate of the trainable parameters includes an Adam optimizer.
[0025] In one embodiment, the step of judging whether the classification accuracy of the trained sea fog image recognition model is qualified or not based on the test set includes:
[0026] The test set is input into the trained sea fog image recognition model to obtain the classification results of the corresponding hyperspectral remote sensing images;
[0027] According to the classification results of the hyperspectral remote sensing images and the corresponding label data, the evaluation index of the classification accuracy of the sea fog image recognition model is calculated and visualized; the evaluation index includes at least one of the confusion matrix, the overall classification accuracy, the average classification accuracy and the Kappa coefficient;
[0028] The classification accuracy of the trained sea fog image recognition model is calculated according to the evaluation indicators, and the classification accuracy is compared with the preset value to determine whether the classification accuracy is qualified or not.
[0029] In a second aspect, the present application provides a hyperspectral remote sensing image classification device for sea fog area identification, the device comprising:
[0030] A data acquisition module, used for acquiring a hyperspectral remote sensing image to be identified;
[0031] The classification and recognition module is used to classify and recognize the hyperspectral remote sensing image using a pre-trained sea fog image recognition model and output the recognition result of the sea fog area; the pre-trained sea fog image recognition model is trained based on a one-dimensional residual neural network model; the number of input channels of the one-dimensional residual neural network model is modified to a single channel.
[0032] In a third aspect, the present application provides a computer device including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method proposed in the first aspect of the present application are implemented.
[0033] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method proposed in the first aspect of the present application.
[0034] The above-mentioned hyperspectral remote sensing image classification method for sea fog area identification can automatically identify whether there is a sea fog area in the hyperspectral remote sensing image and determine the scope of the sea fog area by using a pre-trained sea fog image recognition model to classify and identify the hyperspectral remote sensing image to be identified; a one-dimensional residual neural network model is used as the sea fog image recognition model, and the use of one-dimensional input can reduce the number of convolution calculations in the convolution layer, and the introduction of residuals can retain the characteristics of the input data and prevent the gradient from disappearing; the input channel of the sea fog image recognition model is modified to a single channel, which can effectively avoid the problem of wasting computing resources while increasing the number of training samples, improving the utilization rate of the sea fog feature spectrum and improving the recognition accuracy of the sea fog image recognition model. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the conventional technology, the drawings required for use in the embodiments or the conventional technology descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0036] Figure 1 A flowchart of the steps of a hyperspectral remote sensing image classification method for sea fog area identification in one embodiment;
[0037] Figure 2 A flowchart of steps for obtaining a pre-trained sea fog image recognition model in one embodiment;
[0038] Figure 3 A flowchart of the steps of preprocessing a hyperspectral image of a sea fog region in one embodiment;
[0039] Figure 4 A flowchart of the steps of constructing an initial sea fog image recognition model in one embodiment;
[0040] Figure 5 A flowchart of the steps of introducing a channel attention mechanism and a spatial attention mechanism into a sea fog image recognition model in one embodiment;
[0041] Figure 6 A flowchart of steps for evaluating the classification accuracy of a trained sea fog image recognition model based on a test set in one embodiment;
[0042] Figure 7 A schematic diagram of a process for obtaining a pre-trained sea fog image recognition model in one embodiment
[0043] Figure 8 is a schematic diagram of the structure of an initial sea fog image recognition model in one embodiment;
[0044] Fig. 9 It is a structural block diagram of a hyperspectral remote sensing image classification device for sea fog area identification in another embodiment. DETAILED DESCRIPTION
[0045] In order to facilitate understanding of the present application, the present application will be described more fully below with reference to the relevant drawings. Embodiments of the present application are provided in the drawings. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive.
[0046] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.
[0047] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0048] When used herein, the singular forms "a", "an", and "said / the" may also include plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "include / comprise" or "have" and the like specify the presence of stated features, wholes, steps, operations, components, parts, or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts, or combinations thereof. At the same time, the term "and / or" used in this specification includes any and all combinations of the relevant listed items.
[0049] The present application provides a hyperspectral remote sensing image classification method for sea fog area identification, such as Figure 1 As shown, the method includes the following steps S12 to S14:
[0050] S12, obtaining a hyperspectral remote sensing image to be identified.
[0051] Specifically, the hyperspectral remote sensing image to be identified is a remote sensing image of the sea surface and its surroundings, and the wavelengths included cover the ultraviolet band to the near-infrared band, which may contain sea fog and other ground objects; other ground object types include at least one of the sea surface, clouds and the ground surface.
[0052] S14, using a pre-trained sea fog image recognition model to classify and recognize the hyperspectral remote sensing image, and output the recognition result of the sea fog area; the pre-trained sea fog image recognition model is obtained through training based on a one-dimensional residual neural network model with a single input channel.
[0053] Specifically, after the hyperspectral remote sensing image to be identified is cropped and optimized, a pre-trained sea fog image recognition model is used to classify and identify the hyperspectral remote sensing image; the sea fog image recognition model is specifically a one-dimensional residual neural network model for identifying sea fog areas in images, and the input of the model can only be a one-dimensional data sequence; at the same time, its first convolutional layer is modified to a single-channel input, that is, the input of the model can only be image data of a single wavelength; the sea fog image recognition model is used to extract features of the hyperspectral remote sensing image, and the regional division and classification recognition results of the sea fog and other landforms contained in the hyperspectral remote sensing image to be identified are obtained.
[0054] The above-mentioned hyperspectral remote sensing image classification method for sea fog area identification can automatically identify whether there is a sea fog area in the hyperspectral remote sensing image and determine the scope of the sea fog area by using a pre-trained sea fog image recognition model to classify and identify the hyperspectral remote sensing image to be identified; a one-dimensional residual neural network model is used as the sea fog image recognition model, and the use of one-dimensional input can reduce the number of convolution calculations in the convolution layer, and the introduction of residuals can retain the characteristics of the input data and prevent the gradient from disappearing; the input channel of the sea fog image recognition model is modified to a single channel, which can effectively avoid the problem of wasting computing resources while increasing the number of training samples, improving the utilization rate of the sea fog feature spectrum and improving the recognition accuracy of the sea fog image recognition model.
[0055] In an exemplary embodiment, Figure 2 As shown, the method further includes the following steps S22 to S26:
[0056] S22, obtaining a sea fog area hyperspectral image dataset and dividing it into a training set and a test set; the sea fog area hyperspectral image dataset includes a data sequence and label data corresponding to characteristic wavelengths of the sea fog area hyperspectral image; the characteristic wavelengths include absorption wavelengths and reflection wavelengths of the sea fog; the label data is used to indicate the sea fog and other ground objects in the sea fog area hyperspectral image.
[0057] It can be understood that the role of the sea fog image recognition model is to identify whether there is sea fog in the hyperspectral image and to divide the sea fog area. Therefore, the characteristic wavelength image of the sea fog in the hyperspectral image is selected for identification; the characteristic wavelengths that can characterize the sea fog include any wavelength of 1.4 microns, 1.9 microns, 0.45 microns to 0.75 microns, among which 1.4 microns and 1.9 microns are the absorption wavelengths of sea fog, and 0.45 microns to 0.75 microns are the reflection bands of sea fog; the label data corresponding to the hyperspectral image of the sea fog area can be pre-calibrated manually, which can indicate the sea fog and other types of land features in the hyperspectral remote sensing image.
[0058] Specifically, in order to make the data format of the training set and the test set meet the sea fog image recognition model, the selected characteristic wavelength images and label data are expanded into corresponding data sequences; then the random partitioning method is used to divide the sea fog area hyperspectral images and the corresponding label data into training sets and test sets.
[0059] S24, constructing an initial sea fog image recognition model, and training the initial sea fog image recognition model based on the training set.
[0060] Specifically, a sea fog image recognition model is first constructed based on the preset residual neural network model in the deep learning framework, and then the relevant parameters in the input layer, output layer and hidden layer of the residual neural network model are adjusted to realize the sea fog area recognition function; the sea fog image recognition model is trained using the sea fog hyperspectral remote sensing images of the training set and the corresponding label data, and the trainable parameters of each layer in the model are optimized to improve the classification accuracy of the sea fog image recognition model for hyperspectral images of sea fog areas.
[0061] S26, judging whether the classification accuracy of the trained sea fog image recognition model is qualified based on the test set; if the classification accuracy is qualified, the sea fog image recognition model is used as a pre-trained sea fog image recognition model; if the classification accuracy is unqualified, continue to train the sea fog image recognition model.
[0062] Specifically, after several training sessions, a trained sea fog image recognition model is obtained; the hyperspectral remote sensing images in the test set are processed and input into the trained sea fog image recognition model to obtain and output the classification results of the hyperspectral remote sensing images, and then the corresponding label data is used as the standard to judge the accuracy of the classification results.
[0063] Furthermore, multiple evaluation indicators are obtained by counting the number of correct pixels in the classification results, and the classification accuracy of the sea fog image recognition model is calculated according to the evaluation indicators. Whether the sea fog image recognition model after this training is qualified is judged based on the classification accuracy and the preset classification accuracy value. If qualified, the sea fog image recognition model after this training is used as the pre-trained sea fog image recognition model; if unqualified, the sea fog image recognition model after this training continues to be trained.
[0064] In an exemplary embodiment, Figure 3 As shown, the method further includes the following steps S32 to S34:
[0065] S32, normalizing and multi-scale guided filtering are performed on the hyperspectral image of the sea fog area to obtain a characteristic wavelength image.
[0066] Specifically, using StandardScaler to normalize the hyperspectral images in the sea fog area can help the sea fog image recognition model converge; performing multi-scale guided filtering on the hyperspectral images in the sea fog area can reduce special data and extract image data of the characteristic wavelengths of the sea fog; the image data of each characteristic wavelength can be normalized separately to prevent the differences between the image data of each wavelength from causing the sea fog image recognition model to have large differences in classification accuracy for image data of different wavelengths; and performing an inverse transformation on the absorption wavelength image so that the values of the sea fog area therein are consistent with those of the reflection wavelength image.
[0067] S34, expanding the image data of the characteristic wavelength image into a data sequence corresponding to the characteristic wavelength.
[0068] Specifically, an expansion function is used on the image data and label data of each characteristic wavelength image to obtain a one-dimensional data sequence corresponding to the characteristic wavelength image.
[0069] It should be noted that two-dimensional convolution can make full use of the spatial features of the image, but it consumes a lot of computing resources. The spatial features of the sea fog area are not complicated, and usually only the boundaries of the sea fog area need to be distinguished. Therefore, the hyperspectral remote sensing image can be expanded into a one-dimensional data sequence for image recognition. While retaining the spatial features of some sea fog area boundaries, the computing resources required for the sea fog image recognition model can be greatly reduced.
[0070] In an exemplary embodiment, Figure 4 As shown, constructing the initial sea fog image recognition model includes the following steps S242 to S244:
[0071] S242, modify the input dimension of the obtained ResNet-18 model to one dimension, modify the number of input channels to single channel, and introduce channel attention mechanism and spatial attention mechanism after the convolution layer; and modify the output dimension number of the fully connected layer to the number of categories; the number of categories includes the number of land object types contained in the hyperspectral remote sensing image.
[0072] Among them, the preset ResNet-18 model structure is used as the initial structure of the sea fog image recognition model; the ResNet-18 model refers to a residual neural network model with an initial 18 layers, which is characterized in that multiple residuals are respectively connected to the input and output of several convolutional layers to achieve jump transmission of feature data between multiple convolutional layers, which can improve the model optimization speed and prevent gradient disappearance.
[0073] Specifically, the input dimension of the ResNet-18 model is set to one dimension and the number of input channels is set to single channel. That is, the sea fog image recognition model only uses a data sequence of a single wavelength image each time, which can significantly increase the number of samples in the training model while saving convolutional layer computing resources.
[0074] Furthermore, introducing the channel attention mechanism and the spatial attention mechanism after the convolution layer of the initial sea fog image recognition model, that is, before the last fully connected layer, can further highlight the characteristic channels and characteristic areas after the convolution of the data sequence of characteristic wavelengths.
[0075] Furthermore, the fully connected layer function of the initial sea fog image recognition model is adjusted to a multi-classification function softmax, and the number of output dimensions can be adjusted to the total number of sea fog and other types of land objects that may be contained in the hyperspectral image of the sea fog area.
[0076] S244, obtaining the adjusted ResNet-18 model as an initial sea fog image recognition model.
[0077] Specifically, the adjusted ResNet-18 model is used as the initial sea fog image recognition model.
[0078] In an exemplary embodiment, Figure 5 As shown, introducing the channel attention mechanism and the spatial attention mechanism after the convolution layer includes the following steps S2422 to S2428:
[0079] S2422, perform global average pooling and maximum pooling on the feature sequence obtained after multi-layer convolution of the data sequence to obtain two corresponding channel feature vectors.
[0080] Specifically, the texture and edge features of the data sequence are extracted through multi-layer convolution to obtain a feature sequence with multiple channels; global average pooling is used on the feature sequence to increase the weights of important channels to obtain the first channel feature vector; maximum pooling is used on the feature sequence to increase the weights of the corresponding channels according to the significant features of each channel to obtain the second channel feature vector.
[0081] S2424, connect the two channel feature vectors to generate channel weights, apply the channel weights to the feature sequence, and obtain a channel weighted sequence, that is, obtain a channel attention mechanism.
[0082] Specifically, the concat function is used to connect the first channel feature vector with the second channel feature vector, and the connected feature vectors are passed through two fully connected layers to obtain the channel weights; the channel weights are multiplied by the feature sequence channel by channel, thereby introducing the channel attention mechanism to obtain the channel weighted sequence.
[0083] S2426, performing global average pooling and global maximum pooling on the channel weighted sequence respectively to obtain two corresponding spatial feature vectors.
[0084] Specifically, global average pooling is performed on the channel weighted sequence to increase the weight of important areas and obtain a first spatial feature vector; global maximum pooling is performed on the channel weighted sequence to obtain a second spatial feature vector.
[0085] S2428, connect the two spatial feature vectors to generate spatial weights, apply the spatial weights to the channel weighted sequence to obtain the output feature sequence, that is, obtain the spatial attention mechanism.
[0086] Specifically, the concat function is used to connect the first spatial feature vector and the second spatial feature vector, and the connected spatial vector is convolved to obtain the spatial weight; the spatial weight is applied to the channel weighted sequence to obtain the final feature sequence, and the output feature sequence that introduces the channel attention and spatial attention mechanism is classified and recognized through the final fully connected layer.
[0087] In an exemplary embodiment, during the training process of the sea fog image recognition model, the loss function for measuring the classification accuracy of the model includes a cross entropy loss function, and the optimizer for optimizing the learning rate of the trainable parameters includes an Adam optimizer.
[0088] Specifically, the initial sea fog image recognition model is trained using the data sequence of the training set, and the loss function is set to the cross entropy loss function, which can effectively measure the classification accuracy of the sea fog image recognition model for sea fog and other landforms; the Adam optimizer is used to update the learning rate of trainable parameters to improve the training speed of the sea fog image recognition model; in each training of the sea fog image recognition model, forward propagation is performed, loss is calculated, back propagation is performed, and trainable parameters are optimized to improve the classification accuracy of the sea fog image recognition model.
[0089] In an exemplary embodiment, Figure 6 As shown, judging whether the classification accuracy of the trained sea fog image recognition model is qualified based on the test set includes the following steps S262 to S266:
[0090] S262, input the test set into the trained sea fog image recognition model to obtain the classification result of the corresponding hyperspectral remote sensing image.
[0091] Specifically, the data sequence of the test set is input into the trained sea fog image recognition model to obtain the corresponding sea fog area hyperspectral image classification results.
[0092] S264, calculating evaluation indicators of the classification accuracy of the sea fog image recognition model and performing visualization processing based on the classification results of the hyperspectral remote sensing image and the corresponding label data; the evaluation indicators include at least one of a confusion matrix, an overall classification accuracy, an average classification accuracy and a Kappa coefficient.
[0093] Specifically, by comparing the classification results of the hyperspectral images in the sea fog area with the label data, it is possible to evaluate whether the classification results are accurate.
[0094] Furthermore, the accurate number of statistical classification results is obtained by the following formula to obtain the confusion matrix CM:
[0095]
[0096] Among them, m i,j It represents the number of pixels of the i-th type of ground objects in the hyperspectral image of the sea fog area that are classified into the j-th type of ground objects, and n represents the number of classifications. The values on the main diagonal of the confusion matrix are the number of pixels that are correctly classified. The confusion matrix is visualized through a heat map.
[0097] Furthermore, the overall classification accuracy OA is obtained by the following formula:
[0098]
[0099] Among them, n represents the number of categories, m i,i It represents the number of pixels correctly classified for the i-th type of ground objects, N represents the total number of pixels in the input sea fog area hyperspectral image, and OA represents the percentage of correctly classified pixels to the total number of pixels.
[0100] Furthermore, the average classification accuracy AA is obtained by the following formula:
[0101]
[0102] Among them, n represents the number of categories, m i,j Indicates the number of times the i-th type of feature is classified into the j-th type, m i,i It represents the number of correctly classified pixels of the i-th type of ground objects, and AA represents the average percentage of all correctly classified pixels in the corresponding category.
[0103] Furthermore, the Kappa coefficient is obtained by the following formula:
[0104]
[0105] Where n represents the number of classifications, N is the total number of pixels in the input sea fog area hyperspectral image, and N i is the total number of pixels of the i-th category in the label data, m i,i is the number of correctly classified pixels of the i-th type of land object; the Kappa coefficient takes into account the impact of uncertain factors on the classification results and can quantitatively evaluate the overall effectiveness of the classification model.
[0106] S266, calculating the classification accuracy of the trained sea fog image recognition model according to the evaluation index, and comparing the classification accuracy with a preset value to determine whether the classification accuracy is qualified.
[0107] Specifically, weights are assigned to the overall classification accuracy, average classification accuracy and Kappa coefficient to perform weighted calculation to obtain the classification accuracy of the sea fog image recognition model, and the classification accuracy is compared with the preset value. If it is lower than the preset value, the classification accuracy of the sea fog image recognition model after this training is judged to be unqualified; if it is not lower than the preset value, the classification accuracy of the sea fog image recognition model after this training is judged to be qualified.
[0108] In order to further illustrate the solution of the present application, a specific example is provided below to illustrate the process of obtaining a pre-trained sea fog image recognition model in a hyperspectral remote sensing image classification method for sea fog recognition provided in an embodiment of the present application. Figure 7 As shown, firstly, the hyperspectral remote sensing image data and the corresponding label data of the sea fog area are obtained, and the data are preprocessed by normalization and multi-scale guided filtering; then, the preprocessed data is used to construct a hyperspectral image dataset of the sea fog area, and the dataset is divided into a training set and a test set; then, a sea fog image recognition model is constructed, and the sea fog image recognition model is trained multiple times using the data of the training set; after the training, the performance of the sea fog image recognition model is evaluated using the data of the test set, and the confusion matrix, overall accuracy, average accuracy and Kappa coefficient are calculated according to the recognition results of the test set, and whether the classification accuracy of the model is qualified is judged according to at least one of the four evaluation indicators, and if so, a model with qualified accuracy is obtained as the pre-trained sea fog image recognition model, otherwise, the sea fog image recognition model is continuously trained.
[0109] Among them, the model architecture of the sea fog image recognition model is as follows Figure 8As shown in the figure, the sea fog image recognition model is built based on the Resnet-18 model, in which the Resnet-18 model first preliminarily extracts the features of the input data through the first convolutional layer and the pooling layer; then it deeply extracts the features through four residual blocks in sequence, each residual block includes two convolutional layers, two pooling layers corresponding to the convolutional layer, and the residuals at the beginning and end of the skip-connected residual block; finally, the classification output is realized through the fully connected layer; the sea fog image recognition model also introduces a channel attention mechanism and a spatial attention mechanism between the residual block and the fully connected layer in the Resnet-18 model. The channel attention mechanism includes global average pooling, maximum pooling and fully connected layers, while the spatial attention mechanism includes global average pooling, global maximum pooling and convolutional layers.
[0110] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0111] Based on the same inventive concept, the embodiment of the present application also provides a hyperspectral remote sensing image classification device for sea fog area identification. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations of one or more embodiments of a hyperspectral remote sensing image classification device for sea fog area identification provided by the present application provided below can refer to the above limitations on a hyperspectral remote sensing image classification method for sea fog area identification, and will not be repeated here.
[0112] The present application provides a hyperspectral remote sensing image classification device 40 for sea fog area identification, such as Fig. 9 As shown, the device comprises:
[0113] A data acquisition module 41 is used to acquire a hyperspectral image of a sea fog area;
[0114] The classification and recognition module 42 is used to classify and recognize the hyperspectral remote sensing image using a pre-trained sea fog image recognition model, and output the recognition result of the sea fog area; the pre-trained sea fog image recognition model is obtained through training based on a one-dimensional residual neural network model; the number of input channels of the one-dimensional residual neural network model is modified to a single channel.
[0115] The present application provides a computer device, including a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the steps of a hyperspectral remote sensing image classification method for sea fog area identification proposed in the present application are implemented.
[0116] The present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of a hyperspectral remote sensing image classification method for sea fog area identification proposed in the present application are implemented.
[0117] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0118] In the description of this specification, the description with reference to the terms "some embodiments", "other embodiments", "ideal embodiments", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic descriptions of the above terms do not necessarily refer to the same embodiment or example.
[0119] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0120] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A hyperspectral remote sensing image classification method for sea fog area identification, characterized in that: The method comprises: Acquire a hyperspectral remote sensing image to be identified; The hyperspectral remote sensing image is classified and identified using a pre-trained sea fog image recognition model, and an identification result of the sea fog area is output; the pre-trained sea fog image recognition model is obtained through training based on a one-dimensional residual neural network model with a single input channel.
2. The method according to claim 1, characterized in that: The method further comprises: A sea fog region hyperspectral image dataset is obtained and divided into a training set and a test set; the sea fog region hyperspectral image dataset includes a data sequence and label data of characteristic wavelengths of the sea fog region hyperspectral image; the characteristic wavelengths include an absorption wavelength and a reflection wavelength of the sea fog; the label data is used to indicate the sea fog and other ground objects in the sea fog region hyperspectral image; Constructing an initial sea fog image recognition model, and training the initial sea fog image recognition model based on the training set; Based on the test set, the qualification of the classification accuracy of the trained sea fog image recognition model is judged; if the classification accuracy is qualified, the sea fog image recognition model is used as the pre-trained sea fog image recognition model; if the classification accuracy is unqualified, the sea fog image recognition model is continued to be trained.
3. The method according to claim 2, characterized in that The method further comprises: Performing normalization processing and multi-scale guided filtering on the hyperspectral image of the sea fog area to obtain a characteristic wavelength image; The image data of the characteristic wavelength image is expanded into a data sequence of the characteristic wavelength.
4. The method according to claim 3, characterized in that: The step of constructing the initial sea fog image recognition model comprises: The input dimension of the obtained ResNet-18 model is modified to be one-dimensional, the number of input channels is modified to be a single channel, and a channel attention mechanism and a spatial attention mechanism are introduced after the convolution layer; the output dimension number of the fully connected layer is modified to be the number of classifications; the number of classifications includes the number of types of land objects contained in the hyperspectral remote sensing image; The adjusted ResNet-18 model is obtained as the initial sea fog image recognition model.
5. The method according to claim 4, characterized in that The steps of introducing the channel attention mechanism and the spatial attention mechanism after the convolution layer include: Performing global average pooling and maximum pooling on the feature sequence obtained after multi-layer convolution of the data sequence to obtain two corresponding channel feature vectors; Connecting two of the channel feature vectors to generate a channel weight, and applying the channel weight to the feature sequence to obtain a channel weighted sequence, that is, to obtain the channel attention mechanism; Performing global average pooling and global maximum pooling on the channel weighted sequence respectively to obtain two corresponding spatial feature vectors; Connecting the two spatial feature vectors to generate spatial weights, applying the spatial weights to the channel weighted sequence to obtain an output feature sequence, that is, to obtain the spatial attention mechanism.
6. The method according to claim 5, characterized in that In the training process of the sea fog image recognition model, the loss function for measuring the classification accuracy of the model includes a cross entropy loss function, and the optimizer for optimizing the learning rate of the trainable parameters includes an Adam optimizer.
7. The method according to claim 2, characterized in that The step of judging whether the classification accuracy of the trained sea fog image recognition model is qualified or not based on the test set comprises: Inputting the test set into the trained sea fog image recognition model to obtain a classification result of the corresponding hyperspectral remote sensing image; According to the classification results of the hyperspectral remote sensing image and the corresponding label data, the evaluation index of the classification accuracy of the sea fog image recognition model is calculated and visualized; the evaluation index includes at least one of a confusion matrix, an overall classification accuracy, an average classification accuracy and a Kappa coefficient; The classification accuracy of the trained sea fog image recognition model is calculated according to the evaluation index, and the classification accuracy is compared with a preset value to determine whether the classification accuracy is qualified or not.
8. A hyperspectral remote sensing image classification device for sea fog area identification, characterized in that: The device comprises: A data acquisition module, used for acquiring a hyperspectral remote sensing image to be identified; A classification and recognition module is used to classify and recognize the hyperspectral remote sensing image using a pre-trained sea fog image recognition model, and output a recognition result of the sea fog area; the pre-trained sea fog image recognition model is obtained through training based on a one-dimensional residual neural network model; the number of input channels of the one-dimensional residual neural network model is modified to a single channel.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.