A remote sensing image semantic segmentation method based on deep learning
Patent Information
- Application Number
- CN202111530033.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-15
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2041-12-15
AI Technical Summary
常见的ASPP模块位于编码器的末端,来提取多尺度的特征,但是在信息量较大的遥感图像中,这种操作不足以提取更多的特征,并且随着网络的深入导致目标的浅层特征丢失严重
[0029] This invention considers improving the segnet network and introducing the hollow space pyramid pooling ASPP module in the first two stages of the network to ensure that the spatial position information of the image will not be seriously lost and to extract multi-scale features at different training stages, improving the segmentation accuracy. . After completing the training of the two hollow space pyramid pooling ASPP modules, the corresponding fusion is performed in the decoding stage to effectively utilize the network context information. Atrous convolution increases the receptive field without losing resolution and does not require the introduction of additional parameters. Fusion of different models, using a voting mechanism to effectively remove some misclassified pixels, improves the prediction ability of the model, can accurately segment crop areas from complex backgrounds, effectively utilize land, monitor crop planting areas and improve crops production is of great significance.
Smart Images

Figure CN114187450B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer vision, and in particular relates to a remote sensing image semantic segmentation method based on deep learning suitable for agricultural big data. Background Art
[0002] With the development of remote sensing technology, the amount of remote sensing image data is increasing, and the resolution is getting higher and higher. Remote sensing images contain a lot of information, so remote sensing images have great application potential in environmental assessment, disaster assessment, forestry measurement, precision agriculture, urban planning, map production and updating, change detection and military target identification. Semantic segmentation is a pixel-level classification method that marks each pixel as a label of an object and gives each pixel a category meaning. Deep learning can extract abstract features and has a good ability to analyze complex scenes, so it can effectively improve the segmentation effect of remote sensing images.
[0003] Although traditional convolutional neural networks can mine deep semantic features of images and achieve image-level classification, they cannot directly perform semantic recognition on each pixel of the image, and it is difficult to decompose different categories of the image at the pixel level. Fully convolutional neural networks are one of the simplest and most popular architectures for semantic segmentation. Convolutional neural networks that are usually used for classification are connected to fully connected layers after several convolutional layers. The key to fully convolutional neural networks is to convert fully connected layers into convolutional layers and use upsampling operations to generate prediction graphs.
[0004] In recent years, deep learning has been widely used in the field of computer vision, and semantic segmentation has achieved some results, but it still faces many challenges, because remote sensing images contain a lot of information, exist in multiple scales in actual scenes, and have complex scenes such as illumination, white clouds, shadows, occlusions, etc., and samples in different scenes are also different. Samples of the same type also have different information features, such as different colors of trees and vegetation, and different top colors of buildings. Due to different shooting angles or times, such as different angles of the sun, shadows will be formed on the image, bringing noise to the image. These are the main reasons for the low accuracy of semantic segmentation at present. Remote sensing images require high-quality segmentation, and the segmentation effect still needs to be improved. Deep learning has a good analytical ability for complex scenes, reduces the dependence of remote sensing images on expert knowledge, and improves classification accuracy and recognition efficiency. Therefore, it is of practical significance to combine deep learning to solve the problem of remote sensing image segmentation. The common ASPP module is located at the end of the encoder to extract multi-scale features, but in remote sensing images with large amounts of information, this operation is not enough to extract more features, and as the network goes deeper, the shallow features of the target are seriously lost. Therefore, even though ordinary networks can segment remote sensing images to a certain extent, the segmentation algorithm has not been greatly improved. Summary of the invention
[0005] In order to solve the above technical problems, the present invention provides a remote sensing image semantic segmentation method based on deep learning, which utilizes deep learning experiments to perform semantic segmentation on remote sensing images and optimizes the network of the feature extraction part to effectively extract the multi-scale features of the image and improve the segmentation accuracy.
[0006] To achieve the above object, the technical solution of the present invention is as follows:
[0007] A remote sensing image semantic segmentation method based on deep learning includes the following steps:
[0008] (1) Improve the segnet network model, use segnet as the backbone network, and add two void spatial pyramid pooling ASPP modules;
[0009] (2) In the segnet encoding stage, two dilated spatial pyramid pooling ASPP modules are combined as the encoder of the entire network to form a multi-branch training network;
[0010] (3) The output feature maps of the two atrous spatial pyramid pooling ASPP modules are concatenated in the decoder;
[0011] (4) Complete the training of the entire network and save the optimal network model for network fusion to obtain more accurate segmentation results.
[0012] Further preferably, the specific method for constructing the hollow space pyramid pooling ASPP module in step (1) is as follows:
[0013] (1.3) Construct four n*n parallel dilated convolutions with different dilation rates r, set the step size and padding parameters, and obtain dilated feature maps O of the same size. x,y , for the input feature map I x,y , four hole output feature maps obtained by four hole convolutions with different hole rates r n is the length of the convolution kernel, W u,v is the convolution kernel weight, b is the bias; x, y represent the pixel position, u, v represent the weight position in the convolution kernel, and four different dilated convolutions and a global average pooling are parallelized to form a dilated spatial pyramid pooling ASPP module. To match the size of the dilated convolution output feature map, a bilinear interpolation operation is added after the global average pooling operation.
[0014] (1.4) There are two atrous spatial pyramid pooling ASPP modules. The feature map obtained by the first convolution module of segnet is the first feature map, which is used as the input of the first atrous spatial pyramid pooling ASPP module. The feature map obtained by the second convolution module of segnet is the second feature map, which is used as the input of the second atrous spatial pyramid pooling ASPP module.
[0015] Further preferably, the specific method of step (2) is as follows:
[0016] (2.1) The segnet encoder consists of five convolutional modules. Each of the first two convolutional modules contains two 3×3 convolutional operations and one pooling operation, and each of the last three convolutional modules contains three 3×3 convolutional operations and one pooling operation.
[0017] (2.2) After the first convolutional module of the segnet encoder, a first atrous spatial pyramid pooling ASPP module is established, and after the second convolutional module of the segnet encoder, a second atrous spatial pyramid pooling ASPP module is established to form a multi-branch parallel training network;
[0018] (2.3) The first feature map output by the first convolution module of segnet is input into the first dilated spatial pyramid pooling ASPP module to fully extract multi-scale features, and its five parallel output feature maps are spliced to obtain the first spliced feature map, which is convolved and reduced in dimension through the convolution of the first dilated spatial pyramid pooling ASPP module itself to obtain the first reduced-dimensional feature map;
[0019] (2.4) After the second convolution module of segnet, the second feature map obtained is input into the second atrous spatial pyramid pooling ASPP module, and the multi-scale features are fully extracted through 5 parallel operations. The feature maps output by the parallel operations are spliced to obtain the second spliced feature map, and the second atrous spatial pyramid pooling ASPP module itself is convoluted to reduce the dimension to obtain the second reduced dimension feature map;
[0020] (2.5) The multi-branch parallel training network consisting of five convolutional modules and two atrous spatial pyramid pooling ASPP modules in the segnet encoding stage serves as the encoder of the entire network.
[0021] Further preferably, the specific method of feature map splicing in step (3) is as follows:
[0022] (3.1) The segnet decoder contains five convolution modules. Each of the first three convolution modules contains three 3×3 convolution calculations and a 2x upsampling operation. The first three convolution modules output the first upsampled feature map, the second upsampled feature map, and the third upsampled feature map, respectively. Each of the last two convolution modules contains two 3×3 convolution calculations and a 2x upsampling operation.
[0023] (3.2) The second dimension reduction feature map output by the second atrous spatial pyramid pooling ASPP module is concatenated with the third upsampled feature map in the segnet decoding stage, and after convolution and upsampling, the fourth upsampled feature map is obtained. The fourth upsampled feature map is concatenated with the first dimension reduction feature map output by the first atrous spatial pyramid pooling ASPP module, and after convolution and upsampling, the fifth upsampled feature map is obtained.
[0024] Further preferably, the specific method of step (4) is as follows:
[0025] (4.1) After the encoder and decoder of the entire network are trained in step (2.5), the classification is completed through the softmax layer. Let the remote sensing image classification be C. For each pixel i{i=1,2,3,.....,N}, the true category label is The sample passes through the codec to obtain a C-dimensional output feature vector: Use the softmax function to transform the feature vector The linear prediction values of all categories in are converted into probability values, then the predicted probability value belonging to category C is
[0026] (4.2) After obtaining the probability value, the cross entropy loss function is used to calculate the loss value between the real data and the predicted value to quantify the gap between the two: N is the total number of pixels, and the SGD optimization algorithm is used for model training;
[0027] (4.3) The improved SegNet model is fused with the SegNet and UNET network models by using the voting method: the three models are used to make predictions and the prediction maps are obtained respectively. A vote is performed for each pixel in each map, and the category with the most votes is the category of the pixel.
[0028] Through the above technical solution, the remote sensing image semantic segmentation method based on deep learning applicable to agricultural big data provided by the present invention has the following effects:
[0029] The present invention considers improving the segnet network, introducing the hollow space pyramid pooling ASPP module in the first two stages of the network, ensuring that the spatial position information of the image will not be seriously lost and extracting the multi-scale features of different training stages, thereby improving the segmentation accuracy. After completing the training of the two hollow space pyramid pooling ASPP modules, corresponding fusion is performed in the decoding stage to effectively utilize the network context information. The hollow convolution does not lose resolution while increasing the receptive field, and no additional parameters need to be introduced. Different models are fused, and a voting mechanism is used to effectively remove some misclassified pixels, thereby improving the prediction ability of the model, and the crop area can be accurately segmented from a complex background, which is of great significance to the effective use of land, crop planting area monitoring and improving crop production. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] 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 are briefly introduced below.
[0031] Figure 1 This is a flow chart of an embodiment of the present invention;
[0032] Figure 2 This is a schematic diagram of introducing the ASPP module into the sgenet network disclosed in an embodiment of the present invention.
[0033] Figure 3 This is a schematic diagram of the hollow space pyramid pooling ASPP module disclosed in an embodiment of the present invention.
[0034] Figure 4 It is the Unet network model.
[0035] Figure 5 This is a partial prediction effect diagram disclosed in an embodiment of the present invention. DETAILED DESCRIPTION
[0036] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0037] The present invention provides a remote sensing image semantic segmentation method based on deep learning applicable to agricultural big data. Figure 1 As shown, the specific embodiments are as follows:
[0038] (1) Data preprocessing stage:
[0039] (1.1) Load the original data set. The training set consists of 5 large-sized remote sensing images of different sizes, and the test set consists of 3 large-sized remote sensing images.
[0040] (1.2) Randomly generate two-dimensional pixel coordinates for the training set data and cut out a small 256×256 image at the coordinates;
[0041] (1.3) Perform data enhancement operations, rotate the remote sensing image and the label image by 90°, 180°, and 270°, mirror the remote sensing image and the label image along the y-axis, blur the original image, adjust the illumination of the original image, and add noise (Gaussian noise, salt and pepper noise) to the original image;
[0042] (1.4) Obtain a training set of 10,000 remote sensing images and 10,000 label images.
[0043] (2) Network model construction stage:
[0044] (2.1) Construct a segnet model. The segnet model is a codec structure. The encoder contains five convolution modules (the first convolution module outputs the first feature map, the second convolution module outputs the second feature map, the third convolution module outputs the third feature map, the fourth convolution module outputs the fourth feature map, and the fifth convolution module outputs the fifth feature map). Each convolution module contains multiple 3×3 convolutions, BN, ReLu and pooling operations. Finally, the encoder outputs a 8×8×512 feature map; the decoder also includes five convolution modules, which output the first upsampling feature map, the second upsampling feature map, the third upsampling feature map, the fourth upsampling feature map and the fifth upsampling feature map respectively. Each convolution module contains multiple 3×3 convolutions, BN, ReLu and upsampling operations, and finally the classification is completed through the softmax layer;
[0045] (2.2) Figure 4 As shown in the figure, a unet network model is constructed. The unet model is a codec structure. The encoder first performs a convolution operation to convert the input data into a 32-dimensional feature map (256*256*32), and then repeats the structure of two convolution layers and one pooling layer to output a 16×16×512 feature map; each module in the decoder is concatenated with the feature map of the corresponding encoder module, and then upsampling and two 3×3 convolution operations are repeated, and finally classification is completed through the softmax layer;
[0046] (2.3) Construct four 3×3 parallel dilated convolutions with dilated rates of 1, 6, 12, and 18 respectively. The convolution operation sets strides = 1 and padding = same to obtain dilated feature maps of the same size O. x,y , the hole output feature map O is obtained through hole convolution calculation with hole rate r = (1, 6, 12, 18) x,y , n is the length of the convolution kernel, W u,vis the convolution kernel weight, b is the bias; x, y represent the pixel position, u, υ represent the weight position in the convolution kernel; four dilated convolutions and 2×2 global average pooling operations are performed in parallel to form the dilated spatial pyramid pooling ASPP module. To match the size of the dilated convolution output feature map, a bilinear interpolation operation is added after the global average pooling operation;
[0047] (2.4) Using the segnet network as the backbone network, a first atrous spatial pyramid pooling ASPP module is established after the first convolutional module of the segnet encoder, and a second atrous spatial pyramid pooling ASPP module is established after the second convolutional module to form a multi-branch parallel training network; Figure 2 As shown in the figure, the input 256*256 feature map is passed through the first convolution module of the segnet encoder to obtain the first feature map of 128*128*64, which is used as the input of the first dilated spatial pyramid pooling ASPP module. The first dilated spatial pyramid pooling ASPP module concatenates the 5 parallel operation feature maps to obtain the first concatenated feature map of 128×128×320, which is convolved and reduced in dimension through 1×1 convolution to obtain the first reduced dimension map of 128×128×64. Feature map; The first feature map of 128×128×64 is passed through the second convolution module of the segnet encoder to obtain a second feature map of 64×64×128, which is used as the input of the second dilated spatial pyramid pooling ASPP module. Multi-scale features are fully extracted through parallel dilated convolution and pooling. The second dilated spatial pyramid pooling ASPP module is spliced to obtain a second spliced feature map of 64×64×320, and the second reduced dimension feature map of 64×64×64 is obtained through 1×1 convolution.
[0048] (2.5) After completing the training of the two void space pyramid pooling ASPP modules, the corresponding feature map fusion is performed in the decoding stage; the segnet decoder contains five convolution modules, each of the first three convolution modules contains three 3×3 convolution calculations and a 2-fold upsampling operation, and each of the last two convolution modules contains two 3×3 convolution calculations and a 2-fold upsampling operation. Each convolution operation will add a BN structure and a ReLu activation function; the input of the first upsampled feature map in the decoding stage is the fifth feature map 8×8×512 in the encoding stage. After three 3×3 convolution calculations and a 2-fold upsampling operation, the first upsampled feature map 16×16×512 is obtained, and then after three 3×3 convolution calculations and a 2-fold upsampling operation, the second upsampled feature map 32×32×512 is obtained, and then after three 3×3 convolution calculations and a 2-fold upsampling operation, the third upsampled feature map 32×32×512 is obtained. The second feature map of the second atrous spatial pyramid pooling ASPP module is 64×64×64×64, and the output of the second dimension reduction feature map of 64*64*512 after the third upsampling in the segnet decoding stage is concatenated to obtain a feature map of 64×64×576. After three 3×3 convolution calculations and a 2-fold upsampling operation, the fourth upsampling output of 128×128×256 is obtained. The output of the fourth upsampling 128×128×256 feature map is concatenated with the first dimension reduction feature map of 128×128×64 in the segnet decoding stage to obtain a feature map of 128×128×320. After two 3×3 convolution calculations and a 2-fold upsampling operation, the fifth upsampling feature map of 256×256×128 is obtained. After five upsampling operations, the image size is restored and the classification is completed through the softmax layer.
[0049] (3) Training phase:
[0050] (3.1) First, the dataset is divided into a training set and a validation set. The size of the validation set is 0.25 times that of the training set. The size of the training set is 7500 images, and the size of the validation set is 2500 images.
[0051] (3.2) Let the remote sensing image classification be C and the true category label be y c , the sample passes through the codec to obtain a C-dimensional output feature vector of O c , use the softmax function to transform the feature vector O c The linear prediction values of all categories in are converted into probability values, then the predicted probability value of class C is
[0052] (3.3) After obtaining the probability value, the cross entropy loss function is used to calculate the loss value between the real data and the predicted value to quantify the gap between the two: Use sgd and Adma optimization algorithms for model training;
[0053] (3.4) Each model is trained for 1000 rounds, with a batch size of 20 in each round, and the best model is saved in each round of training.
[0054] (4) Prediction stage:
[0055] (4.1) Load the trained network model and use the test image for prediction. For each pixel i, the probability of belonging to the Cth class is p c (x i ), calculate the category label C of the pixel i , C i =argmaxp c (x i );
[0056] (4.2) The predicted mask image is displayed in black because the pixel values corresponding to each type of object are 0 to 4. The pixel value 1 is the crop area, the pixel value 2 is the road, the pixel value 3 is the building, the pixel value 4 is the water body, and the pixel value 0 is the other background. The visualization marks the crop area in green, the water body in blue, the road in brown, the building in yellow, and the other background in black.
[0057] (5) Model fusion stage:
[0058] (5.1) Save the prediction graphs obtained by using the three models respectively;
[0059] (5.1) Vote for each pixel of each prediction image;
[0060] (5.2) In majority voting, the category with the most votes is the category of the pixel.
[0061] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A remote sensing image semantic segmentation method based on deep learning, characterized in that: The following steps are involved: (1) Improve the segnet network model, use segnet as the backbone network, and add two void spatial pyramid pooling ASPP modules; The specific method of constructing the hollow space pyramid pooling ASPP module is as follows: (1.1) Construct four n*n parallel dilated convolutions with different dilation rates r, set the step size and padding parameters, and obtain dilated feature maps O of the same size. x,y , for the input feature map I x,y , four hole output feature maps are obtained by four hole convolution calculations with different hole rates r n is the length of the convolution kernel, W u,v is the convolution kernel weight, b is the bias; x, y represent the pixel position, u, v represent the weight position in the convolution kernel, and four different dilated convolutions and a global average pooling are parallelized to form a dilated spatial pyramid pooling ASPP module. To match the size of the dilated convolution output feature map, a bilinear interpolation operation is added after the global average pooling operation. (1.2) There are two atrous spatial pyramid pooling ASPP modules. The feature map obtained by the first convolution module of segnet is the first feature map, which is used as the input of the first atrous spatial pyramid pooling ASPP module. The feature map obtained by the second convolution module of segnet is the second feature map, which is used as the input of the second atrous spatial pyramid pooling ASPP module. (2) In the segnet encoding stage, two dilated spatial pyramid pooling ASPP modules are combined as the encoder of the entire network to form a multi-branch training network; The multi-branch parallel training network composed of the convolution module in the segnet encoding stage and two dilated spatial pyramid pooling ASPP modules serves as the encoder of the entire network; The first feature map output by the first convolution module of segnet is input into the first dilated space pyramid pooling ASPP module to obtain the first dimensionality reduction feature map, and the second feature map output by the second convolution module of segnet is input into the second dilated space pyramid pooling ASPP module to obtain the second dimensionality reduction feature map; (3) The output feature maps of the two atrous spatial pyramid pooling ASPP modules are concatenated in the decoder; (4) Complete the training of the entire network and save the optimal network model for network fusion to obtain more accurate segmentation results.
2. The remote sensing image semantic segmentation method based on deep learning according to claim 1, characterized in that: The specific method of step (2) is as follows: (2.1) The segnet encoder consists of five convolutional modules. Each of the first two convolutional modules contains two 3×3 convolutional operations and one pooling operation, and each of the last three convolutional modules contains three 3×3 convolutional operations and one pooling operation. (2.2) After the first convolutional module of the segnet encoder, a first atrous spatial pyramid pooling ASPP module is established, and after the second convolutional module of the segnet encoder, a second atrous spatial pyramid pooling ASPP module is established to form a multi-branch parallel training network; (2.3) The first feature map output by the first convolution module of segnet is input into the first dilated spatial pyramid pooling ASPP module to fully extract multi-scale features, and its five parallel output feature maps are spliced to obtain the first spliced feature map, which is convolved and reduced in dimension through the convolution of the first dilated spatial pyramid pooling ASPP module itself to obtain the first reduced-dimensional feature map; (2.4) After the second convolution module of segnet, the second feature map obtained is input into the second atrous spatial pyramid pooling ASPP module, and the multi-scale features are fully extracted through 5 parallel operations. The feature maps output by the parallel operations are spliced to obtain the second spliced feature map, and the second atrous spatial pyramid pooling ASPP module itself is convoluted to reduce the dimension to obtain the second reduced dimension feature map; (2.5) The multi-branch parallel training network consisting of five convolutional modules and two atrous spatial pyramid pooling ASPP modules in the segnet encoding stage serves as the encoder of the entire network.
3. The remote sensing image semantic segmentation method based on deep learning according to claim 1, characterized in that: The specific method of feature map splicing in step (3) is as follows: (3.1) The segnet decoder contains five convolution modules. Each of the first three convolution modules contains three 3×3 convolution calculations and a 2x upsampling operation. The first three convolution modules output the first upsampled feature map, the second upsampled feature map, and the third upsampled feature map, respectively. Each of the last two convolution modules contains two 3×3 convolution calculations and a 2x upsampling operation. (3.2) The second dimension reduction feature map output by the second atrous spatial pyramid pooling ASPP module is concatenated with the third upsampled feature map in the segnet decoding stage, and after convolution and upsampling, the fourth upsampled feature map is obtained. The fourth upsampled feature map is concatenated with the first dimension reduction feature map output by the first atrous spatial pyramid pooling ASPP module, and after convolution and upsampling, the fifth upsampled feature map is obtained.
4. The remote sensing image semantic segmentation method based on deep learning according to claim 2, characterized in that: The specific method of step (4) is as follows: (4.1) After the encoder and decoder of the entire network are trained in step (2.5), the classification is completed through the softmax layer. Let the remote sensing image classification be C. For each pixel i{i=1,2,3,.....,N}, the true category label is The sample passes through the codec to obtain a C-dimensional output feature vector: Use the softmax function to transform the feature vector The linear prediction values of all categories in are converted into probability values, then the predicted probability value belonging to category C is (4.2) After obtaining the probability value, the cross entropy loss function is used to calculate the loss value between the real data and the predicted value to quantify the gap between the two: N is the total number of pixels, and the SGD optimization algorithm is used for model training; (4.3) The improved SegNet model is fused with the SegNet and UNET network models by using the voting method: the three models are used to make predictions and the prediction maps are obtained respectively. A vote is performed for each pixel in each map, and the category with the most votes is the category of the pixel.
