Stacked part positioning method combining weighted feature fusion network and attention mechanism

By introducing the C3K2-MCA module and BiFPN-Concat structure into the YOLO11 network, combined with the MPDIoU loss function, the problem of poor detection effect of existing object detection algorithms in stacking scenarios is solved, and more efficient part positioning and more accurate occlusion detection are achieved.

CN120279254APending Publication Date: 2025-07-08FUDAN UNIVERSITY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510403585.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-01
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

When existing object detection algorithms deal with complex stacking scenarios, there are problems such as poor detection effect, insufficient deep feature learning and high computational complexity, especially when parts are blocked and overlapped, it is difficult to accurately identify and locate targets.

Method used

The C3K2-MCA module and BiFPN-Concat structure are used to enhance feature fusion capabilities, combine the weighted feature fusion network and attention mechanism, and optimize the model performance using MPDIoU loss function, and improve detection accuracy and efficiency through multi-dimensional feature learning and bidirectional feature fusion.

Benefits of technology

It improves the accuracy and efficiency of stacked parts detection, enhances the adaptability to irregular shape targets, reduces positioning errors caused by occlusion and overlap, simplifies the calculation amount and improves the convergence speed of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120279254A_ABST
    Figure CN120279254A_ABST
Patent Text Reader

Abstract

The invention discloses a stacked part positioning method in combination with a weighted feature fusion network and an attention mechanism, and the method comprises the following steps: S1, building a YOLO11 target detection model in combination with the weighted feature fusion network and the attention mechanism, collecting part image data, inputting the enhanced image data into a backbone network, and carrying out the recognition of the backbone network; carrying out feature extraction through a C3K2-MCA module provided by the invention to obtain a feature map; and S2, taking the feature map output by the backbone network as input, inputting the feature map into a feature fusion layer of the model, and continuing to use a C3K2-MCA module in the feature fusion layer to further refine the features. A C3K2-MCA module is put forward, the modeling capability of the model on multiple dimensions such as channels, widths and heights of irregular objects is enhanced, and the model can effectively capture finer shape features in a complex scene, especially under the condition that parts are stacked or shielded.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of stacked part positioning. Specifically, it relates to a stacked part positioning method combining a weighted feature fusion network and an attention mechanism. Background Art

[0002] In recent years, object detection technology has been widely used in the field of industrial automation, especially in part recognition and detection. With the rapid development of deep learning, the performance of object detection algorithms has been significantly improved. However, existing object detection algorithms (such as YOLO, RCNN, SSD, DETR, etc.) still have some problems to be solved when dealing with complex stacked scenarios. Traditional object detection algorithms have the following disadvantages:

[0003] (1) Poor detection effect in stacked scenarios. In the detection scenario of industrial parts, parts may have large scale changes in the image due to partial occlusion and overlap. Traditional object detection algorithms usually rely on fixed anchor boxes and single-scale feature maps, which makes it difficult for them to accurately identify and locate objects when dealing with irregular objects. Therefore, existing methods have deficiencies in processing multi-scale information and cannot effectively cope with the complex shapes of stacked parts. In the YOLO algorithm and the SSD algorithm, due to the inability of the anchor box settings to adapt to the diversity of object shapes, partial occlusion of stacked parts may cause some targets to be misidentified as the background or other objects. Although the RCNN algorithm can generate relatively accurate candidate regions, its ability to identify occluded objects is still limited, resulting in a decrease in the detection accuracy of stacked objects.

[0004] (2) Insufficient learning of deep features. Although existing object detection algorithms can capture local features well, in stacked scenarios, stacked objects may make it difficult to fuse deep features due to occlusion and partial overlap, and the lack of these deep features will affect the precise positioning of the target. In addition, these algorithms also have certain defects in the fusion of global context information and are difficult to comprehensively capture the spatial relationships in the image, especially in stacked scenarios with small target intervals and large overlaps.

[0005] (3) High computational complexity. The DETR algorithm models global information through the Transformer structure and can overcome the limitations of local feature extraction to a certain extent. However, the DETR has a high computational complexity, and the training process is time-consuming and the training efficiency is low. In stacked scenarios, due to the mutual occlusion and complexity of target objects, although the DETR can process global information, it still faces challenges in detail capture and efficient training, and may lead to problems such as overfitting.

[0006] Therefore, a new method is needed to overcome the above deficiencies and improve the accuracy and efficiency of object detection in stacked scenarios.

[0007] In view of this, the present invention is specifically proposed. Summary of the Invention

[0008] In response to the above problems, the present invention proposes an object detection model. First, aiming at the problem of insufficient modeling ability of existing methods for the three dimensions of channels, width, and height of irregular objects, the present invention proposes the C3K2-MCA structure, that is, in the Bottleneck structure of the YOLO11 backbone network, the MCA (Multidimensional Collaborative Attention) attention module is introduced in a parallel connection manner; to solve the problem of insufficient multi-scale feature expression ability of existing object detection algorithms, the present invention proposes the BiFPN-Concat structure, which is used in the feature fusion layer (Neck) of the network. By introducing bidirectional connections in the feature pyramid, top-down and bottom-up feature fusion is achieved, enabling more accurate shape features to be learned in the stacked part detection scenario, thereby achieving better detection effects. At the same time, the MPDIoU (Minimum Point Distance Intersection over Union) loss function is used to replace the original IOU (Intersection over Union) loss function of the model to comprehensively consider the overlapping area and improve the recognition accuracy of stacked parts and the convergence speed of the model. Specifically, it includes the following steps:

[0009] A stacked part localization method combining a weighted feature fusion network and an attention mechanism, characterized by the following steps: Step S1, collect part images, and perform data augmentation and dataset division on the dataset; Step S2, build a YOLO11 object detection model combining a weighted feature fusion network and an attention mechanism, input the augmented image data into the backbone network, and obtain a feature map through feature extraction by the C3K2-MCA module of the backbone network; Step S3, use the feature map output by the backbone network as input, input it into the feature fusion layer of the model, continue to use the C3K2-MCA module in the feature fusion layer to further refine the features, and use the BiFPN-Concat structure in the model feature fusion layer to effectively integrate features at different levels through bidirectional cross-scale connection and weighted feature fusion, improving the model's detection ability for occluded parts. Step S4, use the MPDIoU (Minimum Point Distance Intersection over Union) loss function to replace the IoU (Intersection over Union) loss function to optimize the model performance, and by minimizing the distance between the predicted box and the key points of the true box, comprehensively consider the overlapping area, the distance between the center points, and the aspect ratio deviation, improving the localization accuracy and convergence speed of the model. Step S5, adjust relevant hyperparameters, train the model, use the principle of backpropagation to dynamically adjust the model parameters, and use the test dataset to comprehensively evaluate the detection effect of the model.

[0010] The stacked part localization method combining a weighted feature fusion network and an attention mechanism provided by the present invention should also have the following features: Among them, Step S1 includes the following sub-steps: Step S1-1, obtain part images in a real scenario; Step S1-2, use the LabelImg software to annotate the detection boxes for object detection of the images, thereby obtaining an initial dataset; Step S1-3, perform data augmentation on the images in the initial dataset using methods such as random rotation, random adjustment of brightness and contrast, random cropping, and random Gaussian blur to enrich the data volume of the dataset, with a total of 10,000 groups of data, and divide the dataset into a training set, a validation set, and a test set at a ratio of 8:1:1.

[0011] The stacked part localization method combining a weighted feature fusion network and an attention mechanism provided by the present invention should also have the following features: Among them, Step S2 includes the following sub-steps: Step S2-1, input the image data into the YOLO11 backbone network, perform feature extraction through several CBS convolution modules, and obtain a rough feature map; Step S2-2, use the C3K2-MCA module proposed by the present invention for further feature extraction, and use the MCA attention mechanism to increase the model's multi-scale feature learning ability for irregular objects to obtain a feature map.

[0012] The stacked part localization method combining a weighted feature fusion network and an attention mechanism provided by the present invention should also have the following features: In step S2-2, the MCA attention mechanism in the C3K2-MCA module is integrated into the C3K2 module in a parallel connection manner, and the mathematical expression of the MCA attention mechanism is:

[0013] F GAP = GAP(F) (1)

[0014] F GSP = GSP(F) (2)

[0015] W c = σ(W2 · δ(W1 · [F GAP ; F GSP )) (3)

[0016] F height = AvgPool(F) + StdPool(F) (4)

[0017] W h = σ(W h ′ · δ(F height )) (5)

[0018] W w = σ(W′ w · δ(F width )) (6)

[0019] F MCA = F × W c × W h × W w (7)

[0020] In the formula, F is the input feature map, F GAP , F GSP are the description vectors of the channel dimension obtained by performing global average pooling (GAP) and global standard deviation pooling (GSP) on the input feature map F; W1 and W2 are learnable weight matrices, δ represents the ReLU (Rectified Linear Unit) activation function, σ represents the Sigmoid activation function, and [;] represents the vector concatenation operation. W C is the channel attention weight generated by concatenating the two vectors F GAP , F GSP and passing through a fully connected layer and an activation function; AvgPool is average pooling, StdPool is standard deviation pooling, F height , F wigth respectively represent the description vectors of height and width obtained by performing average pooling and standard deviation pooling on the input feature map in the height and width dimensions and adding them; Wh , W w To generate the attention weights of height and width of the F height , F wigth vector through the shared fully-connected layer and activation function; F MCA is the result of applying the attention weights of the above three dimensions to the input feature map to achieve multi-dimensional feature recalibration, where × represents element-wise multiplication.

[0021] The stacked part localization method combining the weighted feature fusion network and the attention mechanism provided by the present invention should also have the following features: Among them, step S3 includes the following sub-steps: Step S3-1, taking the feature map output by the backbone network as the input and inputting it into the feature fusion layer of the model. In the feature fusion layer, the C3K2-MCA module is continued to be used to further refine the features; Step S3-2, using the BiFPN-Concat structure proposed by the present invention in the model feature fusion layer. The bidirectional feature fusion ability of BiFPN-Concat enables the model to better capture the differences between the target and the background, improve the detection accuracy, and enables the model to simultaneously focus on large-size and small-size targets, enhancing the detection ability for targets of different scales; in the stacked scenario, the weighted fusion mechanism of BiFPN-Concat enables the model to more effectively integrate the context information and reduce the detection errors caused by occlusion and overlap.

[0022] The stacked part localization method combining the weighted feature fusion network and the attention mechanism provided by the present invention should also have the following features: In step S3-2, the BiFPN-Concat structure has the characteristic of bidirectional feature fusion and can realize the fusion of multi-scale features through the top-down and bottom-up bidirectional paths; when fusing features of different resolutions, BiFPN-Concat assigns learnable weights to each input feature to dynamically adjust the contribution degree of features of different resolutions in the global feature, simplifies the network structure, and can improve the model performance while reducing the computational amount. The mathematical expression of the BiFPN-Concat is:

[0023]

[0024] In the formula, P i represents the output feature map of the i-th layer; represents the index set of the input feature maps connected to the i-th layer; U j represents the j-th input feature map, which is appropriately upsampled or downsampled to match the size of P i . w jis a learnable weight, representing the importance of the j-th input feature map; ∈ is a small constant used to avoid division-by-zero errors. In the stacking scenario, the multi-scale feature fusion ability of BiFPN-Concat enables the model to simultaneously focus on large-size and small-size objects, improving the detection ability for objects of different scales. At the same time, the weighted fusion mechanism of BiFPN-Concat enables the model to adaptively adjust the fusion method of feature maps and more effectively extract features of irregular shapes.

[0025] The stacking part positioning method combining a weighted feature fusion network and an attention mechanism provided by the present invention should also have the following characteristics: In step S4, the mathematical expression of the MPDIoU loss function is:

[0026]

[0027] In the formula, IoU represents the intersection over union of the predicted bounding box and the ground truth bounding box. d1 and d2 respectively represent the Euclidean distances between the upper left and lower right points of the predicted bounding box and the ground truth bounding box. w and h respectively represent the width and height of the ground truth bounding box. By directly minimizing the distance between the key points of the bounding boxes, MPDIoU can more accurately align the predicted bounding box and the ground truth bounding box, reducing the positioning error caused by occlusion and overlap; at the same time, MPDIoU can enhance the adaptability to irregular shapes and more effectively process objects with complex shapes by aligning key points, improving the detection performance.

[0028] Compared with the prior art, the beneficial effects of the present invention are:

[0029] The C3K2-MCA module is proposed to enhance the model's multi-dimensional modeling ability for channels, widths, heights, etc. of irregular objects, enabling the model to effectively capture more detailed shape features in complex scenarios, especially in cases of part stacking or occlusion.

[0030] The BiFPN-Concat structure is proposed, which combines the mechanism of bidirectional feature fusion and can better integrate features of different scales. This structure is suitable for stacking part positioning, improving the detection accuracy of the model for large-size and small-size objects, ensuring the integrity of the feature information of occluded parts, and enhancing the model's detection ability for occluded parts.

[0031] The MPDIoU loss function is introduced to replace the traditional IoU loss function, more precisely minimizing the key point distance between the predicted bounding box and the ground truth bounding box, reducing the positioning error caused by occlusion and overlap areas, enhancing the adaptability to irregular-shaped objects, and improving the detection accuracy and the convergence speed of training.

[0032] The following further describes in detail the specific embodiments of the present invention with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 is the implementation flowchart of the present invention;

[0034] Figure 2 is the algorithm structure diagram of the detection model of the present invention;

[0035] Figure 3 is the structure diagram of the basic feature extraction module C3K2 of the present invention;

[0036] Figure 4 is the structure diagram of the attention mechanism module MCA of the present invention;

[0037] Figure 5 is the improved BottleNeck structure diagram of the present invention;

[0038] Figure 6 is the structure diagram of the feature fusion module BiFPN-Concat of the present invention;

[0039] Figure 7 is the schematic diagram of the input stacked scene parts of the present invention;

[0040] Figure 8 is the schematic diagram of the output stacked scene stacked parts positioning result of the present invention. Detailed implementation manners

[0041] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments in conjunction with the accompanying drawings in the embodiments of the present invention. The following embodiments are used to illustrate the present invention.

[0042] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.

[0043] The present invention provides a stacked parts positioning method combining a weighted feature fusion network and an attention mechanism, as shown in Figure 1 and Figure 2 , which is characterized by including the following steps:

[0044] Step S1, collect part images, perform data augmentation, and then perform dataset division.

[0045] Among them, step S1 includes the following sub-steps:

[0046] Step S1-1: Obtain images of stacked parts and non-stacked parts in the real scenario. The part images are collected using the FM851-E1 camera of Tuyang Technology. A total of 13 types of industrial part images are collected, and the part categories are: hexagon screw, T-shaped screw, hexagon steel column, key bar, spirit level, rectangular nut, hexagon copper column, double-pass hexagon column, flange nut, round head screw, hexagon nut, spring washer, plastic spacer column. Step S1-2: Use the LabelImg software to annotate the detection frames for object detection of the images, thus obtaining the initial dataset. Step S1-3: For the images in the initial dataset, perform data augmentation by means of random rotation, random adjustment of brightness, contrast, random cropping, random Gaussian blur, etc. to enrich the data volume of the dataset. There are a total of 10,000 groups of data, and the dataset is divided into a training set, a validation set, and a test set in a ratio of 8:1:1.

[0047] Step S2: Build the YOLO11 stacked part localization model. Input the augmented image data into the backbone network. After feature extraction by the C3K2-MCA module of the backbone network, enhance the multi-scale feature learning ability of the model for irregular objects to obtain the feature map.

[0048] Among them, Step S2 includes the following sub-steps:

[0049] Step S2-1: Input the image data after data augmentation into the YOLO11 backbone network, and perform feature extraction through several CBS convolution modules to obtain a rough feature map. Step S2-2: Use the C3K2-MCA module and the CBS convolution module for further feature extraction, and use the MCA attention module to enhance the multi-scale feature learning ability of the model for irregular objects to obtain the feature map.

[0050] In Step S2-2, the MCA attention mechanism is integrated into the original C3K2 module of the model in a parallel connection manner. The MCA attention mechanism is as Figure 3 shown. This module reconstructs the feature map into three-dimensional representations of C×H×W, W×H×C, and H×C×W respectively, and uses squeeze transformation and excitation transformation to model attention to enhance the feature representation ability of the network. In order to make the network pay more attention to the target size features in the original feature map rather than more abstract feature information, the present invention uses a parallel fusion structure to integrate the MCA attention mechanism module into the Bottleneck structure of the C3K2 module, so that the network pays more attention to the specific target size information and learns it, as Figure 4 shown.

[0051] Step S3: Use the feature map output by the backbone network as the input and input it into the feature fusion layer of the model. In the feature fusion layer, use the C3K2-MCA structure, and use the BiFPN-Concat structure in the feature fusion layer of the model. In the stacking scenario, BiFPN-Concat can ensure that the features of the occluded parts can be supplemented by the context information, improving the model's detection ability for occluded parts.

[0052] Among them, step S3 includes the following sub-steps:

[0053] Step S3-1: Use the feature map output by the backbone network as the input and input it into the feature fusion layer of the model. Continue to use the C3K2-MCA module in the feature fusion layer to further refine the features; Step S3-2: Use the BiFPN-Concat structure proposed by the present invention in the feature fusion layer of the model. The bidirectional feature fusion ability of BiFPN-Concat enables the model to better capture the difference between the target and the background, improving the detection accuracy, and enabling the model to simultaneously focus on large-size and small-size targets, enhancing the detection ability for targets of different scales; in the stacking scenario, the weighted fusion mechanism of BiFPN-Concat enables the model to more effectively integrate the context information and reduce the detection errors caused by occlusion and overlap.

[0054] Among them, in step S3-2, the BiFPN-Concat structure has the characteristic of bidirectional feature fusion and can achieve the fusion of multi-scale features through the top-down and bottom-up bidirectional paths; when fusing features of different resolutions, BiFPN-Concat assigns learnable weights to each input feature to dynamically adjust the contribution degree of features of different resolutions in the global feature; BiFPN-Concat simplifies the network structure by removing redundant nodes and edges, which can improve the model performance while reducing the computational amount; as Figure 6 shown, the bidirectional feature fusion ability of BiFPN-Concat enables the model to better capture the difference between the target and the background, improving the detection accuracy; in the face of the different sizes and shapes of the stacked parts, the weighted fusion mechanism of BiFPN-Concat enables the model to adaptively adjust the fusion method of the feature map and more effectively extract the features of irregular shapes.

[0055] Step S4: Use the MPDIoU (Minimum Point Distance Intersection over Union) loss function to replace the IoU (Intersection over Union) loss function to optimize the model performance and improve the localization accuracy and convergence speed of the model.

[0056] In step S4, the MPDIoU has the following characteristics: When collecting image data, it is affected by problems such as shooting angles, camera parameters, and environmental factors. There will be some low-quality samples in the dataset. Moreover, when the targets are severely stacked, there will also be certain errors in the target boxes in the manually labeled dataset. These low-quality samples will cause certain interference during model prediction, thereby increasing the IoU loss. To reduce the impact of low-quality samples, MPDIoU minimizes the distance between the upper-left and lower-right points of the predicted box and the ground truth box to ensure the precise alignment of the bounding boxes, so as to improve the localization accuracy of the model for low-quality samples, thereby minimizing the impact of low-quality samples.

[0057] Step S5: Adjust relevant hyperparameters and train the improved YOLO11 model. During the training process, use the principle of backpropagation to dynamically adjust the model parameters to obtain the optimal performance model. At the same time, after completing the selection of the optimal parameters, use the test dataset to comprehensively evaluate the detection effect of the model. Among them, the main evaluation indicators of the model are the mean average precision (mAP), precision, recall, and the number of parameters (Params);

[0058] In step S5, the specific process of training the improved YOLO11 model includes: The number of warm-up rounds for the hyperparameter selection learning rate is 3, the final learning rate is 0.01, and cosine learning rate decay is set. Iteratively train for 200 rounds. Input the training set into the improved YOLO11 object detection model for training, and use the model weight file with the best performance to evaluate its results. Use mAP, Precision, Recall, Params, and as the evaluation criteria for the improved network model. Among them, mAP is a key indicator to measure the model performance. By first setting a certain intersection over union (IoU) threshold, calculate the average precision (AP) for each category, and then take the average of the APs for all categories to reflect the detection accuracy of the model on all categories. The higher the mAP value, the better the detection performance of the model. In addition, the number of parameters and computational complexity of the model also affect the model during real-time detection. The evaluation formula of the model is as follows:

[0059]

[0060] Wherein, TP (True Positive) represents the total number of samples that the model correctly predicts as positive samples when the actual samples are positive; FP (False Positive) represents the total number of samples that the model incorrectly predicts as positive samples when the actual samples are negative; FN (False Negative) represents the total number of samples that the model incorrectly predicts as negative samples when the actual samples are positive. Precision is the number of samples predicted as positive and actually positive divided by the total number of samples predicted as positive. Recall is the number of samples predicted as positive and actually positive divided by the total number of samples that are actually positive. AP represents the area under the Precision-Recall curve, which is used to measure the performance of the model on a specific category. mAP is the mean of the APs for all categories, reflecting the overall performance of the model in multi-category tasks.

[0061] Therefore, to verify that the improvements in the original YOLO11 network structure of the present invention can all have a positive impact on the final results, the performance of the original YOLO11 model in the dataset of the present invention is used as a benchmark to conduct ablation experiments and comparative experiments. The evaluation metrics such as mAP50, mAP50:95, Precision, and Recall are used in this experiment:

[0062] Table 1 Performance comparison table of three improved versions of YOLO11

[0063]

[0064] Table 2 Performance comparison between the model of the present invention and other existing models

[0065]

[0066] As can be seen from Table 1, the average accuracy of the YOLO11 object detection model after adopting the three improvement methods provided by the present invention is the highest, with the mAP50 value being 0.874, which is 8.4% higher than that of the original YOLO11 network model; as can be seen from Table 2, the mAP values of the model YOLO11-MBM integrating the three improvement methods of the present invention are all better than those of the existing best-performing object detection models, and are similar to the performance of the RT-DETR model. Compared with RT-DETR, the parameter quantity of the YOLO11-MBM of the present invention is reduced by 50.94%; although the parameter quantity of the improved model is slightly increased by 1.5% compared with the original YOLO11 object detection model, it still meets the requirements of lightweight and real-time detection of the YOLO series models.

[0067] The present invention aims at the detection of irregular parts in a stacking scenario and proposes a stacking part localization method that combines a weighted feature fusion network and an attention mechanism. The main innovation points are as follows: The present invention proposes a C3K2-MCA module, which integrates a multi-dimensional collaborative attention mechanism (MCA) into the Bottleneck structure of the YOLO11 backbone network through a parallel connection method, enhancing the feature extraction ability of the model in multiple dimensions, especially showing better adaptability to the detection of complex shapes and irregular targets; aiming at the deficiencies of existing object detection models in multi-scale feature fusion, the present invention proposes a BiFPN-Concat structure, which combines bidirectional cross-scale connections and weighted feature fusion, effectively exchanging information between feature maps of different resolutions, strengthening the model's detection ability for large-size and small-size targets, and showing higher precision and robustness in part stacking and occlusion scenarios; an MPDIoU loss function is introduced to replace the traditional IoU loss function. By minimizing the Euclidean distance between the predicted box and the key points of the ground truth box, the bounding boxes are more accurately aligned, showing higher localization accuracy when dealing with occluded, overlapping, and irregularly shaped targets, and significantly improving the detection performance and convergence speed of the model. The combination of these innovation points enables the improved YOLO11 model to significantly improve the detection accuracy and efficiency of irregular parts in complex stacking scenarios.

[0068] It should be emphasized here that the above specific implementation schemes further elaborate on the purpose, technical solutions, and effects of the present invention. These embodiments are only used to illustrate the technical solutions of the present invention and do not limit the scope of its protection. Those skilled in the art should understand that any modification or equivalent replacement made within the technical solutions of the present invention should be included within the protection scope of the present invention.

Claims

1. A stacked part localization method combining a weighted feature fusion network and an attention mechanism, characterized in that, The steps include the following: Step S1: Build a YOLO11 object detection model that combines a weighted feature fusion network and an attention mechanism. Collect part image data, input the enhanced image data into the backbone network, and perform feature extraction through the C3K2-MCA module proposed in the present invention to obtain a feature map. Step S2: Use the feature map output by the backbone network as input and input it into the feature fusion layer of the model. Continue to use the C3K2-MCA module in the feature fusion layer to further refine the features, and use the BiFPN-Concat structure proposed in the present invention in the model feature fusion layer to effectively integrate features at different levels through bidirectional cross-scale connection and weighted feature fusion, improving the model's detection ability for occluded parts. Step S3: Use the MPDIoU (Minimum PointDistance Intersection over Union) loss function to replace the IoU (Intersection over Union) loss function to optimize the model performance. By minimizing the distance between the predicted bounding box and the key points of the ground truth bounding box, comprehensively considering the overlapping area, the distance between the center points, and the aspect ratio deviation, improve the model's positioning accuracy and convergence speed. Step S4: Adjust relevant hyperparameters, train the model, use the principle of backpropagation to dynamically adjust the model parameters, and use the test data set to comprehensively evaluate the detection effect of the model.

2. The stacking part positioning method combining a weighted feature fusion network and an attention mechanism according to claim 1, wherein The step S1 includes the following sub-steps: Step S1-1: Input the image data after data augmentation into the YOLO11 backbone network, and perform feature extraction through several CBS convolution modules to obtain a rough feature map. Step S1-2: Use the C3K2-MCA module and the CBS convolution module proposed in the present invention for further feature extraction, and use the MCA attention module to increase the model's multi-scale feature learning ability for irregular objects to obtain a feature map.

3. A stacked part localization method combining a weighted feature fusion network and an attention mechanism according to claim 2, characterized in that, In step S1-2, the MCA attention mechanism is integrated into the C3K2 module structure in a parallel connection manner. The feature map is respectively reconstructed into three-dimensional representations of C×H×W, W×H×C, and H×C×W, and the squeeze transformation and excitation transformation are respectively used to model the attention to improve the network's feature representation ability, enabling the network to pay more attention to specific target size information and learn it.

4. A stacked part localization method combining a weighted feature fusion network and an attention mechanism according to claim 1, characterized in that The step S2 includes the following sub-steps: Step S2-1: Use the feature map output by the backbone network as input and input it into the feature fusion layer of the model. Continue to use the C3K2-MCA structure in the feature fusion layer to further refine the features. Step S3-2: Use the BiFPN-Concat structure proposed in the present invention in the model feature fusion layer. Utilize its bidirectional feature fusion ability to enable the model to capture the difference between the target and the background, improve the detection accuracy, and enable the model to simultaneously pay attention to large-size and small-size targets, enhancing the detection ability for targets of different scales and reducing detection errors caused by occlusion and overlap.

5. A stacked part localization method combining a weighted feature fusion network and an attention mechanism according to claim 4, characterized in that The step S2 includes the following sub-steps: Step S2-1, taking the feature map output by the backbone network as the input and inputting it into the feature fusion layer of the model. In the feature fusion layer, the C3K2-MCA structure is continued to further refine the features; Step S3-2, using the BiFPN-Concat structure proposed by the present invention in the model feature fusion layer. By utilizing its bidirectional feature fusion ability, the model can capture the differences between the target and the background, improve the detection accuracy, and enable the model to simultaneously focus on large-size and small-size targets, enhance the detection ability for targets of different scales, and reduce the detection errors caused by occlusion and overlap.

6. The stacked part localization method combining a weighted feature fusion network and an attention mechanism according to claim 1, wherein In step S3, MPDIoU can more accurately align the predicted box and the ground truth box by directly minimizing the distance between the key points of the bounding box, reducing the positioning error caused by occlusion and overlap; at the same time, MPDIoU can enhance the adaptability to irregular shapes, and more effectively process targets with complex shapes through the key point alignment method, improving the detection performance.

Citation Information

Cited By

  • Photovoltaic module defect detection method and device, storage medium and computer equipment

    CN120997132A