Disclosure of Invention
In view of the above problems with the prior art, the present invention provides a method, apparatus, electronic device, and storage medium for detecting airport pavement diseases.
In a first aspect, the present invention provides a method of airport pavement disease detection comprising:
Acquiring an airport pavement disease image to be detected;
Inputting the airport pavement disease image to be detected into a trained disease detection model to obtain extraction results of different types of disease corresponding areas in the airport pavement disease image to be detected;
the trained disease detection model is obtained by training different airport pavement disease images and semantic segmentation truth diagrams and semantic edge truth diagrams corresponding to the different airport pavement disease images.
Further, before inputting the airport pavement disease image to be detected into a trained disease detection model to obtain an extraction result of a disease corresponding region in the airport pavement disease image to be detected, the method further comprises the steps of:
Obtaining a disease training image, a semantic segmentation truth value diagram and a semantic edge truth value diagram;
performing wavelet transformation on the disease training image to obtain a low-frequency characteristic image;
Extracting image features of the disease training image by adopting a residual error network to obtain a semantic edge feature image;
coding the disease training image based on the U-Net network according to the low-frequency feature image and the semantic edge feature image to obtain a first feature image;
Decoding the first feature map according to the low-frequency feature map and the semantic edge feature map to obtain a semantic segmentation prediction map;
determining a first loss function according to the semantic segmentation truth diagram and the semantic segmentation prediction diagram;
And updating parameters of the disease detection model according to the first loss function to obtain a trained disease detection model.
Further, the obtaining the semantic segmentation truth-value diagram and the semantic edge truth-value diagram includes:
Extracting the outline of the disease in the disease training image to obtain image annotation information;
Determining a semantic segmentation truth value diagram according to the image annotation information;
and extracting semantic edges of the disease area based on the semantic segmentation truth-value diagram to obtain a semantic edge truth-value diagram.
Further, after the image feature extraction is performed on the disease training image by adopting a residual network to obtain a semantic edge feature image, the method further comprises the following steps:
obtaining a channel domain weight matrix of the semantic edge feature map by adopting an attention mechanism;
obtaining a semantic edge prediction graph according to the semantic edge feature graph and the channel domain weight matrix;
Determining a second loss function according to the semantic edge truth diagram and the semantic edge prediction diagram;
and updating parameters of the disease detection model according to the second loss function.
Further, after the obtaining the first feature map, before the decoding the first feature map according to the low-frequency feature map and the semantic edge feature map, the method further includes:
adopting an attention mechanism to obtain a spatial domain weight matrix of the first feature map;
and determining a second feature map according to the first feature map and the spatial domain weight matrix.
Further, the types of the diseases in the image of the airport pavement diseases to be detected are cracks, repairs, patches, ground lights and plate seams.
In a second aspect, the present invention provides an apparatus for detecting an airport pavement disease, comprising:
The acquisition module is used for acquiring an airport pavement disease image to be detected;
The processing module is used for inputting the airport pavement disease images to be detected into a trained disease detection model to obtain extraction results of different types of disease corresponding areas in the airport pavement disease images to be detected, wherein the trained disease detection model is obtained after training by using different airport pavement disease images and semantic segmentation truth diagrams and semantic edge truth diagrams corresponding to the different airport pavement disease images.
Further, the processing module is further configured to:
before inputting the airport pavement disease image to be detected into a trained disease detection model to obtain an extraction result of a disease corresponding region in the airport pavement disease image to be detected, obtaining a disease training image, a semantic segmentation truth-value diagram and a semantic edge truth-value diagram;
performing wavelet transformation on the disease training image to obtain a low-frequency characteristic image;
Extracting image features of the disease training image by adopting a residual error network to obtain a semantic edge feature image;
coding the disease training image based on the U-Net network according to the low-frequency feature image and the semantic edge feature image to obtain a first feature image;
Decoding the first feature map according to the low-frequency feature map and the semantic edge feature map to obtain a semantic segmentation prediction map;
determining a first loss function according to the semantic segmentation truth diagram and the semantic segmentation prediction diagram;
And updating parameters of the disease detection model according to the first loss function to obtain a trained disease detection model.
Further, the processing module is specifically configured to:
Extracting the outline of the disease in the disease training image to obtain image annotation information;
Determining a semantic segmentation truth value diagram according to the image annotation information;
and extracting semantic edges of the disease area based on the semantic segmentation truth-value diagram to obtain a semantic edge truth-value diagram.
Further, the processing module is further configured to:
obtaining a channel domain weight matrix of the semantic edge feature map by adopting an attention mechanism;
obtaining a semantic edge prediction graph according to the semantic edge feature graph and the channel domain weight matrix;
Determining a second loss function according to the semantic edge truth diagram and the semantic edge prediction diagram;
and updating parameters of the disease detection model according to the second loss function.
Further, the processing module is further configured to:
After the first feature map is obtained, before the first feature map is decoded according to the low-frequency feature map and the semantic edge feature map, a spatial domain weight matrix of the first feature map is obtained by adopting an attention mechanism;
and determining a second feature map according to the first feature map and the spatial domain weight matrix.
Further, the processing module is specifically configured to:
The types of diseases in the airport pavement disease image to be detected are cracks, repairs, patches, floor lamps and plate seams.
In a third aspect, the present invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of airfield pavement disease detection according to the first aspect when executing the computer program.
In a fourth aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which when executed by a processor implements the method of airport pavement disease detection according to the first aspect.
According to the technical scheme, the method, the device, the electronic equipment and the storage medium for detecting the airport pavement diseases, provided by the invention, realize pixel-level segmentation of various diseases in an airport pavement image through the disease detection model, and improve the segmentation precision.
Detailed Description
The following describes the embodiments of the present invention further with reference to the accompanying drawings. The following examples are only for more clearly illustrating the technical aspects of the present invention, and are not intended to limit the scope of the present invention.
The method for detecting the airport pavement diseases provided by the embodiment of the invention can be applied to a system architecture shown in fig. 1, wherein the system architecture comprises an image sensor 100 and a disease detection model 200.
Specifically, the image sensor 100 is used to acquire an image of an airport pavement disease to be detected.
The disease detection model 200 is used for obtaining an extraction result of a disease corresponding region in the airport pavement disease image to be detected after inputting the airport pavement disease image to be detected.
The trained disease detection model is obtained by training different airport pavement disease images and semantic segmentation truth diagrams and semantic edge truth diagrams corresponding to the different airport pavement disease images.
It should be noted that fig. 1 is only an example of a system architecture according to an embodiment of the present invention, and the present invention is not limited thereto in particular.
Based on the system architecture illustrated above, fig. 2 is a schematic flow diagram corresponding to a method for detecting an airport pavement disease according to an embodiment of the present invention, as shown in fig. 2, where the method includes:
step 201, an airport pavement image to be detected is acquired.
Specifically, an image of an airport pavement disease in a real environment is captured by an image sensor such as a visible light camera.
Step 202, inputting the airport pavement disease image to be detected into a trained disease detection model to obtain an extraction result of a disease corresponding region in the airport pavement disease image to be detected.
The trained disease detection model is obtained by training different airport pavement disease images and semantic segmentation truth diagrams and semantic edge truth diagrams corresponding to the different airport pavement disease images.
According to the scheme, pixel-level segmentation of various diseases in the airport pavement image is realized through the disease detection model, and the segmentation accuracy is improved.
Before step 202, the flow of the steps of the embodiment of the present invention is shown in fig. 3, which specifically includes the following steps:
step 301, obtaining a disease training image, a semantic segmentation truth-value diagram and a semantic edge truth-value diagram.
Specifically, extracting the outline of the disease in the disease training image to obtain image annotation information;
Determining a semantic segmentation truth value diagram according to the image annotation information;
And extracting semantic edges of the disease area based on the semantic segmentation truth value graph to obtain a semantic edge truth value graph.
In one possible implementation, the disease training image is manually marked by LabelMe to obtain a semantic segmentation truth-value diagram of the airport pavement disease image, and then the corresponding semantic edge truth-value diagram is extracted from the semantic segmentation truth-value diagram by Matlab.
In the embodiment of the invention, the types of diseases in the images of the airport pavement diseases to be detected are cracks, repairs, patches, ground lights and plate seams.
The scheme considers the common typical categories in the two airfield pavement of the ground lamp and the slab joint to better detect the airfield pavement besides the three diseases of crack, repair and patch, and provides more detailed information.
And 302, performing wavelet transformation on the disease training image to obtain a low-frequency characteristic image.
In one possible implementation, the disease training image is haar wavelet transformed.
Specifically, as shown in fig. 4, four-stage haar wavelet transform is performed on an input disease training image, and the low-frequency part generated by each stage of wavelet transform is used as effective frequency domain information and used as input of the next stage of wavelet transform, thereby obtaining LL1, LL2, LL3 and LL4.
According to the scheme, the noise of the disease training image under the complex background is reduced by extracting the multi-scale low-frequency information.
And 303, extracting image features of the disease training image by adopting a residual error network to obtain a semantic edge feature image.
In one possible implementation, the residual network ResNet is used to perform image feature extraction on the disease training image.
Further, a attention mechanism is adopted to obtain a channel domain weight matrix of the semantic edge feature map;
Obtaining a semantic edge prediction graph according to the semantic edge feature graph and the channel domain weight matrix;
determining a second loss function according to the semantic edge truth diagram and the semantic edge prediction diagram;
And updating parameters of the disease detection model according to the second loss function.
As shown in fig. 5, the outputs of the five parts of the residual network are feature maps c1, c2, c3, c4, c5 of different scales, respectively.
Specifically, the output result of the first branch is obtained by performing a convolution operation on c 5. And deconvoluting the four feature maps c1, c2, c3 and c5 to be the same size by the second branch, splicing the feature maps together, and finally outputting a rough semantic edge prediction result through convolution operation.
In one possible implementation, the semantic edge prediction graph is compared to a semantic edge truth graph to calculate weighted cross entropy loss and back-propagated.
In the embodiment of the present invention, a specific calculation formula of the second loss function is as follows:
Wherein M represents the number of categories, w c represents the weight of category c, y ic is a sign function, N is the number of samples, if the true category of sample i is equal to c, 1 is taken, otherwise 0;p ic represents the prediction probability that the observed sample i belongs to category c.
The scheme can accelerate the convergence of the network and reduce the influence of noise contained in c1, c2, c3 and c4 on the prediction branch corresponding to c 5.
The scheme relieves the problems of tiny semantic edges, small quantity and extremely unbalanced duty ratio of foreground and background in the data set.
Further, as shown in fig. 6, since the collected image disease edge has a small proportion and generally only occupies one pixel, in order to improve the prediction effect of the semantic edge, in the embodiment of the invention, a channel domain attention mechanism is added after the c5 predicts the branch, that is, a channel domain weight matrix of the feature map c5 is obtained through the global pooling layer and the full connection layer, and the output after the c5 is multiplied by the weight matrix is convolved to obtain the semantic edge segmentation result.
According to the scheme, based on the residual network, the bottom features of the residual network are fused, so that the semantic segmentation result is less influenced by noise of the bottom features. The addition of the attention mechanism enables the network to better capture the tiny edge characteristics, so that more accurate prediction results are obtained.
And step 304, coding the disease training image based on the U-Net network according to the low-frequency feature map and the semantic edge feature map to obtain a first feature map.
As shown in fig. 7, the coding part is composed of four convolution blocks, where c1, c2, c3, and c5 are semantic edge feature maps, and LL1, LL2, LL3, and LL4 are low-frequency feature maps.
It should be noted that each convolution operation halves the feature map edge length.
For example, the input picture size is 512×512, and the feature size after four convolution operations is 32×32.
And step 305, decoding the first feature map according to the low-frequency feature map and the semantic edge feature map to obtain a semantic segmentation prediction map.
Further, the decoding portion includes four deconvolution layers, each deconvolution operation doubles the edge length of the feature map, for example, the input feature map size is 64×64, and the feature map size after four deconvolution operations is 512×512.
Based on the image, the disease training image is subjected to a U-Net network to obtain pixel-level semantic segmentation prediction graphs with the same size.
Step 306, determining a first penalty function according to the semantic segmentation truth-value graph and the semantic segmentation prediction graph.
In one possible implementation, a weighted cross entropy loss is calculated.
And step 307, updating parameters of the disease detection model according to the first loss function to obtain a trained disease detection model.
According to the scheme, the wavelet transformation is adopted to extract the image low-frequency information, and the image low-frequency information is fused through the U-Net network, so that noise elimination is facilitated, and the precision of semantic segmentation is improved. The multi-scale frequency domain information features, the semantic edge features and the image encoder extraction features are fused based on the U-Net network, so that high-precision pixel level segmentation of various diseases in the airport pavement image is realized, and the precision of semantic segmentation results and the generalization performance of the model are improved.
Further, before step 305, the embodiment of the present invention obtains a spatial domain weight matrix of the first feature map by using an attention mechanism;
And determining a second feature map according to the first feature map and the spatial domain weight matrix.
Specifically, as shown in fig. 8, the coding part is immediately followed by a spatial domain attention mechanism, and a spatial domain weight matrix of the first feature map is obtained by using convolution operation, and the weighted feature map, namely the second feature map, is output after the first feature map is multiplied by the weight matrix.
According to the scheme, the attention mechanism is added between the encoder and the decoder to weight the fusion characteristics, so that the accuracy of the semantic segmentation result is improved.
Based on the same inventive concept, fig. 9 illustrates an apparatus for detecting an airfield pavement disease, which may be a flow of a method for detecting an airfield pavement disease according to an embodiment of the present invention.
The device comprises:
An acquisition module 901, configured to acquire an image of a disease of an airport pavement to be detected;
the processing module 902 is configured to input the to-be-detected airport pavement disease image to a trained disease detection model to obtain an extraction result of different types of disease corresponding areas in the to-be-detected airport pavement disease image, where the trained disease detection model is obtained by training with different airport pavement disease images and semantic segmentation truth diagrams and semantic edge truth diagrams corresponding to the different airport pavement disease images.
Further, the processing module 902 is further configured to:
before inputting the airport pavement disease image to be detected into a trained disease detection model to obtain an extraction result of a disease corresponding region in the airport pavement disease image to be detected, obtaining a disease training image, a semantic segmentation truth-value diagram and a semantic edge truth-value diagram;
performing wavelet transformation on the disease training image to obtain a low-frequency characteristic image;
Extracting image features of the disease training image by adopting a residual error network to obtain a semantic edge feature image;
coding the disease training image based on the U-Net network according to the low-frequency feature image and the semantic edge feature image to obtain a first feature image;
Decoding the first feature map according to the low-frequency feature map and the semantic edge feature map to obtain a semantic segmentation prediction map;
determining a first loss function according to the semantic segmentation truth diagram and the semantic segmentation prediction diagram;
And updating parameters of the disease detection model according to the first loss function to obtain a trained disease detection model.
Further, the processing module 902 is specifically configured to:
Extracting the outline of the disease in the disease training image to obtain image annotation information;
Determining a semantic segmentation truth value diagram according to the image annotation information;
and extracting semantic edges of the disease area based on the semantic segmentation truth-value diagram to obtain a semantic edge truth-value diagram.
Further, the processing module 902 is further configured to:
After the residual error network is adopted to extract image features of the disease training image to obtain a semantic edge feature image, a attention mechanism is adopted to obtain a channel domain weight matrix of the semantic edge feature image;
obtaining a semantic edge prediction graph according to the semantic edge feature graph and the channel domain weight matrix;
Determining a second loss function according to the semantic edge truth diagram and the semantic edge prediction diagram;
and updating parameters of the disease detection model according to the second loss function.
Further, the processing module 902 is further configured to:
After the first feature map is obtained, before the first feature map is decoded according to the low-frequency feature map and the semantic edge feature map, a spatial domain weight matrix of the first feature map is obtained by adopting an attention mechanism;
and determining a second feature map according to the first feature map and the spatial domain weight matrix.
Further, the processing module 902 is specifically configured to:
The types of diseases in the airport pavement disease image to be detected are cracks, repairs, patches, floor lamps and plate seams.
Based on the same inventive concept, a further embodiment of the invention provides an electronic device, see fig. 10, comprising in particular a processor 1001, a memory 1002, a communication interface 1003 and a communication bus 1004;
The processor 1001, the memory 1002 and the communication interface 1003 complete communication with each other through the communication bus 1004, wherein the communication interface 1003 is used for realizing information transmission between all devices;
The processor 1001 is configured to invoke a computer program in the memory 1002, and when the processor executes the computer program, all steps of the method for detecting an airport pavement disease are implemented, for example, when the processor executes the computer program, the steps are implemented to obtain an airport pavement disease image to be detected, input the airport pavement disease image to a trained disease detection model to obtain an extraction result of a region corresponding to the disease in the airport pavement disease image to be detected, where the trained disease detection model is obtained after training by using different airport pavement disease images and semantic segmentation truth diagrams and semantic edge truth diagrams corresponding to the different airport pavement disease images.
Based on the same inventive concept, a further embodiment of the present invention provides a non-transitory computer readable storage medium, on which a computer program is stored, which when executed by a processor implements all the steps of the above-mentioned method for detecting airfield pavement diseases, for example, the processor implements the steps of obtaining an airfield pavement disease image to be detected, inputting the airfield pavement disease image to a trained disease detection model to obtain an extraction result of a disease corresponding region in the airfield pavement disease image to be detected, wherein the trained disease detection model is obtained after training by using different airfield pavement disease images and semantic segmentation truth diagrams and semantic edge truth diagrams corresponding to the different airfield pavement disease images.
Further, the logic instructions in the memory described above may be implemented in the form of software functional units and stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in the form of a software product stored in a storage medium, comprising instructions for causing a computer device (which may be a personal computer, means for detecting an airport pavement disease, or network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. The storage medium includes a U disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, an optical disk, or other various media capable of storing program codes.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules can be selected according to actual needs to achieve the purpose of the embodiment of the invention. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the above technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., comprising several instructions for causing a computer device (which may be a personal computer, an apparatus for detecting airport pavement diseases, or a network device, etc.) to perform the method for detecting airport pavement diseases according to the embodiments or some parts of the embodiments.
Furthermore, in the present disclosure, such as "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present invention, the meaning of "plurality" means at least two, for example, two, three, etc., unless specifically defined otherwise.
Moreover, in the present invention, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
Furthermore, in the description herein, reference to the terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
It should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention, and not for limiting the same, and although the present invention has been described in detail with reference to the above-mentioned embodiments, it should be understood by those skilled in the art that the technical solution described in the above-mentioned embodiments may be modified or some technical features may be equivalently replaced, and these modifications or substitutions do not make the essence of the corresponding technical solution deviate from the spirit and scope of the technical solution of the embodiments of the present invention.