Part counting method and device, electronic equipment, medium and product

By training a dedicated feature point detection neural network, the problems of poor recognition of dark and silver parts and part occlusion were solved, achieving high-precision part counting, which is suitable for automobile manufacturing and assembly line inspection.

CN121598983APending Publication Date: 2026-03-03GAC HONDA AUTOMOBILE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511502030.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-21
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

Existing technologies perform poorly in identifying dark-colored and silver reflective parts, and their counting accuracy is insufficient in scenarios where parts are closely stacked or obscured, making it difficult to meet high-precision requirements.

Method used

A multi-network collaborative approach is adopted to train a dedicated feature point detection neural network. By recognizing the locally visible features of parts, combined with an improved attention mechanism and region proposal network, feature points of parts are identified and separated. An end-to-end training method is used to adapt to parts of different shapes and sizes.

Benefits of technology

It improves counting accuracy in complex scenarios, especially when parts are partially covered, and can still accurately count the number of parts, meeting real-time requirements. It is suitable for industrial scenarios such as automobile manufacturing and assembly line quality inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121598983A_ABST
    Figure CN121598983A_ABST
Patent Text Reader

Abstract

The invention provides a part counting method and device, electronic equipment, a medium and a product, and aims to improve the counting precision in a complex scene through multi-network cooperation, train a special feature point detection neural network for the problem that sheet parts (such as gaskets and stamping parts) are easy to stack and shield, and improve the counting precision. The network can identify local visible features (such as edge contours and center holes) of the parts, even if the parts are partially covered, the number can still be accurately counted through key point matching, the problem of missing detection caused by shielding in a traditional method is effectively solved, and the network can be widely applied to multiple industrial scenes such as automobile manufacturing and assembly line quality detection. And by deploying the lightweight network model, the real-time requirement can be met, and reliable technical support is provided for intelligent manufacturing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of parts counting technology, and more specifically, to a parts counting method, apparatus, electronic device, medium, and product. Background Technology

[0002] Currently, various products and patents use image capture of target parts, computer image processing and calculation, and then calculate the number of parts in the captured image based on the image processing results. One existing method for counting parts based on image processing includes: taking a picture of all parts to be counted by tiling them flat; processing the captured part image into a grayscale image; binarizing the grayscale image into a binary image; performing morphological opening and closing operations on the binary image; filtering the image after morphological opening and closing operations; processing the filtered image using a watershed algorithm; and counting and labeling the parts in the image processed by the watershed algorithm to obtain the number of parts.

[0003] However, the above method for counting parts has obvious limitations, mainly in the following two aspects: First, the grayscale and binary image-based processing methods perform poorly in identifying dark-colored and silver reflective parts. Because the grayscale values ​​of dark-colored parts are close to the background, and silver reflective parts suffer from localized overexposure or uneven grayscale due to light reflection, they are prone to misclassification during binarization. For example, dark-colored parts may be missed due to insufficient contrast, while silver reflective areas may be incorrectly segmented into multiple regions due to brightness fluctuations, leading to a significant decrease in the recognition rate. Furthermore, changes in lighting conditions further exacerbate this problem, making the algorithm less robust.

[0004] Secondly, existing technologies rely on morphological opening and closing operations for filtering, but their effectiveness is limited in scenarios where parts are tightly stacked and mutually occluded. While opening operations can remove fine noise, they may mistakenly eliminate features of small-sized parts; closing operations can fill gaps, but they easily lead to the merging of adhered parts. When parts are intersecting or partially occluded, morphological operations cannot accurately separate the targets, resulting in serious deviations in statistical counts. For example, stacked metal parts may be identified as a single object due to edge adhesion, and complex occlusion relationships further interfere with contour extraction, making it difficult for existing algorithms to meet the requirements of high-precision counting. Summary of the Invention

[0005] This invention provides a method, apparatus, electronic device, medium, and product for counting parts, solving the technical problem that existing technologies cannot effectively identify stacked metal parts.

[0006] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows: A first aspect of the present invention provides a method for counting parts, comprising the following steps: Scan the tag containing the part to be identified to obtain the part type; Obtain a first part recognition model and a second part recognition model based on the part type; Acquire an image including the part to be identified, and determine whether the part in the image is stacked or laid flat based on preset basic part information; If the parts in the image are stacked, the first part recognition model is used to identify the feature points of the first part in the image, and the number of feature points of the first part is counted. If the parts in the image are laid flat, the second part recognition model is used to identify the parts in the image and the number of flat parts is counted. The number of parts to be identified is obtained based on the number of feature points of the first part and the number of parts laid flat.

[0007] Furthermore, the first part recognition model is trained using a dataset of part images labeled with the feature points of the first part, and the second part recognition model is trained using a dataset of part images labeled with flat parts.

[0008] Furthermore, the image including the part to be identified also includes a part packaging box for preventing the part from being exposed. The part packaging box recognition model is used to identify the part packaging box in the image and cut out the image of the part packaging box. Then, based on the preset basic information of the part, it is determined whether the part in the image of the part packaging box is stacked or laid flat.

[0009] Furthermore, after cutting out the image of the parts packaging box, the angle of the image of the parts packaging box is also corrected.

[0010] Furthermore, the image of the parts packaging box is angle-corrected, including: Adjust the parts packaging box to minimize its width when placed horizontally, and then correct the angle of the image of the parts packaging box.

[0011] Furthermore, before using the first part recognition model to identify the first part feature points in the image or using the second part recognition model to identify the parts in the image, the image is preprocessed.

[0012] A second aspect of the present invention provides a parts counting device, comprising: The scanning module scans the tag containing the part to be identified to obtain the part type; A model acquisition module, wherein the model acquisition module acquires a first part recognition model and a second part recognition model according to the part type; The judgment module acquires an image including the part to be identified, and determines whether the part in the image is stacked or laid flat based on preset basic part information. The stacking processing module, when the parts in the image are in a stacked state, uses the first part recognition model to identify the first part feature points in the image and counts the number of the first part feature points. The flat processing module, when the parts in the image are in a flat state, uses the second part recognition model to identify the parts in the image and counts the number of flat parts. The quantity statistics module obtains the quantity of the parts to be identified based on the quantity of feature points of the first part and the quantity of the flat parts.

[0013] A third aspect of the present invention provides an electronic device including a processor and a memory, wherein the memory stores a computer program that, when executed by the processor, implements the steps of the part counting method described in the first aspect of the present invention.

[0014] A fourth aspect of the present invention provides a computer storage medium storing a computer program that, when executed by a processor, implements the steps of the parts counting method described in the first aspect of the present invention.

[0015] A fifth aspect of the present invention provides a computer program product that, when executed by a processor, implements the steps of the part counting method described in the first aspect of the present invention.

[0016] Compared with the prior art, the beneficial effects of the technical solution of the present invention are: This invention provides a method, apparatus, electronic device, medium, and product for counting parts. Through multi-network collaboration, it improves counting accuracy in complex scenarios. Addressing the issue of easily stacked and occluded thin-sheet parts (such as gaskets and stamped parts), a dedicated feature point detection neural network is trained. This network can identify locally visible features of parts (such as edge contours and center holes). Even if parts are partially covered, it can still accurately count the number of parts through key point matching, effectively solving the problem of missed detections caused by occlusion in traditional methods. It can be widely applied in various industrial scenarios such as automobile manufacturing and assembly line quality inspection. By deploying a lightweight network model, this invention also meets real-time requirements, providing reliable technical support for intelligent manufacturing. Attached Figure Description

[0017] Figure 1 This is a flowchart illustrating a parts counting method provided in an embodiment of the present invention; Figure 2This is an overall framework diagram of a parts counting method provided in an embodiment of the present invention; Figure 3 A schematic diagram illustrating the principle of part box angle correction provided in an embodiment of the present invention; Figure 4 A flowchart of the parts box positioning and cutting process provided in an embodiment of the present invention; Figure 5 A flowchart for counting stacked components provided in an embodiment of the present invention; Figure 6 This is a flowchart illustrating the technology of a flat component provided in an embodiment of the present invention. Figure 7 This is a schematic diagram of a parts counting device provided in an embodiment of the present invention. Detailed Implementation

[0018] The accompanying drawings are for illustrative purposes only and should not be construed as limiting the scope of this patent. To better illustrate this embodiment, some parts in the accompanying drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions; It will be understood by those skilled in the art that certain well-known structures and their descriptions may be omitted in the accompanying drawings.

[0019] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.

[0020] The first embodiment of the present invention provides a method for counting parts, such as... Figure 1 As shown, it includes the following steps: Scan the tag containing the part to be identified to obtain the part type; Obtain a first part recognition model and a second part recognition model based on the part type; Acquire an image including the part to be identified, and determine whether the part in the image is stacked or laid flat based on preset basic part information; If the parts in the image are stacked, the first part recognition model is used to identify the feature points of the first part in the image, and the number of feature points of the first part is counted. If the parts in the image are laid flat, the second part recognition model is used to identify the parts in the image and the number of flat parts is counted. The number of parts to be identified is obtained based on the number of feature points of the first part and the number of parts laid flat.

[0021] like Figure 2 The diagram shown is an overall framework diagram of a parts counting method. The process of this embodiment will now be explained in detail, and the steps are as follows: 1. Scan the labels of the automotive parts to be identified, read and parse the label information, obtain the number of parts and the counting type, and then call the dedicated AI recognition interface (Part quantity AIrecognition interface, or PQARI for short) developed for different storage types of parts through the management platform to send the command to start recognition; 2. After receiving the instruction, PQARI calls upon its camera hardware to take pictures of the scene to be identified, acquiring the image to be recognized. Since the packaging boxes are casually placed on the workbench by the workers, their orientation is not strictly uniform, resulting in a slight angular deviation in each operation. This leads to the need to collect more sample images for counting and recognizing the parts inside the boxes. To meet the training requirements of fewer samples and improve the part counting recognition rate, the angle of the boxes needs to be automatically corrected. In this embodiment, after acquiring the image of the parts box, the angle is automatically corrected based on the principle that a rectangular horizontal placement occupies the least space. Figure 3 As shown; 3. After PQARI obtains the image of the scene to be recognized, such as... Figure 4 As shown, the PartBox Identification Model (PBIM) is loaded into the PQARI system. PQARI inputs an image into PBIM, which then preprocesses the image, including resizing and normalization. It then uses a YOLOv8 convolutional neural network (CNN) for inference, employing a grid for object detection. Each grid cell predicts whether a part box exists within that cell and determines its position and size. (For each grid cell, multiple bounding boxes are predicted, each containing the object's position and confidence score). Non-maximum suppression is applied to all bounding boxes output by the model to eliminate overlapping bounding boxes and select the bounding box with the highest confidence score. This ensures that each box is detected only once. PBIM then delivers the detection results to PQARI for processing. PQARI uses the ImageCuttingAlgorithm (a cutting algorithm specifically designed for AI image recognition) to cut the detected part boxes, using the cutting results as input for the next recognition step. 4. PQARI retrieves the part type read in the first step and determines its type based on the pre-entered basic part information in the database. If it is a stacked part, it loads the Part Counting Feature Point Recognition Model (PCFPRM), the first part recognition model. PCFPRM is a model specifically designed and trained for counting stacked parts. It is trained and optimized by annotating feature points that can be clearly used for counting when parts are stacked, resulting in an accurate counting model.

[0022] The countable feature points of a part are defined when creating the training dataset for the model. The specific countable feature points are not entirely the same for different types of parts and need to be specified based on the actual situation. For example, some parts have special screw holes that are not easily obscured; the number of these screw holes can be used to calculate the number of parts, making these screw holes obvious countable feature points. Other examples include parts with special angles or edges with special lines. 5. PQARI inputs the image to PCFPRM. After PCFPRM receives the image, it processes it as follows: Figure 5 As shown, the image is preprocessed, including image resizing and normalization, to meet the recognition requirements of PCFPRM. Then, inference is initiated using a YOLOv8 convolutional neural network (CNN). A grid is used in the image for object detection, determining that each grid cell is responsible for predicting the presence of part feature points (feature points are predefined during training and are suitable for quantity calculation). The locations of the feature points are obtained, and the bounding box with the highest confidence pair is selected. PCFPRM returns the set of all detected part feature points to PQARI, which ultimately calculates the quantity. 6. If PQARI retrieves the part type from the first step and determines it to be a flat part, then it loads the Part Counting Recognition Model (PCRM). PQARI inputs the image into the PCRM, such as... Figure 6 As shown, after receiving the image, PCRM preprocesses it, including image resizing and normalization, to meet its recognition requirements. Then, it uses a YOLOv8 convolutional neural network (CNN) for inference, employing a grid for object detection. Each grid cell predicts whether a part exists within that cell, identifies the part's location, and selects the bounding box with the highest confidence level. PCRM returns the set of all detected parts to PQARI, which then calculates the total number of parts. 7. After PQARI calculates the quantity, it compares it with the quantity of parts read from the labels in the first step and outputs the final result.

[0023] This embodiment proposes an automatic counting method for automotive parts based on neural networks, overcoming the limitations of traditional image morphological processing techniques. Unlike traditional morphological algorithms based on edge detection and contour analysis, this method employs deep learning technology, using a composite neural network (YOLO) to achieve accurate identification and counting of automotive parts. This method has the following significant advantages: First, this method can effectively handle complex lighting conditions, especially in mixed scenarios where dark-colored parts and highly reflective silver parts coexist. Through multi-level feature extraction, the neural network can learn deep features unaffected by surface reflection, overcoming the problem of misjudgment on reflective surfaces that is common with traditional methods.

[0024] Secondly, this method demonstrates excellent robustness in complex scenarios common in industrial production, where parts are tightly stacked and mutually occluded. By employing an improved attention mechanism and Region Proposal Network (RPN), it can accurately identify and separate intersecting part entities. Experiments show that even with a part overlap rate of 60%, this method can still maintain a counting accuracy of over 99%.

[0025] Furthermore, this method employs an end-to-end training approach, learning from a large amount of labeled data to adapt to automotive parts of different shapes and sizes without requiring individual parameter adjustments for each part. Compared to traditional methods, this invention exhibits stronger generalization capabilities and can be widely applied to various industrial scenarios such as automotive manufacturing and assembly line quality inspection. By deploying a lightweight network model, this method can also meet real-time requirements, providing reliable technical support for intelligent manufacturing.

[0026] A second embodiment of the present invention provides a parts counting device, such as... Figure 7 As shown, it includes: The scanning module scans the tag containing the part to be identified to obtain the part type; A model acquisition module, wherein the model acquisition module acquires a first part recognition model and a second part recognition model according to the part type; The judgment module acquires an image including the part to be identified, and determines whether the part in the image is stacked or laid flat based on preset basic part information. The stacking processing module, when the parts in the image are in a stacked state, uses the first part recognition model to identify the first part feature points in the image and counts the number of the first part feature points. The flat processing module, when the parts in the image are in a flat state, uses the second part recognition model to identify the parts in the image and counts the number of flat parts. The quantity statistics module obtains the quantity of the parts to be identified based on the quantity of feature points of the first part and the quantity of the flat parts.

[0027] A third embodiment of the present invention provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, it implements the steps of the part counting method described in the first embodiment of the present invention.

[0028] A fourth embodiment of the present invention provides a computer storage medium storing a computer program, which, when executed by a processor, implements the steps of the parts counting method described in the first embodiment of the present invention.

[0029] The fifth embodiment of the present invention is a computer program product, which, when executed by a processor, implements the steps of the parts counting method described in the first embodiment of the present invention.

[0030] The same or similar labels correspond to the same or similar parts; The terms used to describe positional relationships in the accompanying drawings are for illustrative purposes only and should not be construed as limiting this patent. Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the implementation of the present invention. Those skilled in the art can make other variations or modifications based on the above description. It is neither necessary nor possible to exhaustively describe all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the claims of the present invention.

Claims

1. A method for counting parts, characterized in that, Includes the following steps: Scan the tag containing the part to be identified to obtain the part type; Obtain a first part recognition model and a second part recognition model based on the part type; Acquire an image including the part to be identified, and determine whether the part in the image is stacked or laid flat based on preset basic part information; If the parts in the image are stacked, the first part recognition model is used to identify the feature points of the first part in the image, and the number of feature points of the first part is counted. If the parts in the image are laid flat, the second part recognition model is used to identify the parts in the image and the number of flat parts is counted. The number of parts to be identified is obtained based on the number of feature points of the first part and the number of parts laid flat.

2. The parts counting method according to claim 1, characterized in that, The first part recognition model is trained using a dataset of part images labeled with the feature points of the first part, and the second part recognition model is trained using a dataset of part images labeled with flat parts.

3. The parts counting method according to claim 1, characterized in that, The image including the part to be identified also includes a part packaging box for preventing the part from being identified. The part packaging box recognition model is used to identify the part packaging box in the image and cut out the image of the part packaging box. Then, based on the preset basic information of the part, it is determined whether the part in the image of the part packaging box is stacked or laid flat.

4. The parts counting method according to claim 3, characterized in that, After cutting out the image of the parts packaging box, the angle of the image of the parts packaging box is also corrected.

5. The parts counting method according to claim 4, characterized in that, The image of the parts packaging box is angle-corrected, including: Adjust the parts packaging box to minimize its width when placed horizontally, and then correct the angle of the image of the parts packaging box.

6. The part counting method according to any one of claims 1 to 5, characterized in that, Before using the first part recognition model to identify the first part feature point in the image or using the second part recognition model to identify the part in the image, the image is further preprocessed.

7. A parts counting device, characterized in that, include: The scanning module scans the tag containing the part to be identified to obtain the part type; A model acquisition module, wherein the model acquisition module acquires a first part recognition model and a second part recognition model according to the part type; The judgment module acquires an image including the part to be identified, and determines whether the part in the image is stacked or laid flat based on preset basic part information. The stacking processing module, when the parts in the image are in a stacked state, uses the first part recognition model to identify the first part feature points in the image and counts the number of the first part feature points. The flat processing module, when the parts in the image are in a flat state, uses the second part recognition model to identify the parts in the image and counts the number of flat parts. The quantity statistics module obtains the quantity of the parts to be identified based on the quantity of feature points of the first part and the quantity of the flat parts.

8. An electronic device, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program that, when executed by the processor, implements the steps of the part counting method according to any one of claims 1 to 6.

9. A computer storage medium, characterized in that, The computer storage medium stores a computer program, which, when executed by a processor, implements the steps of the parts counting method according to any one of claims 1 to 6.

10. A computer program product, characterized in that, When the computer program product is executed by a processor, it implements the steps of the part counting method according to any one of claims 1 to 6.