Bridge defect detection methods, systems, equipment, and media based on improved YOLOX.
By introducing the Siou loss function and improving the detection head, the problem of inconsistent classification and localization in bridge defect detection by the YOLOX algorithm was solved, thus improving detection accuracy and speed.
Patent Information
- Application Number
- CN202311203066.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-18
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2043-09-18
AI Technical Summary
The existing YOLOX algorithm has the problem that the classification and detection of the detection head are not related in bridge defect detection, and the loss function cannot reflect the distance between the prediction and the reality, making it difficult to continue network training.
The Siou loss function is introduced, and the detection head is improved through transfer learning and feature extraction network. The Task Aligner (TAP) is used for scale feature classification and task alignment. The Siou loss function and backpropagation algorithm are combined to update the network weights and optimize the classification and localization information of the feature layer.
It effectively reduces the degrees of freedom of regression, improves the convergence speed and accuracy of the detector, solves the drawback that the classification and detection of the detector head are unrelated, and enhances the interactivity of classification and localization.
Smart Images

Figure CN117237805B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of bridge defect detection technology, and in particular to a bridge defect detection method, system, equipment and medium based on improved YOLOX. Background Technology
[0002] Object detection algorithms in the field of deep learning are generally divided into two-stage and one-stage algorithms: the former excels in detection accuracy and localization precision, while the latter excels in algorithm speed. However, with the addition of various innovative methods, the imbalance problem of positive and negative sample selection in single-stage networks has been greatly solved. Currently, in some fields, single-stage object detection algorithms can rival or even surpass two-stage object detection algorithms in accuracy. For example, Ross B. Girshick proposed the classic two-stage Faster R-CNN model, which improves both speed and accuracy, but it still falls far short of the detection speed and accuracy of the YOLO series in the field of bridge defects.
[0003] The YOLOX network is an algorithm based on YOLOv3 and represents an emerging force in the YOLO series. It combines cutting-edge innovative methods in the field of object detection, including anchor-free methods such as CenterNet and FCOS, and SimOTA's dynamic matching of positive samples to objects, enabling the YOLO-X network to achieve high object detection accuracy.
[0004] However, existing detection heads suffer from the drawback of classification and detection being unrelated. Specifically, the existing YOLOX algorithm suffers from prediction inconsistencies due to the separation of classification and localization. Furthermore, because classification and detection are unrelated, the YOLOX algorithm calculates the classification and detection / regression tasks separately, resulting in separate calculations of the corresponding loss functions. Consequently, the loss calculation results in the loss function fail to reflect the true distance between the YOLOX prediction and the actual distance, making further network training difficult.
[0005] Application content
[0006] In view of the above-mentioned shortcomings of the prior art, this application provides a bridge defect detection method, system, equipment and medium based on improved YOLOX to solve the above-mentioned technical problems (1) the defect that the detection head classification and detection are unrelated; (2) the loss calculation results in the loss function cannot reflect the real distance between the YOLOX prediction and the actual value, making it difficult to continue network training.
[0007] Firstly, this application provides a bridge defect detection method based on an improved YOLOX network. The method includes: inputting bridge defect images into a YOLOX network; preprocessing the bridge defect images; and splitting the preprocessed bridge defect images into a training set and a test set. The YOLOX network includes a backbone network, a neck FPN, and a detection head. Transfer learning is performed on an initial pre-trained model of the YOLOX network using a pre-defined VOC dataset to obtain a first pre-trained model. The network weights corresponding to the first pre-trained model are updated using the training set and the Siou loss function to obtain a final pre-trained model, thus adjusting the network weights of the YOLOX network. The test set is loaded through the backbone network, and a set of feature points corresponding to the test set is output. Feature sampling and fusion are performed on the feature points using the neck FPN to obtain several feature layers. The feature layers are input into the detection head, and the scale features corresponding to the feature layers are obtained through a pre-defined feature extraction network in the detection head. The scale features are input into the task aligner (TAP) in the detection head for classification and task alignment of the scale features, thereby obtaining classification information and detection box localization information.
[0008] Furthermore, the bridge defect images are preprocessed, and the preprocessed bridge defect images are split into training and testing sets. Specifically, this includes: adjusting the size of the input bridge defect images to a preset size through the backbone network; normalizing the adjusted bridge defect images; and splitting the normalized bridge defect images into training and testing sets.
[0009] Furthermore, the training set includes at least: a first training set and a second training set, and the bridge defect images in the training set include: predicted bounding boxes and ground truth bounding boxes; the initial pre-trained model of the YOLOX network is transferred to the preset VOC dataset to obtain a first pre-trained model, and the network weights corresponding to the first pre-trained model are updated using the training set and the Siou loss function to obtain the final pre-trained model, thus completing the adjustment of the network weights of the YOLOX network. Specifically, this includes: transferring the YOLOX weights in the initial pre-trained model to the preset VOC dataset to obtain a first pre-trained model; freezing the preset weights in the YOLOX weights of the first pre-trained model, and then iteratively training the first pre-trained model using the first training set to obtain a second pre-trained model; and performing selective training on the second pre-trained model using the second training set, while simultaneously adjusting the preset weights according to the preset weight unfreezing order. The process involves unfreezing the data to obtain a third pre-trained model. All pre-trained models utilize optimal transport theory to globally allocate bridge defect data corresponding to each target box in the model, obtaining predicted bounding boxes for the bridge defect data. These pre-trained models include an initial pre-trained model, a first pre-trained model, a second pre-trained model, and a third pre-trained model. All pre-trained models employ the Siou loss function to calculate the loss between the predicted and ground truth bounding boxes, obtaining the loss calculation result for the third pre-trained model. Using the backpropagation algorithm and the loss calculation result, the network weights in the third pre-trained model are updated to obtain several weight update sets. These network weights include preset weights. The weight update set with the highest predicted bounding box accuracy among these weight update sets is determined, and the network weights in the third pre-trained model are updated to the weight update set with the highest predicted bounding box accuracy, thus obtaining the final pre-trained model.
[0010] Furthermore, the preset weights include at least the learning rate; after unfreezing the preset weights according to the preset weight unfreezing order, the method further includes: adjusting the learning rate through a cosine annealing strategy during the iterative training of the second pre-trained model using the second training set.
[0011] Furthermore, scale features corresponding to the feature layer are obtained through a preset feature extraction network in the detection head; the scale features are then input into the task aligner (TAP) in the detection head for scale feature classification and task alignment, thereby obtaining classification information and detection box localization information. Specifically, this includes: inputting the feature layer into the Stem layer of the preset feature extraction network for channel compression; then learning features from the feature layer through several convolutional layers with activation functions in the preset feature extraction network; thereby obtaining the scale features corresponding to the feature layer; and finally, using a preset formula: To obtain classification information or detection box location information; among which, These are cascaded features that combine scale features with task interaction features. and All are 1x1 convolutions used for dimensionality reduction. This is used for classification information or detection box location information.
[0012] Secondly, this application provides a bridge defect detection system based on an improved YOLOX network. The system includes: a preprocessing module, used to input bridge defect images into a YOLOX network, perform data preprocessing on the bridge defect images, and split the preprocessed bridge defect images into a training set and a test set; wherein, the YOLOX network includes a backbone network, a neck FPN, and a detection head; an adjustment module, used to perform transfer learning on the initial pre-trained model of the YOLOX network using a preset VOC dataset to obtain a first pre-trained model, and update the network weights corresponding to the first pre-trained model using the training set and the Siou loss function to obtain a final pre-trained model, thus completing the adjustment of the network weights of the YOLOX network; an acquisition module, used to load the test set through the backbone network and output the feature point set corresponding to the test set; perform feature sampling and fusion on the feature point set through the neck FPN to obtain several feature layers; input the feature layers into the detection head, and obtain the scale features corresponding to the feature layers through a preset feature extraction network in the detection head; input the scale features into the task aligner TAP in the detection head for scale feature classification and task alignment, thereby obtaining classification information and detection box localization information.
[0013] Furthermore, the training set includes at least: a first training set and a second training set, and the bridge defect images in the training set include: predicted bounding boxes and ground truth bounding boxes; the adjustment module includes an update unit, used to perform transfer learning on the YOLOX weights in the initial pre-trained model using a preset VOC dataset to obtain a first pre-trained model; freeze the preset weights in the YOLOX weights of the first pre-trained model, and then iteratively train the first pre-trained model using the first training set to obtain a second pre-trained model; perform selective training on the second pre-trained model using the second training set, and simultaneously unfreeze the preset weights according to the preset unfreezing order to obtain a third pre-trained model; wherein, all pre-trained models use the optimal transfer theory to globally assign the corresponding data to each target box in the model. Bridge defect data is used to obtain corresponding predicted bounding boxes. All pre-trained models include an initial pre-trained model, a first pre-trained model, a second pre-trained model, and a third pre-trained model. All pre-trained models use the Siou loss function to calculate the loss between the predicted and ground truth bounding boxes, resulting in the loss calculation result for the third pre-trained model. Using the backpropagation algorithm and the loss calculation result, the network weights in the third pre-trained model are updated to obtain several weight update sets. These network weights include preset weights. The weight update set with the highest predicted bounding box accuracy is determined from these weight update sets, and the network weights in the third pre-trained model are updated to match this set, resulting in the final pre-trained model.
[0014] Furthermore, the acquisition module includes an acquisition unit, used to input the feature layer into the Stem layer of a preset feature extraction network for channel compression; then learn features from the feature layer through several convolutional layers with activation functions in the preset feature extraction network; and finally obtain the scale features corresponding to the feature layer; using a preset formula: To obtain classification information or detection box location information; among which, These are cascaded features that combine scale features with task interaction features. and All are 1x1 convolutions used for dimensionality reduction. This is used for classification information or detection box location information.
[0015] Thirdly, this application provides a bridge defect detection device based on an improved YOLOX, the device including: a processor; and a memory storing executable code thereon, which, when executed, causes the processor to execute a bridge defect detection method based on an improved YOLOX as described above.
[0016] Fourthly, this application provides a non-volatile computer storage medium storing computer instructions thereon, which, when executed, implement a bridge defect detection method based on an improved YOLOX as described above.
[0017] Those skilled in the art will understand that this application has at least the following beneficial effects:
[0018] This application proposes a bridge defect detection method, system, device, and medium based on an improved YOLOX. This application introduces the Siou loss function, which, compared to previous IOU and GIOU methods, considers not only overlapping areas, distance, and dimensions, but also the angle between two bounding boxes. This reflects the true distance between the YOLOX prediction and the actual distance, redefining the distance loss and effectively reducing the degrees of freedom in regression, thereby accelerating network convergence and further improving regression accuracy. Furthermore, this application improves the traditional YOLOX detection head (by using a pre-defined feature extraction network in the detection head to obtain scale features corresponding to the feature layers; inputting the scale features into the task aligner TAP in the detection head for scale feature classification and task alignment, thus obtaining classification information and bounding box localization information). This improved method, while maintaining classification (classification information) and localization features (bounding box localization information), enhances the interaction between classification and localization, and further aligns the two tasks in prediction, solving the drawback of the detection head's classification and detection being unrelated. Attached Figure Description
[0019] The following description refers to some embodiments of this disclosure, in which:
[0020] Figure 1 This is a flowchart of a bridge defect detection method based on an improved YOLOX provided in an embodiment of this application.
[0021] Figure 2 This is a schematic diagram of the internal structure of a bridge defect detection system based on an improved YOLOX, provided in an embodiment of this application.
[0022] Figure 3 This is a schematic diagram of the internal structure of a bridge defect detection device based on an improved YOLOX, provided in an embodiment of this application. Detailed Implementation
[0023] Those skilled in the art should understand that the embodiments described below are merely preferred embodiments of this disclosure and do not imply that this disclosure can only be implemented through these preferred embodiments. These preferred embodiments are merely used to explain the technical principles of this disclosure and are not intended to limit the scope of protection of this disclosure. Based on the preferred embodiments provided by this disclosure, all other embodiments obtained by those skilled in the art without creative effort should still fall within the scope of protection of this disclosure.
[0024] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0025] The YOLOX algorithm is an improvement on YOLOv3. The entire network can be divided into three parts: the backbone network: CSPDarknet, the neck network: FPN, and the detection head: YOLO Head.
[0026] The detection head of the YOLO series has always been known for its simplicity and effectiveness, with continuous updates and improvements from YOLO-v1 to YOLO-v5. YOLOX innovatively uses three decoupled heads, focusing on cls (classification information), reg (boundary localization information), and IOU (confidence information) respectively. This gives the decoupled head an advantage over conventional detection heads in feature representation and learning capabilities, while also accelerating model convergence. However, the detection head still suffers from the drawback of classification and detection being unrelated. Therefore, this application proposes an improved detection head, Pro-head, which not only applies the YOLOX network to the field of bridge defect recognition but also strengthens the interaction between classification and detection tasks, thereby improving the detector's ability to learn alignment.
[0027] The technical solutions proposed in the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0028] This application provides a bridge defect detection method based on an improved YOLOX, such as... Figure 1 As shown in the embodiments of this application, the method mainly includes the following steps:
[0029] Step 110: Input the bridge damage images into the YOLOx network, perform data preprocessing on the bridge damage images, and split the preprocessed bridge damage images into training and testing sets.
[0030] It should be noted that a YOLOx network consists of a backbone network, a neck FPN, and a detection head. The bridge defect images input to the YOLOx network can be a single set of bridge defect images; the method for splitting the set into training and testing sets can be determined by those skilled in the art.
[0031] As an example, this step can be specifically as follows: adjust the size of the input bridge defect image to a preset size through the backbone network; normalize the adjusted bridge defect image; and split the normalized bridge defect image into a training set and a test set.
[0032] The preset size can be 640*640*3. The normalization process can be as follows: subtract the average pixel value of the bridge defect image from all pixel values in the bridge defect image, and then divide the difference by the standard deviation of the bridge defect image. The result is the normalized pixel value.
[0033] Step 120: Perform transfer learning on the initial pre-trained model of the YOLOx network using the preset VOC dataset to obtain the first pre-trained model. Then, update the network weights corresponding to the first pre-trained model using the training set and the Siou loss function to obtain the final pre-trained model, thus completing the adjustment of the network weights of the YOLOx network.
[0034] It should be noted that the preset VOC (Visual Object Classes) dataset can be obtained directly from the internet. The training set includes at least two training sets, and the bridge damage images in the training set include both predicted bounding boxes and ground truth bounding boxes.
[0035] The method used for transfer learning is an existing method, and this application does not limit it.
[0036] Specifically, the process involves transferring learning from the initial pre-trained model of the YOLOx network using a pre-defined VOC dataset to obtain a first pre-trained model. The network weights of this first pre-trained model are then updated using the training set and the Siou loss function to obtain the final pre-trained model, thus adjusting the network weights of the YOLOx network. This can be further described as follows:
[0037] Using a pre-defined VOC dataset, transfer learning is performed on the YOLOX weights in the initial pre-trained model to obtain a first pre-trained model. Pre-defined weights in the YOLOX weights of the first pre-trained model are frozen, and then iteratively trained on the first training set to obtain a second pre-trained model. The second pre-trained model is then trained using the second training set, and the pre-defined weights are unfrozen according to a pre-defined weight unfreezing order to obtain a third pre-trained model. All pre-trained models utilize optimal transfer theory to globally allocate bridge defect data corresponding to each target box in the model to obtain predicted bounding boxes corresponding to the bridge defect data. The model includes an initial pre-trained model, a first pre-trained model, a second pre-trained model, and a third pre-trained model. All pre-trained models use the Siou loss function to calculate the loss between the predicted bounding boxes and the ground truth bounding boxes to obtain the loss calculation result corresponding to the third pre-trained model. Using the backpropagation algorithm and the loss calculation result, the network weights in the third pre-trained model are updated to obtain several weight update sets. Among these, the network weights include preset weights. The weight update set with the highest accuracy in predicting bounding boxes is determined from the several weight update sets, and the network weights in the third pre-trained model are updated to the weight update set with the highest accuracy in predicting bounding boxes to obtain the final pre-trained model.
[0038] In addition, the aforementioned preset weights include at least the learning rate; after the preset weights are unfrozen according to the preset weight unfreezing order, during the iterative training of the second pre-trained model using the second training set, this application can adjust the learning rate using a cosine annealing strategy.
[0039] It should be noted that the specific application methods of the Siou loss function, backpropagation algorithm, optimal transport theory and cosine annealing strategy are existing methods, and this application does not limit them.
[0040] Step 130: Load the test set through the backbone network and output the feature point set corresponding to the test set; perform feature sampling and fusion on the feature set points through the neck FPN to obtain several feature layers; input the feature layers into the detection head, and obtain the scale features corresponding to the feature layers through the preset feature extraction network in the detection head; input the scale features into the task aligner TAP in the detection head for scale feature classification and task alignment, thereby obtaining classification information and detection box localization information.
[0041] It should be noted that the backbone network is a network algorithm that can output feature points, such as CSPDarknet; the neck FPN is a network algorithm that performs feature sampling and fusion in the existing YOLOX network to obtain several feature layers.
[0042] Unlike traditional methods that import several feature layers into different detection heads, this application imports several feature layers into a single detection head after obtaining them, and then obtains classification information and bounding box localization information through a single detection head.
[0043] As an example, this application obtains scale features corresponding to the feature layer through a preset feature extraction network in the detection head; the scale features are then input into the task aligner (TAP) in the detection head for scale feature classification and task alignment, thereby obtaining classification information and detection box localization information, which can be specifically as follows:
[0044] The feature layer is input into the Stem layer of a preset feature extraction network for channel compression; then, features are learned from the feature layer through several convolutional layers with activation functions in the preset feature extraction network; thus, the scale features corresponding to the feature layer are obtained; and the preset formula is used: To obtain classification information or detection box location information; among which, These are cascaded features that combine scale features with task interaction features. and All are 1x1 convolutions used for dimensionality reduction. This is used for classification information or detection box location information.
[0045] besides, Figure 2 This application provides a bridge defect detection system based on an improved YOLOX. For example... Figure 2 As shown in the embodiments of this application, the system mainly includes:
[0046] The system inputs bridge defect images into the YOLOx network through the preprocessing module 210, performs data preprocessing on the bridge defect images, and splits the preprocessed bridge defect images into training and testing sets.
[0047] It should be noted that the YOLOx network includes a backbone network, a neck FPN, and a detection head. The preprocessing module 210 can be any feasible device or apparatus capable of performing data preprocessing.
[0048] The adjustment module 220 in the system performs transfer learning on the initial pre-trained model of the YOLOx network using a preset VOC dataset to obtain the first pre-trained model. Then, it updates the network weights corresponding to the first pre-trained model using the training set and the Siou loss function to obtain the final pre-trained model, thus completing the adjustment of the network weights of the YOLOx network.
[0049] It should be noted that the adjustment module 220 can be any feasible device or apparatus capable of weight adjustment. The training set includes at least: a preset VOC dataset, a first training set, and a second training set, and the bridge defect images in the training set include: predicted bounding boxes and ground truth bounding boxes.
[0050] This application uses a preset VOC dataset to perform transfer learning on the initial pre-trained model of the YOLOx network to obtain a first pre-trained model. The network weights corresponding to the first pre-trained model are then updated using the training set and the Siou loss function to obtain the final pre-trained model. The adjustment of the network weights of the YOLOx network can be achieved through the update unit 221 in the adjustment module 220.
[0051] Specifically, the update unit 221 performs transfer learning on the YOLOX weights in the initial pre-trained model using a preset VOC dataset to obtain a first pre-trained model; freezes the preset weights in the YOLOX weights of the first pre-trained model, and then iteratively trains the first pre-trained model using a first training set to obtain a second pre-trained model; performs selective training on the second pre-trained model using the second training set, and simultaneously unfreezes the preset weights according to the preset weight unfreezing order to obtain a third pre-trained model; wherein, all pre-trained models use the optimal transfer theory to globally allocate the bridge defect data corresponding to each target box in the model to obtain the predicted bounding box corresponding to the bridge defect data. In this process, all pre-trained models include an initial pre-trained model, a first pre-trained model, a second pre-trained model, and a third pre-trained model. All pre-trained models use the Siou loss function to calculate the loss between the predicted bounding boxes and the ground truth bounding boxes, obtaining the loss calculation result corresponding to the third pre-trained model. Using the backpropagation algorithm and the loss calculation result, the network weights in the third pre-trained model are updated to obtain several weight update sets. These network weights include preset weights. The weight update set with the highest predicted bounding box accuracy among these weight update sets is determined, and the network weights in the third pre-trained model are updated to the weight update set with the highest predicted bounding box accuracy, thus obtaining the final pre-trained model.
[0052] The acquisition module 230 in the system loads the test set through the backbone network and outputs the feature point set corresponding to the test set; it performs feature sampling and fusion on the feature set points through the neck FPN to obtain several feature layers; it inputs the feature layers into the detection head, and obtains the scale features corresponding to the feature layers through the preset feature extraction network in the detection head; it inputs the scale features into the task aligner TAP in the detection head to classify the scale features and align them with the task, thereby obtaining classification information and detection box localization information.
[0053] The acquisition module 230 can be any feasible device or apparatus capable of obtaining classification information and detection box localization information through feature processing.
[0054] The above-mentioned scale features corresponding to the feature layer are obtained through the preset feature extraction network in the detection head; the scale features are input into the task aligner TAP in the detection head for scale feature classification and task alignment, thereby obtaining classification information and detection box localization information, which can be achieved by the acquisition unit 231 in the acquisition module 230.
[0055] Specifically, the obtaining unit 231 inputs the feature layer into the Stem layer of a preset feature extraction network for channel compression; then learns features from the feature layer through several convolutional layers with activation functions in the preset feature extraction network; thereby obtaining the scale features corresponding to the feature layer; and then using a preset formula: To obtain classification information or detection box location information; among which, These are cascaded features that combine scale features with task interaction features. and All are 1x1 convolutions used for dimensionality reduction. This is used for classification information or detection box location information.
[0056] The above are method embodiments of this application. Based on the same inventive concept, this application also provides a bridge defect detection device based on an improved YOLOX. Figure 3 As shown, the device includes: a processor; and a memory storing executable code thereon, which, when executed, causes the processor to perform a bridge defect detection method based on an improved YOLOX as described in the above embodiment.
[0057] Specifically, the server inputs bridge defect images into a YOLOx network for data preprocessing, splitting the preprocessed images into training and testing sets. The YOLOx network comprises a backbone network, a neck FPN, and a detection head. Transfer learning is performed on the pre-trained model of the YOLOx network using the training set, and the network weights of the pre-trained model are updated using the Siou loss function to obtain the final pre-trained model, thus adjusting the network weights of the YOLOx network. The backbone network loads the testing set and outputs the corresponding feature point set. The neck FPN performs feature sampling and fusion on the feature points to obtain several feature layers. These feature layers are input into the detection head, where a pre-defined feature extraction network extracts the scale features corresponding to the feature layers. The scale features are then input into the Task Aligner (TAP) in the detection head for scale feature classification and task alignment, thereby obtaining classification information and bounding box localization information.
[0058] In addition, this application embodiment also provides a non-volatile computer storage medium storing executable instructions, which, when executed, implement the bridge defect detection method based on the improved YOLOX described above.
[0059] The technical solutions of this disclosure have been described in conjunction with the preceding embodiments. However, it will be readily understood by those skilled in the art that the scope of protection of this disclosure is not limited to these specific embodiments. Without departing from the technical principles of this disclosure, those skilled in the art can disassemble and combine the technical solutions in the above embodiments, and can also make equivalent changes or substitutions to the relevant technical features. Any changes, equivalent substitutions, improvements, etc., made within the technical concept and / or technical principles of this disclosure will fall within the scope of protection of this disclosure.
Claims
1. A bridge defect detection method based on an improved YOLOX, characterized in that, The method includes: Bridge defect images are input into a YOLOx network for data preprocessing. The preprocessed bridge defect images are then split into training and testing sets. The YOLOx network consists of a backbone network, a neck FPN, and a detection head. The initial pre-trained model of the YOLOx network is transferred to the VOC dataset to obtain the first pre-trained model. The network weights of the first pre-trained model are then updated using the training set and the Siou loss function to obtain the final pre-trained model, thus adjusting the network weights of the YOLOx network. The training set includes at least two sets: a first training set and a second training set. The bridge damage images in the training set include both predicted and ground truth bounding boxes. Specifically, they include: Using a pre-defined VOC dataset, transfer learning is performed on the YOLOX weights in the initial pre-trained model to obtain a first pre-trained model. Pre-defined weights in the YOLOX weights of the first pre-trained model are frozen, and then iteratively trained on the first training set to obtain a second pre-trained model. The second pre-trained model is then trained using the second training set, and the pre-defined weights are unfrozen according to a pre-defined weight unfreezing order to obtain a third pre-trained model. All pre-trained models utilize optimal transfer theory to globally allocate bridge defect data corresponding to each target box in the model to obtain predicted bounding boxes corresponding to the bridge defect data. The model includes an initial pre-trained model, a first pre-trained model, a second pre-trained model, and a third pre-trained model. All pre-trained models use the Siou loss function to calculate the loss between the predicted bounding boxes and the ground truth bounding boxes to obtain the loss calculation result corresponding to the third pre-trained model. Using the backpropagation algorithm and the loss calculation result, the network weights in the third pre-trained model are updated to obtain several weight update sets. Among these, the network weights include preset weights. The weight update set with the highest accuracy in predicting bounding boxes is determined from several weight update sets, and the network weights in the third pre-trained model are updated to the weight update set with the highest accuracy in predicting bounding boxes to obtain the final pre-trained model. The test set is loaded through the backbone network, and the corresponding feature point set is output. The feature set points are sampled and fused through the neck FPN to obtain several feature layers. The feature layers are input into the detection head, and the scale features corresponding to the feature layers are obtained through the preset feature extraction network in the detection head. The scale features are input into the task aligner TAP in the detection head for scale feature classification and task alignment, thereby obtaining classification information and detection box localization information.
2. The bridge defect detection method based on improved YOLOX according to claim 1, characterized in that, Data preprocessing was performed on the bridge defect images, and the preprocessed bridge defect images were split into training and testing sets, specifically including: The input bridge defect images are resized to a preset size using the backbone network; the resized bridge defect images are then normalized; and the normalized bridge defect images are split into training and testing sets.
3. The bridge defect detection method based on improved YOLOX according to claim 1, characterized in that, The preset weights include at least the learning rate; After unfreezing the preset weights according to the preset weight unfreezing order, the method further includes: During the iterative training of the second pre-trained model using the second training set, the learning rate is adjusted using a cosine annealing strategy.
4. The bridge defect detection method based on improved YOLOX according to claim 1, characterized in that, The scale features corresponding to the feature layer are obtained by using a preset feature extraction network in the detection head; The scale features are input into the Task Aligner (TAP) in the detection head for scale feature classification and task alignment, thereby obtaining classification information and bounding box localization information, specifically including: The feature layer is input into the Stem layer of the preset feature extraction network for channel compression; then, the feature is learned from the feature layer through several convolutional layers with activation functions in the preset feature extraction network; thus, the scale feature corresponding to the feature layer is obtained. By using a preset formula: To obtain classification information or detection box location information; among which, These are cascaded features that combine scale features with task interaction features. and All are 1x1 convolutions used for dimensionality reduction. This is used for classification information or detection box location information.
5. A bridge defect detection system based on an improved YOLOX, characterized in that, The system includes: The preprocessing module is used to input bridge defect images into the YOLOx network, perform data preprocessing on the bridge defect images, and split the preprocessed bridge defect images into training and testing sets; the YOLOx network includes a backbone network, a neck FPN, and a detection head; The adjustment module is used to perform transfer learning on the initial pre-trained model of the YOLOx network using a preset VOC dataset to obtain the first pre-trained model, and to update the network weights corresponding to the first pre-trained model using the training set and the Siou loss function to obtain the final pre-trained model, thus completing the adjustment of the network weights of the YOLOx network. The training set includes at least: a first training set and a second training set, and the bridge defect images in the training set include: predicted bounding boxes and ground truth bounding boxes; The adjustment module includes an update unit, used to perform transfer learning on the YOLOX weights in the initial pre-trained model using a preset VOC dataset to obtain a first pre-trained model; freeze preset weights in the YOLOX weights of the first pre-trained model, and then iteratively train the first pre-trained model using a first training set to obtain a second pre-trained model; perform selective training on the second pre-trained model using the second training set, and simultaneously unfreeze preset weights according to the preset weight unfreezing order to obtain a third pre-trained model; wherein, all pre-trained models use optimal transfer theory to globally allocate the bridge defect data corresponding to each target box in the model to obtain the predicted bounding boxes corresponding to the bridge defect data. All pre-trained models include an initial pre-trained model, a first pre-trained model, a second pre-trained model, and a third pre-trained model. All pre-trained models use the Siou loss function to calculate the loss between the predicted bounding boxes and the ground truth bounding boxes, obtaining the loss calculation result corresponding to the third pre-trained model. Using the backpropagation algorithm and the loss calculation result, the network weights in the third pre-trained model are updated to obtain several weight update sets. The network weights include preset weights. The weight update set with the highest predicted bounding box accuracy among these weight update sets is determined, and the network weights in the third pre-trained model are updated to the weight update set with the highest predicted bounding box accuracy to obtain the final pre-trained model. The acquisition module is used to load the test set through the backbone network and output the feature point set corresponding to the test set; the feature set points are sampled and fused through the neck FPN to obtain several feature layers; the feature layers are input into the detection head, and the scale features corresponding to the feature layers are obtained through the preset feature extraction network in the detection head; the scale features are input into the task aligner TAP in the detection head for scale feature classification and task alignment, thereby obtaining classification information and detection box localization information.
6. The bridge defect detection system based on the improved YOLOX according to claim 5, characterized in that, The acquisition module includes acquisition units. This is used to input the feature layer into the Stem layer of a preset feature extraction network for channel compression; then, through several convolutional layers with activation functions in the preset feature extraction network, features are learned from the feature layer; and finally, the scale features corresponding to the feature layer are obtained. By using a preset formula: To obtain classification information or detection box location information; among which, These are cascaded features that combine scale features with task interaction features. and All are 1x1 convolutions used for dimensionality reduction. This is used for classification information or detection box location information.
7. A bridge defect detection device based on an improved YOLOX, characterized in that, The device includes: processor; And a memory having executable code stored thereon, which, when executed, causes the processor to perform a bridge defect detection method based on an improved YOLOX as described in any one of claims 1-4.
8. A non-volatile computer storage medium, characterized in that, It stores computer instructions, which, when executed, implement a bridge defect detection method based on an improved YOLOX as described in any one of claims 1-4.
Citation Information
Patent Citations
Middle school physics experiment apparatus detection method based on improved YOLOv5
CN115937674A
Rapid target detection method based on convolutional neural network
CN116091892A