Wire harness test labeling system

By using clustering and segmentation in the wire harness testing and labeling system and improving the YOLOv11 model to enhance label wrinkle features, combined with an alarm module, the problems of missed and false detections in label image defect identification in industrial environments are solved, improving the accuracy and efficiency of detection.

CN122009642APending Publication Date: 2026-05-12安徽隆华瑞达科技有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
安徽隆华瑞达科技有限公司
Filing Date
2026-02-27
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

In industrial environments, background lighting affects the extraction of wrinkle and defect features in label images, leading to missed or false defects in defect identification and affecting the efficiency of wire harness labeling.

Method used

A wire harness testing and labeling system is employed, comprising a clustering and segmentation module, a detection module, and an alarm module. The clustering and segmentation module enhances the target feature regions by performing clustering operations on pixels in the initial image; the detection module uses an improved YOLOv11 model to enhance the texture features at label wrinkles; and the alarm module controls alarm devices to provide alerts based on the detection results.

Benefits of technology

It effectively improves the accuracy and efficiency of label defect detection, reduces missed detections or misjudgments, and ensures the quality control effect of wire harness labeling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122009642A_ABST
    Figure CN122009642A_ABST
Patent Text Reader

Abstract

The invention discloses a wiring harness test labeling system, and relates to the technical field of image processing. The system comprises the steps of obtaining an initial image to be labeled, clustering the initial image to obtain a clustered image, performing enhancement operation on the clustered image to output an enhanced image, performing clustering and enhancement operation on the initial image to enhance the small target defect feature expression capability, and inputting the enhanced image into a defect detection model to output a detection result. Precise classification and labeling are realized by means of a defect detection model, a detection result is quickly fed back in combination with alarm equipment, and the alarm equipment is controlled to give an alarm according to the detection result; the accuracy of label defect detection is effectively improved, the situation of missing detection or misjudgment is reduced, and the quality control effect of wiring harness labeling is effectively guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing technology, and specifically relates to a wire harness testing and labeling system. Background Technology

[0002] Wiring harness labeling is a process that marks information on a wiring harness composed of multiple wires, cables, and accessories by affixing labels or using inkjet printing. Labels typically include information such as harness specifications, purpose, serial number, production date, and the equipment to which it belongs. Their core function is to facilitate production traceability, rapid identification during installation, and subsequent maintenance and repair. They are widely used in the automotive and electronics industries. However, errors or defects in label printing can lead to mismatches and rework during installation, severely impacting production efficiency and increasing management costs. Furthermore, missing or misread information during later maintenance can prolong repair time and increase the risk of malfunctions.

[0003] The existing publication number (CN117474924A) discloses a label defect detection method based on machine vision. The method involves acquiring a label image of the label to be detected and preprocessing the label image; extracting contours from both the target label image and a pre-acquired target template image; performing preliminary matching between the contour of the label to be detected and each template label contour in the template label contour set; classifying the label contours to be detected in the set of label contours to be detected; performing refined matching between the label contour to be refined and the set of contours to be matched corresponding to the refined label contours; and generating label defect information corresponding to the label to be detected.

[0004] The above method solves the problem of poor defect detection performance in small local cases by extracting the outline of the label image and refining the extracted label outline. However, in some industrial environments, background lighting can reduce the extraction of defect features in the label image, and some small target defect features of the label (such as wrinkles, damage, font misalignment, and font blur) cannot be solved by outline processing alone; on the contrary, it can lead to missed or false judgments in defect identification, affecting the efficiency of labeling wire harnesses. Summary of the Invention

[0005] The purpose of this invention is to solve the problem that the background lighting in an industrial environment greatly affects the extraction of wrinkle and defect features in label images, leading to missed or false identification of defects. Therefore, a wire harness testing and labeling system is proposed.

[0006] A wire harness testing and labeling system proposed in this invention includes a clustering and segmentation module, a detection module, and an alarm module, wherein:

[0007] The clustering enhancement module is used to perform clustering operations on the pixels in the initial image to obtain a clustered image, and to perform enhancement operations on the target feature region to output an enhanced image; the target feature region is the defect feature region in the clustered image;

[0008] The detection module is used to input the enhanced image into the defect detection model and output the detection result; the defect detection model is a target model obtained by improving YOLOv11, and the improvement includes: adding a PDC module between the 16th and 17th layers in the neck network of the YOLOv11 model; the PDC module is used to enhance the texture features at the label wrinkles;

[0009] The alarm module is used to control the alarm device to issue an alarm notification based on the detection results.

[0010] Optionally, the system further includes a preprocessing module, which comprises a scaling module and a transformation module, wherein:

[0011] The scaling module is used to acquire the original image of the label to be affixed, and to adjust the original image to a standard size by calling an image scaling function to obtain a scaled image; the original image is an RGB image with a label size of 256×256;

[0012] The conversion module is used to convert the scaled image into a grayscale image using a grayscale conversion function, and to denoise the grayscale image to obtain an initial image.

[0013] Optionally, the clustering enhancement module includes a first calculation module, a query module, a selection module, and a processing module, wherein:

[0014] The first calculation module is used to test the cluster centers of different values ​​for the pixels in the initial image, calculate the intra-cluster variance corresponding to each cluster center, and draw the intra-cluster curve.

[0015] The query module is used to query the point with the largest slope in the curve within a cluster to define the inflection point, and to determine the number of clusters N based on the inflection point.

[0016] The selection module is used to randomly select N non-repeating values ​​from the pixel intensity values ​​of the initial image as initial cluster centers;

[0017] The processing module is used to process the initial image based on the initial cluster centers to obtain a cluster image.

[0018] Optionally, the processing module includes an iteration module and an addition module, wherein:

[0019] The iterative module is used to execute steps one through three, specifically as follows:

[0020] Step 1: For each pixel in the initial image, calculate the distance between its intensity value and N initial cluster centers, and assign the target pixel to the cluster label with the shortest distance; the target pixel is any pixel in the initial image.

[0021] Step 2: Count all pixels contained in each cluster label, calculate the average value of all pixel intensity values, use the average value as the new cluster center, and replace the cluster center generated in the previous round;

[0022] Step 3: Repeat Step 2 and Step 3, and calculate the total change in the intensity values ​​of the N new cluster center pixels after each replacement. If the total change is not less than the threshold or the number of iterations has not reached the preset number of iterations, continue iterating; otherwise, stop iterating and complete convergence to obtain the cluster label corresponding to the target pixel.

[0023] The adding module is used to traverse each pixel of the initial image and add clustering labels to the corresponding pixels in the initial image to obtain a clustered image.

[0024] Optionally, the clustering enhancement module further includes a boundary generation module, a weighting module, a second calculation module, and a dynamic adjustment module, wherein:

[0025] The boundary generation module is used to extract the boundaries between different clustering regions in the initial clustering image using a preset algorithm to generate a boundary image;

[0026] The weighting module is used to weight and superimpose the boundary image and the initial clustering image to obtain a boundary enhancement image;

[0027] The second calculation module is used to perform morphological operations on the boundary enhancement image to obtain a cleaned image, and to calculate the grayscale histogram of the cleaned image;

[0028] The dynamic adjustment module is used to dynamically adjust the gray level distribution according to the gray level histogram, and to perform local contrast enhancement on each connected region defined by the clustering label in the purified image to obtain an enhanced image.

[0029] Optionally, the defect detection model is derived from YOLOv11, and the improvements include:

[0030] Replace the C3K2 modules in layers 3, 5, 7, and 9 of the YOLOv11 model backbone network with C3K2_RCV modules, and replace the SPPF module in layer 10 with SZASPPF modules. The C3K2_RCV module is used to accurately extract small target features on the label under the premise of lightweight design, and SZASPPF is used to enhance the extraction of key features of small targets and suppress background clutter interference.

[0031] Replace the C3K2 modules in layers 14 and 17 of the neck network of the YOLOv11 model with the C3K2_RCV modules.

[0032] Optionally, the C3K2_RCV module works as follows:

[0033] The input original image is obtained as the first original feature map. The first original feature map is input into the CBS module to obtain the second original feature map. The second original feature map is split in half according to the number of channels to obtain the first channel feature map and the second channel feature map.

[0034] The first channel feature map is input into the first RepViTBlock module to obtain the third original feature map, and the third original feature map is input into the second RepViTBlock module to obtain the fourth original feature map.

[0035] The first channel feature map, the second channel feature map, the third original feature map, and the fourth original feature map are concatenated to obtain the fifth original feature map;

[0036] The 5th original feature map is input into the Conv module for convolution to output the 6th original feature map, and the 6th original feature map is used as the input to the next module.

[0037] Optionally, the SZASPPF module works as follows:

[0038] Obtain the 6th original feature map and use it as the 1st target feature map. Input the 1st target feature map into the Conv module to obtain the 2nd target feature map. Perform max pooling on the 2nd target feature map to obtain the 3rd target feature map. Perform max pooling on the 3rd target feature map to obtain the 4th target feature map.

[0039] The second target feature map is input into the channel attention and the fifth target feature map is output.

[0040] The second, third, fourth, and fifth target feature maps are concatenated to obtain the sixth target feature map.

[0041] The sixth target feature map is sequentially input into the spatial attention and Conv modules to output the seventh target feature map, and the seventh target feature map is used as the input to the next module.

[0042] Optionally, the working principle of the PDC module is as follows:

[0043] Obtain the input feature map, and then input it into two Conv modules for convolution to obtain the first convolution feature map. Input the first convolution feature map into the PWConv module for convolution to obtain the second convolution feature map.

[0044] The first convolutional feature map is sequentially input into two DWConv modules to perform depthwise convolution and output the third convolutional feature map.

[0045] The second and third convolutional feature maps are fused to obtain the fourth convolutional feature map;

[0046] The fourth convolutional feature map is sequentially subjected to average pooling and ReLU activation to obtain the fifth convolutional feature map, which is then used as the input to the next module.

[0047] Optionally, the alarm module includes a statistics module, wherein:

[0048] The statistics module is used to count the number of defective targets marked as unqualified in the enhanced image based on the detection results;

[0049] If the number of defective targets exceeds a threshold, a first control signal is generated; the first control signal is used to control the alarm device to execute a first alarm mode.

[0050] If the number of defective targets is not greater than the threshold, a second control signal is generated; the second control signal is used to control the alarm device to execute the second alarm mode.

[0051] In the first alarm mode, the alarm continues until manual confirmation or a preset duration is reached, and then stops. In the second alarm mode, the alarm continues for a preset short duration and then stops automatically.

[0052] The beneficial effects of this invention are:

[0053] This invention proposes a wire harness testing and labeling system. By clustering and enhancing pixels in the initial image, the system strengthens the ability to express small target defect features. It achieves accurate classification and labeling with the help of a defect detection model. Combined with alarm equipment, the system provides rapid feedback of detection results, effectively improving the accuracy and efficiency of label defect detection, reducing common missed detections or misjudgments, and promptly intercepting unqualified products, thus effectively ensuring the quality control effect of wire harness labeling. Attached Figure Description

[0054] The invention will now be further described with reference to the accompanying drawings.

[0055] Figure 1 A flowchart of a wire harness testing and labeling system provided in an embodiment of the present invention;

[0056] Figure 2 A network structure diagram of the defect detection model is provided for embodiments of the present invention;

[0057] Figure 3 A schematic diagram of the C3K2_RCV module is provided for embodiments of the present invention;

[0058] Figure 4 A schematic diagram of the SZASPPF module is provided for embodiments of the present invention;

[0059] Figure 5 A schematic diagram of the PDC module is provided for embodiments of the present invention. Detailed Implementation

[0060] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The term "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and B can represent: A alone, A and B simultaneously, and B alone. Furthermore, descriptions involving "first," "second," etc., in this invention are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" or "second" can explicitly or implicitly include at least one of those features. Additionally, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.

[0061] Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0062] This invention provides a wire harness testing and labeling system. See also... Figure 1 , Figure 1 A flowchart illustrating a wire harness testing and labeling system provided in an embodiment of the present invention. The system includes the following steps:

[0063] S101, perform clustering operation on the pixels in the initial image to obtain a clustered image, and perform enhancement operation on the target feature region to output an enhanced image;

[0064] S102, input the enhanced image into the defect detection model and output the detection result;

[0065] S103, based on the detection results, control the alarm device to issue an alarm prompt.

[0066] The target feature region is the defect feature region in the clustered image.

[0067] The defect detection model is a target model based on improvements to YOLOv11. The improvements include adding a PDC module between layers 16 and 17 in the neck network of the YOLOv11 model. The PDC module is used to enhance the texture features at the label wrinkles.

[0068] The wire harness testing and labeling system provided in this invention enhances the ability to express small target defect features by clustering and enhancing pixels in the initial image, achieves accurate classification and labeling with the help of a defect detection model, and combines alarm devices to quickly provide feedback on detection results. This effectively improves the accuracy and efficiency of label defect detection, reduces common missed detections or misjudgments, promptly intercepts unqualified products, and effectively ensures the quality control effect of wire harness labeling.

[0069] In one implementation, the detection result is that the enhanced image of the detection is marked with a qualified or unqualified label, and the defect features include defects such as paper wrinkles, blurred fonts, paper damage, and font misalignment in the label to be affixed.

[0070] In one embodiment, the system further includes a preprocessing module, which comprises a scaling module and a transformation module, wherein:

[0071] The scaling module is used to obtain the original image of the label to be applied, and to adjust the original image to a standard size by calling the image scaling function to obtain the scaled image; the original image is an RGB image, and the label size is 256×256;

[0072] The conversion module is used to convert the scaled image to a grayscale image using a grayscale conversion function, and to denoise the grayscale image to obtain the initial image.

[0073] In one implementation, an industrial camera is used to capture the original image of the label to be affixed, and the captured original image is an RGB image.

[0074] In one implementation, the scaling function is Resize(), and the grayscale image conversion and denoising process is as follows:

[0075]

[0076]

[0077] in, It is a grayscale image. To scale the image, The initial image is rgb2gray; rgb2gray is the transformation function. This represents the convolution operation. This is the Gaussian kernel function.

[0078] In one implementation, scaling maintains the image ratio, and interpolation is used to supplement pixels to avoid stretching distortion. Grayscale conversion is necessary because the characteristics of label paper wrinkles depend on pixel intensity rather than color information. The color redundancy of RGB format increases the computational load and introduces interference. Converting to a single-channel grayscale image can preserve key diagnostic details, reduce noise, and improve the efficiency and accuracy of subsequent clustering and segmentation.

[0079] In one embodiment, the clustering enhancement module includes a first calculation module, a query module, a selection module, and a processing module, wherein:

[0080] The first calculation module is used to test the cluster centers of different values ​​for the pixels in the initial image, calculate the intra-cluster variance corresponding to each cluster center, and draw the intra-cluster curve.

[0081] The query module is used to query the point with the largest slope in the curve within a cluster, define the inflection point, and determine the number of clusters N based on the inflection point;

[0082] The selection module is used to randomly select N non-repeating values ​​from the pixel intensity values ​​of the initial image as the initial cluster centers;

[0083] The processing module is used to process the initial image based on the initial cluster centers to obtain the clustered image.

[0084] In one implementation, the number of cluster centers tested is a preset number K; the intra-cluster variance is calculated as the sum of squared distances between all pixels in the cluster and the cluster center; the point with the largest slope is the point where the intra-cluster variance decreases sharply, and K=4 is determined (the four discrete regions: "paper wrinkles, blurred fonts, torn paper, and misaligned fonts").

[0085] In one implementation, by selecting the optimal parameter K=4, it can accurately correspond to four types of regions: paper wrinkles, blurred fonts, paper damage, and font misalignment. This prevents undersegmentation caused by an excessively small K value (such as the inability to distinguish different defect types) and oversegmentation caused by an excessively large K value (such as the same defect being split), ensuring the targeted nature of the initial region division. N cluster centers are randomly initialized to provide a clear starting calculation benchmark and to provide data support for subsequent distance calculation between pixels and cluster centers and center iteration.

[0086] In one embodiment, the processing module includes an iteration module and an addition module, wherein:

[0087] The iteration module is used to execute steps one through three, specifically:

[0088] Step 1: For each pixel in the initial image, calculate the distance between its intensity value and the N initial cluster centers, and assign the target pixel to the cluster label with the shortest distance; the target pixel is any pixel in the initial image.

[0089] Step 2: Count all pixels contained in each cluster label, calculate the average value of all pixel intensity values, use the average value as the new cluster center, and replace the cluster center generated in the previous round;

[0090] Step 3: Repeat Step 2 and Step 3, and calculate the total change in the intensity values ​​of the N new cluster center pixels after each replacement. If the total change is not less than the threshold or the number of iterations has not reached the preset number of iterations, continue iterating; otherwise, stop iterating and complete convergence to obtain the cluster label corresponding to the target pixel.

[0091] The module adds a clustering label to each pixel of the initial image and then adds the clustering label to the corresponding pixel in the initial image to obtain the clustering image.

[0092] In one implementation, the process involves calculating the distance between the intensity value and the N initial cluster centers, assigning the target pixel to the cluster label with the shortest distance, and calculating the average pixel intensity value.

[0093]

[0094]

[0095]

[0096] in, Clustering labels assigned to pixels (x, y) To find the i that minimizes the expression within the parentheses; Let be the total number of pixels within the i-th cluster center. Let i be the strength value of the i-th new cluster center; The distance between the intensity value and the i-th initial cluster center is represented in Euclidean form.

[0097] In one implementation, pixel assignment is based on the similarity (Euclidean distance) between pixel intensity and cluster center, assigning each pixel to the nearest cluster label to initially distinguish areas such as paper wrinkles, blurred fonts, torn paper, and misaligned fonts. By calculating the average intensity of pixels within each cluster label, the cluster center is made to better fit the true characteristics of the area, improving clustering accuracy, ensuring stable and reliable clustering results, and outputting clustered images without undersegmentation or oversegmentation.

[0098] In one embodiment, the clustering enhancement module further includes a boundary generation module, a weighting module, a second calculation module, and a dynamic adjustment module, wherein:

[0099] The boundary generation module is used to extract the boundaries between different clustering regions in the clustering image using a preset algorithm to generate a boundary image;

[0100] The weighting module is used to weight and superimpose the boundary image and the clustering image to obtain the boundary enhancement image;

[0101] The second calculation module is used to perform morphological operations on the boundary enhancement image to obtain the cleaned image, and to calculate the grayscale histogram of the cleaned image.

[0102] The dynamic adjustment module is used to dynamically adjust the gray level distribution based on the gray level histogram, and to perform local contrast enhancement on each connected region defined by the clustering label in the purified image to obtain an enhanced image.

[0103] In one implementation, the Sobel operator or the Canny edge detection algorithm is used to extract the boundaries between different cluster regions in the initial cluster image; the morphological operations include opening and closing operations, where the opening operation is used to eliminate small areas caused by noise or incorrect clustering, and the closing operation is used to fill small holes caused by discontinuous segmentation within the same cluster region to obtain a cleaned image.

[0104] In one implementation, by extracting cluster boundaries and weighting them with the cluster image, the differences between clusters can be amplified simultaneously while preserving regional information; after morphological denoising, a "clean" purified image is obtained, and the dynamic redistribution of the grayscale histogram improves the overall dynamic range.

[0105] Local contrast enhancement in each connected region highlights details of weak targets while suppressing background clutter. Without requiring manual thresholding, it significantly improves the separability of targets from the background, providing high-quality input for subsequent defect detection and reducing the false positive rate.

[0106] In one embodiment, the defect detection model is derived from an improvement upon YOLOv11, the improvement including:

[0107] Replace the C3K2 modules in layers 3, 5, 7, and 9 of the YOLOv11 model backbone network with C3K2_RCV modules, and replace the SPPF module in layer 10 with SZASPPF modules. The C3K2_RCV module is used to accurately extract small target features on the label under the premise of lightweight design, while SZASPPF is used to enhance the extraction of key features of small targets and suppress background clutter interference.

[0108] Replace the C3K2 modules in layers 14 and 17 of the neck network in the YOLOv11 model with the C3K2_RCV modules.

[0109] In one implementation, see [link to implementation details]. Figure 2 , Figure 2 The present invention provides a network structure diagram of a defect detection model for embodiments of the present invention. This defect detection model solves the problems of high false negative rate and difficulty in balancing detection accuracy, as well as the issues of lightweight model and real-time performance, for small targets at sea (wrinkles, blurred fonts, etc.) in complex backgrounds due to blurred and sparse texture features, susceptibility to light interference in industrial environments, and the need to distinguish between texture and sparse features.

[0110] In one implementation, experiments were conducted using the HDR28K dataset. The experimental hardware included an Intel Core i7-9200XM processor and an NVIDIA GeForce RTX 4060 GPU. The operating system was Windows 11, and the environment was configured with CUDA 12.6, PyTorch 2.0.1 and CUDNN 9.7.0 acceleration, and Python 3.9.

[0111] Defect detection results based on different models of the HDR28K dataset

[0112]

[0113] In one implementation, the target model is a defect detection model. By making targeted improvements to the YOLOv11 model in multiple modules, including the backbone network and the neck network, the feature extraction and fusion capabilities are effectively enhanced, the accuracy of small target detection is optimized, and the model can identify defects in the paper to be labeled more accurately and efficiently in complex industrial scenarios.

[0114] In one embodiment, the C3K2_RCV module works as follows:

[0115] The input original image is obtained as the first original feature map. The first original feature map is input into the CBS module to obtain the second original feature map. The second original feature map is split in half according to the number of channels to obtain the first channel feature map and the second channel feature map.

[0116] The first channel feature map is input into the first RepViTBlock module to obtain the third original feature map, and the third original feature map is input into the second RepViTBlock module to obtain the fourth original feature map.

[0117] The first channel feature map, the second channel feature map, the third original feature map, and the fourth original feature map are concatenated to obtain the fifth original feature map;

[0118] The 5th original feature map is input into the Conv module for convolution to output the 6th original feature map, and the 6th original feature map is used as the input to the next module.

[0119] In one implementation, see [link to implementation details]. Figure 3 , Figure 3The schematic diagram of the C3K2_RCV module is provided for the embodiments of the present invention. In the C3K2_RCV module, Conv is a 3×3 convolution kernel with 1 channel. The C3K2_RCV module is an improved version of the C3K2 module in YOLOv11. It is formed by replacing the C3 component in C3K2 with RepViTBlock. Its function is to make up for the shortcomings of the original C3K2 module in capturing fine-grained spatial information (such as texture and edge) and long-distance dependencies of small targets on labels in industrial environments, while maintaining the lightweight attributes of the model. It also avoids the problem of excessive memory consumption of the pure Transformer module.

[0120] In one embodiment, the SZASPPF module works as follows:

[0121] Obtain the 6th original feature map and use it as the 1st target feature map. Input the 1st target feature map into the Conv module to obtain the 2nd target feature map. Perform max pooling on the 2nd target feature map to obtain the 3rd target feature map. Perform max pooling on the 3rd target feature map to obtain the 4th target feature map.

[0122] The second target feature map is input into the channel attention and the fifth target feature map is output.

[0123] The second, third, fourth, and fifth target feature maps are concatenated to obtain the sixth target feature map.

[0124] The sixth target feature map is sequentially input into the spatial attention and Conv modules to output the seventh target feature map, and the seventh target feature map is used as the input to the next module.

[0125] In one implementation, see [link to implementation details]. Figure 4 , Figure 4 The schematic diagram of the SZASPPF module is provided for embodiments of the present invention. In SZASPPF, Conv is a 1×1 convolution kernel with 1 channel. The SZASPPF module replaces the original SPPF module of YOLOv11 and solves the problems of spatial information loss and difficulty in distinguishing small targets from background clutter in small target detection scenarios captured by industrial cameras. Specifically, it introduces a channel attention mechanism before feature pooling to retain the fine features of small targets, and combines a spatial attention mechanism after pooling to highlight the key regions of small targets. At the same time, it integrates multi-scale pooling features and attention-weighted features to enhance the features of small targets and effectively suppress background clutter. This reduces the missed detections and false detections caused by small target size, blurred features, and complex background lighting, providing more accurate input for feature extraction and target detection in subsequent models and helping to improve the overall detection accuracy.

[0126] In one embodiment, the PDC module works as follows:

[0127] Obtain the input feature map, and then input it into two Conv modules for convolution to obtain the first convolution feature map. Input the first convolution feature map into the PWConv module for convolution to obtain the second convolution feature map.

[0128] The first convolutional feature map is sequentially input into two DWConv modules to perform depthwise convolution and output the third convolutional feature map.

[0129] The second and third convolutional feature maps are fused to obtain the fourth convolutional feature map;

[0130] The fourth convolutional feature map is sequentially subjected to average pooling and ReLU activation to obtain the fifth convolutional feature map, which is then used as the input to the next module.

[0131] In one implementation, see [link to implementation details]. Figure 5 , Figure 5 The schematic diagram of the PDC module is provided for the embodiments of the present invention. The two Conv convolution kernels in the PDC module are 3×3 and 5×5, respectively, and the number of channels is 1. It focuses on the texture details of visible light images, realizes the progressive fusion of target features, solves the problems of loss of fuzzy feature information and insufficient feature expression ability, and at the same time supplements global structural information, enhances the global structural extraction ability of small targets (such as small wrinkles and damage of labels), and effectively reduces the false detection rate of small targets without significantly increasing the computing power of the model.

[0132] In one embodiment, the alarm module includes a statistics module, wherein:

[0133] The statistics module is used to count the number of defective targets marked as unqualified in the enhanced image based on the detection results;

[0134] If the number of defective targets exceeds the threshold, a first control signal is generated; the first control signal is used to control the alarm device to execute the first alarm mode.

[0135] If the number of defective targets is not greater than the threshold, a second control signal is generated; the second control signal is used to control the alarm device to execute the second alarm mode.

[0136] In the first alarm mode, it continues until manual confirmation or after a preset duration is reached, and then stops. In the second alarm mode, it continues for a preset short duration and then stops automatically.

[0137] In one implementation, the first alarm mode includes: illuminating a red warning light and controlling it to flash at a first frequency, while simultaneously triggering a buzzer to emit a continuous buzzing sound at the first frequency;

[0138] The second alarm mode includes: illuminating the green indicator light and keeping it constantly lit, while simultaneously triggering a buzzer to emit a short warning sound.

[0139] In one implementation, the alarm method achieves real-time and accurate linkage between detection results and on-site response. By analyzing the number of defects and triggering differentiated audible and visual alarm modes, it can immediately and clearly alert operators, effectively avoid confusion between qualified and unqualified products, and reduce the risk of human error in inspection.

[0140] The foregoing has described one embodiment of the present invention in detail, but this content is merely a preferred embodiment and should not be considered as limiting the scope of the present invention. All equivalent variations and modifications made within the scope of the claims of this invention should still fall within the scope of the claims of this invention.

Claims

1. A wire harness testing and labeling system, characterized in that, The system includes a clustering enhancement module, a detection module, and an alarm module, wherein: The clustering enhancement module is used to perform clustering operations on the pixels in the initial image to obtain a clustered image, and to perform enhancement operations on the target feature region to output an enhanced image; the target feature region is the defect feature region in the clustered image; The detection module is used to input the enhanced image into the defect detection model and output the detection result; the defect detection model is a target model obtained by improving YOLOv11, and the improvement includes: adding a PDC module between the 16th and 17th layers in the neck network of the YOLOv11 model; the PDC module is used to enhance the texture features at the label wrinkles; The alarm module is used to control the alarm device to issue an alarm notification based on the detection results.

2. The wire harness testing and labeling system according to claim 1, characterized in that, The system further includes a preprocessing module, which comprises a scaling module and a transformation module, wherein: The scaling module is used to acquire the original image of the label to be affixed, and to adjust the original image to a standard size by calling an image scaling function to obtain a scaled image; the original image is an RGB image with a label size of 256×256; The conversion module is used to convert the scaled image into a grayscale image using a grayscale conversion function, and to denoise the grayscale image to obtain an initial image.

3. The wire harness testing and labeling system according to claim 1, characterized in that, The clustering enhancement module includes a first calculation module, a query module, a selection module, and a processing module, wherein: The first calculation module is used to test the cluster centers of different values ​​for the pixels in the initial image, calculate the intra-cluster variance corresponding to each cluster center, and draw the intra-cluster curve. The query module is used to query the point with the largest slope in the curve within a cluster to define the inflection point, and to determine the number of clusters N based on the inflection point. The selection module is used to randomly select N non-repeating values ​​from the pixel intensity values ​​of the initial image as initial cluster centers; The processing module is used to process the initial image based on the initial cluster centers to obtain a cluster image.

4. A wire harness testing and labeling system according to claim 3, characterized in that, The processing module includes an iteration module and an addition module, wherein: The iterative module is used to execute steps one through three, specifically as follows: Step 1: For each pixel in the initial image, calculate the distance between its intensity value and N initial cluster centers, and assign the target pixel to the cluster label with the shortest distance; the target pixel is any pixel in the initial image. Step 2: Count all pixels contained in each cluster label, calculate the average value of all pixel intensity values, use the average value as the new cluster center, and replace the cluster center generated in the previous round; Step 3: Repeat Step 2 and Step 3, and calculate the total change in the intensity values ​​of the N new cluster center pixels after each replacement. If the total change is not less than the threshold or the number of iterations has not reached the preset number of iterations, continue iterating; otherwise, stop iterating and complete convergence to obtain the cluster label corresponding to the target pixel. The adding module is used to traverse each pixel of the initial image and add clustering labels to the corresponding pixels in the initial image to obtain a clustered image.

5. A wire harness testing and labeling system according to claim 4, characterized in that, The clustering enhancement module further includes a boundary generation module, a weighting module, a second calculation module, and a dynamic adjustment module, wherein: The boundary generation module is used to extract the boundaries between different clustering regions in the clustering image using a preset algorithm to generate a boundary image; The weighting module is used to weight and superimpose the boundary image and the clustering image to obtain a boundary enhancement image; The second calculation module is used to perform morphological operations on the boundary enhancement image to obtain a cleaned image, and to calculate the grayscale histogram of the cleaned image; The dynamic adjustment module is used to dynamically adjust the gray level distribution according to the gray level histogram, and to perform local contrast enhancement on each connected region defined by the clustering label in the purified image to obtain an enhanced image.

6. A wire harness testing and labeling system according to claim 1, characterized in that, The defect detection model is an improvement upon YOLOv11, and the improvements include: Replace the C3K2 modules in layers 3, 5, 7, and 9 of the YOLOv11 model backbone network with C3K2_RCV modules, and replace the SPPF module in layer 10 with SZASPPF modules. The C3K2_RCV module is used to accurately extract small target features on the label under the premise of lightweight design, and SZASPPF is used to enhance the extraction of key features of small targets and suppress background clutter interference. Replace the C3K2 modules in layers 14 and 17 of the neck network of the YOLOv11 model with the C3K2_RCV modules.

7. A wire harness testing and labeling system according to claim 6, characterized in that, The C3K2_RCV module works as follows: The input original image is obtained as the first original feature map. The first original feature map is input into the CBS module to obtain the second original feature map. The second original feature map is split in half according to the number of channels to obtain the first channel feature map and the second channel feature map. The first channel feature map is input into the first RepViTBlock module to obtain the third original feature map, and the third original feature map is input into the second RepViTBlock module to obtain the fourth original feature map. The first channel feature map, the second channel feature map, the third original feature map, and the fourth original feature map are concatenated to obtain the fifth original feature map; The 5th original feature map is input into the Conv module for convolution to output the 6th original feature map, and the 6th original feature map is used as the input to the next module.

8. A wire harness testing and labeling system according to claim 6, characterized in that, The working principle of the SZASPPF module is as follows: Obtain the 6th original feature map and use it as the 1st target feature map. Input the 1st target feature map into the Conv module to obtain the 2nd target feature map. Perform max pooling on the 2nd target feature map to obtain the 3rd target feature map. Perform max pooling on the 3rd target feature map to obtain the 4th target feature map. The second target feature map is input into the channel attention and the fifth target feature map is output. The second, third, fourth, and fifth target feature maps are concatenated to obtain the sixth target feature map. The sixth target feature map is sequentially input into the spatial attention and Conv modules to output the seventh target feature map, and the seventh target feature map is used as the input to the next module.

9. A wire harness testing and labeling system according to claim 1, characterized in that, The working principle of the PDC module is as follows: Obtain the input feature map, and then input it into two Conv modules for convolution to obtain the first convolution feature map. Input the first convolution feature map into the PWConv module for convolution to obtain the second convolution feature map. The first convolutional feature map is sequentially input into two DWConv modules to perform depthwise convolution and output the third convolutional feature map. The second and third convolutional feature maps are fused to obtain the fourth convolutional feature map; The fourth convolutional feature map is sequentially subjected to average pooling and ReLU activation to obtain the fifth convolutional feature map, which is then used as the input to the next module.

10. A wire harness testing and labeling system according to claim 1, characterized in that, The alarm module includes a statistics module, wherein: The statistics module is used to count the number of defective targets marked as unqualified in the enhanced image based on the detection results; If the number of defective targets exceeds a threshold, a first control signal is generated; the first control signal is used to control the alarm device to execute a first alarm mode. If the number of defective targets is not greater than the threshold, a second control signal is generated; the second control signal is used to control the alarm device to execute the second alarm mode. In the first alarm mode, the alarm continues until manual confirmation or a preset duration is reached, and then stops. In the second alarm mode, the alarm continues for a preset short duration and then stops automatically.