A YOLOv4 concrete surface defect detection method based on position correlation feature fusion

By adding a feature fusion module based on location correlation after YOLOv4's path aggregation network, the inefficiency problem caused by artificial reliance on concrete apparent disease detection in the prior art is solved, and more efficient and accurate disease detection is achieved.

CN114359654BActive Publication Date: 2025-04-25CHONGQING UNIV OF POSTS & TELECOMM
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111478855.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-06
Publication Date
2025-04-25
Estimated Expiration
2041-12-06

AI Technical Summary

Technical Problem

The existing methods for detecting apparent diseases of concrete mainly rely on manual testing, and there are problems such as the detection results being greatly affected by subjectivity, high labor intensity for testing, and low degree of automation, making it difficult to meet the efficient testing needs of a large number of building structures.

Method used

A YOLOv4 concrete apparent disease detection method based on position correlation feature fusion is proposed. By adding a position correlation feature fusion module after YOLOv4's path aggregation network, including Coordinate Attention and Spatial Attention, the feature fusion effect is enhanced and the detection accuracy is improved.

Benefits of technology

Through this method, the accuracy and automation of concrete apparent disease detection are significantly improved, the leakage detection rate and false detection rate are reduced, and the apparent disease of concrete can be detected and located more effectively.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114359654B_ABST
    Figure CN114359654B_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of computer vision, and specifically relates to a YOLOv4 concrete surface disease detection method based on position correlation feature fusion, comprising: performing multi-scale fusion on three layers of features output by a path aggregation network of YOLOv4 respectively, and constructing a YOLOv4 model based on position correlation feature fusion by performing multi-scale adaptive fusion of features based on a position correlation attention module; using a labeling tool to label the location and category of the disease on a collected disease image, and training the model by using the disease image and the disease information obtained after labeling; inputting a real-time detection concrete surface disease image into a trained model, and the model outputs an image with the disease category and location labeled after detection; the invention enhances the effect of YOLOv4 feature fusion and improves the detection accuracy of the target by adding a feature fusion module based on position correlation behind the original YOLOv4 path aggregation network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of computer vision, and in particular relates to a YOLOv4 concrete surface disease detection method based on position correlation feature fusion. Background Art

[0002] At present, there are more and more aging building structures around the world, most of which use concrete as a building material. Concrete has been subjected to the combined effects of various forces for a long time, as well as external environmental influences such as chloride and sulfate corrosion in extremely harsh environments, and it is inevitable that cracks, holes, honeycombs, rough surfaces, exposed steel bars and other diseases will appear. Civil engineering projects such as bridges and dams composed of concrete structures have extremely high requirements for the integrity of concrete structures. During their long-term service, if they are not inspected and maintained in time, they will eventually collapse and cause irreparable losses over time. At present, the detection of concrete surface defects mainly adopts manual detection methods. However, the manual detection method has the disadvantages of being greatly affected by subjectivity, high labor intensity and low degree of automation. With the increase in the service life of buildings such as bridges and dams, more and more bridges and dams need to be inspected. The manual disease detection method can no longer meet the needs of actual engineering applications. Therefore, it is urgent to study more efficient and intelligent concrete surface disease detection methods.

[0003] Concrete surface disease detection is essentially a target detection problem. In recent years, with the rapid development of computer vision technology and artificial intelligence theory, some scholars have combined computer vision technology and artificial intelligence algorithms to realize concrete surface disease detection. Deep learning is the latest research achievement in the field of artificial intelligence. Compared with traditional machine learning methods, deep learning can realize adaptive feature extraction. At the same time, due to the deeper network structure of deep learning, richer and more abstract features can be extracted. At present, target detection algorithms based on deep learning are mainly divided into two categories: the first category is two-stage detection algorithms such as R-CNN, Faster R-CNN and other methods. These methods first obtain the area to be detected through a series of candidate region generation algorithms, and then send it to the convolutional neural network for category determination to achieve target detection and positioning; the second category is single-stage target detection algorithms, such as SSD, YOLO and other methods. These methods can achieve end-to-end target detection and positioning. Since the on-site detection task of concrete surface diseases has certain requirements for speed and accuracy, the single-stage method is more suitable for concrete surface disease detection. YOLO v4 is the fourth generation algorithm in the YOLO series. It extracts and fuses features of different scales of images through the CSPDarknet53 network, and detects targets of different sizes on feature maps of different scales, so that it achieves a good balance between detection speed and accuracy. However, in the actual concrete disease detection task, the on-site environment is complex and the collected images have complex background information. Using the single-stage detection algorithm YOLOv4 for detection cannot fully extract the characteristic information of the disease, and it is easy to miss the detection. Summary of the invention

[0004] In order to enrich the feature information extracted by YOLOv4 during the detection process and thus improve the detection accuracy, the present invention proposes a YOLOv4 concrete surface disease detection method based on position correlation feature fusion, including:

[0005] Collect concrete surface disease images for model training and build a YOLOv4 model based on position correlation feature fusion;

[0006] Use annotation tools to mark the location and category of the disease in the collected disease images;

[0007] According to the collected disease images, as well as the disease category and location information obtained through the annotation software, the YOLOv4 model based on location correlation feature fusion is trained;

[0008] By completing the training of the YOLOv4 model based on the fusion of position-related features, the concrete surface defect images are detected in real time, and the detected defects are classified and located, and the images with the defect categories and locations marked after detection are output;

[0009] The YOLOv4 model based on position-related feature fusion performs multi-scale fusion of the three-layer features output by the path aggregation network of YOLOv4, and performs multi-scale adaptive fusion of features based on the position-related attention module, including:

[0010] The position-related attention module uses Coordinate Attention from the channel dimension to embed the position information into the channel weight, and selects channels that are sensitive to position information during fusion;

[0011] The position-related attention module uses Spatial Attention to perform spatial adaptive weight adjustment on the feature map from the spatial dimension, so that more attention is paid to the location of the target during detection.

[0012] Furthermore, the process of obtaining the channel weight includes:

[0013] Two 1D global pooling operations are used to aggregate each channel along the horizontal and vertical coordinates to obtain two separate direction-aware features f h and f w ;

[0014] The two feature maps are concatenated and then convolved to further extract feature information.

[0015] Separate the feature map f′ along the vertical direction from the extracted feature information h And the horizontal feature map f′ w , use the activation function to obtain the channel weights M from the vertical and horizontal directions h and M w ;

[0016] M h =σ(F h (f′ h ))

[0017] M w =σ(F w (f′ w ))

[0018] Among them, σ is the Sigmoid activation function, F h With F w There are two 1x1 convolution kernels, which are used to adjust the feature map f′ in the vertical direction. h And the horizontal feature map f′ w The channel dimension of the output is made to be the same as the number of original input and output channels.

[0019] Furthermore, using Spatial Attention to perform spatial adaptive weight adjustment on the feature map includes:

[0020] Use maximum pooling and average pooling on the channel dimension to generate two different features F s avg and F s max , connect these two features;

[0021] Use convolution calculation to extract information from the two connected features to obtain spatial attention features;

[0022] Use activation function to obtain spatial weight M for spatial attention feature s , expressed as:

[0023]

[0024] Among them, ρ(.) is the sigmoid activation function, Represents the use of a 7x7 convolution kernel for convolution operation; F' is the input feature map.

[0025] Furthermore, the training process of the YOLOv4 model based on the position correlation feature fusion includes:

[0026] Divide the input image into S×S squares;

[0027] Predict n bounding boxes in each square and generate the confidence score of the detected object for each bounding box of the square;

[0028] For each bounding box, predict the conditional probability of containing a certain type of detection target, and multiply the conditional probability by the confidence to obtain the confidence of each bounding box for each specific category;

[0029] The loss function of YOLOv4 is used to calculate the gap between the output result and the labeled result, and the model is trained through back propagation based on this gap.

[0030] Furthermore, the confidence is expressed as:

[0031]

[0032] Among them, Confidence represents the confidence, Pr(object) represents the probability that the bounding box contains the target to be detected, Indicates the overlap ratio between the predicted bounding box and the annotated bounding box.

[0033] Furthermore, the loss function of YOLOv4 is expressed as:

[0034] L=L reg +L conf +L class ;

[0035] Among them, L reg is the bounding box regression loss; L conf is the confidence loss; L class is the classification loss.

[0036] Furthermore, the border regression loss L reg It is expressed as:

[0037]

[0038]

[0039]

[0040] Among them, IOU(A,B) represents the intersection-and-union ratio of the real box A and the predicted box B, p 2 (A, B) represents the Euclidean distance between the center points of the predicted box B and the true box A; m represents the diagonal distance between the coverage area of ​​the true box A and the predicted box B; w and h represent the width and height of the predicted box, w gt and h gt represents the actual width and height; α is the balance coefficient, and v is the parameter that keeps the aspect ratio of the predicted box consistent.

[0041] Furthermore, the confidence loss L conf It is expressed as:

[0042]

[0043] Among them, λ noobj is the weight of the intersection-over-union error, s 2 is the number of cells divided, and B is the number of bounding boxes predicted for each cell; Indicates whether there is a detected target in the jth bounding box of the i-th cell, if yes, it is 1, otherwise it is 0; is the prediction confidence, is the actual confidence level.

[0044] Furthermore, the classification loss L class It is expressed as:

[0045]

[0046] Among them, s 2 is the number of cells divided; Indicates whether there is a detected target in the jth bounding box of the i-th cell, if yes, it is 1, otherwise it is 0; P ij is the actual probability of the category to which the target in the cell belongs, is the predicted probability.

[0047] The present invention enhances the effect of YOLOv4 feature fusion and improves the detection accuracy of the target by adding a feature fusion module based on position correlation behind the original YOLOv4 Path Aggregation Network (PANet). BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 This is a flow chart of a YOLOv4 concrete surface disease detection method based on position correlation feature fusion in the present invention;

[0049] Figure 2 The training flow chart of the YOLOv4 model based on position correlation feature fusion of the present invention;

[0050] Figure 3 It is a structural diagram of the position correlation feature fusion module of the present invention;

[0051] Figure 4 This is a YOLOv4 network structure diagram based on position correlation feature fusion adopted by the present invention;

[0052] Figure 5 The detection effect of the present invention and the prior art Figure 1 , where (a) is the SSD detection effect diagram, (b) is the FasterRCNN detection effect diagram, (c) is the original YOLOv4 detection effect diagram, and (d) is the YOLOv4 model detection effect diagram based on position correlation feature fusion, i.e., the present invention;

[0053] Figure 6 The detection effect of the present invention and the prior art Figure 2 , where (a) is the SSD detection effect diagram, (b) is the FasterRCNN detection effect diagram, (c) is the original YOLOv4 detection effect diagram, and (d) is the YOLOv4 model detection effect diagram based on position correlation feature fusion, i.e., the present invention. DETAILED DESCRIPTION

[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0055] The present invention provides a YOLOv4 concrete surface disease detection method based on position correlation feature fusion, comprising the following steps:

[0056] Collect concrete surface disease images for model training and build a YOLOv4 model based on position correlation feature fusion;

[0057] Use annotation tools to mark the location and category of the disease in the collected disease images;

[0058] According to the collected disease images, as well as the disease category and location information obtained through the annotation software, the YOLOv4 model based on location correlation feature fusion is trained;

[0059] By completing the training of the YOLOv4 model based on the fusion of position-related features, the concrete surface defect images are detected in real time, and the detected defects are classified and located, and the images with the defect categories and locations marked after detection are output;

[0060] The YOLOv4 model based on position-related feature fusion performs multi-scale fusion of the three-layer features output by the path aggregation network of YOLOv4, and performs multi-scale adaptive fusion of features based on the position-related attention module, including:

[0061] The position-related attention module uses Coordinate Attention from the channel dimension to embed the position information into the channel weight, and selects channels that are sensitive to position information during fusion;

[0062] The position-related attention module uses Spatial Attention to perform spatial adaptive weight adjustment on the feature map from the spatial dimension, so that more attention is paid to the location of the target during detection.

[0063] In this embodiment, Figure 1 ,The YOLOv4 concrete surface disease detection method based on position correlation feature fusion includes the following steps:

[0064] Step 1: Collect and obtain the concrete building surface defect images.

[0065] Step 2: Use annotation tools to manually mark the diseased areas in the image, and mark the location and category information of the disease in the image.

[0066] Step 3: Train the YOLOv4 model based on location correlation feature fusion according to the collected disease images and the disease category and location information obtained through the annotation software.

[0067] The YOLOv4 model based on position correlation feature fusion adopted in the present invention performs multi-scale fusion on the three-layer features output by the Path Aggregation Network (PANet), performs multi-scale adaptive fusion of features based on the position correlation attention module, and then performs output prediction. The improved overall network structure is as follows: Figure 4 As shown in the figure, the position-related attention module first uses Coordinate Attention (CA) channel attention from the channel dimension to embed the position information into the channel weight, and selects the channels that are sensitive to the position information during fusion, thereby avoiding the influence of the position information loss during the transformation of the feature map scale on the feature fusion effect. Then, Spatial Attention (SA) spatial attention is used from the spatial dimension to adjust the spatial weight of the feature map adaptively, so that more attention is paid to the location of the target during detection, and finally the detection accuracy of the target is improved.

[0068] The structure of the position-related attention module is as follows: Figure 3 As shown, the module includes a channel attention module and a spatial attention module, namely:

[0069] 1) Channel Attention Module

[0070] This module uses two 1D global pooling operations to aggregate each channel along the horizontal and vertical coordinates to obtain two separate direction-aware features f h and f w , then the two feature maps are concatenated, and then convolution is performed to further extract feature information, and the feature map f′ along the vertical direction is separated h And the horizontal feature map f′ w Finally, the activation function is used to obtain the channel weights M from the vertical and horizontal directions h and M w , the weight output is as follows:

[0071] M h =σ(F h (f′ h ))

[0072] M w =σ(F w (f′ w ))

[0073] Where σ is the Sigmoid activation function, F h With F w Two 1x1 convolution kernels are used to adjust the output channel dimension so that it is the same as the original input and output channels.

[0074] 2) Spatial Attention Module

[0075] This module uses the maximum pooling and average pooling in the channel dimension to generate two different features F s avg and F s max , and then connect these two features and perform convolution calculation to further extract information to obtain the spatial attention feature U s , and then use the activation function to obtain the spatial weight M s , the weight output is as follows:

[0076]

[0077] Where ρ(.) is the sigmoid activation function, Represents the use of a 7x7 convolution kernel for convolution operation.

[0078] In this embodiment, the collected concrete surface defect images are first normalized, and then the images are reduced or enlarged so that the size of the images becomes 416x416. After the processed images are obtained, the data are first randomly shuffled, and then 80% of the defect images are divided into a training set and 20% are divided into a test set for model training and testing.

[0079] When the collected disease image is marked with the location and category of the disease using the annotation tool, the target area is marked with a rectangular box in the image using the annotation tool, and the center point coordinates, width, height and category of the marked rectangular box are obtained.

[0080] like Figure 2 , the flowchart of the YOLOv4 model training based on position correlation feature fusion of the present invention, the model training steps are:

[0081] A1, the model divides the input image into S×S squares;

[0082] A2, predict n bounding boxes in each square, and generate the confidence of the detected target for each bounding box of the square, where the confidence is expressed as:

[0083]

[0084] Among them, Confidence represents the confidence, Pr(object) represents the probability that the bounding box contains the target to be detected, Indicates the overlap ratio between the predicted bounding box and the annotated bounding box;

[0085] A3, for each bounding box, predict the conditional probability Pr(class(i)|object) of containing a certain type of detection target, where Pr(class(i)|object) represents the probability that the bounding box contains the i-th type of detection target;

[0086] A4, multiply the confidence obtained in step A2 by the conditional probability Pr(class(i)|object) obtained in step A3 to obtain the confidence of each bounding box for each specific category;

[0087] A5, by using the YOLOv4 loss function to calculate, the positioning box of each detected target is obtained, where the loss function is used to calculate the direct difference between the output result of the model and the annotation result. The YOLOv4 loss function mainly consists of three parts: bounding box regression loss, confidence regression loss, and classification loss, as shown in the following formula:

[0088] L=L reg +L conf +L class

[0089] In formula (4), L reg is the coordinate loss, and the specific formula is as follows:

[0090]

[0091]

[0092]

[0093] In the formula, IOU(A,B) represents the intersection-over-union ratio between the real box and the predicted box, p 2 (A, B) represents the Euclidean distance between the center point of the predicted box and the true box; m represents the diagonal distance between the true box and the predicted box; w and h represent the width and height of the predicted box, w gt and h gt Represents the actual width and height. α is the balance coefficient, and v is the parameter that keeps the aspect ratio of the predicted box consistent.

[0094] L conf is the confidence loss, and the specific formula is as follows:

[0095]

[0096] Among them, λ noobj is the weight of the intersection-over-union error, which is set to 0.5. is the prediction confidence, is the actual confidence level.

[0097] Lclass The binary cross entropy loss function is used for classification. The specific formula is as follows:

[0098]

[0099] Among them, P i j is the actual probability of the category to which the target in the cell belongs, is the predicted probability.

[0100] The input image is: the collected concrete surface defect image is first normalized, and then the image is reduced or enlarged so that the image size becomes 416x416 to obtain the processed image, the data is first randomly shuffled, and then 80% of the defect image is divided into a training set and 20% is divided into a test set for model training and testing.

[0101] Step 4: Based on the trained model and the concrete surface defect images to be detected collected on site, the concrete surface defect images can be detected in real time, and the detected defects can be classified and located, and the images with the defect categories and locations marked after detection can be output.

[0102] In order to verify the effectiveness of this method, the experiment detected common concrete surface diseases and established a dataset containing 1751 concrete disease images collected on site. The main types of diseases include spalling, cracks, voids, honeycombs, exposed reinforcement, etc. The image annotation software was used to annotate the disease location and category information of the disease images. The dataset was divided into training data set and test data set in a ratio of 8:2. The details of the dataset are shown in Table 1 below:

[0103] Table 1 Concrete apparent disease dataset

[0104] Disease type Number of training data labels Number of test data labels Total Flaking 644 145 789 crack 794 157 951 Holes 600 160 760 honeycomb 481 115 596 exposed tendons 562 161 723

[0105] In order to verify the effect of the proposed YOLOv4 model based on location correlation feature fusion, training and testing were carried out on the above-established dataset, and the performance of the improved model was evaluated using the commonly used evaluation indicators of target detection, namely, average detection accuracy mAP, recall rate recall and precision rate precision. And corresponding ablation experiments were carried out, and five groups of experiments were conducted, namely, the original YOLOv4 model, only adding the SA spatial attention module after the PANet output, namely SA-YOLOv4 (Spatial Attention-YOLOv4), only adding the CA channel attention module after the PANet output, namely CA-YOLOv4 (Coordinate Attention-YOLOv4), only fusing the three scales of the PANet output, namely M-YOLOv4 (Multiscale-YOLOv4), and the YOLOv4 model based on location correlation feature fusion, namely L-YOLOv4 (Location correlation feature fusion-YOLOv4). The experimental results are shown in Table 2 below.

[0106] Table 2 Experimental results

[0107] Network Model mAP recall precision YOLOv4 75.34% 57.14% 86.67% SA-YOLOv4 75.91% 58.42% 86.76% CA-YOLOv4 76.06% 58.19% 86.84% M-YOLOv4 76.43% 58.65% 87.15% L-YOLOv4 77.16% 59.34% 87.35%

[0108] As can be seen from Table 2, the detection effect of the original YOLOv4 model has been improved by adding multi-scale fusion, CA channel attention module, and SA spatial attention module after the routing aggregation network PANet. The YOLOv4 model based on location correlation feature fusion, which combines the three ideas, has the highest improvement. Compared with the original YOLOv4, the average detection accuracy mAP is 1.82% higher, the recall rate recall is 2.2% higher, and the precision rate precision is 0.68% higher, indicating that the YOLOv4 based on location correlation feature fusion effectively improves the detection accuracy and reduces the missed detection rate.

[0109] At the same time, YOLOv4 based on position correlation feature fusion is compared with other classic target detection algorithms SSD and Faster RCNN, and the mean average precision (mAP) and detection speed are compared. The results are shown in Table 3 below.

[0110] Table 3 Experimental results

[0111]

[0112]

[0113] As can be seen from Table 3, for the self-built concrete surface disease dataset used in this experiment, the mAP value of the original YOLOv4 reached 75.34%. The mAP value of YOLOv4 based on location correlation feature fusion is 1.82% higher than that of the original YOLOv4, while the mAP values ​​of SSD and Faster RCNN on this dataset are 5.66% and 2.15% lower than that of the original YOLOv4, respectively. YOLOv4 based on location correlation feature fusion has achieved good results in both accuracy and speed for concrete surface disease detection, which shows that adding a feature fusion module based on location correlation behind the original YOLOv4's Path Aggregation Network (PANet) allows the network to extract richer feature information through multi-scale adaptive feature fusion, thereby improving the detection accuracy.

[0114] Figure 5-6 (a), (b), (c), and (d) represent the SSD detection effect diagram, the Faster RCNN detection effect diagram, the original YOLOv4 detection effect diagram, and the YOLOv4 model detection effect diagram based on position correlation feature fusion. Figure 5-6 It can be seen that SSD, Faster RCNN, and the original YOLOv4 do not have ideal detection effects on the defect images collected on site, and there are cases of missed detection and false detection. L-YOLOv4 performs multi-scale feature fusion based on position correlation after the path aggregation network, fully utilizes feature information from different scales, and enriches the target context information, making the target detection more accurate during detection, and effectively improving the missed detection and false detection problems in the concrete surface defect detection task.

[0115] Aiming at the scene of concrete surface disease detection, the present invention proposes a YOLOv4 concrete surface disease detection method based on position correlation feature fusion. By adding a feature fusion module based on position correlation behind the original YOLOv4 path aggregation network (PANet), the effect of YOLOv4 feature fusion is enhanced, and the effect of target detection is improved.

[0116] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A YOLOv4 concrete surface disease detection method based on position correlation feature fusion, characterized in that: The following steps are involved: Collect concrete surface disease images for model training and build a YOLOv4 model based on position correlation feature fusion; Use annotation tools to annotate the location and category of the disease in the collected disease images; According to the collected disease images, as well as the disease category and location information obtained through the annotation software, the YOLOv4 model based on location correlation feature fusion is trained; By completing the training of the YOLOv4 model based on the fusion of position-related features, the concrete surface defect images are detected in real time, and the detected defects are classified and located, and the images with the defect categories and locations marked after detection are output; The YOLOv4 model based on position-related feature fusion performs multi-scale fusion of the three-layer features output by the path aggregation network of YOLOv4, and performs multi-scale adaptive fusion of features based on the position-related attention module, including: The position-related attention module uses Coordinate Attention from the channel dimension to embed the position information into the channel weight. During fusion, channels that are sensitive to position information are selected. The process of obtaining channel weights includes: Two 1D global pooling operations are used to aggregate each channel along the horizontal and vertical coordinates to obtain two separate direction-aware features f h and f w ; The two feature maps are concatenated and then convolved to further extract feature information. Separate the feature map f′ along the vertical direction from the extracted feature information h And the horizontal feature map f′ w , use the activation function to obtain the channel weights M from the vertical and horizontal directions h and M w ; M h =σ(F h (f h ')) M w =σ(F w (f w ')) Among them, σ is the Sigmoid activation function, F h With F w There are two 1x1 convolution kernels, which are used to adjust the feature map f′ in the vertical direction. h And the horizontal feature map f′ w The channel dimension of the output is made the same as the number of original input and output channels; The position-related attention module uses Spatial Attention to perform spatial adaptive weight adjustment on the feature map from the spatial dimension, so that the detection pays more attention to the location of the target. The adaptive weight adjustment includes: Use maximum pooling and average pooling on the channel dimension to generate two different features and Connect these two features; Use convolution calculation to extract information from the two connected features to obtain spatial attention features; Use activation function to obtain spatial weight M for spatial attention feature s , expressed as: Among them, ρ(.) is the sigmoid activation function, Represents the use of a 7x7 convolution kernel for convolution operation; F' is the input feature map.

2. According to claim 1, a YOLOv4 concrete apparent disease detection method based on position correlation feature fusion is characterized in that: The training process of the YOLOv4 model based on position correlation feature fusion includes: Divide the input image into S×S squares; Predict n bounding boxes in each square and generate the confidence score of the detected object for each bounding box of the square; For each bounding box, predict the conditional probability of containing a certain type of detection target, and multiply the conditional probability by the confidence to obtain the confidence of each bounding box for each specific category; The loss function of YOLOv4 is used to calculate the gap between the output result and the labeled result, and the model is trained through back propagation based on this gap.

3. According to claim 2, a YOLOv4 concrete surface disease detection method based on position correlation feature fusion is characterized in that: The confidence level is expressed as: Among them, Confidence represents the confidence, Pr(object) represents the probability that the bounding box contains the target to be detected, Indicates the overlap ratio between the predicted bounding box and the annotated bounding box.

4. According to claim 1, a YOLOv4 concrete apparent disease detection method based on position correlation feature fusion is characterized in that: The loss function of YOLOv4 is expressed as: L=L reg +L conf +L class ; Among them, L reg is the bounding box regression loss; L conf is the confidence loss; L class is the classification loss.

5. According to claim 4, a YOLOv4 concrete surface disease detection method based on position correlation feature fusion is characterized in that: Bounding box regression loss L reg It is expressed as: Among them, IOU(A,B) represents the intersection-and-union ratio of the real box A and the predicted box B, p 2 (A, B) represents the Euclidean distance between the center points of the predicted box B and the true box A; m represents the diagonal distance between the coverage area of ​​the true box A and the predicted box B; w and h represent the width and height of the predicted box, w gt and h gt represents the actual width and height; α is the balance coefficient, and v is the parameter that keeps the aspect ratio of the predicted box consistent.

6. The YOLOv4 concrete surface disease detection method based on position correlation feature fusion according to claim 4 is characterized in that: Confidence loss L conf It is expressed as: Among them, λ noobj is the weight of the intersection-over-union error, s 2 is the number of cells divided, and B is the number of bounding boxes predicted for each cell; Indicates whether there is a detected target in the jth bounding box of the i-th cell, if yes, it is 1, otherwise it is 0; is the prediction confidence, is the actual confidence level.

7. The YOLOv4 concrete surface disease detection method based on position correlation feature fusion according to claim 4 is characterized in that: Classification loss L class It is expressed as: Among them, s 2 is the number of cells divided; Indicates whether there is a detected target in the jth bounding box of the i-th cell, if yes, it is 1, otherwise it is 0; is the actual probability of the category to which the target in the cell belongs, is the predicted probability.

Citation Information

Patent Citations

  • Improved yolov5s network model-based cylindrical roller surface detection method and system

    CN115937651A