Industrial part abnormal target detection method and system

The LiteCGNet model solves the problems of high-precision and real-time detection in complex industrial environments, and achieves efficient and accurate target positioning of industrial parts abnormality detection, adapting to the high-speed detection needs of industrial production lines.

CN120563807AActive Publication Date: 2025-08-29HANGZHOU DIANZI UNIV

Patent Information

Application Number
CN202510667497.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-22
Publication Date
2025-08-29
Estimated Expiration
2045-05-22

AI Technical Summary

Technical Problem

The prior art is difficult to achieve high-precision and real-time abnormal detection of industrial parts in complex industrial environments, especially in the needs of multi-scale feature modeling, background interference and high-speed detection.

Method used

The lightweight context-guided object detection model LiteCGNet is adopted, combined with the YOLOv1 backbone network, the context-guided perceptual feature fusion module CGRFPN and the parameter-sharing decoupling head LSCD, and the self-attention mechanism and cross-scale feature recombination, and the model performance is optimized through the joint loss function of EIOU Loss and DFL Loss.

Benefits of technology

Achieve efficient and accurate abnormal detection of industrial parts in complex industrial environments, improve detection accuracy and inference speed, adapt to the real-time response needs of industrial production lines, and enhance the model's robustness to the expression of multi-scale features and target positioning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120563807A_ABST
    Figure CN120563807A_ABST
Patent Text Reader

Abstract

The invention provides an industrial part abnormal target detection method and system. According to the model, a YOLOv10 framework is used as a basic framework to construct a lightweight model, and the detection performance and efficiency are improved through three-stage optimization. Firstly, a multi-head self-attention mechanism is introduced to reconstruct a feature space, and cross-modal feature interaction is promoted by using CSP structure balance calculation efficiency and feature representation capability and combining a channel grouping shuffling strategy. Secondly, designing a context guide perception module in a feature fusion stage, enhancing multi-scale feature expression through a parallel multi-branch architecture and a spatial self-calibration mechanism, and enhancing up-sampling information density in cooperation with a dynamic interpolation fusion module; the detection head adopts a parameter sharing group convolution structure, and the calculation amount is reduced through a convolution kernel parameter sharing and feature decoupling mechanism. The method effectively solves key problems in industrial part detection, and is of great significance to industrial part automatic anomaly detection scenes on an industrial production line.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of target detection and image detection, and in particular relates to a method and a system for detecting abnormal targets of industrial parts. Background Art

[0002] Anomaly detection for industrial parts is a crucial prerequisite for improving product qualification rates and ensuring product quality, and it presents a challenging practical application. Traditionally, during sorting, operators must conduct multi-angle visual inspections of parts as they are transported along rails. This method is not only time-consuming but also subjective and prone to false detections. Traditional image anomaly detection methods, however, face significant limitations in accuracy and real-time performance when used against complex backgrounds and industrial environments. To overcome these challenges, deep learning-based automation technologies have been gradually introduced in recent years to enable more intelligent and efficient industrial parts production.

[0003] To improve inspection efficiency, automated inspection technologies based on image processing are gradually being introduced into industrial scenarios. Traditional image inspection methods (such as edge detection, template matching, and morphological analysis) extract part features based on predefined rules. While this method reduces manual intervention to a certain extent, it faces multiple technical bottlenecks in complex industrial environments. First, part surface characteristics vary greatly, including metallic reflections, transparent coatings, and complex textures, which can easily lead to optical imaging noise. Second, industrial scenes are often complex backgrounds, often with complex cables and cluttered equipment, which can make it difficult to separate the inspected parts from the background. Third, the high-speed operation of production lines requires inspection systems to have millisecond-level real-time response capabilities, a requirement that most inspection technologies cannot meet.

[0004] Although current deep learning target detection methods have achieved certain development results and are relatively mature, they still face many challenges in achieving the dual goals of real-time and accuracy when dealing with complex and changing industrial environments: Insufficient multi-scale feature modeling: Industrial parts vary greatly in size and there are multi-view changes. The existing models have limited feature representation capabilities for tiny defects or large-scale targets; Sensitive to background interference: Complex industrial backgrounds can easily lead to model misactivation, especially in metal substrates or highly reflective scenes, where the false detection rate increases significantly; The dilemma of balancing speed and accuracy, etc.

[0005] In summary, existing technologies have yet to effectively address the problem of collaboratively optimizing detection accuracy, real-time performance, and generalization capabilities in complex industrial environments. A detection method that balances efficient reasoning with robust feature representation is urgently needed to address the combined challenges of multimodal interference, multi-scale targets, and stringent real-time requirements in industrial scenarios. Summary of the Invention

[0006] Aiming at the deficiencies of existing methods in industrial parts anomaly detection, the present invention proposes an industrial parts anomaly target detection method and system thereof, which improves the inference speed while ensuring the detection accuracy, and realizes efficient and accurate industrial parts anomaly detection.

[0007] The present invention is specifically as follows: In a first aspect, the present invention provides a method for detecting abnormal targets in industrial parts, comprising the following steps: Acquire multi-angle images of industrial parts; Multi-angle images of industrial parts are processed by the lightweight context-guided target detection model LiteCGNet to obtain abnormal target detection results; The lightweight context-guided target detection model LiteCGNet includes a backbone network Backbone, a neck network Neck and a decoupling head Head; The backbone network adopts the YOLOv10 model as the framework, and the bottleneck structure in the penultimate and third layers is replaced by the channel shuffle self-attention bottleneck module ShuffleCTB; The neck network (Neck) adopts a context-guided perceptual feature fusion module (CGRFPN). The CGRFPN uses a residual context module (RCM) to reconstruct spatial features and a pyramid context extraction module (PCE) to extract current context information. Finally, through horizontal and vertical pooling operations, it captures axial context in two directions and reconstructs the axial global context, thereby achieving explicit modeling of rectangular key areas. The decoupling head Head adopts a decoupling head LSCD based on parameter sharing optimization.

[0008] In a second aspect, the present invention provides an abnormal target detection system for industrial parts, comprising: Data acquisition module, responsible for acquiring multi-angle images of industrial parts; The abnormal target detection module is responsible for processing multi-angle images of industrial parts through the lightweight context-guided target detection model LiteCGNet to obtain abnormal target detection results; In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method described above.

[0009] In a fourth aspect, the present invention provides a computing device comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method described is implemented.

[0010] Beneficial effects of the present invention: The multi-stage collaborative anomaly detection method and system for industrial parts proposed in this invention effectively solves the key problems in industrial parts detection, and achieves remarkable results in improving detection accuracy, accelerating reasoning speed, and enhancing generalization ability, which is of great significance to industrial production quality control.

[0011] To address the complexity of industrial scenarios, this paper innovatively designs a lightweight context-guided object detection model, LiteCGNet. Its ShuffleCTB module, by integrating the CSP architecture with the Transformer attention mechanism, effectively enhances the cross-modal feature representation of parts. Combined with the context-guided perceptual feature fusion module CGRFPN, this significantly improves the model's representation of multi-scale features and robustness in object localization. This module utilizes an adaptive feature interpolation algorithm and a cross-scale feature recombination strategy to construct a parallel multi-branch fusion architecture and integrate a spatial self-calibration mechanism. This strengthens the model's focus on foreground objects, enhances the representation of multi-scale features, increases the information density of upsampling, and enhances object localization robustness in complex industrial environments. During model training, a joint loss function, EIOU Loss and DFL Loss, is introduced. EIOU Loss enhances global control over object geometry by introducing a center point distance penalty and a width-height difference penalty. DFL Loss transforms coordinate regression into discrete probability distribution learning, alleviating the sensitivity of traditional regression methods to annotation errors. The combination of these two loss functions improves object localization robustness in complex scenarios.

[0012] To meet the stringent real-time responsiveness requirements of high-speed industrial production lines, LiteCGNet employs a parameter-sharing group convolutional decoupling (LSCD) head. This minimizes model parameter size while maintaining feature decoupling capabilities, significantly improving model inference speed. This enables the system to inspect large numbers of parts in a remarkably short time, avoiding production line congestion caused by slow inspection speeds, improving production efficiency, and adapting to the actual needs of industrial production.

[0013] The present invention effectively solves the key problems in industrial parts detection and is of great significance for the automated anomaly detection scenarios of industrial parts on industrial production lines. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0015] Figure 1This is the network architecture diagram of the LiteCGNet lightweight context-guided target detection model of the present invention; Figure 2 The structural diagram of the decoupling head LSCD module for parameter sharing optimization of the present invention; Figure 3 This is the network architecture diagram of the channel shuffling self-attention bottleneck module ShuffleCTB of the present invention; Figure 4 This is the structural diagram of the context-guided perception feature fusion CGRFPN module of the present invention; Figure 5 The PCE module structure diagram for the pyramid context extraction of the present invention; Figure 6 This is a diagram of the detection effect of the present invention in the industrial parts target detection dataset. DETAILED DESCRIPTION

[0016] The technical solutions in the embodiments of the present invention will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present invention.

[0017] This embodiment provides a method for detecting abnormal targets in industrial parts, the method comprising: Step S1: Acquire multi-angle images of industrial parts: An industrial camera mounted on a fixed bracket on the assembly line, controlled by a trigger, captures multi-angle images of industrial parts. The captured images are normalized to a uniform 640×640 resolution and cropped to a 576×576 tensor.

[0018] Step S2: The multi-angle images of industrial parts are processed by the lightweight context-guided target detection model LiteCGNet to obtain abnormal target detection results; The lightweight context-guided object detection model, LiteCGNet, introduces a multi-head self-attention mechanism to reconstruct the feature space. It leverages the CSP architecture to balance computational efficiency and feature representation capabilities, and combines a channel grouping and shuffling strategy to promote cross-modal feature interaction. Secondly, during the feature fusion phase, a context-guided perception module is designed. This module enhances multi-scale feature representation through a parallel multi-branch architecture and spatial self-calibration mechanism, and enhances upsampling information density through a dynamic interpolation fusion module. The detection head utilizes a parameter-sharing group convolutional architecture, reducing computational effort through convolution kernel parameter sharing and feature decoupling.

[0019] See attached Figure 1 The lightweight context-guided target detection model LiteCGNet includes a backbone network Backbone, a neck network Neck and a decoupling head Head; See attached Figure 3The backbone network Backbone adopts the YOLOv10 model as the basic framework, and the Bottleneck structure in the penultimate and third layers (i.e., P3 and P4 layers) is replaced by a channel shuffle self-attention bottleneck module ShuffleCTB; The channel shuffle self-attention bottleneck module (ShuffleCTB) combines the CSP architecture with the Transformer attention mechanism. It reconstructs the feature space by introducing a multi-head self-attention mechanism and promotes cross-modal feature interaction using a channel grouping shuffle strategy. This enhances the cross-modal feature representation capability of parts and balances model inference speed with feature representation capabilities. Specifically, its implementation process is as follows: (1) Use partition operation Divide the input feature map into two parts along the channel dimension 、 : Assume the input feature map is , the total number of input channels is , the channel division ratio is , then the input partition It can be expressed as: 、 The global context semantics containing multiple feature maps and the local detail features containing multiple feature maps are extracted through two-branch processing operations (i.e., the global modeling branch MHSA_CGLU and the local perception branch Bottleneck extraction): Assume that the Bottleneck module function is , the MHSA_CGLU module function is , then the processing of the two branches can be expressed as: Specifically, the implementation process of the global modeling branch MHSA_CGLU is: First, input the data Projecting into multiple low-dimensional spaces, we obtain query, key, and value vectors for multiple heads. We then use the Multi-Head Self-Attention mechanism in the Transformer architecture to calculate the attention scores of different heads and perform a weighted sum. Combined with position encoding, we extract global contextual semantics to better capture the information relationships at different locations in the feature map. Specifically: 1) Reshape into sequence form , the number of attention heads is , the dimension of each head is , .

[0020] 2) Projection to obtain query, key, and value vectors: in is the projection matrix, .

[0021] Divide Q, K, and V by head: .

[0022] 3) Calculate attention score: in, is the attention score matrix of the i-th head, by and The transpose of is multiplied and normalized by softmax. .

[0023] 4) Multiply the attention score with the corresponding value vector and sum them to get the output of each head: in Represents the output of the i-th head.

[0024] 5) Concatenate the outputs of h heads by columns: .

[0025] 6) Combined with position encoding , and get the final output of the global modeling branch MHSA_CGLU : in ,Position encoding PE is usually generated based on sine and cosine functions, ,which introduces position information into the model and helps the model better ,capture the information relationship of different positions in the feature map.

[0026] The calculation of each element in the position encoding PE is as follows: 1. Even dimension (i is an even number) 2. Odd dimension (i is an odd number) in: Represents input data the position index in the sequence, ∈[0,N-1], N is the sequence length, i.e. ; i represents the dimension index of the position encoding vector, ∈[0, -1], Feature dimensions of the global modeling branch MHSA_CGLU.

[0027] Specifically, the implementation process of the local perception branch Bottleneck is: For input data First, 1×1 convolution is used to reduce the number of channels to reduce the amount of computation. Then, 3×3 convolution is used to extract features. Finally, 1×1 convolution is used to increase the dimension and restore the number of channels. At the same time, residual connections are used to add the input directly to the output to solve the gradient vanishing and gradient exploding problems in deep network training, allowing the network to better learn local detailed features. Specifically: 1) Yes Dimensionality reduction through 1×1 convolution, for Number of channels: in , , through 1×1 convolution, the number of channels is increased from downgraded to . They are the weight matrix and bias of 1×1 convolution respectively.

[0028] 2) Use 3×3 convolution to extract features from the feature map after dimensionality reduction: in , They are the weight matrix and bias of 3×3 convolution respectively.

[0029] 3) Use 1×1 convolution to increase the dimension and restore the number of channels to the same as the input: in , , They are the weight matrix and bias of 1×1 convolution respectively.

[0030] 4) Residual connection converts the original input Add directly to the convolution result , which helps alleviate the gradient vanishing and gradient exploding problems in deep network training and enables the network to better learn local detail features: in .

[0031] (3) The global context semantics and local detail features are grouped and processed separately. The feature maps are grouped into a group, and then the groups between the global context semantics and local detail features are randomly spliced. Specifically: 3-1 will Subgroups 、 Each contains feature maps, the number of groups in each group can be expressed as: in express The number of subgroups within a group, express The number of subgroups within a group.

[0032] 3-2 Randomly permute the channels in each subgroup to generate perturbed features and ; For example: for Ycnn 1, assuming its original channel order is [ a , b ] , after random permutation becomes [ b , a ] .

[0033] for Ycnn 2. The original channel order is [ c , d ], after random permutation it may be [ d , c ] .

[0034] for Ycnn 3. The original channel order is [ e , f ], after random permutation it may be [ f , e ] .

[0035] for Ytrans 1, the original channel order is [ g , h ], after random permutation it may be [h , g ] .

[0036] for Ytrans 2. The original channel order is [ i , j ], after random permutation it might be [ j , i ] .

[0037] 3-3 Characteristics after these disturbances and Perform random splicing, ∈[1, ], ∈[1, ], forming cross-modal mixed features. Specifically: First, the two-branch subgroups are combined into a joint set, namely: Then generate a length of A random permutation vector of ,satisfy: in Indicates the The group index of the position, Indicates random permutation of input combinations.

[0038] The randomly spliced ​​joint subgroups can be expressed as: (4) The randomly spliced ​​feature maps are fused to obtain the output cross-modal features.

[0039] in express The convolution operation.

[0040] The neck network Neck adopts a context-guided perceptual feature fusion module CGRFPN; the context-guided perceptual feature fusion module CGRFPN uses the residual context module RCM to reconstruct spatial features, and at the same time uses the pyramid context extraction module PCE to extract current context information. Finally, through horizontal and vertical pooling operations, the axial context in two directions is captured, and then the axial global context is reconstructed, thereby realizing explicit modeling of rectangular key areas.

[0041] Specifically, the context-guided perception feature fusion module CGRFPN uses an adaptive feature interpolation algorithm and a cross-scale feature recombination strategy to build a parallel multi-branch fusion architecture and integrate a spatial self-calibration mechanism to strengthen the model's attention to foreground targets, improve the ability to express multi-scale features, increase the information density of upsampling, and enhance the robustness of target positioning in complex industrial environments. Specifically, it includes two branches and a cross-level feature interaction stage, see Appendix Figure 4 .

[0042] The first branch includes a pyramid context extraction module PCE and three groups of cascaded first banded convolutional attention modules RCA.

[0043] See attached Figure 5 The pyramid context extraction module PCE extracts the last three levels of feature maps of the backbone network (Respectively, the original input resolution ) Through multi-scale pooling, the spatial dimensions are unified to the smallest level , and then spliced ​​along the channel dimension to form a pyramid fusion feature with global context awareness; among them, multi-scale pooling is a series of adaptive pooling operations on input feature maps of different resolutions. For the last three levels of feature maps of the backbone network , assuming that their resolutions are ( × )、( × )、( × )and( > > ),( > > ).right When performing adaptive pooling, the target minimum level is used, such as Resolution ( × ) determines the pooling kernel size and step size, Downsample to ( × ) resolution; Similarly, by adaptively adjusting the pooling kernel and step size, it is downsampled to ( × ) resolution. In this way, feature maps of different resolutions are unified to the smallest level in the spatial dimension, facilitating subsequent splicing along the channel dimension to form a pyramid fusion feature with global context awareness. This process significantly enhances the model's robustness to object scale changes by aggregating semantic information from different receptive fields. This process can be expressed as: in Indicates that average pooling is used to downsample the feature map P times, where P represents the feature with pyramid context. In this way, the PCE module effectively integrates feature information at different levels, providing rich contextual information for subsequent feature processing and target recognition.

[0044] The first banded convolution attention module RCA of the three cascades performs axial long-range modeling on the pyramid fusion features output by the pyramid context extraction module PCE, splits them according to the original number of channels and upsamples them to the corresponding resolution to obtain multi-scale pyramid context fusion features. .

[0045] The second branch includes the residual context module RCM and three groups of cascaded second banded convolutional attention modules RCA.

[0046] The residual context module RCM is used to calculate the last three levels of feature maps of the backbone network pass Horizontal banded convolution and The parallel structure of vertical strip convolution captures direction-sensitive spatial dependencies and then generates enhanced feature maps through channel excitation. The specific implementation process is: Input the last three levels of feature maps of the backbone network , performing 11×1 horizontal banded convolution and 1×11 vertical banded convolution on the feature maps of each layer. The 11×1 horizontal banded convolution captures long-range spatial dependencies in the horizontal direction, while the 1×11 vertical banded convolution captures long-range spatial dependencies in the vertical direction. The results of these two convolutions are then added together and subjected to channel-wise excitation (using a channel-wise attention mechanism, which uses global average pooling to obtain global channel features, then uses a fully connected layer to learn the dependencies between channels and obtain channel weights, which are then weighted on the original feature maps) to generate enhanced feature maps for different layers.

[0047] The three groups of cascaded second banded convolution attention modules RCA perform axial long-range modeling on the enhanced feature maps of different levels output by the residual context module RCM, split them according to the original number of channels and upsample them to the corresponding resolution to obtain multi-scale residual context fusion features ; The cross-level feature interaction stage includes a first multi-feature fusion block FBM, a first dynamic interpolation fusion module DIF, a second multi-feature fusion block FBM, a second dynamic interpolation fusion module DIF, a third multi-feature fusion block FBM, a first residual fusion block RepC3, and a second residual fusion block RepC3; The first multi-feature fusion block FBM fuses the high-scale pyramid context features output by the first branch The high-scale residual context fusion feature output by the second branch Perform gated fusion; As an example, the specific implementation process of the gated fusion is: The two input features are activated by Sigmoid to generate a spatial attention mask, which is then aligned by bilinear interpolation and then multiplied element-wise to achieve semantically guided detail enhancement.

[0048] The first dynamic interpolation fusion module DIF combines the gated fusion result output by the first multi-feature fusion block FBM with the mid-scale residual context fusion feature output by the second branch Spatial dimension expansion is achieved through learnable bilinear interpolation, and the Convolution dynamically adjusts channel weights and ultimately generates fused features through residual connections.

[0049] The second multi-feature fusion block FBM fuses the mid-scale pyramid context features output by the first branch Perform gated fusion with the features output by the first dynamic interpolation fusion module DIF; The second dynamic interpolation fusion module DIF combines the gated fusion result output by the second multi-feature fusion block FBM with the low-scale residual context fusion feature output by the second branch. Spatial dimension expansion is achieved through learnable bilinear interpolation, and the Convolution dynamically adjusts channel weights and ultimately generates fused features through residual connections.

[0050] The third multi-feature fusion block FBM fuses the low-scale pyramid context features output by the first branch Perform gated fusion with the features output by the second dynamic interpolation fusion module DIF to output the low-scale total fusion features ; The first residual fusion block RepC3 receives the result of the concatenation of the output features of the second multi-feature fusion block FBM and the result of the downsampling of the output features of the third multi-feature fusion block FBM by the spatial channel compression module SCDown, and obtains the mid-scale total fusion feature through fusion technology and residual structure. ; The second residual fusion block RepC3 receives the result of the concatenation of the output features of the first multi-feature fusion block FBM and the result of the downsampling of the output features of the first RepC3 by the spatial channel compression module SCDown, and obtains a high-scale total fusion feature through fusion technology and residual structure. ; The spatial channel compression module SCDown adopts a two-stage compression strategy, first using Convolution maintains the channel dimension, and then passes depth-wise separable convolution ( kernel, stride=2) to achieve spatial dimensionality reduction.

[0051] The decoupling head adopts the decoupling head LSCD based on parameter sharing optimization to reduce the overall parameter amount of the network. Its operation process can be divided into two stages: feature processing and dual-branch prediction; The LSCD uses a parameter reuse mechanism and group convolution operations to minimize the number of model parameters while ensuring feature decoupling capabilities, achieving an effective balance between the overall real-time computing performance of the model and the detection accuracy. Figure 2 , and its implementation process is: S301, the multi-scale total fusion feature output by the neck network Neck Through independent The convolution module Conv_GN unifies the number of channels and maps the feature channels of different levels to a fixed dimension to obtain .

[0052] S302, all scale features processed in step S301 By sharing the weights of the same set of convolution kernels in the group convolution module, we can further extract common semantic features across levels while keeping the spatial resolution unchanged to obtain multi-scale features. In this process, GroupNorm is used instead of BatchNorm to improve the stability of small-batch training by calculating statistics by grouping channels.

[0053] As an example, the weight sharing group convolution module consists of two connected in series Convolution composition.

[0054] S303, multi-scale features processed by weight sharing group convolution module The prediction results are generated through multi-scale dense prediction branches (one2many).

[0055] The multi-scale dense prediction branch includes a high-scale dense prediction branch, a medium-scale dense prediction branch, and a low-scale dense prediction branch; The architecture of the high-scale dense prediction branch, the medium-scale dense prediction branch, and the low-scale dense prediction branch are the same, all of which include two parallel branches. The first branch uses the regression branch Conv_Reg and the Scale layer, and the second branch uses the classification branch Conv_Cls. The regression branch Conv_Reg and the classification branch Conv_Cls output 64-dimensional bounding box distribution parameters and 80-dimensional category probabilities respectively.

[0056] The Scale layer scales the bounding box of the regression branch Conv_Reg output result to address the problem of inconsistent target scales detected by each detection head.

[0057] Among them, the weight-sharing group convolution module significantly reduces the number of parameters and computational complexity of multi-level detection heads by reusing the convolution kernel weights. In traditional detection networks, feature maps at different levels need to independently learn convolution kernel parameters to adapt to their scale characteristics. This design reduces the number of parameters from O(N×C²) to O(C²) by forcing all levels to share the same set of convolution kernels, where N is the number of layers and C is the number of channels. This design allows the network to maintain its feature expression capabilities while alleviating the risk of overfitting. In addition, weight sharing forces the network to extract universal features that are independent of scale, enhancing the model's ability to generalize to multi-scale targets. However, this design may weaken the level specificity, and it is necessary to balance efficiency and accuracy by adjusting the number of hidden layer channels.

[0058] The introduction of group normalization (GroupNorm) further optimizes the network's training dynamics and deployment adaptability. Unlike BatchNorm, which relies on batch statistics, GroupNorm divides channels into several groups (such as 8 groups) and independently calculates the mean and variance within each group, thus breaking away from the dependence on batch size. This feature makes it stable in small-batch training, online learning, and dynamic input resolution scenarios, avoiding the performance degradation of BatchNorm caused by statistical fluctuations. In detection tasks, target sparsity and background dominance make the feature distribution exhibit long-tail characteristics. GroupNorm alleviates the distribution differences between channels through group normalization, improving the model's sensitivity to foreground targets. In addition, GroupNorm eliminates the need to maintain sliding average parameters during the inference phase, simplifying the model deployment process.

[0059] The collaborative design of shared convolution and group normalization reduces model complexity while strengthening the consistency of feature representation. Shared convolution improves computational efficiency through parameter reuse, while GroupNorm enhances training robustness through group statistics. Together, the two enable the network to achieve an optimal balance between accuracy and efficiency.

[0060] During training, the loss function of the lightweight context-guided target detection model LiteCGNet is for in, and To balance the weight.

[0061] Efficient Intersection-over-Union Loss It introduces center point distance penalty and width-height difference penalty based on traditional IoU loss: in is the Euclidean distance between the predicted target detection box and the center point of the true target detection box, and is the width and height of the minimum bounding box that can completely contain the predicted box and the real box at the same time, To predict the width of the target detection box, is the width of the ground truth (GT) box, which is the box that annotates the real target position and size. To predict the height of the target detection box, is the height of the real target detection box; Specific calculation: in A inter is the intersection area of ​​the predicted box and the real box, A union is the union area of ​​the predicted box and the true box 。

[0062] Distribution Focus Loss : in 、 are the two adjacent integer coordinates of the center point of the real target detection frame, 、 They are 、 The predicted probability of .

[0063] DFL models coordinate uncertainty through probability density, effectively alleviating the sensitivity of traditional regression methods to annotation errors. It is particularly suitable for refined positioning of small targets or fuzzy boundaries.

[0064] The joint optimization mechanism of EIOU and DFL is based on the complementarity of mathematical modeling. EIOU ensures macroscopic alignment of bounding boxes through global geometric constraints (center point distance and width-height difference penalty), while DFL refines the microscopic precision of local coordinates through discrete probability distribution modeling. The two are combined to form multi-granularity supervision. Regarding noise immunity, EIOU's convexity optimization ensures convergence stability, while DFL suppresses interference from outliers through probability density focusing. Joint training significantly enhances robustness. For direction-sensitive tasks, EIOU implicitly constrains the aspect ratio of the rotated box, while DFL can be extended to discrete learning in the angular domain to explicitly improve direction prediction accuracy.

[0065] This example also conducts a comparative experiment on the LiteCGNet model.

[0066] Table 1 Comparison of model performance on RSOD dataset Table 1 shows the experimental results of model performance comparison on the RSOD dataset, where the bold part indicates that the model ranks first among all models in terms of performance in this indicator, while the underlined part indicates that the performance ranks second. The experimental results show that RT-DETR-R18 based on the Transformer architecture performs best in mAP and F-value, and achieves second place in both recall and precision. However, its global attention mechanism and complex decoding structure result in a low detection speed. FCOS improves the recall rate of the model with its anchor-free design, but the center branch has limited ability to classify dense objects, the precision rate is low, and its single-stage architecture is slow. The YOLOv10 model, as a lightweight network of the recent SOTA model, improves training efficiency through a dual allocation strategy. Its end-to-end design avoids the time-consuming NMS, and its lightweight design sacrifices some accuracy to achieve the real-time limit in terms of FPS. The LiteCGNet designed by the present invention uses YOLOv10 as the baseline model, improves YOLO's bottleneck, neck, and head, and adopts GiraffeDet's neck-heavy and head-light design, sacrificing some speed. It leads YOLOv10s by 1.8%, 2.8%, 3.1%, and 2.9% in mAP, recall, precision, and F-value, respectively. The model designed by the present invention achieves the second highest mAP, F-value, and FPS, and even surpasses the RT-DETR-R18 model in precision, demonstrating its effectiveness in remote sensing multi-scale object detection.

[0067] The RSOD (Remote Sensing Object Detection) dataset is a benchmark dataset for remote sensing image interpretation developed by Wuhan University, aiming to promote the research and performance evaluation of remote sensing image interpretation algorithms. This dataset covers four typical ground objects: aircraft (446 images), oil tanks (165 images), amusement parks (189 images), and overpasses (176 images). The data source integrates public remote sensing databases with laboratory-proprietary resources, covering multi-resolution, multi-viewpoint, and temporal variations. The dataset strictly adheres to the PASCAL VOC annotation specification, providing structured annotations including object bounding box coordinates, class labels, and attribute descriptions.

[0068] Table 2 Comparison of model performance on industrial parts target detection dataset The industrial parts target detection dataset is data acquired in real industrial scenarios. Experiments conducted on this dataset can verify whether the target detection network proposed in this invention can achieve ideal results in industrial scenarios. As can be seen from Table 2 (REF _Ref191306920 \r \h), LiteCGNet maintains a high level of mAP, recall, precision, and F-value, leading all models by 3.1%, 5.1%, 3.2%, and 4.2% in each accuracy metric, respectively. It also achieves good results in terms of frame rate, second only to the YOLOv10s model at 30.6 frames per second. It is worth noting that GiraffeDet also achieves good results in various indicators, surpassing the RT-DETR-R50 model by 0.1%, 1.4%, and 0.7% in recall, precision, and F-value, respectively. This shows that the neck-heavy and trunk-light structure has a good effect in this industrial scenario.

[0069] REF _Ref193745915 \r \h Figure 6 This is the detection effect of LiteCGNet on the industrial parts target detection dataset. It can be seen that LiteCGNet demonstrates excellent detection performance on the industrial parts target detection dataset. Experimental results show that the network model can not only effectively cope with the detection needs of different scales and multiple perspectives, but also maintain accurate target positioning capabilities even in complex scenes with metallic backgrounds. It is worth noting that in a metal substrate environment with strong reflective interference, the system still achieves a high detection accuracy. This set of experiments strongly verifies the multi-dimensional performance advantages of the LiteCGNet architecture proposed in this chapter in industrial detection scenarios, especially its multi-scale perception capabilities and perspective robustness, fully demonstrating the practical value of the algorithm in complex industrial environments.

[0070] This embodiment also provides an abnormal target detection system for industrial parts, the system comprising: Data acquisition module, responsible for acquiring multi-angle images of industrial parts; The abnormal target detection module is responsible for processing multi-angle images of industrial parts through the lightweight context-guided target detection model LiteCGNet to obtain abnormal target detection results.

[0071] Furthermore, those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CDROM, optical storage, etc.) containing computer-usable program code.

[0072] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0073] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0074] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0075] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some of the technical features thereof can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for detecting abnormal targets in industrial parts, the method comprising: Acquire multi-angle images of industrial parts; Multi-angle images of industrial parts are processed by the lightweight context-guided target detection model LiteCGNet to obtain abnormal target detection results; Characterized in that the lightweight context-guided target detection model LiteCGNet includes a backbone network Backbone, a neck network Neck and a decoupling head Head; The backbone network adopts the YOLOv10 model as the framework, and the bottleneck structure in the penultimate and third layers is replaced by the channel shuffle self-attention bottleneck module ShuffleCTB; The neck network (Neck) adopts a context-guided perceptual feature fusion module (CGRFPN). The CGRFPN uses a residual context module (RCM) to reconstruct spatial features and a pyramid context extraction module (PCE) to extract current context information. Finally, through horizontal and vertical pooling operations, it captures axial context in two directions and reconstructs the axial global context, thereby achieving explicit modeling of rectangular key areas. The decoupling head Head adopts a decoupling head LSCD based on parameter sharing optimization.

2. The method according to claim 1, characterized in that The implementation process of the channel shuffling self-attention bottleneck module ShuffleCTB is: Divide the input feature map into two parts along the channel dimension 、 , 、 The global context semantics containing multiple feature maps and the local detail features containing multiple feature maps are extracted through the global modeling branch MHSA_CGLU and the local perception branch Bottleneck respectively; The global context semantics and local detail features are grouped separately, and then the groups between the global context semantics and local detail features are randomly spliced; The randomly spliced ​​feature maps are fused to obtain cross-modal features.

3. The method according to claim 2, characterized in that The implementation process of the global modeling branch MHSA_CGLU is: First, input the data Projected into multiple low-dimensional spaces, we obtain query, key, and value vectors for multiple heads. Then, we use the multi-head self-attention mechanism in the Transformer architecture to calculate the attention scores of different heads and perform weighted summation. Combined with position encoding, we can extract the global context semantics to better capture the information relationship between different positions in the feature map.

4. The method according to claim 2, characterized in that The implementation process of the local perception branch Bottleneck is: For input data First, 1×1 convolution is used to reduce the dimensionality of the number of channels to reduce the amount of calculation, then 3×3 convolution is used to extract features, and then 1×1 convolution is used to increase the dimensionality to restore the number of channels. At the same time, residual connection is used to add the input directly to the output to solve the gradient vanishing and gradient exploding problems in deep network training, so that the network can better learn local detail features.

5. The method according to claim 1, characterized in that: The context-guided perception feature fusion module CGRFPN includes two branches and a cross-level feature interaction stage; The first branch includes a pyramid context extraction module PCE and three groups of cascaded first banded convolutional attention modules RCA; The pyramid context extraction module PCE performs the last three levels of feature maps of the backbone network Through multi-scale pooling, the spatial dimensions are unified to the smallest level, and then spliced ​​along the channel dimension to form a pyramid fusion feature with global context awareness; The first banded convolution attention module RCA of the three cascades performs axial long-range modeling on the pyramid fusion features output by the pyramid context extraction module PCE, splits them according to the original number of channels and upsamples them to the corresponding resolution to obtain multi-scale pyramid context fusion features. ; The second branch includes the residual context module RCM and three sets of cascaded second banded convolution attention modules RCA; The residual context module RCM is used to calculate the last three levels of feature maps of the backbone network pass Horizontal banded convolution and The parallel structure of vertical strip convolution captures direction-sensitive spatial dependencies, and then generates enhanced feature maps through channel excitation; The three groups of cascaded second banded convolution attention modules RCA perform axial long-range modeling on the enhanced feature maps of different levels output by the residual context module RCM, split them according to the original number of channels and upsample them to the corresponding resolution to obtain multi-scale residual context fusion features ; The cross-level feature interaction stage includes a first multi-feature fusion block FBM, a first dynamic interpolation fusion module DIF, a second multi-feature fusion block FBM, a second dynamic interpolation fusion module DIF, a third multi-feature fusion block FBM, a first residual fusion block RepC3, and a second residual fusion block RepC3; The first multi-feature fusion block FBM fuses the high-scale pyramid context features output by the first branch The high-scale residual context fusion feature output by the second branch Perform gated fusion; The first dynamic interpolation fusion module DIF combines the gated fusion result output by the first multi-feature fusion block FBM with the mid-scale residual context fusion feature output by the second branch Spatial dimension expansion is achieved through learnable bilinear interpolation, and the Convolution dynamically adjusts channel weights and ultimately generates fused features through residual connections; The second multi-feature fusion block FBM fuses the mid-scale pyramid context features output by the first branch Perform gated fusion with the features output by the first dynamic interpolation fusion module DIF; The second dynamic interpolation fusion module DIF combines the gated fusion result output by the second multi-feature fusion block FBM with the low-scale residual context fusion feature output by the second branch. Spatial dimension expansion is achieved through learnable bilinear interpolation, and the Convolution dynamically adjusts channel weights and ultimately generates fused features through residual connections; The third multi-feature fusion block FBM fuses the low-scale pyramid context features output by the first branch The features output by the second dynamic interpolation fusion module DIF are gated and fused to obtain the low-scale total fusion features. ; The first residual fusion block RepC3 receives the result of the concatenation of the output features of the second multi-feature fusion block FBM and the result of the downsampling of the output features of the third multi-feature fusion block FBM by the spatial channel compression module SCDown, and obtains the mid-scale total fusion feature through fusion technology and residual structure. ; The second residual fusion block RepC3 receives the result of the concatenation of the output features of the first multi-feature fusion block FBM and the result of the downsampling of the output features of the first RepC3 by the spatial channel compression module SCDown, and obtains a high-scale total fusion feature through fusion technology and residual structure. .

6. The method according to claim 1, characterized in that The implementation process of the parameter sharing optimized decoupling head LSCD is: The multi-scale total fusion features output by the neck network Neck pass The convolution module Conv_GN unifies the number of channels and maps the feature channels of different levels to a fixed dimension to obtain the first multi-scale feature ; The first multi-scale feature By sharing the weights of the same set of convolution kernels in the group convolution module, we can further extract the common semantic features across levels while keeping the spatial resolution unchanged, and obtain the second multi-scale feature ; The second multi-scale feature after the weight sharing group convolution module is processed The prediction results are generated through multi-scale dense prediction branches.

7. The method according to claim 6, characterized in that The multi-scale dense prediction branch includes a high-scale dense prediction branch, a medium-scale dense prediction branch, and a low-scale dense prediction branch; The architecture of the high-scale dense prediction branch, the medium-scale dense prediction branch, and the low-scale dense prediction branch are the same, all of which include two parallel branches. The first branch uses the regression branch Conv_Reg and the Scale layer, and the second branch uses the classification branch Conv_Cls. The regression branch Conv_Reg and the classification branch Conv_Cls output bounding box distribution parameters and category probabilities respectively; The Scale layer scales the bounding box of the regression branch Conv_Reg output result.

8. An abnormal target detection system for industrial parts implementing the method according to any one of claims 1 to 7, characterized in that: The system comprises: Data acquisition module, responsible for acquiring multi-angle images of industrial parts; The abnormal target detection module is responsible for processing multi-angle images of industrial parts through the lightweight context-guided target detection model LiteCGNet to obtain abnormal target detection results.

9. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 7.

10. A computing device comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Power grid multi-component defect detection and identification method and system based on YOLOv5-EM

    CN115205565A

  • Subway pedestrian abnormal behavior detection method, device and equipment and storage medium

    CN118097771A

  • Bearing diagnosis method and system based on variable working condition multi-modal data fusion

    CN118332488A

  • Abnormal behavior detection method and device based on improved YOLOv8 and storage medium

    CN119152344A

  • Industrial part surface defect detection method and device based on YOLOv5n

    CN119418128A

Cited By

  • Unauthorized abnormal visual detection and change control method for industrial equipment on site

    CN122347588A

  • A weed detection method and system based on edge information enhancement and multi-scale adaptive fusion, and a storage medium

    CN122435468B