Road abnormal condition detection method and system
By using a combination of anomaly detection models and fine-grained classification models in road anomaly detection, and using deformable convolutional residual modules and direct feature pyramid networks for feature extraction and fusion, irregular target shapes in road anomaly detection are solved. and complex background problems, achieving efficient detection of various abnormal conditions and accurate classification of tiny foreign materials.
Patent Information
- Application Number
- CN202410699891.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-05-31
AI Technical Summary
It is difficult for the existing technology to effectively detect various anomalies of different sizes in road abnormality detection. Especially in daily inspections, the target shape is irregular, the background is complex, and the data sources are diverse, resulting in poor detection results and the inability to effectively distinguish between small and small ones. Foreign material.
A road anomaly detection method is proposed, which uses an anomaly detection model to extract multi-scale features through a deformable convolution residual module and a coordinate attention mechanism, and performs adaptive spatial feature fusion through a direct feature pyramid network, combined with a fine-grained classification model Feature extraction is enhanced through attention cropping and discarding operations to achieve effective detection of irregular targets and tiny foreign objects.
It improves the detection accuracy and classification performance of irregular targets and tiny foreign objects, and can effectively capture multi-scale feature information in complex backgrounds, reduce useless information interference, enhance the expression of key information, and achieve better multi-scale feature fusion effects.
Smart Images

Figure CN118570639A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a method and system for detecting abnormal road conditions. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] Road inspection work includes daily inspection and key inspection. Daily inspection mainly detects abnormal situations such as occupying the road for business, foreign objects on the road surface, road diseases, etc. Key inspection mainly detects tiny foreign objects on the road surface and classifies their materials.
[0004] At present, due to the following difficulties in the process of detecting road abnormalities, the existing models cannot achieve good detection effects in inspection tasks. In daily inspections, there will be various types and sizes of abnormalities, which are difficult to detect effectively. In key inspections, there will be problems such as being unable to effectively distinguish the materials of tiny foreign objects.
[0005] The specific difficulties are:
[0006] (1) The shape of road anomalies is irregular, and the length-to-width ratios of different types of anomalies vary greatly;
[0007] (2) There is no fixed scene in road inspection. All images are captured dynamically, and the image background is complex and changeable, with a lot of noise interference;
[0008] (3) The data sources of road inspection include inspection vehicle photography, drone photography, surveillance photography, and manual photography. The images captured by different photography methods have different perspectives and sizes.
[0009] In addition, due to the diverse data sources and shooting angles of road inspections, the road anomaly targets are distributed in various sizes. The shallow features of the image contain more detailed information such as color, texture, edge, and angle, while the deep features of the image contain more abstract semantic information. The shallow features have a smaller receptive field, pay more attention to detailed information, and are more suitable for the detection of small-sized targets, while the deep abstract features have a larger receptive field and are more suitable for the detection of large-sized targets. Traditional feature fusion methods cannot effectively integrate the feature information of each scale, which may cause the loss of detailed information of large-sized targets or the loss of small-sized targets. Summary of the invention
[0010] In order to solve the above problems, the present invention proposes a road abnormality detection method and system, proposes an anomaly detection model, and on this basis improves the classification performance of the anomaly detection model by adaptively opening a fine-grained classification module, so as to solve the problem that the types and sizes of abnormal situations in daily inspections are diverse and difficult to detect effectively, and the problem that the materials of tiny foreign objects cannot be effectively distinguished in key inspections.
[0011] In order to achieve the above object, the present invention adopts the following technical solution:
[0012] In a first aspect, the present invention provides a method for detecting abnormal road conditions, comprising:
[0013] Acquire a road image to be processed;
[0014] The anomaly detection model is used to detect the road image to be processed to obtain the initial detection target;
[0015] Among them, the anomaly detection model includes: extracting multi-scale feature maps from the processed road image, using a deformable convolution residual module to extract features from the last layer of feature maps, and concatenating the extracted features with the original feature maps and obtaining the maximum scale feature map after coordinate attention processing, and performing adaptive spatial feature fusion operations on the intermediate scale feature maps and the maximum scale feature maps to perform target detection;
[0016] An initial detection target image is cropped from the road image to be processed, and the initial detection target image is classified using a fine-grained classification model to obtain a final anomaly detection target;
[0017] Among them, the fine-grained classification model includes: enhancing the initial detection target image under the guidance of attention and extracting the enhanced feature map and the attention map, and classifying them after fusing the enhanced feature map and the attention map; the attention guidance is to obtain the key area image by the attention cropping operation on the attention map and the discarded area image by the attention discarding operation, and the enhancement operation is guided based on the key area image and the discarded area image.
[0018] As an optional implementation method, the process of obtaining the maximum-scale feature map includes: a deformable convolution residual module is composed of two deformable convolution residual connections, the last layer of feature map is subjected to feature extraction by n deformable convolution residual modules, and then the feature map is spliced with the original feature map to obtain a complete feature map, and the complete feature map is subjected to coordinate attention processing to obtain the maximum-scale feature map.
[0019] As an optional implementation, the process of performing an adaptive spatial feature fusion operation on the intermediate-scale feature map and the maximum-scale feature map includes:
[0020] The multi-scale feature maps extracted from the road image to be processed include feature map C1, feature map C2, feature map C3, feature map C4 and feature map C5;
[0021] For the intermediate-scale feature maps C3 and C4, feature scaling is performed through linear interpolation upsampling and convolution downsampling. After scaling to a uniform size, an adaptive spatial feature fusion operation is performed.
[0022] The fusion result of the maximum scale feature map, feature map C3 and feature map C4 is subjected to feature scaling and adaptive spatial feature fusion operations to obtain the final fusion result for target detection.
[0023] As an optional implementation, the attention cropping operation includes: normalizing the attention map to between 0 and 1, selecting attention maps with a high attention degree exceeding a set threshold, cutting out the corresponding part of the initial detection target image under the guidance of the selected attention map, and scaling it to the same size as the initial detection target image, thereby obtaining a key area image.
[0024] As an optional implementation, the attention discarding operation includes: normalizing the attention map to between 0 and 1, selecting an attention map with an attention degree exceeding a set threshold, covering the corresponding part of the initial detection target image with a mask under the guidance of the selected attention map, discarding the feature information of the corresponding area, and thereby obtaining a discarded area image.
[0025] As an optional implementation, a multi-scale feature map is extracted from the enhanced initial detection target image, including feature map C1, feature map C2, feature map C3, feature map C4 and feature map C5. Feature map C2, feature map C3, feature map C4 and feature map C5 are processed by a feature pyramid structure to obtain feature map P2, feature map P3, feature map P4 and feature map P5. Each layer of feature map is then subjected to a global average pooling operation for feature splicing to obtain an enhanced feature map.
[0026] As an optional implementation, when extracting multi-scale feature maps, a coordinate attention mechanism is added to the last layer to aggregate global spatial features and channel features.
[0027] In a second aspect, the present invention provides a road abnormality detection system, comprising:
[0028] A data acquisition module is configured to acquire a road image to be processed;
[0029] The target detection module is configured to detect the road image to be processed using an anomaly detection model to obtain an initial detection target;
[0030] Among them, the anomaly detection model includes: extracting multi-scale feature maps from the processed road image, using a deformable convolution residual module to extract features from the last layer of feature maps, and concatenating the extracted features with the original feature maps and obtaining the maximum scale feature map after coordinate attention processing, and performing adaptive spatial feature fusion operations on the intermediate scale feature maps and the maximum scale feature maps to perform target detection;
[0031] A fine-grained classification module is configured to crop an initial detection target image from the road image to be processed, classify the initial detection target image using a fine-grained classification model, and obtain a final anomaly detection target;
[0032] Among them, the fine-grained classification model includes: enhancing the initial detection target image under the guidance of attention and extracting the enhanced feature map and the attention map, and classifying them after fusing the enhanced feature map and the attention map; the attention guidance is to obtain the key area image by the attention cropping operation on the attention map and the discarded area image by the attention discarding operation, and the enhancement operation is guided based on the key area image and the discarded area image.
[0033] In a third aspect, the present invention provides an electronic device comprising a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method described in the first aspect is performed.
[0034] In a fourth aspect, the present invention provides a computer-readable storage medium for storing computer instructions, wherein when the computer instructions are executed by a processor, the method described in the first aspect is performed.
[0035] In a fifth aspect, the present invention provides a computer program product, comprising a computer program, which, when executed by a processor, implements the method described in the first aspect.
[0036] Compared with the prior art, the present invention has the following beneficial effects:
[0037] In view of the problem that abnormal situations in daily inspections are of various types and sizes and difficult to detect effectively, this paper proposes an anomaly detection model (Road Anomaly Detection Network, RADNet). First, a deformable feature extraction module (Deformable Feature Extraction Module, DFE) is proposed to enhance the model's feature extraction ability for irregular targets; secondly, coordinate attention (Coordinate Attention, CA) is introduced into the backbone network to improve the model's feature learning ability; finally, a directly connected feature pyramid network (Directly Connected Feature Pyramid Network, DCFPN) is proposed to optimize the model's multi-scale feature fusion effect through cross-layer feature adaptive fusion, so that the model can capture all effective information.
[0038] The direct-connected feature pyramid network DCFPN reduces the semantic gap between non-adjacent layers by directly fusing each feature layer, so that deep features can fuse shallow detail information, and shallow features can also fuse deep semantic information, thereby greatly enriching the information flow of the network. In addition, the adaptive fusion operation suppresses useless information from different layers, enhances the expression of key information, and achieves better multi-scale feature fusion effects.
[0039] In order to solve the problem that tiny foreign materials cannot be effectively distinguished in key inspections, the present invention proposes the RADNet-FG algorithm based on the RADNet algorithm, and improves the classification performance of RADNet by adaptively opening the fine-grained material classification module (Fine Grained Module, FG). First, a data enhancement module is constructed to enhance the original image under the guidance of attention through attention cropping and attention discarding; secondly, a feature learning module is constructed to extract feature maps through the backbone network ResNet-FPN-CA; finally, the feature map and the attention map are fused through the bilinear attention pooling mechanism to generate fused features, and fine-grained classification is performed based on the fused features to realize the detection of road anomalies in daily inspections and key inspections.
[0040] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0042] Figure 1A RADNet structure diagram provided in Example 1 of the present invention;
[0043] Figure 2 A structural diagram of a DFE module provided in Embodiment 1 of the present invention;
[0044] Figure 3 A CA module structure diagram provided in Example 1 of the present invention;
[0045] Figure 4 A DCFPN structure diagram provided in Example 1 of the present invention;
[0046] Figure 5 A diagram of the RADNet-FG structure provided in Example 1 of the present invention;
[0047] Figure 6 A diagram of the fine-grained classification model architecture provided in Example 1 of the present invention;
[0048] Figure 7 A diagram of the data enhancement process under attention guidance provided in Example 1 of the present invention;
[0049] Figure 8 A diagram of the ResNet-50 network structure provided in Example 1 of the present invention;
[0050] Fig. 9 The FPN-ResNet-50 network structure diagram provided in Example 1 of the present invention;
[0051] Fig.10 A diagram of the FPN-ResNet-50 network structure with an added attention mechanism provided in Example 1 of the present invention;
[0052] Figure 11 (a)-(c) is a comparison of the detection results of RADNet and YOLOv8 provided in Example 1 of the present invention;
[0053] Figure 12 (a)-(c) is a second comparison of the detection results of RADNet and YOLOv8 provided in Example 1 of the present invention;
[0054] Figure 13 (a)-(c) is a comparison of the detection results of RADNet and YOLOv8 provided in Example 1 of the present invention;
[0055] Figure 14 (a)-(c) is a comparison of the detection results of RADNet-FG and RADNet provided in Example 1 of the present invention;
[0056] Figure 15(a)-(c) is a second comparison of the RADNet-FG and RADNet detection results provided in Example 1 of the present invention. DETAILED DESCRIPTION
[0057] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0058] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0059] It should be noted that the terms used herein are only for describing specific embodiments, and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that the terms "include" and "comprise" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0060] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.
[0061] Example 1
[0062] This embodiment provides a method for detecting abnormal road conditions, including:
[0063] Acquire a road image to be processed;
[0064] The anomaly detection model is used to detect the road image to be processed to obtain the initial detection target;
[0065] Among them, the anomaly detection model includes: extracting multi-scale feature maps from the processed road image, using a deformable convolution residual module to extract features from the last layer of feature maps, and concatenating the extracted features with the original feature maps and obtaining the maximum scale feature map after coordinate attention processing, and performing adaptive spatial feature fusion operations on the intermediate scale feature maps and the maximum scale feature maps to perform target detection;
[0066] An initial detection target image is cropped from the road image to be processed, and the initial detection target image is classified using a fine-grained classification model to obtain a final anomaly detection target;
[0067] Among them, the fine-grained classification model includes: enhancing the initial detection target image under the guidance of attention and extracting the enhanced feature map and the attention map, and classifying them after fusing the enhanced feature map and the attention map; the attention guidance is to obtain the key area image by the attention cropping operation on the attention map and the discarded area image by the attention discarding operation, and the enhancement operation is guided based on the key area image and the discarded area image.
[0068] The original YOLOv8s model cannot achieve good detection results in inspection tasks because there are three difficulties in detecting road anomalies:
[0069] (1) The shape of road anomaly targets is irregular, and the length-to-width ratios of different types of anomalies vary greatly, so it is necessary to accurately extract the features of road anomaly targets;
[0070] (2) There is no fixed scene for road inspection. All images are captured dynamically. The image background is complex and changeable, with a lot of noise interference. It is necessary to accurately detect road abnormalities in a complex background.
[0071] (3) The data sources for road inspections include inspection vehicle photography, drone photography, surveillance photography, and manual photography. The images taken by different photography methods have different perspectives and sizes, and it is necessary to detect road abnormality targets of different scales.
[0072] In view of the above problems, considering the accuracy and real-time performance of road inspection, this embodiment takes YOLOv8s as the benchmark network, improves it on the basis of YOLOv8s, and proposes a road anomaly detection model RADNet (Road Anomaly Detection Network), such as Figure 1 As shown in the figure. First, a deformable feature extraction module (DFE) is proposed to enhance the feature extraction capability of the model; secondly, a coordinate attention module (CA) is introduced into the backbone network to improve the feature learning capability of the model; finally, a directly connected feature pyramid network (DCFPN) is proposed to enhance the multi-scale feature fusion capability of the model.
[0073] The following is an introduction to the three improvements.
[0074] (1) Deformable Feature Extraction Module (DFE)
[0075] like Figure 2 As shown in the figure, the DFE module can adaptively adjust the receptive field of the model to make it more closely fit the target area, effectively enhancing the feature extraction capability for irregular targets.
[0076] Specifically, the input feature map is first split into two gradient flows through an ordinary convolution. The upper part passes through n deformable convolution residual modules (DCN Block) for deep feature extraction, and the lower part retains the original feature information. Finally, the deep features extracted by n deformable convolution residual modules (DCN Block) are concatenated with the original feature map to obtain a complete feature map. At this time, the feature map contains rich contextual information.
[0077] Among them, the deformable convolution residual module (DCNBlock) is the core component of the DFE module, which is composed of two deformable convolution DCNv2 residual connections. Deformable convolution Network (DCN) adds an offset to each sampling point of the convolution kernel on the basis of ordinary convolution, so that the shape of the convolution kernel is no longer a fixed rectangle, but can be automatically adjusted as needed to fit targets of different shapes. In actual applications, the area extracted by the deformable convolution may exceed the target area, which will bring irrelevant noise information. To solve this problem, DCNv2 adds a weight coefficient to each sampling point, focusing only on useful information and removing noise interference.
[0078] (2) Coordinate Attention Mechanism CA
[0079] The road inspection background is complex and changeable. During the inspection, it is necessary to overcome the interference of background noise and accurately detect road anomalies. In order to improve the feature learning ability of the detection model, this embodiment introduces coordinate attention (CA) in the backbone network. By weighting the features of the two dimensions of space and channel, the model pays more attention to the area of interest, extracts useful information, and suppresses useless information.
[0080] like Figure 3 As shown in the figure, coordinate attention CA is a hybrid attention. First, through two one-dimensional feature encoding processes, the complete feature map output by the DFE module is aggregated in the horizontal and vertical directions to capture long-range dependencies and precise position information. Then, the spatial information is embedded in the channel attention to realize the extraction of key information in two dimensions of channel and position, thereby obtaining the maximum scale feature map.
[0081] (3) Direct Feature Pyramid Network DCFPN
[0082] Road inspection data comes from various sources and shooting angles, and the road anomaly targets are distributed in various sizes. The shallow features of the image contain more detailed information such as color, texture, edge, and corners, while the deep features of the image contain more abstract semantic information. Shallow features have a smaller receptive field, pay more attention to detailed information, and are more suitable for the detection of small-sized targets. Deep abstract features have a larger receptive field and are more suitable for the detection of large-sized targets. Traditional feature fusion methods cannot effectively integrate the feature information of each scale, which may cause the loss of detailed information of large-sized targets or the loss of small-sized targets.
[0083] In order to improve the multi-scale feature fusion capability of the detection model, this embodiment proposes a directly connected feature pyramid network (DCFPN), which enables the model to capture all effective information by directly fusing the multi-scale features of the backbone network.
[0084] The structure of the direct feature pyramid network DCFPN is as follows Figure 4 As shown in Figure 1, the feature information of each layer of the neck network is directly fused through the adaptive spatial feature fusion operation ASFF. The feature fusion operation is divided into feature scaling and adaptive fusion.
[0085] Specifically:
[0086] In the backbone network, multi-scale feature maps are extracted from the input road image to be processed, including feature maps C1, C2, C3, C4 and C5. The last layer of feature map C5 is processed by DFE module and coordinate attention CA to obtain the maximum scale feature map.
[0087] Then, the intermediate-scale feature maps C3 and C4 extracted by the backbone network are scaled, and the feature maps from different layers are scaled to a uniform size through linear interpolation upsampling and convolution downsampling, and then sent to the ASFF module for adaptive fusion;
[0088] The ASFF adaptive fusion process is shown in formula (1). It filters out interference information by spatially weighting features on different feature layers, realizes adaptive feature fusion in the spatial dimension, suppresses useless information from different feature layers, and enhances the expression of useful information.
[0089]
[0090] in, Represents the feature vector of the n-th layer feature and the l-th layer feature map at position (i, j), and β ij l is the trained spatial weight coefficient, is the fusion result.
[0091] Finally, the ASFF adaptive fusion process is repeated on the maximum scale feature map and the fusion results of feature map C3 and feature map C4 to obtain the final fusion result, which is used for target detection to obtain the initial detection target.
[0092] Compared with FPN, DCFPN reduces the semantic gap between non-adjacent layers by directly fusing each feature layer, so that deep features can fuse shallow detail information, and shallow features can also fuse deep semantic information, thereby greatly enriching the information flow of the network. In addition, DCFPN suppresses useless information from different layers through the ASFF adaptive fusion operation, enhances the expression of key information, and achieves better multi-scale feature fusion effect.
[0093] Since there are tiny foreign objects such as screws and rubber rods on some roads, which seriously threaten road driving safety, it is necessary to conduct regular key inspections, focusing on detecting tiny foreign objects and classifying and recording the materials of foreign objects. General target detection algorithms focus on the coarse-grained recognition of medium and large-sized targets. It is difficult to solve the above problems by relying solely on general target detection algorithms. Therefore, this embodiment proposes a fine-grained classification model FG (Fine Grained Module). If the initial detection target obtained by the anomaly detection model is lower than the confidence level, the fine-grained classification model FG will continue to be used for classification. On the basis of the excellent positioning ability of the RADNet algorithm, the fine-grained classification ability is enhanced to form an enhanced algorithm RADNet-FG, such as Figure 5 As shown, Figure 5 The RADNet network in Figure 1 As shown, the FG module is Figure 6 shown.
[0094] In RADNet-FG, first, a data enhancement module of the FG model is constructed to enhance the original image under the guidance of attention through attention cropping and attention discarding; secondly, a feature learning module of the FG model is constructed to extract enhanced feature maps through the backbone network ResNet-FPN-CA; finally, the enhanced feature map and the attention map are fused through the bilinear attention pooling mechanism to generate fused features, and fine-grained classification is performed based on the fused features.
[0095] The visual similarity between different categories of targets in fine-grained classification tasks is relatively large. Compared with ordinary classification tasks, it takes more time to produce fine-grained classification datasets. Therefore, extracting more feature information from limited data is the key to improving the effect of fine-grained classification. This embodiment proposes a fine-grained classification model FG, which can expand the original dataset through attention guidance, such as Figure 6As shown in the figure, it consists of two parts, namely the data enhancement module and the feature learning module. The following is a detailed introduction to these two parts.
[0096] (1) Data enhancement module.
[0097] Ordinary data enhancement methods may introduce uncontrollable noise interference and are not suitable for fine-grained classification tasks. To address this problem, this embodiment introduces an attention-guided data enhancement module, which can enhance target detail features in a targeted manner.
[0098] Figure 7 The data enhancement process under the guidance of attention is shown. The initial detection target image is first sent to the backbone network for feature extraction to obtain the feature map of the detection target. Then, the feature map is subjected to 1×1 convolution and batch normalization operations to obtain M reduced-dimensional attention maps (M is 32 by default), where each attention map corresponds to a detail feature of the target. At this time, the attention map obtained still contains a lot of invalid information and interference information, so it is necessary to further perform attention enhancement operations on the attention map.
[0099] This embodiment mainly uses two attention enhancement methods: attention cropping and attention discarding. In order to amplify important detail features, the generated attention map is firstly subjected to attention cropping. The process of attention cropping is as follows: firstly, the attention map is normalized to between 0 and 1, and then the attention map with high attention is selected according to the set threshold. Finally, under the guidance of the selected attention map, the corresponding part of the original initial detection target image is intercepted and scaled to the same size as the original initial detection target image. The key area image obtained after processing is used as the augmented data for training.
[0100] However, if only the attention cropping operation is performed, the network will pay too much attention to the information of the key areas and ignore the feature information of other areas. Therefore, the attention discarding operation is performed after the attention cropping to enhance the network's attention to non-key areas. The process of attention discarding is: first normalize the attention map to between 0 and 1, then select the attention map of the key area according to the set threshold, and finally cover the corresponding part of the original initial detection target image with a mask under the guidance of the selected attention map, discard the feature information of the corresponding area, and the discarded area image obtained after processing is used as the augmented data for training.
[0101] (2) Feature learning module.
[0102] The feature learning module is mainly composed of the backbone network, which is responsible for extracting image features. The quality of the backbone network directly affects the performance of the final classification model. Therefore, this embodiment selects the ResNet-50 with excellent performance as the backbone network, and improves it on the basis of ResNet-50, adding the CA attention mechanism and FPN structure to make it more suitable for small target fine-grained classification tasks.
[0103] With the development of deep learning, the number of network layers has gradually increased. However, an overly deep network structure will lead to the problem of random gradient disappearance. In order to solve this problem, residual units came into being. Residual units add cross-layer connections based on deep network transmission. The input can be directly transmitted across layers and added to the results of layer-by-layer convolution.
[0104] ResNet-50 is a deep residual network built based on residual units. It consists of 49 convolutional layers and one fully connected layer. The network structure is as follows: Figure 8 As shown in the figure, the convolutional layers can be divided into 5 groups, namely C1, C2, C3, C4, and C5. The first group C1 consists of 7×7 convolution, batch normalization module BN, activation function ReLU, and maximum pooling module. The second, third, fourth, and fifth parts have similar structures, consisting of residual units, 1×1 convolution, 3×3 convolution, and maximum pooling modules.
[0105] Therefore, ResNet-50 is used as the backbone network to extract the enhanced multi-scale feature maps of the initial detection target image, including feature map C1, feature map C2, feature map C3, feature map C4 and feature map C5;
[0106] Convolutional layers of different depths extract different feature information. Deep features contain more semantic information, while shallow features contain more positioning information. If only deep features are used, shallow detail features will be ignored. At the same time, multiple convolution downsampling will continuously reduce the image resolution, resulting in the problem of feature information loss.
[0107] In order to effectively utilize deep semantic information and shallow positioning information and solve the problem of feature information weakening caused by multiple downsampling of convolutional neural networks, this embodiment adds a feature pyramid FPN (Feature Pyramid Network) structure based on the backbone network ResNet-50 to form the FPN-ResNet-50 backbone network structure. The improved backbone network is as follows Fig. 9As shown in the figure, the feature maps C2, C3, C4 and C5 extracted by the backbone network ResNet-50 are fused into four layers of features, namely, feature maps P2, P3, P4 and P5, through the FPN structure. Each layer of features is then subjected to the global average pooling operation for feature splicing. The enhanced feature maps obtained after splicing are used by the bilinear attention pooling module and the data enhancement module. The enhanced feature maps and the attention maps are fused for fine-grained classification.
[0108] At the same time, in order to further enhance the feature extraction capability of the backbone network, this embodiment adds a coordinate attention module CA (Coordinate Attention) to the last layer of the backbone network. Fig.10 As shown in Figure 3, the CA module can aggregate global spatial features and channel features, so that the generated feature map C5 comprehensively considers global detail information.
[0109] The above method of this embodiment can realize the detection of abnormal road conditions in daily inspections and key inspections. Experiments on a large number of data sets show that the above method of this embodiment has achieved good results.
[0110] 1.RADNet algorithm.
[0111] (1) Ablation experiment results.
[0112] Table 1 shows the statistical results of the ablation experiments, where √ indicates that relevant methods have been added to the model.
[0113] Table 1 Ablation experiment results
[0114]
[0115] It can be seen that the deformable feature extraction module (DFE) has a strong feature extraction capability and improves the detection effect. After the introduction of the DFE module, the model precision, recall rate, and mAP are improved by 1.8%, 0.6%, and 0.6% respectively compared with the baseline network YOLOv8. The coordinate attention module (CA) can enhance the model's attention to foreground targets and suppress background noise interference. After the introduction of the CA module, the model precision, recall rate, and mAP are improved by 1.7%, 1.5%, and 1.8% respectively compared with the baseline network YOLOv8. The direct feature pyramid network (DCFPN) can enhance the model's feature fusion capability. After the introduction of the DCFPN network, the model precision, recall rate, and mAP are improved by 0.2%, 2.6%, and 0.2% respectively compared with the baseline network YOLOv8. The Focaler-IOU loss function can improve the problem of uneven sample distribution. After introducing the Focaler-IOU loss function, the model precision, recall rate, and mAP are improved by 1.4%, 1.4%, and 1.6% respectively compared with the baseline network YOLOv8.
[0116] (2) Visualization of experimental results.
[0117] The detection effects of the RADNet algorithm and the baseline network YOLOv8 algorithm are visually compared to intuitively show the superiority of the improved algorithm. The comparison results are shown in Figures 11-13, where (a) is the original image, (b) is the YOLOv8 detection result, and (c) is the RADNet detection result. As shown in Figures 11(a)-(c), YOLOv8 misdetects the road sign line in the background as a foreign object on the road, while RADNet does not misdetect it. The reason for the analysis is that the coordinate attention module in RADNet suppresses noise information, enhances the feature learning ability of the model, and improves the false detection phenomenon. As shown in Figures 12(a)-(c), YOLOv8 does not detect the banner target and the foreign object target on the road, while RADNet correctly detects the target. The reason for the analysis is that the direct feature pyramid module in RADNet enhances the multi-scale information fusion ability of the model, enhances the feature expression of the target information, and improves the missed detection phenomenon. As shown in Figures 13(a)-(c), compared with YOLOv8, the target box located by RADNet fits the target shape better. The reason for this is that the deformable feature extraction module in RADNet adjusts the distribution of convolution kernels, which enhances the model's ability to extract features of targets with specific shapes and improves positioning accuracy. In short, the combined use of the three improvements enables RADNet to have stronger feature extraction and fusion capabilities, and can accurately detect targets with abnormal road conditions.
[0118] 2.RADNet-FG algorithm.
[0119] (1) Comparative experimental results.
[0120] Table 2 shows the experimental results of the RADNet-FG algorithm, the RADNet algorithm, and the YOLOv8 algorithm on the TPFOD road image dataset. It can be seen that after the introduction of fine-grained classification processing, the ability of RADNet-FG to detect small foreign materials on the road has been greatly improved, with the model accuracy reaching 95.6%, the recall rate reaching 48.3%, and the mAP reaching 90.1%, which are 5.0%, 3.5%, and 15.4% higher than RADNet without fine-grained classification processing, and 10.6%, 2.2%, and 21.3% higher than YOLOv8.
[0121] Table 2 Experimental results of RADNet-FG and RADNet
[0122]
[0123] (2) Visualization of experimental results.
[0124] Figures 14 and 15 show the material detection effects of the RADNet-FG algorithm and the RADNet algorithm on tiny foreign objects on the road, where (a) is the original image, (b) is the RADNet detection effect, and (c) is the RADNet-FG detection effect. As shown in Figures 14(a)-(c), the RADNet algorithm misdetects metal as rubber, while the RADNet-FG algorithm can accurately classify the material of tiny foreign objects. As shown in Figures 15(a)-(c), the RADNet algorithm misdetects potholes as rubber, which will trigger erroneous alarm information, while the RADNet-FG algorithm can correctly distinguish between foreign objects and potholes, reducing false alarms.
[0125] Example 2
[0126] This embodiment provides a road abnormality detection system, including:
[0127] A data acquisition module is configured to acquire a road image to be processed;
[0128] The target detection module is configured to detect the road image to be processed using an anomaly detection model to obtain an initial detection target;
[0129] Among them, the anomaly detection model includes: extracting multi-scale feature maps from the processed road image, using a deformable convolution residual module to extract features from the last layer of feature maps, and concatenating the extracted features with the original feature maps and obtaining the maximum scale feature map after coordinate attention processing, and performing adaptive spatial feature fusion operations on the intermediate scale feature maps and the maximum scale feature maps to perform target detection;
[0130] A fine-grained classification module is configured to crop an initial detection target image from the road image to be processed, classify the initial detection target image using a fine-grained classification model, and obtain a final anomaly detection target;
[0131] Among them, the fine-grained classification model includes: enhancing the initial detection target image under the guidance of attention and extracting the enhanced feature map and the attention map, and classifying them after fusing the enhanced feature map and the attention map; the attention guidance is to obtain the key area image by the attention cropping operation on the attention map and the discarded area image by the attention discarding operation, and the enhancement operation is guided based on the key area image and the discarded area image.
[0132] It should be noted that the above modules correspond to the steps described in Example 1, and the examples and application scenarios implemented by the above modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above Example 1. It should be noted that the above modules, as part of the system, can be executed in a computer system such as a set of computer executable instructions.
[0133] In further embodiments, there is also provided:
[0134] An electronic device includes a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method described in Embodiment 1 is performed. For the sake of brevity, it will not be described in detail here.
[0135] It should be understood that in this embodiment, the processor may be a central processing unit CPU, and the processor may also be other general-purpose processors, digital signal processors DSP, application-specific integrated circuits ASIC, off-the-shelf programmable gate arrays FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0136] The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.
[0137] A computer-readable storage medium is used to store computer instructions, and when the computer instructions are executed by a processor, the method described in Example 1 is completed.
[0138] The method in Example 1 can be directly embodied as a hardware processor, or a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, it is not described in detail here.
[0139] A computer program product includes a computer program, and when the computer program is executed by a processor, the method described in embodiment 1 is implemented.
[0140] The present invention also provides at least one computer program product tangibly stored on a non-transitory computer-readable storage medium. The computer program product includes computer executable instructions, such as instructions included in a program module, which are executed in a device on a real or virtual processor of the target to perform the process / method as described above. Typically, program modules include routines, programs, libraries, objects, classes, components, data structures, etc. that perform specific tasks or implement specific abstract data types. In various embodiments, the functions of program modules can be combined or divided between program modules as needed. Machine executable instructions for program modules can be executed in local or distributed devices. In distributed devices, program modules can be located in local and remote storage media.
[0141] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.
Claims
1. A method for detecting abnormal road conditions, characterized in that: include: Acquire a road image to be processed; The anomaly detection model is used to detect the road image to be processed to obtain the initial detection target; Among them, the anomaly detection model includes: extracting multi-scale feature maps from the processed road image, using a deformable convolution residual module to extract features from the last layer of feature maps, and concatenating the extracted features with the original feature maps and obtaining the maximum scale feature map after coordinate attention processing, and performing adaptive spatial feature fusion operations on the intermediate scale feature maps and the maximum scale feature maps to perform target detection; An initial detection target image is cropped from the road image to be processed, and the initial detection target image is classified using a fine-grained classification model to obtain a final anomaly detection target; Among them, the fine-grained classification model includes: enhancing the initial detection target image under the guidance of attention and extracting the enhanced feature map and the attention map, and classifying them after fusing the enhanced feature map and the attention map; the attention guidance is to obtain the key area image by the attention cropping operation on the attention map and the discarded area image by the attention discarding operation, and the enhancement operation is guided based on the key area image and the discarded area image.
2. A method for detecting abnormal road conditions as claimed in claim 1, characterized in that: The process of obtaining the maximum-scale feature map includes: the deformable convolution residual module is composed of two deformable convolution residual connections, the last layer of feature map is subjected to feature extraction by n deformable convolution residual modules, and then the feature map is concatenated with the original feature map to obtain a complete feature map, and the complete feature map is subjected to coordinate attention processing to obtain the maximum-scale feature map.
3. A method for detecting abnormal road conditions as claimed in claim 1, characterized in that: The process of performing adaptive spatial feature fusion operation on the intermediate scale feature map and the maximum scale feature map includes: The multi-scale feature maps extracted from the road image to be processed include feature map C1, feature map C2, feature map C3, feature map C4 and feature map C5; For the intermediate-scale feature maps C3 and C4, feature scaling is performed through linear interpolation upsampling and convolution downsampling. After scaling to a uniform size, an adaptive spatial feature fusion operation is performed. The fusion result of the maximum scale feature map, feature map C3 and feature map C4 is subjected to feature scaling and adaptive spatial feature fusion operations to obtain the final fusion result for target detection.
4. A method for detecting abnormal road conditions as claimed in claim 1, characterized in that: The attention cropping operation includes: normalizing the attention map to between 0 and 1, selecting the attention map with a high attention value exceeding the set threshold, intercepting the corresponding part of the initial detection target image under the guidance of the selected attention map, and scaling it to the same size as the initial detection target image, thereby obtaining the key area image; The attention discarding operation includes: normalizing the attention map to between 0 and 1, selecting the attention map with a high attention value exceeding the set threshold, covering the corresponding part of the initial detection target image with a mask under the guidance of the selected attention map, discarding the feature information of the corresponding area, and thus obtaining the discarded area image.
5. A road abnormality detection method as claimed in claim 1, characterized in that: Multi-scale feature maps are extracted from the enhanced initial detection target image, including feature maps C1, C2, C3, C4 and C5. Feature maps C2, C3, C4 and C5 are processed by the feature pyramid structure to obtain feature maps P2, P3, P4 and P5. Each layer of feature maps is then subjected to global average pooling operation for feature splicing to obtain an enhanced feature map.
6. A method for detecting abnormal road conditions as claimed in claim 5, characterized in that: When extracting multi-scale feature maps, a coordinate attention mechanism is added to the last layer to aggregate global spatial features and channel features.
7. A road abnormality detection system, characterized in that: include: A data acquisition module is configured to acquire a road image to be processed; The target detection module is configured to detect the road image to be processed using an anomaly detection model to obtain an initial detection target; Among them, the anomaly detection model includes: extracting multi-scale feature maps from the processed road image, using a deformable convolution residual module to extract features from the last layer of feature maps, and concatenating the extracted features with the original feature maps and obtaining the maximum scale feature map after coordinate attention processing, and performing adaptive spatial feature fusion operations on the intermediate scale feature maps and the maximum scale feature maps to perform target detection; A fine-grained classification module is configured to crop an initial detection target image from the road image to be processed, classify the initial detection target image using a fine-grained classification model, and obtain a final anomaly detection target; Among them, the fine-grained classification model includes: enhancing the initial detection target image under the guidance of attention and extracting the enhanced feature map and the attention map, and classifying them after fusing the enhanced feature map and the attention map; the attention guidance is to obtain the key area image by the attention cropping operation on the attention map and the discarded area image by the attention discarding operation, and the enhancement operation is guided based on the key area image and the discarded area image.
8. An electronic device, characterized in that: The method comprises a memory and a processor and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method according to any one of claims 1 to 6 is completed.
9. A computer-readable storage medium, characterized in that: Used to store computer instructions, which, when executed by a processor, complete the method described in any one of claims 1 to 6.
10. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Target detection method for large-size aerial remote sensing image
CN113989645A
Fruit detection method and system in complex orchard environment
CN114494151A
Remote sensing image aircraft detection method based on multiple adaptive mechanisms
CN117853944A
Cited By
Human-changed gas station monitoring method based on visual algorithm
CN119360312A
