Aluminum pipe surface defect detection method and system based on lightweight digital model

By using a lightweight MC-YOLO model and an improved hardware platform, the accuracy and real-time performance issues of detecting minute defects on the surface of aluminum tubes were resolved, enabling efficient and low-cost detection and classification on embedded devices.

CN121837129APending Publication Date: 2026-04-10浙江康盛科工贸有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-24
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Traditional detection methods have low accuracy and high false negative rate in detecting minute defects on the surface of aluminum tubes for cooling. Furthermore, existing high-precision deep learning models have high computational complexity, making it difficult to achieve real-time detection on embedded devices.

Method used

A lightweight MC-YOLO model was adopted, with the backbone network improved to MobileNetV4 and the neck network to C3FSH modules. Combined with an improved S-Hswish activation function, it was deployed on a Raspberry Pi single-board computer. The model was optimized by combining ring LED lighting and the OpenVINO toolkit to achieve efficient detection.

Benefits of technology

It achieves high-precision, real-time surface defect detection of aluminum tubes on embedded devices, with high robustness and low cost, and can accurately identify and classify minute defects in complex backgrounds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121837129A_ABST
    Figure CN121837129A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of industrial product surface quality detection, and discloses an aluminum pipe surface defect detection method and system based on a lightweight digital model.The method comprises the steps that firstly, an embedded hardware platform with Raspberry Pi as the core is constructed, and an improved MC-YOLO lightweight detection model is deployed; an aluminum tube surface image is collected through a camera, and the model is used for defect identification and classification. According to the MC-YOLO model, YOLOv5s is taken as a basis, a backbone network of the MC-YOLO model is replaced by MobileNetV4 so as to reduce the calculation complexity, and a C3 module in a neck network is improved into a C3FSH module fused with Faster Block and an improved S-Hswsh activation function, so that the speed is increased on the premise of ensuring the precision. The industrial problems of low detection precision and high omission ratio of small defects on the surface of the aluminum tube under the strong reflection background are effectively solved, and the device is high in precision, high in efficiency and low in cost.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of surface quality detection of industrial products, and particularly relates to an aluminum pipe surface defect detection method and system based on a lightweight deep learning model and an embedded hardware platform. BACKGROUND

[0002] Aluminum pipes are widely used as cooling pipelines in refrigeration systems (such as air conditioners and refrigerators) due to their light weight, good corrosion resistance, and good thermal conductivity. During the production, transportation, and assembly of aluminum pipes, small defects such as scratches, indentations, white spots, and cracks may occur on the surface. These defects not only affect the appearance of the product, but also become stress concentration points. Under the harsh working conditions of long-term pressure and temperature cycles of refrigerants, they may cause pipeline fatigue cracking and refrigerant leakage, ultimately leading to the failure of the entire refrigeration system and posing a serious safety hazard.

[0003] Currently, the traditional aluminum pipe defect detection methods mainly have the following limitations: 1. Manual detection: low efficiency, high labor intensity, susceptible to subjective factors, and high missed detection rate.

[0004] 2. Traditional non-destructive testing (such as ultrasonic and eddy current testing): the detection object has limitations, the sensitivity to small surface defects is insufficient, and it is difficult to achieve full-coverage high-speed online detection.

[0005] 3. Machine vision based on traditional image processing: although it can achieve preliminary segmentation of defects, it has weak feature extraction capability for small defects, poor robustness in complex backgrounds such as strong light reflection and uneven illumination of aluminum pipes, and high false detection rate.

[0006] 4. Detection method based on deep learning: In recent years, deep learning technology, especially target detection models, has shown great potential in surface defect detection. However, direct application of existing general models (such as YOLO and Faster R-CNN) to refrigeration aluminum pipe detection faces serious challenges: such as small target detection difficulty: scratches, white spots, and other defects on the surface of aluminum pipes have a very small proportion in the image, which are typical small targets, and mainstream detection models have insufficient feature extraction for such targets, which may lead to missed detection. For example, complex background interference: the surface of aluminum pipes has strong metal light reflection characteristics, and may have noise such as oil stains and water stains, which can easily be confused with real defects, increasing the difficulty of model feature extraction and classification. For example, model complexity and real-time balance: industrial sites require detection systems to have high real-time performance (high frame rate FPS). Although complex models can improve accuracy, they have large model parameter quantities and high computational costs, making it difficult to achieve real-time detection on industrial embedded devices with limited deployment resources.

[0007] Therefore, there is an urgent need in the art for an innovative technical solution capable of accurately, quickly and robustly detecting and classifying small defects on the surface of refrigeration aluminum pipes, and which can be deployed in embedded devices. SUMMARY

[0008] The purpose of the present application is to solve the following problems: (1) The traditional detection method and the traditional machine vision method have low detection accuracy and high missing detection rate for small defects on the surface of refrigeration aluminum pipes.

[0009] (2) In the complex background of strong reflection and uneven illumination of aluminum pipes, the defect feature extraction is insufficient, and the model robustness is poor.

[0010] (3) The existing high-precision deep learning model has high computational complexity, which makes it difficult to meet the real-time detection requirements of industrial field embedded devices while ensuring detection accuracy.

[0011] The present application provides an aluminum pipe surface defect detection method and system based on a lightweight digital model, which has high detection accuracy, lightweight model, high system integration, and strong practicality.

[0012] The above technical problems of the present application are mainly solved by the following technical scheme: an aluminum pipe surface defect detection method based on a lightweight digital model, characterized in that the method comprises the following steps: S1: Constructing an embedded hardware detection platform, the platform comprising an image acquisition unit, an illumination unit and a processing unit, wherein the processing unit adopts a Raspberry Pi single board computer.

[0013] S2: Deploying an improved MC-YOLO lightweight detection model on the processing unit.

[0014] S3: Acquiring aluminum pipe surface images through the image acquisition unit.

[0015] S4: Using the MC-YOLO model to detect and classify the acquired aluminum pipe surface images.

[0016] The MC-YOLO model is obtained by improving the YOLOv5s model, and the improvement includes: (a) Using MobileNetV4 as the backbone network to replace the original YOLOv5s backbone network.

[0017] (b) In the neck network, replace the Bottleneck module of the C3 module with the Faster_Block module, and replace the activation function with the improved S-Hswish function to form the C3FSH module.

[0018] In the foregoing aluminum pipe surface defect detection method based on a lightweight digital model, preferably, the MobileNetV4 backbone network adopts a general reverse bottleneck module (UIB), and a multi-query attention mechanism (MQA) is introduced into the network, and the calculation method includes the following formula: (1) (2) In the formula, SR represents spatial reduction.

[0019] In the foregoing aluminum pipe surface defect detection method based on a lightweight digital model, preferably, the Faster_Block module replaces a 3×3 regular convolution with a 1×1 regular convolution, and adds a 3×3 partial convolution (PConv).

[0020] In the foregoing aluminum pipe surface defect detection method based on a lightweight digital model, preferably, the expression of the improved S-Hswish activation function is: (3) In the formula, the Softplus function formula is: (4) In the formula, the parameters α and β are dynamically adjusted according to the mean and standard deviation of the input data.

[0021] In the foregoing aluminum pipe surface defect detection method based on a lightweight digital model, preferably, the lighting unit adopts a ring-shaped LED lighting structure for suppressing aluminum pipe surface reflection and highlighting defect features.

[0022] In the foregoing aluminum pipe surface defect detection method based on a lightweight digital model, preferably, when the MC-YOLO model is deployed on the processing unit, the OpenVINO tool package is used for model optimization and inference acceleration, specifically including using a model optimizer to optimize the model, and using an inference engine to accelerate the inference at the hardware instruction level.

[0023] In the foregoing aluminum pipe surface defect detection method based on a lightweight digital model, preferably, the Raspberry Pi single-board computer is connected to the Windows platform through a VNC service to realize remote operation and result display.

[0024] In the foregoing aluminum pipe surface defect detection method based on a lightweight digital model, preferably, before defect detection and classification using the MC-YOLO model, a model training stage is further included, which is performed on a PC end GPU, and specifically includes: An image dataset containing various defects on the surface of an aluminum pipe is constructed, and the defects at least include scratches, indentations, white spots, and cracks. using the data set to train the improved MC-YOLO model, and adjusting the model parameters by optimizing the loss function; The optimal weight file obtained after the training is completed is converted and optimized through the OpenVINO tool package and deployed into the Raspberry Pi processing unit.

[0025] The application also provides an embedded aluminum pipe surface defect detection system for executing the above method, and the system comprises: An image acquisition module is configured to acquire aluminum pipe surface images.

[0026] A processing module is configured to run the MC-YOLO model for defect detection by using a Raspberry Pi single-board computer.

[0027] An illumination module is configured to provide uniform illumination and suppress reflection by using a ring-shaped LED illumination structure.

[0028] A display module is configured to display the detection results.

[0029] A computer readable storage medium has a computer program stored thereon, and the program, when executed by a processor, implements the method steps of any one of claims 1-8.

[0030] Compared with the prior art, the application has the following advantages: (1) High detection accuracy and strong robustness: the MC-YOLO model used in the application enhances the feature extraction capability for small defects on the surface of the aluminum pipe by introducing MobileNetV4 and C3FSH modules. The improved S-Hswish activation function and the ring-shaped light source design effectively overcome the interference of strong reflection and uneven illumination, and significantly improve the detection accuracy and robustness in complex industrial scenes.

[0031] (2) Lightweight model and good real-time performance: by using the highly efficient MobileNetV4 as the backbone network and using Faster_Block and PConv in the neck network to reduce the parameter amount and calculation amount, the MC-YOLO model is more lightweight compared with the original YOLOv5s model. Combined with the deep optimization of OpenVINO on the embedded end, the entire system can realize high-frame-rate real-time detection on devices with limited resources such as Raspberry Pi, fully meeting the beat requirements of industrial pipelines.

[0032] (3) High system integration and low deployment cost: the application provides a complete solution from algorithm, hardware to software deployment. With Raspberry Pi as the core, the hardware structure is compact and the power consumption is low, and the cost is much lower than that of the traditional industrial computer solution. The system is easy to install and maintain, greatly reducing the automation threshold and total cost of ownership of aluminum pipe surface defect detection.

[0033] (4) Complete function, strong practicability: the system can not only detect the existence of defects, but also accurately classify the defect types (such as scratches, pressure pits, white spots, etc.), providing valuable data support for quality control and process improvement in the production process. BRIEF DESCRIPTION OF DRAWINGS

[0034] Figure 1 It is a system schematic diagram of the application.

[0035] Figure 2 It is a raspberry pi hardware module design structure diagram (real object) of the system.

[0036] Figure 3 It is the overall architecture diagram of the improved MC-YOLO lightweight model of the application.

[0037] Figure 4 It is the structure diagram of the general reverse bottle neck module in MobileNetV4.

[0038] Figure 5 It is the function image comparison diagram of the S-Hswish activation function proposed by the application and ReLU and Hswish.

[0039] Figure 6 It is the structure diagram of the C3FSH module in the neck network of the application.

[0040] Figure 7 It is the development flowchart for model deployment and inference using OpenVINO toolkit. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical scheme and advantages of the application more clear and explicit, the application will be further described in detail below with reference to the drawings.

[0042] The aluminum pipe surface defect detection method based on a lightweight digital model of the embodiment comprises the following steps: S1: Construct an embedded hardware detection platform, the platform comprising an image acquisition unit, an illumination unit and a processing unit, wherein the processing unit adopts a Raspberry Pi single board computer.

[0043] S2: Deploy an improved MC-YOLO lightweight detection model on the processing unit.

[0044] S3: Acquire aluminum pipe surface images through the image acquisition unit.

[0045] S4: Use the MC-YOLO model to detect and classify the defects of the acquired aluminum pipe surface images.

[0046] The MC-YOLO model is obtained by improving the YOLOv5s model, and the improvements include: (a) MobileNetV4 is used as the backbone network to replace the original YOLOv5s backbone network; (b) In the neck network, the Bottleneck module of the C3 module is replaced with the Faster_Block module, and the activation function is replaced with the improved S-Hswish function to form the C3FSH module.

[0047] The system will be described in detail below: The aluminum pipe surface defect detection system based on a lightweight digital model of the embodiment, as shown in the system overall schematic diagram, provides a complete set of aluminum pipe surface defect detection system that can be deployed in industrial field. Figure 1

[0048] The workflow is as follows: after starting the system, the Raspberry Pi controls the annular light source to light up, and triggers the camera to collect the image of the aluminum pipe surface passing through the detection station at a constant speed. The collected image is transmitted to the Raspberry Pi memory through the CSI interface. Then, the Raspberry Pi calls the deployed MC-YOLO model to infer the image, identify and locate the defects, and judge the defect categories. Finally, the detection results (including whether there is a defect, the defect type, the position information) are visualized and displayed through the connected display, and can trigger the sound and light alarm or communicate with the production line PLC to sort out the unqualified products.

[0049] I. Specific implementation of hardware system Referring to Figure 2 and Table 1 below, the hardware module design structure diagram and the hardware modeling.

[0050] Table 1: The hardware core of the system includes: 1. Main control and processing unit: Raspberry Pi 4B (4GB memory) is used as the core computing platform. Its quad-core ARM Cortex-A72 processor provides sufficient computing power. We choose a 64GB MicroSD card (Class 10) as the storage medium, which is used to install the Raspberry Pi OS-64bit operating system, Python running environment, OpenVINO tool package, MC-YOLO model weight file and detection application program.

[0051] ​2. Image acquisition unit: Official Raspberry Pi high-definition camera module (such as IMX477 sensor) is used, which is directly connected with Raspberry Pi through CSI-2 interface to ensure high speed and stability of data transmission. Fixed focus lens is selected, and appropriate working distance is adjusted according to the diameter of aluminum pipe and the requirement of detection field of view to ensure clear imaging of defect features.

[0052] 3. Illumination unit: In order to overcome the strong reflection of aluminum pipe surface, ring-shaped LED white light source is used in this embodiment, which is installed around the camera lens. By adjusting the brightness and angle of the light source, the light is uniformly irradiated on the surface of the aluminum pipe at a certain angle, and the mirror reflection spot is moved out of the camera field of view, so as to highlight the diffuse reflection characteristics of the defect area such as scratch and pressure pit.

[0053] 4. Acceleration module: In order to improve the inference speed, Intel Neural Compute Stick 2 (NCS2) is used as VPU acceleration device in this embodiment, which is connected with Raspberry Pi through USB 3.0 interface. OpenVINO inference engine can efficiently call NCS2 for model inference.

[0054] 5. Communication and display: Raspberry Pi accesses the factory local area network through the built-in gigabit Ethernet port, which can realize uploading of detection data and remote control. At the same time, the display is connected through HDMI interface for real-time display of detection interface. The system power supply is provided by official 5V / 3A DC adapter.

[0055] II. Specific implementation of software algorithm and model deployment This part is the core of the implementation of the application, and the specific steps are as follows: First step: model training (completed on PC) 1. Data preparation: Collect a large number of images containing various types of aluminum pipe surface defects (such as scratches, pressure pits, white spots and cracks), and use labeling tools (such as LabelImg) to accurately label the defect position and type to form data sets in VOC format.

[0056] 2. Model construction and training: Based on YOLOv5s framework, MC-YOLO model as shown in the attached Figure 3 is constructed.

[0057] A. Replacement of main network: Replace the original CSPDarknet53 main network of YOLOv5s with MobileNetV4. As shown in the attached Figure 4 , the general reverse bottle neck module (UIB) of MobileNetV4 and its multi-query attention mechanism (MQA) provide efficient feature extraction capability for the model.

[0058] The core calculation formula of MQA is shown in the following formula (1) and (2): (1) (2) B. Neck network improvement: Replace the C3 module in the YOLOv5s neck network with the C3FSH module. As shown in the attached Figure 6 , the C3FSH module internally uses Faster_Block, which uses 1x1 convolution and 3x3 partial convolution (PConv) to reduce computation, and replaces the activation function in it with the S-Hswish function proposed by us (see the function image comparison in the attached Figure 5 ). The function expression is: (3) where the Softplus function is: (4) It can dynamically adjust to adapt to input features and improve non-linear expression ability.

[0059] As Figure 5 can be seen, compared to ReLU and Hswish, it is smoother and the transition is more natural in the area where the input is close to 0, which helps to reduce errors and oscillations caused by the discontinuity of the activation function during training. In addition, in the positive region, the output growth rate of S-Hswish is faster than Hswish, and when the input is large, it can provide higher activation values, which can amplify important features during forward propagation and improve the expression ability of the certificate number detection model.

[0060] Further, the overall structure of the improved C3FSH network, due to the fusion of the Faster_Block module in the C3 module and the replacement of the ReLU activation function with the improved S-Hswish, can reduce computational complexity and parameter quantity, improve the speed of target detection, and better handle feature extraction and non-linear relationship processing in complex scenarios, improving the flexibility and overall performance of the model.

[0061] 3. Model training: On a server equipped with GPU, use the prepared dataset to train the improved MC-YOLO model, optimize the model parameters through the backpropagation algorithm until the loss function converges, and obtain the optimal model weight file.

[0062] Second step: Model conversion and deployment (completed on Raspberry Pi side) 1. Environment configuration: Install Raspberry Pi OS-64bit system on Raspberry Pi and configure OpenVINO toolkit version 2022 or later.

[0063] 2. Model optimization and conversion: Refer to the attached Figure 7The OpenVINO development process shown uses OpenVINO's model optimizer to first convert the trained model into ONNX format and then further convert it into OpenVINO's special intermediate representation file. This process performs graph structure optimization, node fusion, FP16 quantization, and other operations to greatly optimize the model to adapt to edge devices.

[0064] In actual implementation, the operating system can directly select the Raspberry Pi OS-64bit operating system officially released by Raspberry Pi. The connection between Raspberry Pi and Windows platform can be realized by using VNC software. Set up SSH service when burning the system, manually start VNC service by using Linux command after connecting Raspberry Pi through SSH, and then only need to install a VNC Viewer on the Windows platform. After obtaining the IP address of Raspberry Pi, the Raspberry Pi can be connected through VNCViewer.

[0065] 3. Inference program development: use Python to write the master program on Raspberry Pi. The program uses the inference engine API of OpenVINO to load the optimized IR model and specifies the execution of inference on the second generation of Intel neural computing stick NCS2. The program flow is: initialize the camera → loop capture image → image preprocessing (size scaling, normalization) → call the engine for inference → parse the output result (bounding box, confidence, class) → post-processing (non-maximum suppression) → display and output the result.

[0066] In order to quickly respond to the detection needs of edge devices and improve the inference speed of the model on the edge device, this embodiment uses OpenVINO to realize the rapid planning and arrangement of the detection model, aiming to accelerate the deployment of applications and solutions, so as to realize the acceleration of the edge model.

[0067] III. Specific implementation of detection process After the system is powered on and runs, the master program starts and executes in the following steps: 1. Image acquisition: the program controls the camera to continuously or triggeringly acquire the image of the surface of the aluminum pipe.

[0068] 2. Image preprocessing: scale the acquired image to the input size specified by the model (such as 640x640) and perform pixel value normalization.

[0069] 3. Model inference: input the preprocessed image data into the deployed MC-YOLO model. The model first extracts multi-scale features through the MobileNetV4 backbone network, then performs feature fusion through the improved C3FSH neck network, and finally predicts the bounding box and class of the defect at the output end.

[0070] 4. Result post-processing and output: Perform non-maximum suppression operation on multiple prediction boxes of model output, filter out overlapping redundant boxes, and get the final defect detection result. The program superimposes defect categories (such as "crater", "scratch") and position information on the original image, and displays it in real time through the HDMI interface. At the same time, according to the preset threshold value, the severity of the defect can be judged, and the alarm lamp or sorting device can be controlled through the GPIO port.

[0071] Through the cooperation of the above hardware and software, the present application successfully realizes the real-time automatic detection and classification of the surface defects of the aluminum pipe on the low-power and low-cost embedded device with high precision and high efficiency.

[0072] The above examples are descriptions of the present application, not limitations of the present application. The described examples are only some of the embodiments of the present application, not all. Based on the examples in the present application, all other examples obtained by those of ordinary skill in the art without creative labor belong to the scope of protection of the present application.

Claims

1. A method for detecting surface defects in aluminum tubes based on a lightweight digital model, characterized in that, The method includes the following steps: S1: Construct an embedded hardware testing platform, which includes an image acquisition unit, an illumination unit, and a processing unit, wherein the processing unit uses a Raspberry Pi single-board computer; S2: Deploy the improved MC-YOLO lightweight detection model on the processing unit; S3: Acquire an image of the aluminum tube surface using the image acquisition unit; S4: Use the MC-YOLO model to perform defect detection and classification on the acquired aluminum tube surface images; The MC-YOLO model is derived from an improvement upon the YOLOv5s model, including the following improvements: (a) Replace the original YOLOv5s backbone network with MobileNetV4 as the backbone network; (b) In the neck network, the Bottleneck module of the C3 module is replaced with the Faster_Block module, and the activation function is replaced with the improved S-Hswish function to form the C3FSH module.

2. The method for detecting surface defects of aluminum tubes based on a lightweight digital model according to claim 1, characterized in that, The MobileNetV4 backbone network employs the Universal Inverted Bottleneck Module (UIB) and introduces the Multi-Query Attention (MQA) mechanism into the network. Its computation method... Including the following formulas: (1) (2) In the formula: SR represents space reduction.

3. The method for detecting surface defects in aluminum tubes based on a lightweight digital model according to claim 1, characterized in that, The Faster_Block module replaces the 3×3 regular convolution with a 1×1 regular convolution and adds a 3×3 partial convolution PConv.

4. The method for detecting surface defects in aluminum tubes based on a lightweight digital model according to claim 1, characterized in that, The expression for the improved S-Hswish activation function is as follows: (3) The formula for the Softplus function is as follows: (4) In the formula: parameters α and β are dynamically adjusted based on the mean and standard deviation of the input data.

5. The method for detecting surface defects in aluminum tubes based on a lightweight digital model according to claim 1, characterized in that, The lighting unit adopts a ring-shaped LED lighting structure to suppress reflections on the aluminum tube surface and highlight defect features.

6. The method for detecting surface defects in aluminum tubes based on a lightweight digital model according to claim 1, characterized in that, When deploying the MC-YOLO model on the processing unit, the OpenVINO toolkit is used for model optimization and inference acceleration. Specifically, this includes using a model optimizer to optimize the model and using an inference engine for hardware instruction-level accelerated inference.

7. The method for detecting surface defects of aluminum tubes based on a lightweight digital model according to claim 1, characterized in that, The Raspberry Pi single-board computer connects to the Windows platform via VNC service to enable remote operation and result display.

8. The method for detecting surface defects in aluminum tubes based on a lightweight digital model according to claim 1, characterized in that, Before using the MC-YOLO model for defect detection and classification, a model training phase is also included, which is performed on a PC-based GPU and specifically includes: Construct an image dataset containing various defects on the surface of aluminum tubes, including at least scratches, indentations, white spots, and cracks; The improved MC-YOLO model was trained using the dataset, and the model parameters were tuned by optimizing the loss function. The optimal weight file obtained after training is converted and optimized using the OpenVINO toolkit and then deployed to the Raspberry Pi processing unit.

9. An embedded aluminum tube surface defect detection system for performing the method according to any one of claims 1-8, characterized in that, The system includes: Image acquisition module, used to acquire images of the aluminum tube surface; The processing module uses a Raspberry Pi single-board computer to run the MC-YOLO model for defect detection; The lighting module uses a ring-shaped LED lighting structure to provide uniform illumination and suppress glare; The display module is used to display the detection results.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the method as described in any one of claims 1-8.