A 3D printing concrete hole defect intelligent detection and grading method and system

By using CA-Hole multi-layer coordinate attention enhancement and the MSCA lightweight channel attention module, combined with dynamic size calibration, a CMDH-YOLOv5 detection model was constructed. This model solved the challenges of detection accuracy and lightweight deployment in 3D printed concrete hole detection, achieving high-precision hole defect detection and classification, and adapting to on-site quality control.

CN122367945APending Publication Date: 2026-07-10HEBEI UNIV OF TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HEBEI UNIV OF TECH
Filing Date
2026-04-13
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing 3D printed concrete hole detection technologies suffer from insufficient adaptability to detection scenarios, weak targeting of subdivided defect detection, and a disconnect between detection results and engineering quality control, making it difficult to achieve high-precision, lightweight, and real-time hole defect detection and classification.

Method used

By employing the CA-Hole multi-layer coordinate attention enhancement strategy and the MSCA lightweight channel attention module, combined with dynamic size calibration, a CMDH-YOLOv5 detection model is constructed to achieve high-precision extraction and lightweight deployment of full-scale hole features, forming a complete technical closed loop from defect identification to engineering classification.

Benefits of technology

It achieves high-precision, lightweight, and real-time detection of pore defects on the surface of 3D printed concrete, significantly reducing the number of model parameters, improving detection accuracy, increasing grading accuracy, and adapting to the quality control needs of engineering sites.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122367945A_ABST
    Figure CN122367945A_ABST
Patent Text Reader

Abstract

This invention discloses an intelligent detection and grading method and system for pore defects in 3D-printed concrete, belonging to the field of intelligent quality inspection and deep learning defect detection technology in building 3D printing. The method first constructs a CMDH-YOLOv5 detection model based on an improved YOLOv5m. Through a C3-MSCA integrated structure and a CA-Hole multi-layer coordinate attention enhancement strategy, it achieves directional enhancement of pore defect features and lightweight optimization of the model. The model outputs pixel-level detection results of pore defects. Based on standard printing strips, a dynamic mapping factor is calculated to complete the physical scale conversion of pore size. Finally, the engineering grade is determined by combining defect size and density, outputting structured detection results. This invention achieves high-precision, lightweight, and real-time detection of pore defects in 3D-printed concrete, with an engineering grade matching accuracy of 89.2%, adaptable to embedded deployment requirements in engineering sites.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent quality inspection and machine vision defect detection technology in 3D printing of buildings, specifically to an intelligent detection and classification method and system for pore defects in 3D printed concrete. Background Technology

[0002] 3D printing concrete technology, as a core direction for the intelligent transformation of the construction industry, has been widely applied in various scenarios such as prefabricated building construction, emergency engineering construction, and the creation of irregularly shaped landscape structures, thanks to its outstanding advantages of flexible molding, high material utilization, short construction cycle, and the ability to integrate complex and irregularly shaped components. This aligns with the industry development trend of green building and low-carbon construction. The technology completes component molding by stacking concrete slurry layer by layer, eliminating the need for traditional formwork processes and significantly reducing construction costs and material waste. However, in the actual printing process, factors such as fluctuations in concrete material ratios, unstable nozzle speed of the printing equipment, and changes in temperature and humidity in the construction environment can easily lead to defects such as pores of different sizes on the surface of the molded components.

[0003] From an engineering safety perspective, voids directly impact the mechanical properties and long-term durability of 3D-printed concrete structures: large voids (≥5mm in diameter) directly weaken the compressive strength and impermeability of components, significantly increasing the risk of external moisture and corrosive media penetration, accelerating internal steel corrosion, and leading to structural durability failure; while small voids (<3mm in diameter), although having limited short-term impact on the macroscopic mechanical properties of components, easily become stress concentration sources during long-term service, inducing the initiation and propagation of microcracks, ultimately causing structural cracking and failure. Failure to detect and address both types of voids in a timely manner can lead to serious engineering safety hazards.

[0004] Currently, the detection and quality control of void defects in 3D printed concrete still relies primarily on traditional manual inspection, supplemented by conventional machine vision methods. Traditional manual inspection depends on on-site visual inspection and caliper measurement by inspectors, which has inherent drawbacks such as low inspection efficiency, strong subjectivity of inspection results, and poor repeatability. It is prone to missed or false detections of tiny voids and voids against complex texture backgrounds, and cannot accurately identify void boundaries and quantify dimensions, making it difficult to meet the quality control requirements of large-scale 3D printing construction.

[0005] With the development of detection technology, scholars at home and abroad have conducted multi-dimensional technical explorations on the detection of pores in 3D printed concrete. These technologies can be divided into three main categories: The first category is traditional non-destructive testing technology, which focuses on 3D laser scanning, CT scanning, and X-CT / MRI fusion imaging. This can achieve high-precision microscopic characterization of pore structures. However, this type of technology requires expensive equipment, has a long testing process, and is highly dependent on the laboratory environment, making real-time online detection at the construction site impossible. Some testing methods are destructive, making them unsuitable for the batch component testing needs during construction. The second category is non-deep learning detection methods based on traditional machine vision. These methods often use basic image processing algorithms such as threshold segmentation and edge detection to identify pores. Related research often relies on manually setting fixed thresholds, resulting in poor generalization ability for engineering scenarios with uneven lighting and complex aggregate textures, leading to serious missed and false detections. They also have weak ability to identify low-contrast interlayer micropores, resulting in insufficient overall detection accuracy and robustness. The third category is intelligent detection methods based on deep learning, which have become a focus of industry research in recent years. Mainstream research often achieves a balance between detection efficiency and accuracy through anchor frame optimization, lightweight backbone network replacement, and fusion of general attention mechanisms. However, existing deep learning detection methods still face the following technical bottlenecks: First, the model parameters are numerous, resulting in high computational costs and making it difficult to deploy on embedded devices and mobile detection terminals at engineering sites. Second, the feature extraction of micro-holes and interlayer interface pores is not targeted enough. Micro-holes specifically refer to concrete surface / interlayer pores with a physical size of <3mm. Interlayer interface pores are a unique defect type in 3D printed concrete, often exhibiting a linear discrete distribution along the interlayer bonding surface. They are characterized by low contrast, small single-hole size, and high density, making them easily obscured by concrete aggregate textures and printing path traces. Existing methods have not been customized to address these characteristics of 3D printed concrete pores, resulting in a generally high rate of missed detection for small-sized defects. Third, the detection results are mostly limited to pixel-level defect recognition, lacking close integration with on-site quality control and graded handling, failing to form a complete technical closed loop from defect detection and precise size quantification to engineering grading and handling recommendations.

[0006] In summary, the field of 3D printed concrete hole detection still faces industry pain points such as insufficient adaptability to detection scenarios, weak targeting of subdivided defect detection, and a disconnect between defect detection and engineering quality control. There is an urgent need to develop an intelligent detection method that takes into account detection accuracy, lightweight deployment capability, and engineering classification adaptability, so as to provide reliable technical support for the quality control of 3D printed concrete construction. Summary of the Invention

[0007] To address the shortcomings of existing technologies, this invention aims to provide an intelligent detection and classification method and system for pore defects in 3D printed concrete. Through a collaborative architecture combining a CA-Hole multi-layer coordinate attention enhancement strategy, an MSCA lightweight channel attention module, and dynamic size calibration, it overcomes industry pain points such as the difficulty in simultaneously extracting full-scale pore features, balancing lightweight design with detection accuracy, large quantification errors in defect size, and a disconnect between detection results and engineering quality control. This achieves high-precision, lightweight, and real-time intelligent detection of pore defects on the surface of 3D printed concrete, forming a complete technical closed loop from defect identification and precise size quantification to engineering classification and treatment.

[0008] To achieve the above solution, the present invention adopts the following technical solution: In a first aspect, the present invention protects an intelligent detection and classification method for void defects in 3D printed concrete, the detection and classification method comprising the following: Images of the surface of 3D printed concrete components are obtained, each image containing a complete horizontal standard printing strip. The locations of holes and defects are finely annotated to construct a hole and defect dataset. A CMDH-YOLOv5 detection model was constructed, with YOLOv5m as the basic framework. A C3-MSCA integrated structure integrating a lightweight channel attention module was embedded in the backbone network of YOLOv5m. A CA module was inserted at the feature position after each splicing operation in the feature fusion network. The lightweight channel attention module of the MSCA includes a weight calculation link consisting of global adaptive average pooling, 1×1 convolutional channel compression, ReLU activation, 1×1 convolutional channel recovery, and Sigmoid activation. The feature map output by the C3 module in the C3-MSCA integrated structure is processed by the weight calculation link to output channel weights. The channel weights are multiplied channel-by-channel with the input features of global adaptive average pooling to obtain the output of the lightweight channel attention module of the MSCA. In the 1×1 convolution channel compression operation, the channel compression ratio is set to a range of 8-32, and the number of channels is forced to be no less than 8. The CMDH-YOLOv5 detection model is trained using the hole defect dataset to output pixel-level bounding box detection results for hole defects; Based on the standard printed strips of 3D printed concrete, strip contour recognition is performed on the same image to be inspected, and the pixel-level size of the hole defect is converted into the actual physical size. Based on the actual physical size and density of defects per unit area, the engineering grade of the defects is determined, and a structured inspection result containing the defect location, physical size, defect grade, and corresponding treatment suggestions is output.

[0009] Furthermore, the normalized resolution of the input image for the CMDH-YOLOv5 detection model is 640×640; In the C3-MSCA integrated structure, the number of Bottleneck stacks, n, ranges from 1 to 3.

[0010] Furthermore, the pixel-level size of the hole defect is converted into the actual physical size through a dynamic mapping factor. The calculation process of the dynamic mapping factor is as follows: the actual physical width of the standard printed strip is preset, the standard printed strip area in the image to be detected is located through Gaussian blur, OTSU binarization and morphological operations, the pixel width of the strip is measured, and the dynamic mapping factor corresponding to the current image is calculated based on the relationship that the actual physical width of the standard printed strip = the pixel width of the strip × the dynamic mapping factor.

[0011] Furthermore, the image to be detected is captured from top to bottom by a camera fixed above the print head of the 3D printing equipment, with a shooting distance applicable to the range of 0.3m-1m.

[0012] Furthermore, the engineering grade determination rules for the aforementioned hole defects are as follows: Based on actual physical dimensions, they are divided into three core grades: small defects (size < 3mm), medium defects (size 3mm-5mm), and large defects (size > 5mm); grade upgrades are determined by combining the defect density per unit area: every 50cm... 2 If the number of internal minor defects exceeds 5-10, the monitoring level will be upgraded to a key monitoring level. Every 50cm 2 If there are more than 2-3 major internal defects, the defect level is upgraded to a serious defect level. The corresponding handling principles are as follows: minor defects are monitored by routine means and do not require immediate repair; medium defects are repaired locally; major and serious defects require work stoppage for rectification, and comprehensive re-inspection and reinforcement are carried out.

[0013] Furthermore, the image standardization preprocessing includes unifying the resolution of the acquired image, converting the BGR channel to the RGB channel, and normalizing the pixel values ​​to the [0,1] range; Meanwhile, the training dataset is expanded through data augmentation, which includes horizontal flipping, vertical flipping, scaling, and brightness and contrast adjustment. The scaling ratio ranges from 0.8 to 1.2 times, the brightness compensation value ranges from 5 to 10, and the contrast gain ranges from 1.1 to 1.4.

[0014] Furthermore, the training parameters of the CMDH-YOLOv5 detection model are as follows: 50-300 training rounds, batch size of 8-32, initial learning rate of 0.001-0.01, confidence threshold of 0.2-0.5, and SGD or Adam as the optimizer. For video stream detection of 3D printed concrete component surfaces, a frame-sampling detection method is adopted, with a frame-sampling frequency range of 1-30 frames / second.

[0015] Secondly, the present invention also protects an intelligent detection and grading system for 3D printed concrete void defects, characterized in that the system performs the detection and grading method described above.

[0016] Compared with the prior art, the beneficial effects of the present invention are: This invention achieves synergistic optimization of detection accuracy and model lightweighting through the collaborative design of the MSCA lightweight channel attention module and the C3-MSCA integrated structure, overcoming the industry pain point of existing detection models where "lightweighting sacrifices accuracy, and high accuracy is accompanied by a large number of parameters." The MSCA module reduces the number of module parameters by 70.8% compared to the traditional SE module through an extremely simplified weight calculation link. Combined with feature selection optimization of the C3-MSCA integrated structure, the overall number of parameters of the improved model is only 16.68M, a reduction of 20.1% compared to the original YOLOv5m. The inference frame rate stably reaches 38.8FPS, significantly higher than the 30FPS threshold required for real-time detection in industrial settings. This greatly reduces the hardware threshold for engineering deployment and adapts to the field deployment requirements of embedded devices and edge computing nodes.

[0017] The CA-Hole multi-layer coordinate attention enhancement strategy proposed in this invention effectively solves the core problem that a single CA module, when deployed on a single-scale feature map, struggles to simultaneously capture the detailed features of micro-holes and the semantic features of large-sized holes. By deploying the standard coordinate attention CA module across four layers of feature map nodes at different scales, the ability of shallow feature maps to capture micro-holes and the ability of deep feature maps to lock onto the contours of large holes are specifically enhanced. This achieves full-coverage feature optimization for hole defects across all scales, resulting in a 6.5% improvement in the F1 score of micro-holes compared to the original YOLOv5m, and a reduction in the localization error rate of larger holes to below 8%. This fundamentally reduces the model's misjudgment of non-defect areas such as aggregate texture and printing paths.

[0018] This invention, based on dynamic dimensional calibration of standard printed strips, solves the core problem of large dimensional quantization errors caused by the fixed pixel-to-millimeter mapping method in existing technologies, which is easily affected by changes in shooting distance and viewing angle. This method utilizes the unique strip-forming characteristics of 3D printed components, using a 40mm standard printed strip as a natural dimensional reference, and dynamically calculates the mapping factor for each image. The average error in dimensional determination can be reduced to 3.8%, significantly better than the 15%-20% average error of traditional fixed-ratio mapping methods. This provides accurate and reliable data support for the engineering classification of hole defects, and effectively connects the detection results from pixel-level recognition to engineering quantification.

[0019] This invention constructs a complete technical closed loop of "hole detection - size calibration - engineering classification - treatment suggestions," solving the industry pain point of the disconnect between existing detection methods and engineering quality control. Through a dual judgment rule combining size classification and density classification, it achieves refined engineering classification of hole defects, with a model engineering classification matching accuracy rate of 89.2%, an improvement of 8.1 percentage points compared to the original YOLOv5m. Specifically, the accuracy rate for small defect classification is 87.5%, for medium defect classification is 92.3%, and for large defect classification is 90.0%. The classification results can be directly integrated into the 3D printed concrete construction quality control process, providing clear technical guidance for on-site defect treatment and truly realizing the implementation of the entire process from defect detection to quality control.

[0020] The CMDH-YOLOv5 detection model of this invention maintains mainstream-level overall detection performance while significantly compressing parameter scale, and exhibits strong robustness in complex engineering scenarios. In typical complex engineering scenarios such as light and shadow fluctuations, multi-strip interference, and the superposition of external debris, the model achieves stable detection performance with no missed detections and no false detections, solving the problems of poor adaptability and insufficient generalization ability of existing models in complex field environments. Furthermore, the technical solution possesses strong compatibility and scalability; the improvement approach can be extended to detection scenarios of other surface defects such as cracks and interlayer delamination in 3D printed concrete, providing a universal technical framework for intelligent quality inspection of the entire 3D printing process in construction, and has broad prospects for promotion and application.

[0021] This invention addresses the detection needs of full-scale void defects in 3D-printed concrete by employing a multi-scale progressive deployment approach to achieve full-coverage feature optimization for both micro and large voids. The MSCA lightweight channel attention module is a customized improvement module for 3D-printed concrete inspection scenarios. While retaining core channel filtering capabilities, it significantly reduces the number of module parameters and computational overhead, adapting to the deployment requirements of embedded devices in engineering sites and improving the model's generalization ability and robustness in complex engineering scenarios. Attached Figure Description

[0022] Figure 1 This is a flowchart illustrating the intelligent detection and grading method for 3D printed concrete void defects of the present invention. Figure 2 This is a schematic diagram of the overall architecture of the CMDH-YOLOv5 detection model in this invention. The CMDH-YOLOv5 detection model includes image input, backbone network, feature fusion network, head detection, and output defect detection results. In the output image, green text indicates the pixel-to-actual distance mapping relationship and the strip width, and red, cyan, and yellow boxes correspond to large, medium, and small hole defects, respectively. Figure 3This is a schematic diagram of the internal structure of the standard coordinate attention (CA) module used in this invention, which is a prior art module.

[0023] Figure 4 This is a schematic diagram of the internal structure of the MSCA lightweight channel attention module in this invention; Figure 5 This is a schematic diagram of the internal structure of the C3-MSCA integrated structure in this invention, including the C3 module and the MSCA lightweight channel attention module; Figure 6 The confusion matrix comparison diagram of the engineering classification results of hole defects of different models contains 4 sets of comparison sub-diagrams. From left to right and from top to bottom, they are the defect classification confusion matrices of the original YOLOv5m model, YOLOv7 model, YOLOv8m model and the CMDH-YOLOv5 model of this application. Figure 7 This is a comparison chart of the hole defect detection effects of different models under typical complex engineering scenarios. It includes 3 types of test scenarios and 4 sets of model comparison results. The 3 types of scenarios, from left to right, are: vertical stripe with bright and shadow areas, multi-strip interference + large shadow + external debris interference, and light and shadow mixed distribution scenario. The detection effects of different models under the same scenario are shown in the following charts from top to bottom: the CMDH-YOLOv5 model of this application, the original YOLOv5m model, the YOLOv7 model, and the YOLOv8m model. The hole defect detection results are shown in the same engineering scenario. Detailed Implementation

[0024] The present invention will be further explained below with reference to the embodiments and accompanying drawings, but this is not intended to limit the scope of protection of this application.

[0025] The present invention provides an intelligent detection and classification method for void defects in 3D printed concrete, comprising the following steps: Step 1, CMDH-YOLOv5 detection model construction: Based on the YOLOv5m framework, and following the classic structure of input end-backbone network-feature fusion network-detection head, a CMDH-YOLOv5 detection model for detecting void defects in 3D printed concrete is constructed; in the backbone network, a C3-MSCA integrated structure integrating a lightweight channel attention module of MSCA is embedded, and a standard coordinate attention (CA) module is inserted at the feature position after each splicing operation of the feature fusion network; In the feature fusion network, the CA module is deployed on four feature map nodes of different scales, and differentiated weight allocation is performed for shallow / deep feature maps to form a CA-Hole multi-layer coordinate attention enhancement strategy, which solves the pain point of full-scale hole feature extraction.

[0026] The MSCA lightweight channel attention module is designed for 3D printed concrete hole detection scenarios. Addressing industry pain points such as the use of fully connected layer computation chains in traditional SE and ECA general channel attention modules, poor compatibility with the YOLOv5 fully convolutional architecture, low inference efficiency on embedded devices, lack of small target feature protection, and easy loss of weak features due to tiny holes in 3D printed concrete, the module has undergone structural reconstruction and scenario adaptability optimization. The MSCA lightweight channel attention module is fully compatible with the YOLOv5 architecture and adds channel compression lower limit protection to avoid the loss of small hole features. Specifically, it employs a weight calculation chain of global adaptive average pooling → 1×1 convolutional channel compression → ReLU activation → 1×1 convolutional channel restoration → Sigmoid activation. In the 1×1 convolutional channel compression operation, the channel compression ratio is set to a range of 8~32, forcing a minimum of 8 channels. While retaining the core channel filtering capabilities, this significantly reduces the number of module parameters and computational overhead, enhancing the ability to extract effective features for hole detection.

[0027] The MSCA lightweight channel attention module is embedded in the C3 module of the backbone network, achieving lightweighting without sacrificing feature extraction capabilities. The MSCA lightweight channel attention module has a single-input-single-output structure, with the number of channels and spatial size of the input and output feature maps being completely identical. While significantly reducing the number of model parameters and computational overhead, it strengthens the feature channels that are effective for hole detection and suppresses redundant channels dominated by background such as aggregate texture and printing path, making it suitable for the deployment requirements of embedded devices in engineering sites.

[0028] To address the challenges of weak pore features and complex background textures in 3D printed concrete, a multi-scale deployment of CA modules enhances the capture of small defect features, while the MSCA lightweight channel attention module suppresses redundant background channels, achieving a balance between accuracy and lightweight design.

[0029] Step 2, Dataset Construction and Model Training: Collect surface images of real 3D printed concrete components to construct a dataset of holes and defects. Use a human-machine collaborative calibration method to complete the dataset annotation. Through a process that combines automatic machine initial inspection with manual interactive correction, the locations of holes and defects are finely annotated. The dataset is divided into training set, validation set and test set in a 7:2:1 ratio. The dataset size is expanded through data augmentation to improve the model's generalization ability.

[0030] The data enhancement methods include horizontal flipping, vertical flipping, image scaling, and brightness and contrast adjustment, wherein the scaling ratio ranges from 0.8 to 1.2 times, the brightness compensation value ranges from 5 to 10, and the contrast gain ranges from 1.1 to 1.4.

[0031] The parameters during model training are set as follows: 50-300 training epochs, batch size of 8-32, initial learning rate of 0.001-0.01, confidence threshold of 0.2-0.5, and SGD or Adam optimizer. The model weights are saved every 10 epochs during training, and the weights with the best performance on the validation set are selected as the output of the detection model to obtain the trained CMDH-YOLOv5 detection model.

[0032] Step 3, Image Acquisition and Standardization Preprocessing: Using a camera fixed above the print head of the 3D printing equipment, an image of the surface of the 3D printed concrete component to be inspected is acquired from top to bottom (similar to a top-down view), ensuring that the image contains a complete horizontal (printing strip width direction) standard printing strip. The shooting distance is controlled within the range of 0.3m-1m. The image to be inspected undergoes standardization preprocessing, which involves: unifying the image resolution to 640×640 using bilinear interpolation, converting the BGR channel to the RGB channel, and normalizing the pixel values ​​to the [0,1] interval to provide standardized input for subsequent feature extraction. For video stream detection of the 3D printed concrete component surface, a frame-sampling detection method is used to process the video stream segment by segment. The frame-sampling frequency ranges from 1 to 30 frames / second. The above standardization preprocessing procedure is then performed on the single-frame image obtained from the frame-sampling.

[0033] In the construction of the dataset, each acquired image was also subjected to standardized preprocessing.

[0034] Step 4, Hole Defect Detection: The standardized preprocessed image is input into the trained CMDH-YOLOv5 detection model. The backbone network extracts multi-scale features of hole defects layer by layer. The feature fusion network fully integrates shallow high-resolution features with deep semantic features. Finally, the detection head outputs the category confidence and pixel-level bounding box coordinates of hole defects, thus completing the intelligent identification and localization of hole defects.

[0035] Step 5, Dynamic Dimension Calibration and Physical Dimension Conversion: Based on a standard 40mm wide printed strip of 3D printed concrete, strip contour recognition is performed on the same image to be inspected, and the dynamic mapping factor between pixels and actual physical dimensions is calculated. The pixel-level dimensions of holes and defects output by the model are converted into actual physical dimensions through the dynamic mapping factor.

[0036] Step Six, Engineering Grade Determination and Result Output: Based on the actual physical size and defect density per unit area of ​​the hole defect, the engineering grade of the hole defect is determined, and a structured inspection report containing the defect location, actual physical size, defect grade, and corresponding treatment suggestions is finally output.

[0037] The engineering grade determination rule for the aforementioned hole defect is as follows: Based on actual physical dimensions, core defects are divided into three categories: small defects (size < 3mm), medium defects (size 3mm-5mm), and large defects (size > 5mm). Determination of grade upgrade based on defect density per unit area: every 50cm 2 If the number of internal small defects exceeds 5-10, the monitoring level will be upgraded to key monitoring level; every 50cm 2 If the number of internal major defects exceeds 2-3, it will be upgraded to a critical defect level. The corresponding handling principles are as follows: minor defects and key monitoring levels are subject to routine monitoring and do not require immediate repair; medium defects are subject to local repair; and major and severe defects require work stoppage for rectification, comprehensive re-inspection, and reinforcement.

[0038] Furthermore, the C3-MSCA integrated structure embeds the lightweight channel attention module of MSCA into the end of the feature fusion stage of the traditional C3 module, forming an integrated single-input-single-output structure of feature branch extraction, parallel fusion, dimension normalization, and channel filtering, which is 100% compatible with the input and output formats of the native C3 module of YOLOv5. First, the C3 module completes the differential feature extraction through a dual-branch structure: one branch compresses the input channel c1 into the intermediate channel c_ through a 1×1 convolution (cv1), and then passes it through n Bottlenecks. The Bottleneck module is stacked to extract features (the number of Bottleneck stacks n ranges from 1 to 3); another branch uses a 1×1 convolution (cv2) to match the input channel c1 into the intermediate channel c_, retaining the original shallow detail features as residual supplementation; the features of the two branches are concatenated and fused along the channel dimension, and then dimensionality is normalized by a 1×1 convolution (cv3), converting the concatenated 2×c_ channel number into the target output channel c2, which is then input into the MSCA module to complete channel-level feature filtering, achieving a dual optimization of feature extraction effect and model lightweight efficiency.

[0039] Furthermore, the calculation process of the dynamic mapping factor is as follows: First, the input image is subjected to Gaussian blur, OTSU binarization, and morphological closing operations to automatically locate the standard printed strip area in the image and avoid interference from aggregate texture and printing marks; then, the pixel width of the strip in the image is measured. Based on the relationship that the actual physical width of the standard printed strip is 40mm = strip pixel width × dynamic mapping factor, the pixel-millimeter mapping relationship corresponding to the current image can be dynamically calculated based on the dynamic mapping factor, and the pixel size of the hole defect boundary box is converted into the actual physical size, completing the accurate size quantization without manual calibration, and adapting to the width fluctuation of the standard printed strip within ±2mm.

[0040] Example 1 This embodiment presents an intelligent detection and grading method for void defects in 3D printed concrete, comprising the following steps: Step 1: Construction of the CMDH-YOLOv5 Detection Model: Based on the YOLOv5m framework, and following the classic structure of input-backbone-neck-head, a CMDH-YOLOv5 detection model for detecting pore defects in 3D printed concrete is constructed. CMDH stands for Concrete Multi-scale Defect Hole, representing a dedicated detection model for multi-scale pore defects in concrete. A C3-MSCA integrated structure with a lightweight channel attention module is embedded in the backbone network. A CA-Hole multi-layer coordinate attention enhancement strategy is deployed on the multi-scale feature map nodes of the feature fusion network, completing the overall model architecture. For details of the overall model architecture, please refer to [link to full description]. Figure 2 In the upper right corner of the image, the pixel-to-physical distance mapping factor and the standard printed strip pixel width of the current image are marked in green, realizing the accurate conversion of hole defects from pixel scale to physical scale; different colored bounding boxes are used in the image to mark the defect level, with red boxes marking large-sized hole defects (size > 5mm), cyan boxes marking medium-sized hole defects (size 3mm-5mm), and yellow boxes marking small-sized hole defects (size < 3mm), intuitively showing the location, size and level information of the defects.

[0041] The CA-Hole multi-layer coordinate attention enhancement strategy uses the standard coordinate attention (CA) module as the basic feature enhancement unit. The CA module is deployed in four sets of feature map nodes of different scales: 64×64, 32×32, 16×16, and 8×8 in the feature fusion network. The shallow high-resolution feature maps of 64×64 and 32×32 can enhance the capture of weak features of small holes and prevent them from being submerged by background textures during downsampling. The deep feature maps of 16×16 and 8×8 can accurately lock the overall outline of large holes and solve the problem that the edge localization of large holes is easily interfered with by the background. Through the progressive enhancement of the four layers of feature maps, the CA-Hole strategy achieves full-coverage feature optimization of hole defects at all scales, forming a synergistic effect of feature enhancement and cross-scale fusion with the feature fusion network.

[0042] I. C3-MSCA Integrated Module Structure Description The C3-MSCA integrated structure embeds the lightweight channel attention module of MSCA into the end of the feature fusion stage of the C3 module, forming an integrated single-input-single-output structure of feature branch extraction, parallel fusion, dimension regularization, and channel filtering. It is deployed on the feature aggregation node of the YOLOv5 backbone network to achieve the fusion of "deep semantics and shallow details" and channel-level feature filtering of hole defect features. While ensuring detection accuracy, it reduces the number of model parameters and adapts to the needs of embedded deployment in engineering.

[0043] The input to the C3-MSCA ensemble structure is the feature map output by the convolutional module of the previous layer in the backbone network, with an input channel number c1. Within the structure, cv1 and cv2 are both 1×1 convolutional layers, both compressing the channel number c1 to an intermediate channel number c_, achieving unified channel dimensions for both branches and ensuring that the features from the two branches can be properly concatenated and fused along their channel dimensions. The formula for calculating the intermediate channel number c_ is c_ = int(c2 × e), where c2 is the final output channel number of the module, and e is the channel scaling ratio, with a default value of 0.5. One branch extracts deep semantic features through Bottleneck module stacking, while the other branch retains the original shallow detail features as residual supplementation. The features from the two branches are concatenated and fused along the channel dimension. First, a 1×1 convolutional layer (cv3) is used for dimension normalization, converting the concatenated 2×c_ channel number into the target output channel number (c2). Then, the input to the MSCA lightweight channel attention module completes channel-level filtering, strengthening feature channels effective for hole detection and suppressing redundant channels dominated by background elements such as aggregate texture and printing paths. The number of Bottleneck module stacks (n) ranges from 1 to 3. For details on the C3-MSCA ensemble structure, please refer to [link to relevant documentation]. Figure 5 .

[0044] The C3 module is internally split into two feature branches. The main branch contains a cv1 convolutional layer and a stack of Bottleneck×n residual blocks. cv1 is a 1×1 convolutional layer that compresses the input channel c1 into an intermediate channel c_, where c_ is the number of intermediate transition channels within the module. The calculation formula is c_=int(c2×e), where c2 is the final output channel number of the module, and e is the channel scaling ratio, with a default value of 0.5. Bottleneck×n is a stacked structure of n Bottleneck residual blocks (default n=1, with a value range of 1-3), used to extract deep semantic features of hole defects (such as the overall outline of the hole and large-scale structural information), enhancing the non-linear expressive power of the features.

[0045] The residual branch of module C3 is a cv2 convolutional layer. This branch runs in parallel with the main branch and compresses the input feature map into an intermediate channel c_ through a 1×1 convolution. However, it does not go through the Bottleneck residual block stacking and directly preserves shallow detail features (such as hole edges and small texture information), avoiding the loss of details caused by excessive stacking of the main branch.

[0046] The output features of the two branches are concatenated along the channel dimension (marked by the " / / " symbol in the figure), which integrates the deep semantic features of the main branch with the shallow detail features of the residual branch along the channel dimension. After concatenation, the number of channels is 2×c_, realizing feature complementarity between "global structure and local details" and providing a more comprehensive feature foundation for subsequent channel refinement.

[0047] The concatenated feature map is input into the cv3 convolutional layer (which is a 1×1 convolution). The concatenated 2×c_ channels are normalized to the target output channel c2, unifying the feature dimensions, ensuring input compatibility with the subsequent MSCA module, and completing the dimensional transition after feature fusion.

[0048] The cv3-normalized feature map is input into the MSCA lightweight channel attention module. The core workflow is as follows: global adaptive average pooling is performed on the input feature map → 1×1 convolutional channel compression → ReLU activation → 1×1 convolutional channel restoration → Sigmoid activation. Channel-level weights are then generated and multiplied channel-by-channel with the globally adaptive average pooled input feature map to achieve effective feature enhancement and redundant channel suppression. The MSCA lightweight channel attention module has a single-input, single-output structure, maintaining a c² input / output channel count and consistent spatial dimensions with the input, thus preserving the dimensionality compatibility of the original network and achieving a dynamic balance between detection accuracy and model lightweighting.

[0049] The feature map processed by the MSCA lightweight channel attention module is the final output of the C3-MSCA ensemble module. This output feature map has c2 channels and a spatial dimension equal to the input feature map. Figure 1 This information is directly transmitted to subsequent networks, providing lightweight and high-precision enhancement features for detecting voids and defects in 3D printed concrete.

[0050] II. MSCA Lightweight Channel Attention Module Structure Description The MSCA (Multi-scale Scene-adaptive ChannelAttention) module, such as... Figure 4 As shown, a lightweight channel attention module designed for detecting voids in 3D printed concrete is deployed at the end of the C3-MSCA integrated module. Its aim is to filter effective feature channels with extremely low computational overhead. The MSCA module is embedded at the end of the C3 module, and the channel-level importance of the features fused and normalized by the C3 module is recalibrated to enhance void-related features and suppress redundant background information such as aggregate texture and printing path, thereby improving the model's detection accuracy and robustness in complex scenarios.

[0051] The core process is as follows: First, global adaptive average pooling is performed on the input feature map. The global spatial information of each channel is compressed into a scalar by nn.AdaptiveAvgPool2d(1) to form a channel descriptor. Then, the descriptor is transformed nonlinearly by a "bottleneck" structure consisting of two 1×1 convolutional layers: the first 1×1 convolutional layer compresses the number of channels to C / r (r is the compression ratio, ranging from 8 to 32), and sets a lower limit protection for channel compression, forcing the number of channels after compression to be no less than 8, avoiding the loss of weak features with small holes <3mm caused by excessive compression of shallow high-resolution features, so as to reduce computational complexity; then, the ReLU activation function is used to introduce nonlinearity; the second 1×1 convolutional layer restores the number of channels to the original number of channels C. Finally, the transformed channel descriptor is normalized to a weight value between 0 and 1 by the Sigmoid activation function, representing the importance of each channel.

[0052] This invention abandons the complex multi-branch and multi-scale interaction structure and the fully connected layer computation architecture of the general SE module. Instead, it adopts a 1×1 convolution lightweight computation link that is fully compatible with the YOLOv5 fully convolutional architecture. This significantly reduces the number of parameters while achieving targeted enhancement of effective features for hole defects.

[0053] The output of the lightweight channel attention module of MSCA is used as the final output of the C3-MSCA integrated structure and directly passed to the subsequent feature fusion network (Neck layer) to provide enhanced feature support after channel screening for the subsequent detection of pore defects in 3D printed concrete.

[0054] Figure 4 The data flow begins with the input feature map (C, H, W), where C represents the number of channels and is the core adjustment dimension of the module; H and W represent the spatial height and width. First, global adaptive average pooling compresses all spatial information (H×W) of each channel into a scalar, resulting in an output shape of (C, 1, 1). This descriptor then enters a "bottleneck" structure consisting of two 1×1 convolutions: the first is a channel compression convolution, which reduces the number of channels from C to max(8, C / / r), where r is a preset compression ratio; after ReLU activation, the second channel recovery convolution restores the number of channels from max(8, C / / r) back to the original C. Subsequently, the sigmoid function maps the values ​​to between 0 and 1, generating channel attention weights (C, 1, 1). Finally, these weights are multiplied channel-by-channel with the original input (C, H, W), outputting an enhanced feature map with the same dimensions as the input (C, H, W). The entire process enables adaptive recalibration of channels without altering the shape of the feature map.

[0055] Step 2, Dataset Construction and Model Training: Collect surface images of real 3D printed concrete components to construct a dedicated dataset for hole defects. Use a human-machine collaborative calibration method to complete the dataset annotation. Through a process that combines automatic machine initial inspection with manual interactive correction, the location of hole defects is finely annotated. The dataset is divided into training set, validation set and test set in a 7:2:1 ratio. The dataset size is expanded through data augmentation to improve the model's generalization ability.

[0056] The data augmentation methods include horizontal flipping, vertical flipping, image scaling, and brightness and contrast adjustment. The scaling ratio ranges from 0.8 to 1.2 times, the brightness compensation value ranges from 5 to 10, and the contrast gain ranges from 1.1 to 1.4. The model training parameters are set as follows: 50-300 training epochs, batch size ranges from 8 to 32, initial learning rate ranges from 0.001 to 0.01, confidence threshold ranges from 0.2 to 0.5, and the optimizer uses SGD or Adam. The model weights are saved every 10 epochs during training, and the weights with the best performance on the validation set are finally selected as the output of the detection model.

[0057] Step 3, Image Acquisition and Standardization Preprocessing: Using a camera fixed above the print head of the 3D printing equipment, images of the surface of the 3D printed concrete component to be inspected are acquired from top to bottom, ensuring that the image contains complete horizontal standard printing strips. The shooting distance is controlled within the range of 0.3m-1m. Standardization preprocessing is performed on the images to be inspected. The image resolution is unified to 640×640 using bilinear interpolation, the BGR channel is converted to the RGB channel, and the pixel values ​​are normalized to the [0,1] interval to provide standardized input for subsequent feature extraction.

[0058] For video stream inspection of the surface of 3D printed concrete components, a frame-sampling detection method is used to process the video stream segment by segment. The frame-sampling frequency ranges from 1 to 30 frames per second. The above-mentioned standardized preprocessing process is then performed on the single-frame image obtained by frame-sampling.

[0059] Step 4, Intelligent Detection of Holes and Defects: The standardized preprocessed image is input into the trained CMDH-YOLOv5 detection model. The backbone network extracts multi-scale features of holes and defects layer by layer. The feature fusion network fully integrates shallow high-resolution features and deep semantic features. Finally, the detection head outputs the category confidence and pixel-level bounding box coordinates of holes and defects, thus completing the intelligent identification and localization of holes and defects.

[0060] Step 5, Dynamic Dimension Calibration and Physical Dimension Conversion: Based on a standard 40mm wide printed strip of 3D printed concrete, strip contour recognition is performed on the same image to be inspected, and the dynamic mapping factor between pixels and actual physical dimensions is calculated. The pixel-level dimensions of holes and defects output by the model are converted into actual physical dimensions through the dynamic mapping factor.

[0061] The calculation method of the dynamic mapping factor is as follows: First, the input image is subjected to Gaussian blur, OTSU binarization, and morphological closing operations to automatically locate the standard printed strip area in the image and avoid interference from aggregate texture and printing marks; then, the pixel width of the strip in the image is measured, and based on the relationship that the actual physical width of the standard printed strip is 40mm = strip pixel width × dynamic mapping factor, the pixel-millimeter mapping factor corresponding to the current image is dynamically calculated to adapt to the width fluctuation of the standard printed strip within ±2mm; finally, through this mapping factor, the pixel size of the hole defect boundary box is converted into the actual physical size, completing the accurate size quantization without manual calibration.

[0062] Step Six, Engineering Grade Determination and Result Output: Based on the actual physical size and defect density per unit area of ​​the hole defect, the engineering grade of the hole defect is determined, and a structured inspection report containing the defect location, actual physical size, defect grade, and corresponding treatment suggestions is finally output.

[0063] The engineering grade determination rule for the aforementioned hole defect is as follows: Based on actual physical dimensions, core defects are divided into three categories: small defects (size < 3mm), medium defects (size 3mm-5mm), and large defects (size > 5mm). Determination of grade upgrade based on defect density per unit area: every 50cm 2 If the number of internal small defects exceeds 5-10, the monitoring level will be upgraded to key monitoring level; every 50cm 2 If the number of internal major defects exceeds 2-3, it will be upgraded to a critical defect level. The corresponding handling principles are as follows: minor defects are handled with routine monitoring and do not require immediate repair; medium defects are handled with local repair; major defects and severe defects require work stoppage for rectification, and comprehensive re-inspection and reinforcement are carried out.

[0064] In this embodiment, the human-machine collaborative calibration process is implemented through an interactive annotation tool. First, the automatic initial defect detection is completed through preset parameters. Then, the missing defects are supplemented and the false defects are deleted and corrected through human interaction. At the same time, the standardization and quantification of defect size are completed to ensure the accuracy and consistency of the dataset annotation.

[0065] In this embodiment, the kernel size of the Gaussian blur is in the range of (5,5)-(7,7), the morphological closing operation uses a 3×3 convolution kernel, and the number of iterations is in the range of 1-2 times, which is suitable for 3D printed concrete surface images with different texture complexity.

[0066] Example 2 The detection and grading method in this embodiment includes the following steps: Step 1, CMDH YOLOv5 detection model construction: Based on the YOLOv5m framework, using the same input... backbone network Feature Fusion Network The classic structure of the detection head uses an input image with a normalized resolution of 640×640; C3 is embedded in the backbone network. The MSCA integrated architecture features a Bottleneck module stack with n=1, and an embedded lightweight channel attention module with a channel compression ratio of 16. The CA is deployed in four feature maps of the feature fusion network: 64×64, 32×32, 16×16, and 8×8. Hole's multi-layer coordinate attention enhancement strategy enables the network to adaptively strengthen the response weights of shallow high-resolution feature maps during training through multi-layer distributed deployment. This automatically increases the effective feature attention to the hole contour region and weakens the interference of background texture outside the contour, achieving accurate feature enhancement of hole defects at all scales.

[0067] Step 2, Dataset Construction and Model Training: Collect real 3D printed concrete component surface images to construct a dedicated dataset containing 1850 valid images and 8055 instances of hole defects. The dataset is labeled using a human-computer collaborative labeling method and divided into training, validation, and test sets in a 7:2:1 ratio. Data augmentation is performed by horizontal flipping, vertical flipping, scaling by 0.8-1.2 times, brightness compensation of 5-10, and contrast gain of 1.1-1.4 to expand the dataset size.

[0068] The core parameters for model training were set as follows: 60 training epochs, batch size 16, initial learning rate 0.01, confidence threshold 0.3, SGD optimizer, momentum 0.937, and weight decay 0.0005. The model weights were saved every 10 epochs during training, and the weights with the best performance on the validation set were selected as the output of the detection model.

[0069] Step 3, Image Acquisition and Standardized Preprocessing: An industrial camera fixed above the print head of the 3D printing equipment is used to acquire images of the surface of the 3D printed concrete component from top to bottom, ensuring the image contains the complete horizontal 40mm standard printing strip. The shooting distance is controlled at 0.5m. Standardized preprocessing is performed on the images: the image resolution is unified to 640×640 using bilinear interpolation, the BGR channel is converted to RGB channels, and the pixel values ​​are normalized to the [0,1] range. For video stream detection on the component surface, a frame-sampling detection method is used, with a frame-sampling frequency of 10 frames / second.

[0070] Step four, intelligent detection of holes and defects: The standardized preprocessed image is input into the trained CMDH-YOLOv5 detection model to complete the intelligent identification and localization of holes and defects, and output the category confidence score and pixel-level bounding box coordinates of the holes and defects. Testing showed that the model has only 16.68M parameters, a 20.1% reduction compared to the original YOLOv5m, and the inference frame rate stably reaches 38.8 FPS, meeting the real-time detection needs of industrial sites.

[0071] Step 5, Dynamic Size Calibration and Physical Size Conversion: For the same image to be inspected, Gaussian blur is performed using a (5,5) kernel size. The standard printed strip area is located by OTSU binarization and 3×3 kernel morphological closing operation. The pixel width of the strip is measured, and the dynamic mapping factor of the current image is calculated to convert the pixel-level size of the hole defect into the actual physical size. The average size judgment error is reduced to 3.8%.

[0072] Step Six, Engineering Grading and Result Output: Based on the actual physical size of the hole defect, the core level is classified, and the level is upgraded by combining the defect density per unit area. Finally, a structured inspection report is output.

[0073] The test set verified that the engineering classification matching accuracy of the method in this embodiment reached 89.2%, which is 8.1 percentage points higher than that of the original YOLOv5m. Among them, the classification accuracy of small defects was 87.5%, medium defects was 92.3%, and large defects was 90.0%. The classification misjudgments were mainly concentrated between adjacent size levels, and there were no serious misjudgments across levels.

[0074] In complex engineering scenarios involving light and shadow fluctuations, multi-band interference, and superposition of external debris, the method in this embodiment achieves stable detection performance with no missed detections and no false detections. The detection results match the actual defects with 100% accuracy, demonstrating strong scenario robustness and engineering adaptability.

[0075] Figure 6The confusion matrix comparison diagram of the engineering classification results of hole defects of different models contains 4 sets of comparison sub-diagrams. From left to right and from top to bottom, they are the defect classification confusion matrices of the original YOLOv5m model, YOLOv7 model, YOLOv8m model and the CMDH-YOLOv5 model of this application. Figure 7 This image compares the hole defect detection performance of different models under typical complex engineering scenarios. It includes three test scenarios and four sets of model comparison results. The three scenarios, from left to right, are: (a) vertical stripes with highlighted and shadowed areas; (b) multi-strip interference + large shadows + external debris interference; and (c) a scene with mixed light and shadow distribution. The image also shows the detection performance of different models within the same scenario, from top to bottom: the original YOLOv5m model, the YOLOv7 model, the YOLOv8m model, and the CMDH-YOLOv5 model of this application, all under the same engineering scenario. The comparison of the detection performance of each model for the above three typical complex engineering scenarios is as follows: Scene 1: Vertical stripes containing highlight and shadow areas ( Figure 7 In (a) the original YOLOv5m model easily misidentifies aggregate textures and background highlights as tiny holes, exhibiting two obvious false detections and insufficient ability to distinguish between textures and shadows with similar gray levels; the YOLOv7 model misses one tiny hole <3mm, showing limited ability to extract small target features in low-contrast scenes; the YOLOv8m model misses one tiny hole, and the bounding box positioning of the hole in the highlighted area is significantly offset. The CMDH-YOLOv5 model in this application uses a CA-Hole multi-layer coordinate attention enhancement strategy to strengthen the feature response of the hole area while weakening background interference such as aggregate textures and shadows, ultimately achieving accurate detection of all real holes without any false detections or misses, with accurate bounding box positioning and a high degree of fit with the outline of the real holes.

[0076] Scenario 2: Multi-band interference + large shadow + external clutter interference ( Figure 7(b) The original YOLOv5m model misidentified the edge of the plastic film in the background as a hole defect, resulting in one obvious false detection. Interference from multiple strips caused the hole location at the strip junction to shift. The YOLOv7 model missed one large hole ≥5mm and also had two false detections of background clutter. External interference and shadow superposition hindered feature extraction. The YOLOv8m model missed two small holes and had three false detections of background clutter, making it difficult to adapt to complex scenes with multiple superimposed interferences. The CMDH-YOLOv5 model in this application, with its channel-level feature filtering mechanism of the MSCA lightweight attention module, effectively suppresses the transmission of redundant information such as strip interference and plastic film. At the same time, it strengthens the extraction of large hole contour features through the CA-Hole module, ultimately achieving accurate detection of all holes without any false detections or missed detections. The bounding box positioning is accurate and highly consistent with the real hole contour, fully demonstrating the strong anti-interference capability of the dual-module collaboration.

[0077] Scene 3: Scene with mixed light and shadow distribution ( Figure 7 (c) The original YOLOv5m model misidentified adjacent shadow areas as holes, resulting in one obvious false detection. The grayscale fluctuations caused by the alternation of light and shadow further exacerbated the difficulty of feature differentiation. The YOLOv7 model missed one tiny hole located at the boundary between highlight and shadow, and its response to features in the light-shadow transition area was insufficient. The YOLOv8m model had three background false detections and two missed tiny hole detections. The interference of light and shadow and the superposition of background textures led to a significant decrease in detection performance. The CMDH-YOLOv5 model in this application adaptively optimizes the multi-scale feature map through the CA-Hole module, focusing on enhancing the small target extraction capability of the shallow high-resolution feature map. Ultimately, it achieves zero missed hole recognition, no background false detections, and the detection results completely match the real defects.

[0078] In summary, the qualitative comparison results of three types of complex engineering scenarios demonstrate that the CMDH-YOLOv5 model of this application exhibits significant detection advantages under complex conditions such as light and shadow fluctuations, multi-strip interference, and superimposed external debris. The CA-Hole multi-layer coordinate attention enhancement module effectively solves the problem of distinguishing between holes and background textures in traditional models, avoiding false detections of the background. The MSCA lightweight attention module strengthens effective feature selection and redundant interference suppression, reducing missed detections and improving positioning accuracy. In contrast, the original YOLOv5m is prone to false detections due to background interference, YOLOv7 has obvious problems with missing detections of small targets, and YOLOv8m faces the dual dilemma of missed detections and false detections, all of which are difficult to adapt to the complex and ever-changing on-site inspection needs of 3D printed concrete. This qualitative analysis corroborates the quantitative indicators mentioned above, fully demonstrating that this application, through the synergy of two modules, effectively solves the core pain point of insufficient robustness of existing models in complex scenarios, providing reliable technical support for accurate on-site inspection in engineering projects.

[0079] Ablation Experiments and Analysis To verify the independent roles and synergistic effects of each improved module in the CMDH-YOLOv5 model of this application, and to clarify the impact of the CA-Hole multi-layer coordinate attention enhancement strategy and the MSCA lightweight channel attention module on detection performance, multiple ablation experiments were designed based on the original YOLOv5m baseline model. All experiments were conducted on the same dataset, with the same training parameters and testing environment to ensure the objectivity and comparability of the results.

[0080] Table 1 compares the overall performance of the ablation experiment groups, focusing on five groups of controlled variable experiments. It comprehensively verifies the detection accuracy, lightweight index, and engineering performance of the model under different module combinations, providing basic data support for the ablation experiments. The aim is to clarify the overall optimality of the improved group in terms of "accuracy-efficiency-engineering adaptability". Table 2 focuses on the detailed impact of attention module configuration on detection accuracy, and specifically analyzes the role of the number of CA module layers and the introduction of the MSCA module on the detailed accuracy index. Table 3 compares the comprehensive performance of different model configurations, further benchmarking the model of this application against the mainstream YOLO series models in the industry, highlighting the industry-differentiated advantages of the model in balancing accuracy and lightweight.

[0081] Experimental Design and Grouping This ablation experiment was conducted using the controlled variable method, with 5 experimental groups set up as follows: Baseline group (Group A): Original YOLOv5m model, without any attention enhancement modules; Single CA group (Group B): Based on the baseline model, only one standard CA attention module is added to the feature fusion network; Single MSCA group (Group C): Based on the baseline model, only the MSCA lightweight channel attention module is embedded in the backbone network C3 module; Dual-module group (Group D): Based on the baseline model, a combination of one layer of CA module and one layer of MSCA module is added; Full Improvement Group (Group E): The CMDH-YOLOv5 model proposed in this application is a combination of deploying a 4-layer CA module (CA-Hole strategy) in the feature fusion network and embedding an MSCA module in the backbone network.

[0082] Overall performance comparison results The comparison results of the core performance indicators (number of parameters, inference frame rate, detection accuracy, and classification accuracy) of each experimental group are shown in the table below: Table 1 Ablation Experiment Setup and Overall Performance Results

[0083] As shown in Table 1, the baseline group (Group A), as the basic model, has 20.87M parameters and an mAP@0.5 of 0.9044, demonstrating stable basic detection capabilities. However, it is not optimized for multi-scale hole features, resulting in low F1 values ​​for small and large defects and a hierarchical matching accuracy of only 82.5%. After adding a single CA module to the single CA group (Group B), the F1 value for large defects improved by approximately 10.4% compared to the baseline group. However, because single-scale attention cannot take into account multi-scale features, the excessive enhancement of large hole features suppresses the weak feature response of small holes, leading to a 18.1% decrease in the F1 value for small defects, a drop in mAP@0.5 to 0.8586, and a decrease in hierarchical matching accuracy to 80.1%, verifying the limitations of the single-layer CA module.

[0084] When only the MSCA module was embedded in the single-module group (Group C), the number of model parameters increased slightly compared to the baseline group (22.46M), the inference frame rate dropped to 42.4 FPS, and the F1 score for medium and large defects did not improve significantly. The hierarchical matching accuracy was 79.3%, indicating that although using the MSCA module alone has the potential for lightweight design, it lacks the ability to target and enhance hole features, making it difficult to effectively improve detection accuracy. After combining a 1-layer CA module and a 1-layer MSCA module in the dual-module group (Group D), the hierarchical matching accuracy improved to 84.7%, which is a significant improvement compared to the single-module group, but the balance of multi-scale hole detection is still insufficient.

[0085] The fully improved group (Group E), namely the model in this application, significantly reduces the number of parameters to 16.68M (a 20.1% reduction compared to the baseline group) through the synergistic effect of the CA-Hole strategy (4-layer CA module) and the MSCA module, while maintaining an inference frame rate of 38.8 FPS, meeting the real-time detection requirements of engineering. At the same time, the mAP@0.5 reaches 0.8813, the F1 value of small defects is improved by 6.5% compared to the baseline group, the F1 value of large defects is improved by 18.8%, and the hierarchical matching accuracy is as high as 89.2%, which is 8.1 percentage points higher than the baseline group. This fully demonstrates the full coverage enhancement effect of the CA-Hole strategy on multi-scale hole features, as well as the advantages of the MSCA module in lightweight design and feature selection. The two work together to achieve a dynamic balance between detection accuracy and model efficiency.

[0086] Impact of attention module configuration on detection accuracy To further analyze the impact of the number of CA module layers and the introduction of the MSCA module on the refinement of detection accuracy, the precision, recall, and F1 scores of defects at various scales were compared under different attention configurations. The results are shown in the table below: Table 2. Impact of different attention module configurations on detection accuracy

[0087] As shown in Table 2, compared with the baseline group (without any attention module), adding only one CA module slightly improves the precision and F1 score for large defects, but the improvement in F1 score for small defects is limited. When the number of CA module layers increases to 4 (CA-Hole strategy), the precision increases to 89.7%, the recall reaches 77.9%, and the F1 scores for small defects and large defects increase to 76.8% and 88.9% respectively, which are significantly better than the single-layer CA module. This proves that the multi-layer CA module is adaptable to multi-scale features and effectively solves the problem that weak features of small holes are easily submerged.

[0088] When the MSCA module is added alone, the model precision reaches 89.1% and the recall reaches 75.7%. The F1 score of defects at each scale is higher than that of the single CA group, which verifies the effectiveness of the MSCA module in channel feature selection. When the CA-Hole strategy is combined with the MSCA module, the model precision is further improved to 91.3% and the F1 score reaches 85.4%, achieving the optimal balance between precision and recall and highlighting the synergistic gain of the two.

[0089] Module synergy analysis To clarify the synergistic mechanism between the CA-Hole strategy and the MSCA module, the combined impact of different module combinations on model lightweighting and detection performance was compared. The results are shown in the table below: Table 3. Impact of different attention module configurations on detection accuracy

[0090] As shown in Table 3, when the CA-Hole strategy (4-layer CA module) is used alone, it can improve the detection accuracy, but the number of parameters and the amount of computation are not significantly reduced. When the MSCA module is used alone, the lightweight effect is initially shown, but the improvement in accuracy is limited. When the two are combined, the number of model parameters is reduced by 20.1% compared with the baseline group, the FLOPs are significantly reduced, and the detection accuracy is maintained at the mainstream level, achieving the core goal of "no loss of accuracy and weight reduction".

[0091] The essence of this synergistic effect is that the CA-Hole strategy, through multi-scale feature map embedding, directionally enhances the feature representation of both small and large holes, solving the problem of imbalance in multi-scale object detection in traditional models. The MSCA module, through a streamlined weight calculation chain, filters effective feature channels and suppresses background redundancy, reducing the computational overhead of the CA-Hole module while optimizing bounding box localization accuracy. The two form a closed loop of "feature enhancement - redundancy filtering," rather than a simple functional superposition, which is the core innovation that distinguishes this application's model from existing single attention improvement schemes.

[0092] The following key conclusions can be drawn from the ablation experiments: The CA-Hole multi-layer coordinate attention enhancement strategy (4-layer CA module) effectively balances feature extraction for both small and large holes compared to a single-layer CA module, avoiding performance bias caused by single-scale attention. This is key to improving the accuracy of multi-scale hole detection. The MSCA lightweight channel attention module has independent feature selection and lightweighting capabilities. Its integration with the C3 module does not destroy the feature aggregation capabilities of the original network, providing support for embedded model deployment. The synergy between the CA-Hole multi-layer coordinate attention enhancement strategy and the MSCA lightweight channel attention module is the core of achieving triple optimization of "detection accuracy, inference efficiency, and engineering classification accuracy". Neither module alone can achieve the same effect. The combined solution is highly targeted and adaptable to the detection of hole defects in 3D printed concrete.

[0093] To further optimize the above technical solution, the number of Bottleneck stacks in the C3-MSCA module and the channel compression ratio of the MSCA lightweight channel attention module can be adjusted according to the computing power requirements of the actual engineering scenario, so as to achieve a dynamic balance between detection accuracy and inference efficiency.

[0094] To further optimize the above technical solution, the dataset can be iteratively updated by expanding the image samples under different printing parameters and imaging conditions, thereby further improving the model's generalization ability in complex scenarios.

[0095] To further optimize the above technical solution, the infrared thermometer can be linked with the visual positioning system to correct the interference of light fluctuations on strip recognition in real time, thereby further improving the calculation accuracy of the dynamic mapping factor.

[0096] To further optimize the above technical solutions, the defect size classification threshold and density judgment threshold can be adaptively adjusted according to the quality control standards of different projects to meet the quality inspection needs of different scenarios.

[0097] Any aspects not covered in this invention are applicable to existing technologies.

Claims

1. A method for intelligent detection and classification of void defects in 3D printed concrete, characterized in that, The detection and grading method includes the following: Images of the surface of 3D printed concrete components are obtained, each image containing a complete horizontal standard printing strip. The locations of holes and defects are finely annotated to construct a hole and defect dataset. A CMDH-YOLOv5 detection model was constructed, with YOLOv5m as the basic framework. A C3-MSCA integrated structure integrating a lightweight channel attention module was embedded in the backbone network of YOLOv5m. A CA module was inserted at the feature position after each splicing operation in the feature fusion network. The lightweight channel attention module of the MSCA includes a weight calculation link consisting of global adaptive average pooling, 1×1 convolutional channel compression, ReLU activation, 1×1 convolutional channel recovery, and Sigmoid activation. The feature map output by the C3 module in the C3-MSCA integrated structure is processed by the weight calculation link to output channel weights. The channel weights are multiplied channel-by-channel with the input features of global adaptive average pooling to obtain the output of the lightweight channel attention module of the MSCA. In the 1×1 convolution channel compression operation, the channel compression ratio is set to a range of 8-32, and the number of channels is forced to be no less than 8. The CMDH-YOLOv5 detection model is trained using the hole defect dataset to output pixel-level bounding box detection results for hole defects; Based on the standard printed strips of 3D printed concrete, strip contour recognition is performed on the same image to be inspected, and the pixel-level size of the hole defect is converted into the actual physical size. Based on the actual physical size and density of defects per unit area, the engineering grade of the defects is determined, and a structured inspection result containing the defect location, physical size, defect grade, and corresponding treatment suggestions is output.

2. The method according to claim 1, characterized in that, The normalized resolution of the input image for the CMDH-YOLOv5 detection model is 640×640. In the C3-MSCA integrated structure, the number of Bottleneck stacks, n, ranges from 1 to 3.

3. The method according to claim 1, characterized in that, The pixel-level size of the hole defect is converted into the actual physical size by a dynamic mapping factor. The calculation process of the dynamic mapping factor is as follows: the actual physical width of the standard printed strip is preset, the standard printed strip area in the image to be detected is located by Gaussian blur, OTSU binarization and morphological operations, the pixel width of the strip is measured, and the dynamic mapping factor corresponding to the current image is calculated based on the relationship that the actual physical width of the standard printed strip = the pixel width of the strip × the dynamic mapping factor.

4. The method according to claim 1, characterized in that, The image to be detected is captured from top to bottom by a camera fixed above the print head of the 3D printing equipment, with a shooting distance applicable to the range of 0.3m-1m.

5. The method according to claim 1, characterized in that, The engineering grade determination rules for the aforementioned hole defects are as follows: Based on actual physical dimensions, they are divided into three core grades: small defects (<3mm), medium defects (3mm-5mm), and large defects (>5mm); grade upgrades are determined by combining defect density per unit area: every 50cm... 2 If the number of internal minor defects exceeds 5-10, the monitoring level will be upgraded to a key monitoring level. Every 50cm 2 If there are more than 2-3 internal defects, the defect level is upgraded to a critical defect level; the corresponding handling principle is: minor defects are monitored routinely and do not require immediate repair. Defects in the middle are treated with local repairs; Major and severe defects require work to be suspended for rectification, and a comprehensive re-inspection and reinforcement treatment must be carried out.

6. The method according to claim 1, characterized in that, The image standardization preprocessing includes unifying the resolution of the acquired image, converting the BGR channel to the RGB channel, and normalizing the pixel values ​​to the [0,1] range; Meanwhile, the training dataset is expanded through data augmentation, which includes horizontal flipping, vertical flipping, scaling, and brightness and contrast adjustment. The scaling ratio ranges from 0.8 to 1.2 times, the brightness compensation value ranges from 5 to 10, and the contrast gain ranges from 1.1 to 1.

4.

7. The method according to claim 1, characterized in that, The training parameters of the CMDH-YOLOv5 detection model are as follows: 50-300 training rounds, batch size of 8-32, initial learning rate of 0.001-0.01, confidence threshold of 0.2-0.5, and SGD or Adam as the optimizer. For video stream detection of 3D printed concrete component surfaces, a frame-sampling detection method is adopted, with a frame-sampling frequency range of 1-30 frames / second.

8. A smart detection and grading system for void defects in 3D printed concrete, characterized in that, The system performs the detection and grading method according to any one of claims 1-7.