An industrial part anomaly target detection method and system thereof
By using the lightweight context-guided object detection model LiteCGNet, combined with self-attention mechanism and feature fusion technology, the problems of detection accuracy and real-time performance in complex industrial environments are solved, achieving efficient and accurate anomaly detection of industrial parts.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU DIANZI UNIV
- Filing Date
- 2025-05-22
- Publication Date
- 2026-05-15
AI Technical Summary
Existing technologies struggle to achieve both high-precision and real-time target detection in complex industrial environments, particularly in scenarios involving multi-scale feature modeling, background interference, and high-speed operation, where a trade-off between detection accuracy and speed exists.
We employ the lightweight context-guided object detection model LiteCGNet, combining the ShuffleCTB module, the CFRPN module, and the LSCD decoupling head. Through self-attention mechanism and feature fusion technology, we improve feature representation and robustness, and optimize model performance through the joint loss function of EIOU Loss and DFL Loss.
It achieves efficient and accurate anomaly detection of industrial parts in complex industrial environments, improves detection accuracy and inference speed, enhances the model's generalization ability, and adapts to the real-time response requirements of industrial production lines.
Smart Images

Figure CN120563807B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of target detection and image detection technology, specifically a method and system for detecting abnormal targets in industrial parts. Background Technology
[0002] Anomaly detection in industrial parts is a crucial prerequisite for improving product pass rates and ensuring product quality, and it is a challenging practical application task. In traditional sorting processes, operators need to visually inspect parts transported along the track from multiple angles. This method is not only time-consuming but also prone to subjective errors. Furthermore, traditional image-based anomaly detection methods have significant limitations in accuracy and real-time performance when facing complex backgrounds and industrial environments. To overcome these problems, deep learning-based automation technologies have been gradually introduced in recent years to achieve 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 through predefined rules. While this reduces human intervention to some extent, it faces multiple technical bottlenecks in complex industrial environments: First, the surface characteristics of parts are diverse, and complex conditions such as metallic reflection, transparent coatings, and complex textures can easily lead to optical imaging noise. Second, industrial backgrounds are usually quite complex, often containing intricate cables and messy equipment, which may make it difficult to separate the parts to be inspected from the background. Third, the high-speed operation of production lines requires the inspection system to have millisecond-level real-time response capabilities, a requirement that most inspection technologies cannot meet.
[0004] Although current deep learning-based object detection methods have achieved certain progress and are relatively mature, they still face many challenges in simultaneously achieving the dual goals of real-time performance and accuracy when dealing with complex and ever-changing industrial environments: insufficient multi-scale feature modeling: industrial parts vary greatly in size and have multiple perspective changes, and existing models have limited ability to represent the features of small defects or large-scale targets; sensitivity to background interference: complex industrial backgrounds can easily lead to false activation of the model, especially in metal substrates or high-reflectivity scenarios, where the false detection rate increases significantly; and the dilemma of balancing speed and accuracy, etc.
[0005] In summary, existing technologies have not yet effectively solved the problem of synergistic optimization of detection accuracy, real-time performance, and generalization ability in complex industrial environments. There is an urgent need for a detection method that balances efficient inference and robust feature representation to address the combined challenges of multimodal interference, multi-scale targets, and stringent real-time requirements in industrial scenarios. Summary of the Invention
[0006] This invention addresses the shortcomings of existing methods for detecting anomalies in industrial parts by proposing a method and system for detecting anomalies in industrial parts. This method improves inference speed while ensuring detection accuracy, thereby achieving efficient and accurate detection of anomalies in industrial parts.
[0007] The present invention is as follows:
[0008] In a first aspect, the present invention provides a method for detecting abnormal targets in industrial parts, comprising the following steps:
[0009] Acquire multi-angle images of industrial parts;
[0010] Multi-angle images of industrial parts are processed by the lightweight context-guided target detection model LiteCGNet to obtain abnormal target detection results.
[0011] The lightweight context-guided target detection model LiteCGNet includes a backbone network, a neck network, and a decoupled head.
[0012] The backbone network uses the YOLOv10 model as its framework, and the Bottleneck structure in its penultimate and third-to-last layers is replaced by the channel shuffle self-attention bottleneck module ShuffleCTB.
[0013] The Neck network employs a context-guided perceptual feature fusion module CGRFPN. The CGRFPN uses a residual context module RCM to reconstruct spatial features, while using a pyramid context extraction module PCE to extract current context information. Finally, it captures the axial context in two directions through horizontal and vertical pooling operations, thereby reconstructing the axial global context and thus achieving explicit modeling of the rectangular key region.
[0014] The decoupling head adopts the LSCD decoupling head based on parameter sharing optimization.
[0015] Secondly, the present invention provides an abnormal target detection system for industrial parts, comprising:
[0016] The data acquisition module is responsible for acquiring multi-angle images of industrial parts;
[0017] The abnormal target detection module is responsible for processing multi-angle images of industrial parts using the lightweight context-guided target detection model LiteCGNet to obtain abnormal target detection results.
[0018] Thirdly, 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 perform the method described thereon.
[0019] Fourthly, the present invention provides a computing device, including a memory and a processor, wherein the memory stores executable code, and the processor executes the executable code to implement the method described above.
[0020] Beneficial effects of this invention:
[0021] The multi-stage anomaly collaborative detection method and system for industrial parts proposed in this invention effectively solves key problems in the detection of industrial parts. It has significant effects in improving detection accuracy, accelerating reasoning speed, and enhancing generalization ability, and is of great significance to industrial production quality control.
[0022] To address the complexity of industrial scenarios, this invention innovatively designs a lightweight context-guided target detection model, LiteCGNet. The ShuffleCTB module, by integrating the CSP architecture and Transformer attention mechanism, effectively enhances the cross-modal feature representation capability of parts. Combined with the context-guided perceptual feature fusion module CFRPN, it significantly improves the model's robustness in representing multi-scale features and target localization. This invention designs the context-guided perceptual feature fusion module CFRPN. This module constructs a parallel multi-branch fusion architecture and integrates a spatial self-calibration mechanism through adaptive feature interpolation algorithms and cross-scale feature recombination strategies. This strengthens the model's attention to foreground targets, improves its ability to represent multi-scale features, increases the information density of upsampling, and enhances the robustness of target localization in complex industrial environments. During model training, a joint loss function of EIOU Loss and DFL Loss is introduced. EIOU Loss enhances the global control capability of target geometry by introducing center point distance penalties and width-to-height difference penalties; 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 improves the robustness of target localization in complex scenarios.
[0023] To meet the stringent real-time response requirements of high-speed industrial production lines, LiteCGNet employs a parameter-shared group convolutional decoupling head, LSCD, which maximizes the compression of model parameters while maintaining feature decoupling capabilities, significantly improving model inference speed. This enables the system to complete the inspection of a large number of parts in a very short time, avoiding production line congestion caused by slow inspection speed, improving production efficiency, and adapting to the actual needs of industrial production.
[0024] This invention effectively solves a key problem in the inspection of industrial parts and is of great significance for the automated anomaly detection of industrial parts on industrial production lines. Attached Figure Description
[0025] To more clearly illustrate the technical solution of the present invention, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 This is a diagram of the LiteCGNet network architecture, a lightweight context-guided object detection model of this invention.
[0027] Figure 2 This is a structural diagram of the decoupling head LSCD module with parameter sharing optimization according to the present invention;
[0028] Figure 3 This is a network architecture diagram of the ShuffleCTB self-attention bottleneck module of the present invention.
[0029] Figure 4 This is a structural diagram of the context-guided perceptual feature fusion CFRPN module of the present invention;
[0030] Figure 5 This is a structural diagram of the PCE module for pyramid context extraction in this invention;
[0031] Figure 6 This is a diagram showing the detection results of the present invention on an industrial parts target detection dataset. Detailed Implementation
[0032] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0033] This embodiment provides a method for detecting abnormal targets in industrial parts, the method comprising:
[0034] Step S1: Obtain multi-angle images of industrial parts:
[0035] An industrial camera mounted on a fixed bracket on the production line is used to acquire multi-angle images of industrial parts, controlled by a trigger. The acquired images are standardized, uniformly adjusted to a resolution of 640×640, and then cropped to 576×576 tensors.
[0036] Step S2: Multi-angle images of industrial parts are processed by the lightweight context-guided target detection model LiteCGNet to obtain abnormal target detection results;
[0037] The lightweight context-guided object detection model LiteCGNet introduces a multi-head self-attention mechanism to reconstruct the feature space, utilizes a CSP structure to balance computational efficiency and feature representation capability, and combines a channel grouping and shuffling strategy to promote cross-modal feature interaction. Secondly, a context-guided perception module is designed in the feature fusion stage, which enhances multi-scale feature representation through a parallel multi-branch architecture and spatial self-calibration mechanism, and works in conjunction with a dynamic interpolation fusion module to enhance upsampling information density. The detection head adopts a parameter-sharing group convolutional structure, reducing computational load through convolutional kernel parameter sharing and feature decoupling mechanisms.
[0038] See appendix Figure 1 The lightweight context-guided target detection model LiteCGNet includes a backbone network, a neck network, and a decoupled head network.
[0039] See appendix Figure 3 The backbone network adopts the YOLOv10 model as its basic framework, and the Bottleneck structure in its second to third layers (i.e., P3 and P4 layers) is replaced by the channel shuffle self-attention bottleneck module ShuffleCTB.
[0040] The ShuffleCTB channel shuffling self-attention bottleneck module integrates the CSP architecture concept and the Transformer attention mechanism. It reconstructs the feature space by introducing a multi-head self-attention mechanism and utilizes a channel grouping shuffling strategy to promote cross-modal feature interaction, enhancing the cross-modal feature representation capability of parts and balancing model inference speed and feature representation capability. Specifically, its implementation process is as follows:
[0041] (1) Using partitioning operation The input feature map is divided into two parts along the channel dimension. , :
[0042] Let the input feature map be The total number of input channels is The channel division ratio is Then the input partition It can be represented as:
[0043]
[0044]
[0045] , The global context semantics containing multiple feature maps and the local detail features containing multiple feature maps are extracted through a two-branch processing operation (i.e., the global modeling branch MHSA_CGLU and the local perception branch Bottleneck extraction):
[0046] Assume the Bottleneck module function is The MHSA_CGLU module function is Then the processing of the two branches can be represented as:
[0047]
[0048]
[0049] Specifically, the implementation process of the global modeling branch MHSA_CGLU is as follows:
[0050] First, input data Projecting onto multiple low-dimensional spaces yields query, key, and value vectors for multiple heads. Then, the attention scores of different heads are calculated and weighted summed using the multi-head self-attention mechanism in the Transformer architecture. This summation, combined with positional encoding, extracts global contextual semantics to better capture information relationships at different locations in the feature map. Specifically:
[0051] 1) Remodeling into sequence form The number of attention heads is The dimensions of each head are , .
[0052] 2) Projection yields the query, key, and value vectors:
[0053]
[0054] in It is a projection matrix. .
[0055] Divide Q, K, and V by their headers:
[0056]
[0057]
[0058]
[0059] .
[0060] 3) Calculate the attention score:
[0061]
[0062] in, It is the attention score matrix of the i-th head, obtained by... and Multiplying the transposes of the given terms and then normalizing by softmax, we get the result. .
[0063] 4) Multiply the attention score by the corresponding value vector and sum them to obtain the output of each head:
[0064]
[0065] in This represents the output of the i-th head.
[0066] 5) Concatenate the outputs of h headers column by column:
[0067] .
[0068] 6) Combining positional coding This yields the final output of the global modeling branch MHSA_CGLU. :
[0069]
[0070] in Position encoding (PE) is usually generated based on sine and cosine functions to introduce positional information into the model, helping the model to better capture the information relationships between different positions in the feature map.
[0071] The calculation of each element in the positional encoding PE is as follows:
[0072] 1. Even-numbered dimensions (i is even)
[0073]
[0074] 2. Odd-numbered dimensions (i is odd)
[0075]
[0076] in: Indicates input data Position index in the sequence, ∈[0,N-1], N The sequence length is... ; i The dimension index representing the positional encoding vector. ∈[0, -1], The feature dimensions of the global modeling branch MHSA_CGLU.
[0077] Specifically, the implementation process of the local perception branch Bottleneck is as follows:
[0078] For input data First, 1×1 convolutions are used to reduce the number of channels and decrease computation. Then, 3×3 convolutions are used to extract features, followed by 1×1 convolutions to restore the number of channels. Simultaneously, residual connections are used to directly add the input to the output to address the vanishing and exploding gradient problems in deep network training, allowing the network to better learn local detail features. Specifically:
[0079] 1) To Dimensionality reduction is achieved through 1×1 convolution. for Number of channels:
[0080]
[0081] in , The number of channels is reduced from 1×1 convolution. Downgraded to . These are the weight matrix and bias of the 1×1 convolution, respectively.
[0082] 2) Use 3×3 convolution to extract features from the dimensionality-reduced feature map:
[0083]
[0084] in , These are the weight matrix and bias of the 3×3 convolution, respectively.
[0085] 3) Use 1×1 convolution to increase the dimensionality, restoring the number of channels to the same as the input:
[0086]
[0087] in , , These are the weight matrix and bias of the 1×1 convolution, respectively.
[0088] 4) Residual connection will connect the original input Add directly to the result after convolution. This helps alleviate the vanishing and exploding gradient problems in deep network training, enabling the network to learn local detailed features better.
[0089]
[0090] in .
[0091] (3) Group the global context semantics and local detail features separately, according to each Each feature map is grouped into a set, and then these groups are randomly concatenated between global context semantics and local detail features. Specifically:
[0092] 3-1 Subgroups , Each contains If there are 2 feature maps, then the number of groups in each group can be expressed as:
[0093]
[0094] in express Number of subgroups within a group express The number of subgroups within a group.
[0095] 3-2 Randomly permutate the channels within each subgroup to generate perturbed features. and ;
[0096] For example:
[0097] for Ycnn 1. Assume its original channel order is [ a , b ], after random permutation, becomes [ b , a ] .
[0098] for Ycnn 2. The original channel sequence is [ c , d ], after random permutation, it may be [ d , c ] .
[0099] for Ycnn 3. The original channel sequence is [ e , f ], after random permutation, it might be [ f , e ] .
[0100] for Ytrans 1. The original channel sequence is [ g , h ], after random permutation, it may be [ h , g ] .
[0101] for Ytrans 2. The original channel sequence is [ i, j ], after random permutation, it might be [ j , i ] .
[0102] 3-3 Features of these perturbations and Perform random splicing. ∈[1, ], ∈[1, This forms a cross-modal hybrid feature. Specifically:
[0103] First, combine the bi-branched subgroups into a union set, that is:
[0104]
[0105] Then generate a length of random permutation vector ,satisfy:
[0106]
[0107] in Indicates the first Group index at each position, This indicates that the input combinations are randomly arranged.
[0108] A randomly concatenated union of subgroups can be represented as:
[0109]
[0110] (4) Perform a fusion operation on the randomly spliced feature maps to obtain the output cross-modal features.
[0111]
[0112] in express The convolution operation.
[0113] The Neck network employs a Context-Guided Aware Feature Fusion Module (CGRFPN). The CGRFPN uses a Residual Context Module (RCM) to reconstruct spatial features, while simultaneously using a Pyramid Context Extraction Module (PCE) to extract current context information. Finally, it captures the axial context in two directions through horizontal and vertical pooling operations, thereby reconstructing the axial global context and achieving explicit modeling of the rectangular key region.
[0114] Specifically, the Context-Guided Aware Feature Fusion Module (CGRFPN) constructs a parallel multi-branch fusion architecture and integrates a spatial self-calibration mechanism through an adaptive feature interpolation algorithm and a cross-scale feature recombination strategy. This enhances the model's focus on foreground targets, improves its ability to express multi-scale features, increases the information density of upsampling, and strengthens the robustness of target localization in complex industrial environments. Specifically, it includes a two-branch, cross-level feature interaction stage (see appendix). Figure 4 .
[0115] The first branch includes the Pyramid Context Extraction (PCE) module and three cascaded first strip convolutional attention modules (RCA).
[0116] See appendix Figure 5 The pyramid context extraction module (PCE) extracts the feature maps of the last three layers of the backbone network. (respectively, the original input resolution) By using multi-dimensional pooling, spatial dimensions are unified to the smallest level. Then, the features are concatenated along the channel dimension to form a pyramid fusion feature map with global context awareness; multi-scale pooling involves performing a series of adaptive pooling operations on the input feature maps at different resolutions. For the last three layers of feature maps in the backbone network... Assuming their resolutions are respectively ( × ), ( × ), ( × )and( > > ), ( > > ).right When performing adaptive pooling, it will be based on the minimum level of the target, such as... resolution ( × Determine the pooling kernel size and step size, and... downsampling to ( × Resolution; for Similarly, by adaptively adjusting the pooling kernel and stride, 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 stitching along the channel dimension to form a pyramid fusion feature with global context awareness. This process significantly enhances the model's robustness to changes in target scale by aggregating semantic information from different receptive fields. This process can be represented as:
[0117]
[0118] in This indicates that average pooling downsampling is applied to the feature map P. The P value represents a feature with pyramid context. In this way, the PCE module effectively integrates feature information from different levels, providing rich contextual information for subsequent feature processing and target recognition.
[0119] The three cascaded first-band convolutional attention modules (RCA) perform axial long-range modeling on the pyramid fusion features output by the pyramid context extraction module (PCE), split them according to the original number of channels, and upsample them to the corresponding resolution to obtain multi-scale pyramid context fusion features. .
[0120] The second branch includes the residual context module RCM and three cascaded second strip convolutional attention modules RCA.
[0121] The Residual Context Module (RCM) analyzes the feature maps of the last three layers of the backbone network. pass Horizontal band convolution and The parallel structure of vertical strip convolutions captures orientation-sensitive spatial dependencies, which are then enhanced by channel excitation to generate an enhanced feature map; the specific implementation process is as follows:
[0122] Input the feature maps of the last three layers of the backbone network Each layer of feature maps is subjected to 11×1 horizontal stripe convolutions and 1×11 vertical stripe convolutions. The 11×1 horizontal stripe convolutions capture long-range spatial dependencies in the horizontal direction, while the 1×11 vertical stripe convolutions capture long-range spatial dependencies in the vertical direction. The results of these two convolutions are then summed, followed by channel activation (using a channel attention mechanism, i.e., obtaining global features of each channel through global average pooling, then learning the dependencies between channels through a fully connected layer to obtain channel weights, and finally weighting the original feature maps) to generate enhanced feature maps, resulting in enhanced feature maps for different layers.
[0123] The three cascaded second strip convolutional 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. ;
[0124] 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;
[0125] The first multi-feature fusion block (FBM) will fuse the high-scale pyramid context features output from the first branch. High-scale residual context fusion features of the second branch output Perform gating fusion;
[0126] As an example, the specific implementation process of the gating fusion is as follows:
[0127] The two input features are activated by Sigmoid to generate a spatial attention mask, which is then aligned by bilinear interpolation and multiplied element-wise to achieve semantically guided detail enhancement.
[0128] The first dynamic interpolation fusion module DIF combines the gated fusion result output by the first multi-feature fusion block FBM with the mesoscale residual context fusion feature output by the second branch. Spatial dimensionality expansion is achieved through learnable bilinear interpolation, and employs... Convolution dynamically adjusts channel weights, and finally generates fused features through residual connections.
[0129] The second multi-feature fusion block (FBM) fuses the mesoscale pyramid context features output from the first branch. Gated fusion is performed on the features output by the first dynamic interpolation fusion module DIF;
[0130] 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 dimensionality expansion is achieved through learnable bilinear interpolation, and employs... Convolution dynamically adjusts channel weights, and finally generates fused features through residual connections.
[0131] The third multi-feature fusion block (FBM) fuses the low-scale pyramid context features output from the first branch. The features output by the second dynamic interpolation fusion module DIF are gated and fused to output low-scale total fused features. ;
[0132] The first residual fusion block RepC3 receives the results of the second multi-feature fusion block FBM output features after concat concatenation, and the results of the third multi-feature fusion block FBM output features after downsampling by the spatial channel compression module SCDown. Through fusion techniques and residual structures, it obtains the mesoscale total fused features. ;
[0133] The second residual fusion block RepC3 receives the output features of the first multi-feature fusion block FBM after concatenation and the output features of the first RepC3 after downsampling by the spatial channel compression module SCDown. Through fusion techniques and residual structures, it obtains the high-scale total fused features. ;
[0134] The spatial channel compression module SCDown employs a two-stage compression strategy, first using... Convolution preserves the channel dimension, and then depthwise separable convolution is used ( The kernel (stride=2) achieves spatial dimensionality reduction.
[0135] The decoupling head adopts the parameter-sharing optimization-based decoupling head LSCD to reduce the overall number of network parameters. Its operation process can be divided into two stages: feature processing and dual-branch prediction.
[0136] The LSCD, through parameter reuse mechanisms and grouped convolution operations, maximizes the compression of model parameters while ensuring feature decoupling capabilities, achieving an effective balance between overall real-time computational performance and detection accuracy. See Appendix for details. Figure 2 The implementation process is as follows:
[0137] S301. The multi-scale total fusion features output by the Neck network are obtained. Through independent The convolutional module Conv_GN unifies the number of channels, mapping feature channels from different levels to a fixed dimension, resulting in... .
[0138] S302, Process all scale features after step S301. By using a weight-sharing convolutional module that shares the same set of convolutional kernels, general semantic features across layers are further extracted while maintaining spatial resolution, resulting in multi-scale features. In this process, GroupNorm is used instead of BatchNorm for group normalization. By calculating statistics for each channel group, the stability of small-batch training is improved.
[0139] As an example, the weight-shared group convolutional module consists of two cascaded... Convolutional structure.
[0140] S303, multi-scale features processed by the weight-shared group convolutional module Prediction results are generated through multi-scale dense prediction branches (one2many).
[0141] The multi-scale dense prediction branches include high-scale dense prediction branches, meso-scale dense prediction branches, and low-scale dense prediction branches.
[0142] The architecture of the high-scale dense prediction branch, the mesoscale dense prediction branch, and the low-scale dense prediction branch is the same, all of which include two parallel branches. The first branch adopts the regression branch Conv_Reg and the Scale layer, and the second branch adopts the classification branch Conv_Cls.
[0143] The regression branch Conv_Reg and the classification branch Conv_Cls output 64-dimensional bounding box distribution parameters and 80-dimensional class probabilities, respectively.
[0144] The Scale layer scales the bounding box of the Conv_Reg output from the regression branch to address the issue of inconsistent target scales detected by each detector head.
[0145] The weight-sharing convolutional module significantly reduces the number of parameters and computational complexity of multi-level detection heads by reusing convolutional kernel weights. In traditional detection networks, feature maps at different levels need to independently learn convolutional kernel parameters to adapt to their scale characteristics. This design, however, forces all levels to share the same set of convolutional kernels, reducing the number of parameters from O(N×C²) to O(C²), where N is the number of levels and C is the number of channels. This design allows the network to maintain its feature representation ability while mitigating the risk of overfitting. Furthermore, weight sharing forces the network to extract scale-independent general features, enhancing the model's generalization ability to multi-scale targets. However, this design may weaken layer specificity, requiring adjustment of the number of hidden layer channels to balance efficiency and accuracy.
[0146] The introduction of GroupNorm further optimizes the training dynamics and deployment adaptability of the network. Unlike BatchNorm, which relies on batch statistics, GroupNorm divides channels into several groups (e.g., 8 groups) and calculates the mean and variance independently within each group, thus eliminating the dependence on batch size. This feature makes it stable in scenarios with small batch training, online learning, and dynamic input resolution, avoiding the performance degradation caused by statistical fluctuations in BatchNorm. In detection tasks, the sparsity of targets and the dominance of the background result in a long-tailed feature distribution. GroupNorm alleviates the distribution differences between channels through group normalization, improving the model's sensitivity to foreground targets. In addition, GroupNorm does not require maintaining moving average parameters during the inference phase, simplifying the model deployment process.
[0147] The collaborative design of shared convolution and group normalization reduces model complexity while enhancing the consistency of feature representations. Shared convolution improves computational efficiency through parameter reuse, while GroupNorm enhances training robustness through group statistics. Together, they achieve a better balance between accuracy and efficiency in the network.
[0148] During training, the loss function of the lightweight context-guided object detection model LiteCGNet is... for
[0149]
[0150] in, and To balance the weights.
[0151] High efficiency crossover loss It introduces center point distance penalty and width / height difference penalty on the basis of traditional IoU loss:
[0152]
[0153] in To predict the Euclidean distance between the center points of the target detection bounding box and the ground truth target detection bounding box, and The width and height of the smallest bounding box that can completely contain both the predicted and ground truth boxes. To predict the width of the target detection box, This is the width of the ground truth bounding box (GT box, which is the box that marks the location and size of the actual target). To predict the height of the target detection box, The height of the actual target detection bounding box;
[0154] Specific calculations:
[0155] in A inter The area of the intersection between the predicted bounding box and the ground truth bounding box. A union The area of the union of the predicted bounding box and the ground truth bounding box. 。
[0156] Distribution focus loss :
[0157]
[0158] in , These are the two adjacent integer coordinates of the center point of the real target detection box. , They are , The predicted probability.
[0159] DFL models coordinate uncertainty using probability density, effectively mitigating the sensitivity of traditional regression methods to annotation errors, and is particularly suitable for fine-grained positioning of small targets or fuzzy boundaries.
[0160] 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 penalties), while DFL refines the microscopic accuracy of local coordinates through discrete probability distribution modeling. The combination of the two forms multi-granularity supervision. In terms of noise robustness, EIOU's convexity optimization ensures convergence stability, while DFL suppresses outlier interference through probability density focusing. Joint training significantly enhances robustness. For orientation-sensitive tasks, EIOU implicitly constrains the aspect ratio of the rotated bounding box, while DFL can be extended to discretized learning in the angular domain, explicitly improving orientation prediction accuracy.
[0161] This embodiment also includes a comparative experiment with the LiteCGNet model.
[0162] Table 1. Comparison of model performance on the RSOD dataset.
[0163]
[0164] Table 1 presents the experimental results comparing model performance on the RSOD dataset. The bolded sections indicate the best performance among all models for that metric, while the underlined sections indicate the second-best performance. The results show that RT-DETR-R18, based on the Transformer architecture, performs best in mAP and F-score, and achieves second-best performance in both recall and precision. However, its global attention mechanism and complex decoding structure result in lower detection speed. FCOS improves recall with its anchor-free design, but its centrality branch has limited ability to classify dense targets, resulting in lower precision, and its single-stage architecture is relatively slow. YOLOv10, as a lightweight network among recent state-of-the-art (SOTA) models, improves training efficiency through a dual-assignment strategy, avoids NMS time consumption through an end-to-end design, and sacrifices some accuracy for lightweight design, achieving the real-time limit in terms of FPS. The LiteCGNet model designed in this invention uses YOLOv10 as the baseline model and improves upon YOLO's bottleneck, neck, and head aspects. It adopts GiraffeDet's neck-focused, head-light design, sacrificing some speed, and achieves a comprehensive lead over YOLOv10 in mAP, recall, precision, and F-score with advantages of 1.8%, 2.8%, 3.1%, and 2.9%, respectively. The model designed in this invention achieves the second-highest mAP, F-score, and FPS, and even surpasses the RT-DETR-R18 model in precision, demonstrating its effectiveness in remote sensing multi-scale target detection.
[0165] The RSOD (Remote Sensing Object Detection) dataset, developed by Wuhan University, is a benchmark dataset for remote sensing image interpretation, aiming to promote 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 publicly available remote sensing databases and proprietary laboratory resources, covering multi-resolution, multi-view, and time-series variation features. The dataset strictly adheres to the PASCAL VOC annotation specification, providing structured annotations including target bounding box coordinates, category labels, and attribute descriptions.
[0166] Table 2. Performance Comparison Results of Models on the Industrial Parts Target Detection Dataset
[0167]
[0168] The industrial parts object detection dataset is based on data obtained from real industrial scenarios. Experiments on this dataset can verify whether the object detection network proposed in this invention can achieve ideal results in industrial scenarios. As shown in Table 2, LiteCGNet maintains a high level in mAP, recall, precision, and F-score, leading other models by 3.1%, 5.1%, 3.2%, and 4.2% in accuracy, respectively. It also performs well in frame rate, second only to the YOLOv10s model at 30.6 frames / second. Notably, GiraffeDet also achieved good results across various metrics, surpassing the RT-DETR-R50 model by 0.1%, 1.4%, and 0.7% in recall, precision, and F-score, respectively. This indicates that the neck-heavy, backbone-light structure performs well in this industrial scenario.
[0169] Figure 6 This section presents the detection performance of LiteCGNet on an industrial parts object detection dataset. As can be seen, LiteCGNet demonstrates superior detection performance on this dataset. Experimental results show that this network model can effectively handle detection requirements at different scales and from multiple perspectives, maintaining accurate target localization even in complex scenes with metallic backgrounds. Notably, the system still achieves high detection accuracy in environments with strong reflection interference on metallic substrates. These experiments strongly validate the multi-dimensional performance advantages of the LiteCGNet architecture proposed in this chapter in industrial inspection scenarios, particularly its multi-scale perception capability and perspective robustness, fully demonstrating the practical value of this algorithm in complex industrial environments.
[0170] This embodiment also provides an industrial part abnormality target detection system, the system comprising:
[0171] The data acquisition module is responsible for acquiring multi-angle images of industrial parts;
[0172] The abnormal target detection module is responsible for processing multi-angle images of industrial parts using the lightweight context-guided target detection model LiteCGNet to obtain abnormal target detection results.
[0173] Furthermore, those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0174] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations 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, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0175] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0176] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0177] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate 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. The lightweight context-guided target detection model LiteCGNet is characterized by comprising a backbone network, a neck network, and a decoupled head network. The backbone network uses the YOLOv10 model as its framework, with the Bottleneck structure in its penultimate and third-to-last layers replaced by the channel shuffle self-attention bottleneck module (ShuffleCTB). The implementation process of the channel shuffle self-attention bottleneck module ShuffleCTB is as follows: the input feature map is divided 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 separately through the global modeling branch MHSA_CGLU and the local perception branch Bottleneck. The global context semantics and local detail features are then grouped and processed separately, and then the groups of global context semantics and local detail features are randomly concatenated. The randomly concatenated feature maps are then fused to obtain cross-modal features. The implementation process of the global modeling branch MHSA_CGLU is as follows: first, the input data... Projecting onto multiple low-dimensional spaces yields query, key, and value vectors for multiple heads. Then, the attention scores of different heads are calculated using the multi-head self-attention mechanism in the Transformer architecture and weighted summed. This, combined with positional encoding, extracts global contextual semantics to better capture information relationships at different locations in the feature map. The implementation process of the local perceptual branch, Bottleneck, involves processing the input data... First, dimensionality reduction of the number of channels is achieved through 1×1 convolution to reduce computational cost. Then, features are extracted through 3×3 convolution, and dimensionality is increased again through 1×1 convolution to restore the number of channels. At the same time, residual connections are used to directly add the input to the output to solve the gradient vanishing and gradient exploding problems in deep network training. The Neck network employs a context-guided perceptual feature fusion module CGRFPN. The CGRFPN uses a residual context module RCM to reconstruct spatial features, while using a pyramid context extraction module PCE to extract current context information. Finally, it captures the axial context in two directions through horizontal and vertical pooling operations, thereby reconstructing the axial global context and thus achieving explicit modeling of the rectangular key region. The decoupling head adopts the LSCD decoupling head based on parameter sharing optimization.
2. The method according to claim 1, characterized in that, The context-guided perceptual feature fusion module CFRPN includes two branches and a cross-level feature interaction stage. The first branch includes the pyramid context extraction module PCE and three sets of cascaded first strip convolutional attention modules RCA; The pyramid context extraction module (PCE) extracts the feature maps of the last three layers of the backbone network. By using multi-dimensional 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 three cascaded first-band convolutional attention modules (RCA) perform axial long-range modeling on the pyramid fusion features output by the pyramid context extraction module (PCE), split them according to the original number of channels, and upsample 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 strip convolutional attention modules RCA; The Residual Context Module (RCM) analyzes the feature maps of the last three layers of the backbone network. pass Horizontal band convolution and The parallel structure of vertical strip convolution captures orientation-sensitive spatial dependencies, and then channel excitation generates an enhanced feature map; The three cascaded second strip convolutional 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) will fuse the high-scale pyramid context features output from the first branch. High-scale residual context fusion features of the second branch output Perform gating fusion; The first dynamic interpolation fusion module DIF combines the gated fusion result output by the first multi-feature fusion block FBM with the mesoscale residual context fusion feature output by the second branch. Spatial dimensionality expansion is achieved through learnable bilinear interpolation, and employs... Convolution dynamically adjusts channel weights, and finally generates fused features through residual connections; The second multi-feature fusion block (FBM) fuses the mesoscale pyramid context features output from the first branch. Gated fusion is performed on 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 dimensionality expansion is achieved through learnable bilinear interpolation, and employs... Convolution dynamically adjusts channel weights, and finally generates fused features through residual connections; The third multi-feature fusion block (FBM) fuses the low-scale pyramid context features output from the first branch. The features output by the second dynamic interpolation fusion module DIF are subjected to gated fusion to obtain the low-scale total fused features. ; The first residual fusion block RepC3 receives the results of the second multi-feature fusion block FBM output features after concat concatenation, and the results of the third multi-feature fusion block FBM output features after downsampling by the spatial channel compression module SCDown. Through fusion techniques and residual structures, it obtains the mesoscale total fused features. ; The second residual fusion block RepC3 receives the output features of the first multi-feature fusion block FBM after concatenation and the output features of the first residual fusion block RepC3 after downsampling by the spatial channel compression module SCDown. Through fusion techniques and residual structures, it obtains the high-scale total fused features. .
3. The method according to claim 1, characterized in that, The implementation process of the parameter-sharing optimized decoupling head LSCD is as follows: The multi-scale total fusion features output by the Neck network pass The convolutional module Conv_GN unifies the number of channels, mapping feature channels from different levels to a fixed dimension to obtain the first multi-scale feature. ; The first multi-scale feature By using a weight-sharing convolutional module that shares the same set of convolutional kernels, general semantic features across layers are further extracted while maintaining spatial resolution, resulting in a second multi-scale feature. ; The second multi-scale feature after processing by the weight-shared group convolutional module. Prediction results are generated through dense prediction branches at multiple scales.
4. The method according to claim 3, characterized in that, The multi-scale dense prediction branches include high-scale dense prediction branches, meso-scale dense prediction branches, and low-scale dense prediction branches. The architecture of the high-scale dense prediction branch, the mesoscale dense prediction branch, and the low-scale dense prediction branch is the same, all of which include two parallel branches. The first branch adopts the regression branch Conv_Reg and the Scale layer, and the second branch adopts the classification branch Conv_Cls. The regression branch Conv_Reg and the classification branch Conv_Cls output the bounding box distribution parameters and class probabilities, respectively. The Scale layer scales the bounding box of the Conv_Reg output result of the regression branch.
5. An industrial part anomaly detection system implementing the method of any one of claims 1-4, characterized in that, The system includes: The data acquisition module is responsible for acquiring multi-angle images of industrial parts; The abnormal target detection module is responsible for processing multi-angle images of industrial parts using the lightweight context-guided target detection model LiteCGNet to obtain abnormal target detection results.
6. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method of any one of claims 1-4.
7. A computing device comprising a memory and a processor, wherein the memory stores executable code, and the processor, when executing the executable code, implements the method of any one of claims 1-4.