Bridge disease small sample detection large model construction method

By employing generative augmentation and pseudo-label closed-loop sample expansion, two-stage pre-training, LoRA fine-tuning, and FPN/CBAM optimization, a large-scale bridge defect detection model with small sample size solves the problems of small sample size and domain adaptation in bridge defect detection. This model achieves high-precision and strong generalization of bridge defect detection, adapts to edge deployment, improves detection accuracy and generalization ability, and reduces computational overhead.

CN123160950APending Publication Date: 2026-11-24HEBEI UNIV OF TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611372211.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-05
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Bridge scenarios are complex, with diverse and minute defects, and severe background interference. Existing deep learning models for bridge defect detection suffer from small sample dilemmas, domain adaptation problems, and limited computing resources, making it difficult to achieve high-precision and highly generalized specialized defect detection.

Method used

We designed a large-scale model for detecting bridge defects using small samples. We expanded the sample size through generative augmentation and pseudo-label closed-loop, reduced domain bias through two-stage pre-training, improved generalization ability through LoRA fine-tuning and meta-learning, optimized FPN and CBAM modules to enhance small target detection, and improved accuracy by integrating weighted Focal Loss and CIoU Loss. The model is then lightweight and deployed on edge inspection equipment.

Benefits of technology

Achieve high-precision and highly generalized bridge defect detection with limited data, adapt to edge deployment, improve detection accuracy and generalization ability, reduce computational overhead, adapt to edge inspection equipment, and support real-time detection and online iteration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123160950A_ABST
    Figure CN123160950A_ABST
Patent Text Reader

Abstract

This invention discloses a method for constructing a large model for small-sample bridge defect detection, belonging to the interdisciplinary field of computer vision and bridge engineering inspection. It includes dataset construction and scene-based enhancement, two-stage pre-training adaptation, efficient PEFT parameter fine-tuning, and customized model structure optimization. Data construction and training optimization significantly improve model accuracy and generalization ability. By constructing a pixel-level labeled small-sample dataset following the "Standards for Technical Condition Assessment of Highway Bridges," and combining a diffusion model and CLIP screening mechanism for high-quality generative enhancement, the problem of scarce professional data is fundamentally solved. Two-stage pre-training (COCO general pre-training + bridge domain pre-training) effectively reduces domain bias, while the loss function design integrating weighted Focal Loss and CIoULoss accurately addresses the challenges of sample imbalance and localization accuracy. Combined with small-sample adaptation training strategies (such as early stopping and cross-validation), the model achieves high-precision and strong generalization detection performance with limited data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the interdisciplinary field of computer vision and bridge engineering inspection, and in particular to a method for constructing a large model for small sample detection of bridge defects. Background Technology

[0002] With the continuous expansion of highway bridges in my country, traditional manual inspection methods can no longer meet the high-frequency, high-precision maintenance needs. Automated defect detection technology based on computer vision has become a research hotspot, especially deep learning models, which have demonstrated excellent performance in general object detection tasks. Current mainstream methods rely on large-scale, high-quality labeled data for end-to-end training and have achieved good results in laboratory environments, providing a potential technical path for intelligent bridge maintenance.

[0003] However, directly applying existing deep learning models to practical bridge defect detection faces several severe challenges. First, high-quality defect image data in specialized fields is scarce and annotation costs are extremely high, leading to a severe small-sample dilemma in model training and a high risk of overfitting. Second, bridge scenarios are complex, with diverse defect morphologies and small scales, and significant background interference, causing general-purpose models to exhibit significant domain adaptation problems, resulting in high rates of missed and false detections. Furthermore, high-performance models have high computational costs, making direct deployment to edge inspection equipment with limited computing resources difficult. Therefore, there is an urgent need for a dedicated defect detection method that can achieve high accuracy and strong generalization with limited data and is adaptable to edge deployment. Summary of the Invention

[0004] The technical problem to be solved by this invention is that bridge scenarios are complex, with diverse and small-scale defects and severe background interference. This invention provides a method for constructing a large model for small-sample detection of bridge defects. This method can achieve high accuracy and strong generalization with limited data and can adapt to specialized defect detection for edge deployment.

[0005] To address the aforementioned issues, the following technical solution is provided: A method for constructing a large-scale model for small-sample bridge defect detection is designed, comprising six steps: dataset construction and scenario-based enhancement, two-stage pre-training adaptation, efficient fine-tuning of PEFT parameters, customized optimization of model structure, optimization of loss function and training strategy, and model validation and deployment. The method expands the sample size through generative enhancement and pseudo-label loop closure, reduces domain bias through two-stage pre-training, improves small-sample generalization ability through LoRA fine-tuning and meta-learning, optimizes FPN and CBAM modules to enhance small target detection and anti-interference capabilities, and integrates weighted Focal Loss and CIoU Loss to improve detection accuracy. The resulting lightweight model is then deployed on edge inspection equipment.

[0006] The above technical solutions achieve simultaneous improvements in accuracy, generalization ability, and practicality through multi-technology collaboration. Generative augmentation and pseudo-label closed-loop strategies efficiently generate high-quality adapted samples when the original samples are limited, filling data gaps and ensuring sample validity, providing reliable support for model training. Two-stage pre-training significantly reduces domain bias, enabling the model to master the basic features of bridge defects in advance and improving scene adaptability. The combination of LoRA (Low-Rank Adaptation) fine-tuning and meta-learning reduces computational costs and memory usage while accurately focusing on core features, strengthening generalization ability in small-sample scenarios, and ensuring stable model performance. Customized optimization of FPN (Feature Pyramid Network) and CBAM (Convolutional Block Attention Module) enhances the extraction of small-target defect features, using the attention mechanism to suppress environmental interference and achieve accurate capture of minute defects. The fusion of weighted Focal Loss and CIoULoss (Complete Intersection over Union Loss) solves the problems of imbalanced samples and difficult example learning, accurately optimizing bounding box matching and significantly reducing false negative and false positive rates. After lightweight optimization, the model maintains high performance while reducing the number of parameters and computational overhead. It can be deployed on edge inspection equipment for real-time detection without relying on the cloud, improving inspection efficiency, reducing costs, and providing accurate data support for bridge maintenance decisions. This method integrates the advantages of all core algorithms to construct a high-precision, highly generalizable, interference-resistant, and lightweight detection model that accurately adapts to edge inspection needs, promoting the intelligent upgrade of defect detection. Addressing the imbalance in bridge defect categories (e.g., fewer micro-crack samples and more ordinary crack samples), it strengthens the training of scarce categories through weight coefficients, as shown in the following formula: The parameters are explained below: Number of samples in a single training batch; : No. The category weights corresponding to each sample are set as follows: rare diseases (such as support deformation, foundation scour) are set as follows: Common defects (such as concrete cracks) are set as ,satisfy Balance the proportion of categories; Model for the first The predicted class probability of each sample; if it is a positive sample (the target disease exists), then... To predict the probability of disease category, negative samples (no disease) are used to predict the probability of the "no disease" category. Focus parameter, range of values It is used to reduce the loss contribution of easily classified samples (high confidence samples) and focus on small sample diseases that are difficult to classify.

[0007] The formula used to optimize the positioning accuracy of bridge defect detection frames, especially suitable for irregular defects such as thin cracks and irregular spalling, is as follows: Explanation of parameters and derived formulas: IoU (Intersection over Union): The degree of overlap between the detection bounding box and the ground truth bounding box, a core measure of localization accuracy. ,in For the model's predicted bounding box, The actual bounding boxes are manually labeled; : Center point of the prediction box Center point of the real frame The square of the Euclidean distance; The diagonal length of the smallest bounding rectangle that can simultaneously contain both the predicted bounding box and the ground truth bounding box; Balance coefficient ; The consistency index between the aspect ratio of the predicted bounding box and the ground truth bounding box. ,in To predict the width and height of the bounding box, This represents the actual frame width and height.

[0008] Furthermore, in the dataset construction and scenario enhancement steps, based on the "Standard for Technical Condition Assessment of Highway Bridges", the basic small sample annotation set needs to cover the superstructure, substructure and deck system of the bridge, with no less than 50 samples for each category and no less than 300 samples for the entire set, and the annotation accuracy of small target defects reaches the pixel level.

[0009] The aforementioned technical solution establishes a high-quality, high-coverage professional bridge defect image dataset by strictly adhering to the "Standards for Technical Condition Assessment of Highway Bridges," providing a solid data foundation for intelligent bridge detection and assessment based on deep learning. This method first ensures that the basic small-sample annotation set systematically covers key components such as the bridge superstructure, substructure, and deck system. Furthermore, by setting a sample size requirement of no less than 50 images per category and no less than 300 images for the entire dataset, it effectively avoids overfitting and insufficient generalization due to insufficient samples in the initial stage when data is scarce. More importantly, it requires pixel-level annotation accuracy for small-target defects (such as micro-cracks, spalling, and rust spots). This directly supports the training and application of advanced algorithms requiring high-precision localization and segmentation (such as instance segmentation algorithms based on Mask R-CNN or semantic segmentation algorithms based on U-Net and its variants), enabling the model to accurately identify and quantify the morphology and distribution of defects, thereby achieving a refined assessment of the technical condition. Furthermore, the aforementioned scenario-based enhancement steps significantly improve the diversity and complexity of the dataset by simulating complex on-site conditions such as varying lighting, weather, occlusion, and shooting angles. This helps enhance the robustness of the trained model, enabling it to maintain high-precision defect detection and identification capabilities in real and ever-changing road and bridge inspection environments. In summary, this systematic data construction and enhancement method not only directly improves the performance ceiling of subsequent deep learning models but also lays an indispensable data foundation for achieving automated and high-precision highway and bridge technical condition assessments that meet industry standards.

[0010] For small targets (area < 50 pixels²) such as microcracks and micro-peeling, the deviation between the detected bounding box and the ground truth bounding box is measured by the following formula: Parameter explanation: M: Total number of small target disease samples; : No. The minimum side length of the ground truth bounding box for each small target is used to normalize the error (to avoid misclassification due to an underestimation of the absolute error of small targets); Requirements: <0.2, ensuring accurate location of small-target diseases.

[0011] Furthermore, the generative enhancement uses a diffusion model combined with professional prompts for bridge defects to generate simulation samples. High-quality samples are selected using the CLIP model based on cosine similarity calculation, with the selection condition set to similarity > 0.8. The prompts include descriptions of defect type, size, morphology, and environmental characteristics.

[0012] The aforementioned technical solution, which uses the CLIP model based on cosine similarity calculation to screen high-quality samples, creatively solves the core bottleneck of scarce, difficult, and costly real defect samples in the field of bridge defect detection, providing large-scale, high-quality, and customizable training data for deep learning models. This method first utilizes advanced generative artificial intelligence technology such as stable diffusion models to synthesize highly realistic and diverse bridge defect images based on refined professional prompts describing defect type, size, morphology, and environmental features. This overcomes the limitations of traditional data augmentation techniques (such as rotation, cropping, and color dithering) which can only perform low-level geometric and appearance transformations, achieving the generation of novel and physically logical defect morphologies and complex background combinations at the semantic level, greatly expanding the coverage of data distribution. Subsequently, by introducing the CLIP model to calculate the cosine similarity between the generated samples and corresponding text prompts in a shared multimodal embedding space, and setting a strict screening threshold (similarity > 0.8), an automated and quantifiable quality assessment and filtering mechanism is constructed. This step is crucial, effectively ensuring the semantic fidelity of the generated samples. It guarantees a high degree of consistency between the visual content and the intended professional description, filtering out semantically ambiguous or poorly generated noisy samples, ultimately forming a clean and reliable augmented dataset. This process combines the powerful generation capabilities of the diffusion model with the cross-modal understanding capabilities of the CLIP model, forming a closed loop of "generation-evaluation." This ensures that the generated data is not only abundant but also highly controllable and professional in quality. This directly contributes to training more robust and generalizable disease identification models (such as YOLO, Faster R-CNN object detection models, or DeepLab segmentation models), enabling them to more accurately handle the vast differences in disease manifestations in the real world. It significantly improves the practicality and reliability of automated detection systems, providing key technological support for promoting intelligent bridge maintenance from the laboratory to engineering applications.

[0013] The visual feature similarity between generated samples and real samples is calculated based on the CLIP model. High-quality generated samples are selected using the cosine similarity formula: Parameter descriptions: Generate visual feature vectors (usually 512 or 1024 dimensions) extracted from samples using the CLIP model. Visual feature vectors extracted from real samples using the CLIP model; L2 norm, used to normalize feature vectors; Selection criteria: This ensures that the generated samples are consistent with the actual bridge defects.

[0014] Furthermore, in the two-stage pre-training adaptation step, the first stage completes general visual pre-training based on the COCO general object detection dataset, and the second stage completes bridge-domain specific pre-training based on bridge defect-free structural images and publicly available small datasets of bridge defects, realizing the transition of the model from general recognition to bridge scene recognition.

[0015] The aforementioned technical solution employs a progressive knowledge transfer strategy to effectively and smoothly adapt the basic feature extraction and pattern recognition capabilities learned by the model in general vision tasks to the highly specialized scenario of bridge defect detection. This maximizes the model's initial performance and convergence speed under conditions of data scarcity. The first stage involves pre-training on large-scale general object detection datasets (such as the COCO dataset), allowing the model (e.g., backbone networks like Faster R-CNN, YOLOv5, or Vision Transformer) to fully grasp the general visual features of various objects in nature (such as edges, textures, shapes, and contextual relationships). This process leverages the powerful generalization capabilities of big data-driven deep learning models. The second stage focuses on the bridge domain, using images of bridge structures without defects and publicly available small-scale defect datasets for domain-specific pre-training. This crucial step enables the model to further focus on learning the inherent features of bridge structures (such as typical geometric shapes and material textures of piers, beams, and bridge decks), normal visual patterns, and initial local representations of defects, building upon its existing general visual knowledge. This phased training strategy essentially follows the "broad first, then specialized" transfer learning principle. It effectively avoids the problems of overfitting and unstable convergence that can easily occur when training directly on small-scale, high-difficulty professional datasets. Through the second stage of bridge domain pre-training, the model's parameter space is guided to an optimization starting point closer to the target task, significantly improving the model's sensitivity and specificity to bridge scenarios. This lays an excellent initialization foundation for subsequent final fine-tuning on core, high-quality labeled disease datasets. This makes the entire model training process more efficient and stable, enabling better final performance with limited labeled data. It is a core technical path for solving data bottlenecks in professional vertical domain AI applications and building high-precision specialized models.

[0016] Furthermore, the PEFT parameter fine-tuning uses LoRA or Adapter modules as the core fine-tuning units, inserts them into the model feature fusion layer and classification regression head, freezes more than 90% of the parameters of the model backbone feature extraction layer, and trains only the parameters of the fine-tuning module and the detection head, with the number of trained parameters ≤ 5% of the total number of parameters of the original model.

[0017] The above technical solution uses LoRA (Low-Rank Adaptation) or Adapter modules as the core fine-tuning units, inserts them into the model feature fusion layer and classification regression head, and freezes more than 90% of the parameters of the model's backbone feature extraction layer. It trains only the parameters of the fine-tuning module and the detection head, thus keeping the number of training parameters within 5% of the total number of parameters in the original model. This is beneficial because it creatively solves the core contradictions of high computational cost, large storage overhead, and significant overfitting risk when performing professional adaptation of large-scale pre-trained visual models in resource-constrained engineering scenarios. This method achieves efficient capture of the specific knowledge of downstream bridge defect detection tasks with very few additional trainable parameters (typically only 0.5% to 5% of the original model parameters) by bypassing key layers of the pre-trained model (such as self-attention or feedforward network bypass in the Transformer block, or feature fusion layer of CNN). Specifically, LoRA parameterizes the weight update amount as a low-rank decomposition matrix (ΔW = BA, where B and A are low-rank matrices), while the Adapter inserts a tiny feedforward network containing the bottleneck structure into the model.

[0018] Furthermore, in the customized optimization of the model structure, the enhancement of small target features is achieved by optimizing the FPN structure, adding a feature map output branch with a resolution of 800×800 or higher, and fusing deep semantic features with shallow detail features; at the same time, a CBAM hybrid attention module is inserted to filter key feature channels and focus on the disease area, suppressing background interference.

[0019] The above technical solution, through model structure customization and optimization, achieves small target feature enhancement by optimizing the Feature Pyramid Network (FPN) structure. Specifically, this includes adding a high-resolution feature map output branch with a resolution of 800×800 or higher to fuse deep semantic features and shallow detail features. Simultaneously, a Convolutional Block Attention (CBAM) module is inserted to filter key feature channels, focus on the diseased area, and suppress background interference. Its beneficial effect lies in directly addressing the key technical challenge of accurately identifying and locating small, low-contrast targets such as minute cracks and localized peeling, which are common in bridge disease detection scenarios. It systematically improves the model from two levels: multi-scale feature representation and adaptive feature enhancement, significantly enhancing the model's sensitivity and detection accuracy for small target diseases. From the perspective of multi-scale feature fusion, traditional FPN structures typically build the pyramid from the deeper layers of the backbone network, which may result in the loss of key detail information of small targets even in the highest-resolution feature maps used for detection. By adding higher-resolution input branches (e.g., 800×800 pixels) or making more refined use of shallow features in the backbone network, the bottom of the feature pyramid can retain richer spatial details and edge texture information. Then, through top-down paths and lateral connections, the deep, strong semantic features are effectively fused with these high-resolution shallow detail features, generating a multi-scale feature representation with both strong semantics and high spatial resolution. This provides a crucial information foundation for the subsequent detection head to accurately regress the location and boundaries of small targets. From the adaptive feature enhancement level, the introduced CBAM module achieves dual fine-tuning of the fused features by sequentially implementing channel attention and spatial attention mechanisms. The channel attention submodule aggregates spatial information through global average pooling and max pooling, and then generates channel weights through a shared multilayer perceptron, thereby emphasizing feature channels related to disease and suppressing unimportant channels. The spatial attention submodule generates a spatial weight map by concatenating the outputs of average pooling and max pooling along the channel dimension and applying convolutional layers, highlighting image regions where diseases may occur and weakening interference from complex backgrounds. This adaptive attention mechanism, combining channel and spatial domains, enables the model to dynamically and selectively focus on features most relevant to the defects, further amplifying the effective signals of small targets. In summary, this optimization of the FPN structure and integration of the CBAM attention mechanism synergistically enhances the model's ability to perceive, locate, and identify small defects in complex bridge scenarios, representing a core structural innovation that improves the practicality and reliability of overall technical condition assessment algorithms.

[0020] Furthermore, the loss function fusion adopts weighted Focal Loss as classification loss and CIoU Loss as localization loss, and constructs the total loss function with a classification loss to localization loss ratio of 1:1.2. The loss weight coefficient of rare disease categories is set to 1.5-2.5, and the weight coefficient of common disease categories is set to 0.5-1.0.

[0021] The aforementioned technical solution addresses the performance bottlenecks in bridge defect detection caused by uneven sample distribution, high positioning accuracy requirements, and the scarcity of key defects. Focal Loss automatically focuses on difficult-to-classify samples, effectively overcoming the problem of background and common defects dominating training. CIoU Loss achieves pixel-level precise positioning by comprehensively optimizing overlap area, center distance, and aspect ratio. A 1:1.2 ratio of classification to positioning loss ensures balanced development of recognition and positioning capabilities. The strategy of applying higher loss weights to scarce defects forces the model to improve its detection sensitivity for a few but high-risk defects. Overall, this design ensures that the model possesses excellent overall accuracy, recall rate of key targets, and stable positioning reliability in complex scenarios, directly enhancing the practical value and safety assurance capabilities of automated assessment.

[0022] Furthermore, the small sample adaptation training strategy adopts training parameters with a batch size of 8-16 and an initial learning rate of 1e-4. The learning rate decays exponentially with the number of training rounds. At the same time, an early stopping mechanism and 5-fold cross-validation are added. The early stopping condition is set to no improvement in the validation set mAP for 10 consecutive rounds.

[0023] The aforementioned technical solutions, through combined application, create a highly robust and automated training environment. This ensures that, under small sample constraints, the model can smoothly and fully learn the characteristics of bridge defects, while strictly suppressing over-memorization of limited training data. Ultimately, it guides the model to converge to a state that combines high accuracy and strong generalization ability, which is crucial for ensuring the reliability of the final bridge defect detection model in practical deployment.

[0024] First, calculate the average precision (AP) for a single disease category, then take the average across all disease categories, using the following formula: , Parameter descriptions: (Accuracy): The proportion of samples predicted as positive (indicating disease presence) that are actually positive. ; (Recall): The proportion of samples that are actually positive that are correctly predicted as positive. ; True positive (correctly detected disease). False positive (misdiagnosing disease as present when there is none) False negative (the presence of disease was missed and the disease was not detected). Total number of bridge defects For the first Average accuracy of disease types.

[0025] Furthermore, the model validation deployment adopts a multi-dimensional evaluation system, with core indicators including mAP, disease missed detection rate, and small target positioning error. The requirements are: total missed detection rate ≤5%, high-risk disease missed detection rate ≤3%, small target positioning error <0.2, and after INT8 quantization and channel pruning, the model volume ≤40% of the original volume and the accuracy loss ≤2%, which is compatible with edge inspection equipment.

[0026] The above technical solution delivers a usable model that is both accurate and compact: it meets the reliability threshold for engineering applications in terms of indicators, and is adapted to real edge computing environments in terms of form. This truly bridges the last mile of artificial intelligence from algorithm development to real-time intelligent on-site inspection, ensuring the automated, high-precision, and low-cost operation of regular bridge inspection and real-time monitoring.

[0027] Further, including: (1) constructing and enhancing a small sample dataset of bridge defects, generating simulation samples and pseudo-label samples to expand the training set; (2) selecting a basic visual model and completing two-stage pre-training; (3) performing efficient fine-tuning of small sample parameters based on PEFT technology and meta-learning; (4) optimizing the model structure to enhance small target detection and anti-interference capabilities; (5) configuring a fusion loss function and a training strategy adapted to small samples, training until the model performance is stable; (6) verifying the model performance through multi-dimensional indicators, deploying it on edge devices after lightweighting, and supporting online fine-tuning iteration.

[0028] The aforementioned technical solution constructs a systematic, closed-loop, and highly engineered solution that effectively overcomes the core challenges of small sample size, high accuracy, lightweight design, and strong generalization in intelligent bridge defect detection across the entire chain, from data, algorithms, optimization to deployment. S1 constructs and enhances a small-sample dataset of bridge defects, using generative models (such as diffusion models) to generate simulated samples and combining them with a self-training strategy to produce pseudo-labeled samples. This creates high-quality, diverse training data from the source, directly alleviating the fundamental bottleneck of scarce labeled data in specialized fields. S2 selects a basic visual model and completes two-stage pre-training. First, a powerful general visual representation is established on general datasets such as COCO. Then, domain-adaptive pre-training is performed on defect-free bridge structures and publicly available small-sample defect datasets, injecting crucial prior knowledge of bridge scenarios into the model and laying a foundation for superior initial feature extraction capabilities. S3, based on efficient PEFT parameter fine-tuning techniques (such as LoRA or Adapter modules) combined with meta-learning ideas, achieves rapid and efficient model adaptation to specific defects with only a small proportion of parameters needing to be trained, greatly reducing training costs and effectively preventing overfitting. S4 optimizes the model structure, such as improving the feature pyramid network to enhance the representation of small target features and inserting a convolutional attention module (CBAM) to suppress background interference, specifically strengthening the model's ability to perceive and locate subtle defects. S5 configures a composite loss function that integrates weighted Focal Loss and CIoU Loss, and adopts training strategies adapted to small samples (such as exponential decay learning rate, early stopping, and cross-validation) to finely guide the model to reach an optimal state between balancing categories, accurate localization, and preventing overfitting. Finally, S6 ensures model reliability through multi-dimensional performance verification (such as strictly limiting the false negative rate and localization error), and then efficiently deploys the model on edge devices through lightweight techniques such as INT8 quantization and channel pruning, supporting online fine-tuning iterations. This achieves a complete deployment from laboratory algorithm to a reliable and continuously evolving intelligent inspection system in the field. The entire process is interconnected and synergistic, ultimately delivering an end-to-end intelligent bridge defect detection system that maintains high accuracy and robustness even with limited data and meets the constraints of actual edge computing.

[0029] Compared with the prior art, the beneficial effects of the present invention are as follows: (1) The method for constructing a large model for small sample detection of bridge defects significantly improves the model accuracy and generalization ability through data construction and training optimization. By constructing a small sample dataset with pixel-level annotation in accordance with the "Standard for Evaluation of Technical Condition of Highway Bridges", and combining the diffusion model and CLIP screening mechanism for high-quality generative enhancement, the problem of scarce professional data is fundamentally solved. The dual-stage pre-training (COCO general pre-training + bridge domain pre-training) effectively reduces the domain offset, while the loss function design that integrates weighted Focal Loss and CIoU Loss accurately addresses the challenges of sample imbalance and positioning accuracy. Combined with small sample adaptation training strategies (such as early stopping and cross-validation), the model is ensured to obtain high-precision and strong generalization detection performance with limited data; (2) The method for constructing a large model for small sample detection of bridge defects ensures the practicality of the algorithm through lightweight model structure design and efficient fine-tuning. The PEFT technology (such as LoRA fine-tuning) is used to achieve efficient adaptation with less than 5% of the parameters trained, which greatly reduces the computation and storage costs. By customizing and optimizing the FPN structure (adding a high-resolution branch) and embedding the CBAM attention module, the feature extraction and anti-background interference capabilities for minor defects are significantly enhanced. This enables the model to accurately capture minor defects in bridges, providing reliable technical support for the refined assessment of technical conditions; (3) The method for constructing a large model for small-sample detection of bridge defects achieves efficient and reliable deployment in edge scenarios through full-link engineering design. By using multi-dimensional strict verification indicators (such as a false negative rate of ≤5%) and lightweight processing (INT8 quantization and channel pruning), it ensures that the model can be directly deployed on edge inspection equipment under the condition that the volume is compressed to 40% of the original volume and the accuracy loss is ≤2%. This solution opens up a closed loop from algorithm development to field application, supports real-time detection and online iteration, greatly improves the automation level and decision-making efficiency of bridge inspection, and promotes the intelligent upgrading of maintenance work. Attached Figure Description

[0030] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a schematic diagram of the overall process structure of the present invention; Figure 2 This is a schematic diagram of the auxiliary structure of the first step of the present invention; Figure 3 This is a schematic diagram of the auxiliary structure in the second step of the present invention; Figure 4 This is a schematic diagram of the auxiliary structure in the third step of the present invention; Figure 5 This is a schematic diagram of the auxiliary structure in the fourth step of the present invention; Figure 6 This is a schematic diagram of the auxiliary structure in the fifth step of the present invention; Figure 7 This is a schematic diagram of the auxiliary structure in the sixth step of the present invention. Detailed Implementation

[0031] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0032] like Figure 1 - Figure 7 As shown in the figure, this embodiment provides a method for building a large model for small sample detection of bridge defects, which includes six steps: dataset construction and scenario enhancement, two-stage pre-training adaptation, efficient fine-tuning of PEFT parameters, customized optimization of model structure, optimization of loss function and training strategy, and model validation and deployment.

[0033] Generative augmentation and pseudo-label closed-loop sample expansion are used, two-stage pre-training reduces domain bias, LoRA fine-tuning and meta-learning improve small sample generalization ability, FPN and CBAM modules are optimized to enhance small target detection and anti-interference ability, and weighted Focal Loss and CIoU Loss are integrated to improve detection accuracy. After being lightweight, it is deployed on edge inspection equipment.

[0034] Preferably, in the dataset construction and scenario enhancement steps, based on the "Standard for Technical Condition Assessment of Highway Bridges", the basic small sample annotation set should cover the superstructure, substructure and deck system of the bridge, with no less than 50 samples for each category and no less than 300 samples for the entire set, and the annotation accuracy of small target defects should reach the pixel level.

[0035] Preferably, generative enhancement uses a diffusion model combined with professional prompts for bridge defects to generate simulation samples. High-quality samples are selected using the CLIP model based on the cosine similarity calculation method, with the selection condition set to similarity > 0.8. The prompts include descriptions of defect type, size, morphology, and environmental characteristics.

[0036] Preferably, in the two-stage pre-training adaptation step, the first stage completes general visual pre-training based on the COCO general object detection dataset, and the second stage completes bridge-domain specific pre-training based on bridge defect-free structural images and publicly available small datasets of bridge defects, realizing the transition of the model from general recognition to bridge scene recognition.

[0037] Preferably, the PEFT parameter fine-tuning uses LoRA or Adapter modules as the core fine-tuning units, inserts the model feature fusion layer and classification regression head, freezes more than 90% of the parameters of the model backbone feature extraction layer, and trains only the parameters of the fine-tuning module and the detection head, with the number of training parameters ≤ 5% of the total number of parameters of the original model.

[0038] Preferably, in the customized optimization of the model structure, the enhancement of small target features is achieved by optimizing the FPN structure, adding a feature map output branch with a resolution of 800×800 or higher, and fusing deep semantic features with shallow detail features; at the same time, a CBAM hybrid attention module is inserted to filter key feature channels and focus on the disease area, suppressing background interference.

[0039] Preferably, the loss function fusion adopts weighted Focal Loss as the classification loss and CIoU Loss as the localization loss, and constructs the total loss function with a ratio of 1:1.2 between classification loss and localization loss. The loss weight coefficient for rare disease categories is set to 1.5-2.5, and the weight coefficient for common disease categories is set to 0.5-1.0.

[0040] Preferably, the small sample adaptation training strategy uses training parameters with a batch size of 8-16 and an initial learning rate of 1e-4. The learning rate decays exponentially with the number of training rounds. At the same time, an early stopping mechanism and 5-fold cross-validation are added. The early stopping condition is set to no improvement in the validation set mAP for 10 consecutive rounds.

[0041] Preferably, the model validation deployment adopts a multi-dimensional evaluation system, with core indicators including mAP, disease missed detection rate, and small target positioning error. The requirements are: total missed detection rate ≤5%, high-risk disease missed detection rate ≤3%, small target positioning error <0.2, and after INT8 quantization and channel pruning, the model volume ≤40% of the original volume and the accuracy loss ≤2%, which is compatible with edge inspection equipment.

[0042] The proposed method for constructing a large model for small sample detection of bridge defects in this embodiment includes the following steps: (1) Constructing and enhancing a small sample dataset of bridge defects, generating simulation samples and pseudo-label samples to expand the training set; (2) Selecting a basic visual model and completing two-stage pre-training; (3) Performing efficient fine-tuning of small sample parameters based on PEFT technology and meta-learning; (4) Optimizing the model structure to enhance small target detection and anti-interference capabilities; (5) Configuring a fusion loss function and a training strategy adapted to small samples, and training until the model performance is stable; (6) Verifying the model performance through multi-dimensional indicators, and deploying it on edge devices after lightweighting and supporting online fine-tuning iteration.

[0043] In the description of this invention, it should be understood that the terms "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. In the description of this invention, unless otherwise specified and limited, it should be noted that the terms "installed," "connected," and "linked" should be interpreted broadly. For example, they can refer to mechanical or electrical connections, or internal connections between two elements; they can be direct connections or indirect connections through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms according to the specific circumstances.

[0044] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A bridge disease small sample detection large model construction method, characterized in that, It includes six major steps: dataset construction and scenario-based enhancement, two-stage pre-training adaptation, efficient fine-tuning of PEFT parameters, customized optimization of model structure, optimization of loss function and training strategy, and model validation and deployment. Generative augmentation and pseudo-label closed-loop sample expansion are used, two-stage pre-training reduces domain bias, LoRA fine-tuning and meta-learning improve small sample generalization ability, FPN and CBAM modules are optimized to enhance small target detection and anti-interference ability, and weighted Focal Loss and CIoU Loss are integrated to improve detection accuracy. After being lightweight, it is deployed on edge inspection equipment.

2. The method for constructing a large model for small sample detection of bridge defects according to claim 1, characterized in that: In the dataset construction and scenario enhancement steps, based on the "Standard for Technical Condition Assessment of Highway Bridges", the basic small sample annotation set needs to cover the superstructure, substructure and deck system of the bridge, with no less than 50 samples for each category and no less than 300 samples for the entire set. The annotation accuracy of small target defects should reach the pixel level.

3. The method for constructing a large model for small sample detection of bridge defects according to claim 1, characterized in that: The generative enhancement uses a diffusion model combined with professional prompts for bridge defects to generate simulation samples. High-quality samples are selected using the CLIP model based on cosine similarity calculation, with the selection criterion set to similarity > 0.

8. The prompts include descriptions of defect type, size, morphology, and environmental characteristics.

4. The method for constructing a large model for small sample detection of bridge defects according to claim 1, characterized in that: In the two-stage pre-training adaptation steps, the first stage completes general visual pre-training based on the COCO general object detection dataset, and the second stage completes bridge-domain specific pre-training based on bridge defect-free structural images and public bridge defect small datasets, realizing the transition of the model from general recognition to bridge scene recognition.

5. The method for constructing a large model for small sample detection of bridge defects according to claim 1, characterized in that: The PEFT parameter fine-tuning uses LoRA or Adapter modules as the core fine-tuning units, inserts them into the model feature fusion layer and classification regression head, freezes more than 90% of the parameters of the model backbone feature extraction layer, and trains only the parameters of the fine-tuning module and the detection head. The number of training parameters is ≤ 5% of the total number of parameters of the original model.

6. The method for constructing a large model for small sample detection of bridge defects according to claim 1, characterized in that: In the customized optimization of the model structure, the enhancement of small target features is achieved by optimizing the FPN structure, adding a feature map output branch with a resolution of 800×800 or higher, and fusing deep semantic features with shallow detail features; at the same time, a CBAM hybrid attention module is inserted to filter key feature channels and focus on the disease area, suppressing background interference.

7. The method for constructing a large model for small sample detection of bridge defects according to claim 1, characterized in that: The loss function fusion adopts weighted Focal Loss as classification loss and CIoU Loss as localization loss, and constructs the total loss function with a classification loss to localization loss ratio of 1:1.

2. The loss weight coefficient of rare disease categories is set to 1.5-2.5, and the weight coefficient of common disease categories is set to 0.5-1.

0.

8. The method for constructing a large model for small sample detection of bridge defects according to claim 1, characterized in that: The small sample adaptation training strategy uses training parameters with a batch size of 8-16 and an initial learning rate of 1e-4. The learning rate decays exponentially with the number of training rounds. An early stopping mechanism and 5-fold cross-validation are also added. The early stopping condition is set to no improvement in the validation set mAP for 10 consecutive rounds.

9. A method for constructing a large model for small sample detection of bridge defects according to claim 1, characterized in that: The model validation deployment adopts a multi-dimensional evaluation system, with core indicators including mAP, disease missed detection rate, and small target positioning error. The requirements are: total missed detection rate ≤5%, high-risk disease missed detection rate ≤3%, small target positioning error <0.2, and after INT8 quantization and channel pruning, the model volume ≤40% of the original volume and accuracy loss ≤2%, which is compatible with edge inspection equipment.

10. A method for constructing a large model for small sample detection of bridge defects according to claims 1-9, comprising the following steps: (1) Construct and enhance the small sample dataset of bridge defects, and generate simulation samples and pseudo-label samples to expand the training set; (2) Select a basic visual model and complete two-stage pre-training; (3) Perform efficient fine-tuning of parameters for small samples based on PEFT technology and meta-learning; (4) Optimize the model structure to enhance small target detection and anti-interference capabilities; (5) Configure the fusion loss function and training strategy to adapt to small samples, and train until the model performance is stable; (6) Verify the model performance through multi-dimensional indicators, and deploy it on edge devices after lightweighting and support online fine-tuning iteration.