Disclosure of Invention
Aiming at the problems, the invention provides a method and a device for detecting the tillage change of a high-resolution remote sensing image based on deep learning, which are used for solving the technical problems in the prior art, and can change single-channel extraction into multi-channel extraction by adopting a polymerization residual convolution layer, so that a network can fully learn the characteristics of the image; the residual error module is introduced, so that the model can effectively train a deeper network structure, and the problems of model degradation and the like caused by network deepening are prevented.
In order to achieve the purpose, the invention provides the following scheme: the invention provides a high-resolution remote sensing image cropland change detection device based on deep learning, which comprises: the system comprises an image correction unit, an image drawing unit, a data processing unit, a model building unit, a communication unit and terminal equipment;
the image correction unit, the image drawing unit, the data processing unit, the model building unit, the communication unit and the terminal equipment are sequentially connected;
the image correction unit is used for collecting a high-resolution remote sensing image of the cultivated land and preprocessing the high-resolution remote sensing image to obtain a corrected cultivated land image;
the image drawing unit draws a label graph based on the farmland correction image;
the data processing unit is used for carrying out segmentation processing on the farmland correction image and the label map to obtain a segmentation data set;
the model construction unit is used for performing convolution operation on the segmentation data set, extracting the characteristics of the segmentation data set, constructing a ResNeXt attU-Net model based on the characteristics, and acquiring the change result of the farmland based on the ResNeXt attU-Net model;
the communication unit is used for transmitting the change result of the farmland to the terminal equipment.
Preferably, the image correction unit comprises an acquisition module and a correction module; the acquisition module, the correction module and the image drawing unit are sequentially connected;
the acquisition module is used for acquiring a high-resolution remote sensing image of the cultivated land;
and the correction module is used for preprocessing the high-resolution remote sensing image to obtain a farmland correction image.
Preferably, the image drawing unit comprises an interpretation module and a delineation module; the correction module, the interpretation module, the delineation module and the data processing unit are connected in sequence;
the interpretation module is used for loading and manually and visually interpreting the farmland correction image to obtain an interpretation image;
the drawing module is used for drawing the image spots for interpreting the intertillage change of the image to obtain a label image.
Preferably, the data processing unit comprises a partitioning module and a collecting module; the correction module and the drawing module are both connected with the segmentation module; the segmentation module, the collection module and the model construction unit are connected in sequence;
the segmentation module is used for carrying out segmentation processing on the farmland correction image and the label graph to obtain a plurality of image segmentation graphs;
the collection module is used for collecting all the image segmentation maps to obtain a segmentation data set.
Preferably, the model construction unit comprises a feature extraction module, an aggregation residual error module and a model construction module; the set module, the feature extraction module, the residual error aggregation module and the model construction module are sequentially connected;
the feature extraction module is used for performing convolution operation on the segmentation data set and extracting features of the segmentation data set;
the residual aggregation module is used for carrying out residual aggregation processing on the characteristics of the segmentation data set;
the model building module builds a ResNeXt attU-Net model based on the characteristics processed by the aggregation residual errors, and obtains the arable land change result based on the ResNeXt attU-Net model.
Preferably, the communication unit includes a first communication module and a second communication module; the first communication module is arranged in the model construction unit; the second communication module is arranged in the terminal equipment;
the first communication module is used for transmitting the result of the farmland change;
the second communication module is used for receiving the result of the farmland change.
Preferably, the first communication module and the second communication module are wirelessly connected through 2.4 g.
The method for detecting the farmland change of the high-resolution remote sensing image based on deep learning comprises the following steps:
s1, collecting a high-resolution remote sensing image of the cultivated land, and preprocessing the high-resolution remote sensing image to obtain a corrected cultivated land image;
s2, drawing a label graph based on the farmland correction image;
s3, carrying out segmentation processing on the farmland correction image and the label graph to obtain a segmentation data set;
s4, performing convolution operation on the segmented data set, extracting the characteristics of the segmented data set, and constructing a ResNeXt attU-Net model based on the characteristics, wherein the ResNeXt attU-Net model is used for obtaining the change result of the farmland.
The invention discloses the following technical effects:
(1) changing the convolution layer of the model in the up-sampling and down-sampling processes into a polymerization residual convolution layer, and changing single-channel extraction of a feature extraction channel into multi-channel extraction so that the network can fully learn the features of the image; the residual error module is introduced, so that the model can effectively train a deeper network structure, and the problems of model degradation and the like caused by network deepening are prevented;
(2) the invention changes the original jump connection of the U-Net model, introduces the attention mechanism in the jump connection process, the attention mechanism can adjust the weight of each component in the feature diagram, inhibits the learning of the features by reducing the weight of the feature diagram which is irrelevant to the task, and enhances the learning of the features by increasing the weight of the features which are relevant to the task. In the task of detecting the change of the high-resolution remote sensing image, the key point is to extract a change region from the images in two phases, so that the information weight of the change type is increased by introducing an attention mechanism, so that the model gravity learns the change region, meanwhile, the weight of the unchanged type is reduced, the sensitivity of the model to the change type is improved, and more accurate farmland change conditions can be obtained.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Referring to fig. 1, the present embodiment provides a device for detecting tillage change based on high-resolution remote sensing images of deep learning, including: the system comprises an image correction unit, an image drawing unit, a data processing unit, a model building unit, a communication unit and terminal equipment; the image correction unit, the image drawing unit, the data processing unit, the model building unit, the communication unit and the terminal equipment are connected in sequence.
The image correction unit is used for acquiring a high-resolution remote sensing image of the cultivated land, preprocessing the high-resolution remote sensing image and obtaining a corrected cultivated land image; the image drawing unit draws a label graph based on the cultivated land correction image; the data processing unit is used for carrying out segmentation processing on the farmland correction image and the label graph to obtain a segmentation data set; the model construction unit is used for performing convolution operation on the segmentation data set, extracting the characteristics of the segmentation data set, constructing a ResNeXt attU-Net model based on the characteristics, and acquiring the change result of the cultivated land based on the ResNeXt attU-Net model; the communication unit is used for transmitting the change result of the cultivated land to the terminal equipment; and the terminal equipment is used for storing and checking the change result of the cultivated land.
The image correction unit comprises an acquisition module and a correction module; the acquisition module, the correction module and the image drawing unit are sequentially connected; the acquisition module is used for acquiring a high-resolution remote sensing image of the cultivated land; and the correction module is used for preprocessing the high-resolution remote sensing image to obtain a farmland correction image.
The image drawing unit comprises an interpretation module and a delineation module; the correction module, the interpretation module, the delineation module and the data processing unit are connected in sequence; the interpretation module is used for loading and manually and visually interpreting the farmland correction image to obtain an interpretation image; the drawing module is used for drawing the image spots for interpreting the change of the intertillage land to obtain a label image.
The data processing unit comprises a segmentation module and a collection module; the correction module and the drawing module are both connected with the segmentation module; the segmentation module, the collection module and the model construction unit are connected in sequence; the segmentation module is used for carrying out segmentation processing on the farmland correction images and the label images to obtain a plurality of image segmentation images; the collection module is used for collecting all the image segmentation maps to obtain a segmentation data set.
The model building unit comprises a feature extraction module, an aggregation residual error module and a model building module; the set module, the feature extraction module, the residual error aggregation module and the model construction module are sequentially connected; the characteristic extraction module is used for carrying out convolution operation on the segmentation data set and extracting the characteristics of the segmentation data set; the aggregation residual module is used for carrying out aggregation residual processing on the characteristics of the segmentation data set; the model building module builds a ResNeXt attU-Net model based on the characteristics processed by the polymerization residual errors, and obtains the result of the farmland change based on the ResNeXt attU-Net model.
The communication unit comprises a first communication module and a second communication module; the first communication module is arranged in the model construction unit; the second communication module is arranged in the terminal equipment; the first communication module is used for transmitting the result of the farmland change; the second communication module is used for receiving the result of the farmland change. The first communication module and the second communication module are wirelessly connected through 2.4 g.
Referring to fig. 2 to 10, the embodiment provides a method for detecting farmland change based on high-resolution remote sensing images of deep learning, which comprises the following steps:
and S1, collecting the high-resolution remote sensing image of the cultivated land, and preprocessing the high-resolution remote sensing image to obtain a corrected cultivated land image.
In the imaging process of the satellite, due to different orbit positions, solar altitude angles and instantaneous field angles of the sensor at different moments, the obtained remote sensing image may have geometric distortion in position and cannot be directly used. Therefore, the first step in the remote sensing image interpretation is to pre-process the acquired image. The preprocessing generally comprises radiation correction, geometric correction, image enhancement and the like, and the influence on the change detection of the remote sensing image is weakened by preprocessing the image to eliminate 'pseudo change' caused by external factors.
The radiation correction is used for correcting or eliminating the phenomenon that when the sensor receives electromagnetic wave radiation energy emitted by an earth surface object, due to the influences of factors such as atmospheric action, illumination conditions and the like, a detection value received by the sensor is inconsistent with the spectral radiance actually emitted by the earth surface object, and the phenomenon of image gray level distortion, namely radiation error, is caused.
The radiation correction is further divided into absolute radiation correction and relative radiation correction. Wherein, the radiation correction adopts relative radiation correction, namely, one phase image in two phases of images is taken as a reference image, the other phase image is taken as an image to be corrected, and a regression analysis method is adopted to establish linear mapping y between the two phases of imagesiThe formula is as follows:
yi=ki*xi+bi
in the formula, yiThe radiation brightness value x of the pixel of the ith waveband after radiation correction of the image to be corrected in the later periodiThe pixel radiation brightness value k of the image to be corrected in the ith wave bandi、biThe slope and intercept of the linear regression equation of the ith wave band. Selecting pseudo-invariant feature points in the two-phase image by adopting an iterative weighted multivariate algorithm, selecting a threshold value and a weighted value after multiple iterations, calculating the pseudo-invariant feature points by adopting a least square method, and further solving a slope k in the formulaiAnd intercept bi。
The geometric errors of the image are caused by a series of factors such as the height of a sensor platform, the curvature of the earth, the change of air refraction, the change of terrain and the like. The geometric correction is a geometric deformation error generated by the characteristics of geometric position, shape size, space position and the like of the same ground object when a certain type of information in the two-phase images is projected to a reference system in a specified image. The method utilizes the control points to carry out geometric correction on the image, the number of the control points is related to the times of using a polynomial model for geometric correction, for an nth-order polynomial, (n +1) × (n +2)/2 control points are at least needed theoretically, and in the process of actually selecting the control points, the number of the control points is at least larger than the lowest theoretical value. The selection of control points mainly follows the following principles: (1) the control point should select characteristic points which are easy to distinguish, permanent and fine in images, such as house corners, road intersections, airports and the like; (2) the area with large characteristic change on the image should select some control points; (3) control points are selected in the image edge area to avoid the corrected image extrapolation; (4) the selection of control points should be evenly distributed over the image. In the embodiment of the present application, the first-stage image is a reference image, the second-stage image is an image to be corrected, and the geometric correction is performed by using a second-order polynomial model, which has the following formula:
in the formula, x
l、y
lIs pixel coordinate, x, of the corrected later-stage image
1And y
1Is the pixel coordinate of the previous image.
And
the coefficients of the second-order polynomial correction model are obtained by the least square method through artificially selected control points, wherein i is 0, 1, 2, 3, 4 and 5.
There are many methods for image enhancement in remote sensing images, such as color enhancement, radiation enhancement, etc., and the final results obtained by different methods are different. The embodiment of the application mainly aims at performing gray level stretching on the acquired two-phase image. The gray scale stretching is a simple and efficient linear image enhancement method. The piecewise linear gray stretching can restrain a low-frequency part in an image, improve the contrast and brightness of the high-frequency part, improve the visual effect of the image more obviously, and extract more useful information for a current task from the image when the image is visually interpreted. 2% linear stretching is carried out on two images adopted in the experiment, namely the pixel gray value of the image gray value between 2% and 98% is linearly stretched, the gray values smaller than 2% and larger than 98% are set as 0, so that part of abnormal values can be abandoned, and the pixel values in the residual range are stretched again to the gray value range of 0-255, and the formula is as follows:
in the formula, g (x, y) represents the processed image, f (x, y) represents the input image, and V represents the image pixel gradation value.
And S2, drawing a label graph based on the farmland correction image.
And respectively loading the two-stage images by using remote sensing image processing software, and drawing the pattern spots of the farmland change in the two-stage images in a manual visual interpretation mode to serve as training samples of the model.
And S3, carrying out segmentation processing on the farmland correction image and the label graph to obtain a segmentation data set.
And (4) dividing the processed two-stage images obtained in the S1 and the S2 and the label graph which is interpreted and sketched by human vision according to the same size, and dividing the divided images and the label graph into a training sample and a verification sample according to a certain proportion.
S4, performing convolution operation on the segmented data set, extracting the characteristics of the segmented data set, and constructing a ResNeXt attU-Net model based on the characteristics, wherein the ResNeXt attU-Net model is used for obtaining the change result of the cultivated land.
Firstly, a convolution operation in a deep learning framework pytore is called to extract features of an input image, and one convolution kernel can only extract one feature map and can not extract all different features of the whole image, so each convolution layer extracts different types of features by a plurality of different convolution kernels, wherein the low-layer convolution layer mainly extracts shallow features of the image, such as information of boundaries, contours and the like, and the high-layer convolution layer extracts high-level features of the image, such as geometric relations, spatial relations and the like of the image by superposing and integrating the information extracted by the low-layer convolution. Second, a pooling operation in the pytorech is invoked. Because the feature map of the input image after passing through the convolution layer has high dimensionality and contains some unimportant high-frequency information, if the high-dimensional feature maps are directly input into the next convolution layer, the calculated amount of the model is increased, the dimensionality is overhigh, and the phenomenon of overfitting occurs. Therefore, a method for performing aggregation processing on the convolved feature maps, that is, describing a large-area region by using a feature with a small dimension, is needed, and the method can reduce the dimension of the feature maps, well retain the main features of the feature maps, effectively reduce the number of parameters, and prevent the occurrence of an overfitting phenomenon. However, the convolution operation only performs linear transformation on the input image, and no matter how many hidden layers are overlapped in the neural network, the output result is a combination of linear transformation, and only a simple mapping relation can be expressed. When the method faces complex task scenes such as remote sensing images, the model expression capability of linear transformation is insufficient, and the generalization capability is very limited. Therefore, in order to improve the expression capability and generalization capability of the model, it is necessary to introduce an activation function to map the linear features extracted by the convolutional layer into nonlinear features, so as to enhance the generalization capability of the model.
Aiming at the phenomena of missing detection, error detection and the like of the U-Net model in the change detection of the high-resolution image, the invention improves the U-Net model. In the up-down sampling stage of the original U-Net model, a polymerization residual module is introduced, and the accuracy of the model is improved by deepening or widening the network in the traditional method, but the difficulty of network design and the calculation cost are increased along with the increase of the number of hyper-parameters. The ResNeXt structure can improve the accuracy rate on the premise of not increasing the complexity of parameters, and simultaneously reduces the number of the hyper-parameters. When ResNeXt processes feature graphs with the same size, convolution kernels with the same size and number are adopted, when the resolution length and width of the feature graphs are reduced by two times, the number of feature channels is doubled, each branch in the block adopts the same structure, the increase of the number of the feature channels can fully extract feature information of images, the feature extraction time is saved, and the detection precision is improved (as shown in figure 3). An attention module is added on a jump connection layer, the calculation burden of processing high-dimensional input data is reduced through an attention mechanism, the data dimensionality is reduced through a structured selection input subset, a task processing system is enabled to be more concentrated on finding an image change area, the weight of change area information is increased, meanwhile, the inhibition on non-change area characteristic information is achieved, noise and redundancy in input are ignored, and therefore the output quality is improved.
The ResNeXt AttU-Net model is similar to the U-Net model in structure and is composed of an encoder, a decoder and a jump connection. In the encoder part, the ResNeXt attU-Net model is composed of 4 convolutional layers and down-sampling layers, wherein the convolutional layers adopt the above-mentioned aggregation residual convolutional module to solve the problem of model degradation caused by deepening of the number of network layers, and meanwhile, the characteristic information of the image is extracted through multiple channels, so that the characteristic information of the image is fully utilized, and the change detection precision is improved. A jump connection incorporating an attention module is used between each layer of encoder and decoder for a total of 4 layers. The skip connection can splice the shallow features and the deep features in the wave band dimension, and the added attention module can increase the feature weight of the change information, so that the anti-noise capability of the model is improved.
The invention discloses the following technical effects:
(1) changing the convolution layer of the model in the up-sampling and down-sampling processes into a polymerization residual convolution layer, and changing single-channel extraction of a feature extraction channel into multi-channel extraction so that the network can fully learn the features of the image; the residual error module is introduced, so that the model can effectively train a deeper network structure, and the problems of model degradation and the like caused by network deepening are prevented;
(2) the invention changes the original jump connection of the U-Net model, introduces the attention mechanism in the jump connection process, the attention mechanism can adjust the weight of each component in the feature diagram, inhibits the learning of the features by reducing the weight of the feature diagram which is irrelevant to the task, and enhances the learning of the features by increasing the weight of the features which are relevant to the task. In the task of detecting the change of the high-resolution remote sensing image, the key point is to extract a change region from the images in two phases, so that the information weight of the change type is increased by introducing an attention mechanism, so that the model gravity learns the change region, meanwhile, the weight of the unchanged type is reduced, the sensitivity of the model to the change type is improved, and more accurate farmland change conditions can be obtained.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the present invention in its spirit and scope. Are intended to be covered by the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.