Industrial part automatic counting method and system based on deep learning
By combining the DAVE and BoTSORT algorithms, high-precision automatic counting of different parts can be achieved without training, solving the problems of visual fatigue, insufficient robustness and high hardware cost in traditional methods, and making it suitable for parts counting on high-speed production lines.
Patent Information
- Application Number
- CN202511049795.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-29
- Publication Date
- 2025-11-14
AI Technical Summary
Traditional manual counting methods suffer from visual fatigue and systematic missed detection problems in the inspection of high-speed moving parts. Traditional computer vision methods lack robustness in complex industrial environments. Deep learning methods face problems such as data dependence, high hardware costs, and lag in flexible production when applied in industrial applications.
The DAVE algorithm is used for feature extraction, density detection, and bounding box detection, combined with the BoTSORT algorithm for multi-target tracking, enabling automatic part counting. The DAVE algorithm uses ResNet-50 and Transformer for encoding, generating feature representations and predicting bounding boxes, while the BoTSORT algorithm uses Kalman filtering and the Hungarian algorithm for target tracking.
It achieves high-precision and high-recall part inspection, ensuring the accuracy and continuity of counting. It can adapt to different types and shapes of parts without training, reducing preparation time and resource consumption, and is suitable for high-speed production lines.
Smart Images

Figure CN120953204A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, and specifically to an automatic counting method and system for industrial parts based on deep learning. Background Technology
[0002] In modern industrial production systems, parts counting, as a core component throughout the manufacturing process, is not only a key indicator for monitoring production efficiency but also a crucial foundation for building a product quality traceability system. Accurate real-time counting systems provide dynamic decision support for production scheduling, effectively preventing inventory losses and quality risks caused by counting errors. Especially in precision manufacturing, the accuracy of parts counting directly impacts product reliability; even minor errors can trigger a chain reaction of quality problems.
[0003] Traditional manual counting methods have shown fundamental flaws in modern production lines. Prolonged exposure to high-speed moving parts causes visual fatigue for operators, leading to an exponential increase in counting error rates with working hours. In the inspection of micro-parts, the systemic missed detection problem caused by the limitations of human eye resolution is particularly prominent, and this inherent defect severely restricts the implementation of high-precision quality management systems.
[0004] While the introduction of computer vision technology has ushered in a new era of automated counting, traditional image processing methods still have significant shortcomings in complex industrial environments. Morphological processing-based methods struggle to handle misjudgments caused by parts being stacked and sticking together, while threshold segmentation techniques are extremely sensitive to changes in lighting; even slight fluctuations in environmental conditions can lead to severe distortions in detection results. These methods lack robustness in dynamic industrial scenarios and fail to meet the stability requirements of continuous production.
[0005] While deep learning-based object detection methods have improved detection accuracy, their industrial application faces multiple obstacles. Model training requires massive amounts of labeled data, and labeling each part type consumes significant manpower and resources. The complex network structure demands high-performance computing equipment, leading to substantial energy consumption and hardware costs. More importantly, when production lines switch to new parts, traditional models need to be retrained to adapt to the feature changes, and this lag severely hinders the advancement of flexible production.
[0006] This invention overcomes the limitations of existing methods through an innovative technical architecture. First, it automatically captures the essential attributes of parts through unsupervised feature learning, completely eliminating the dependence on labeled data. Second, its plug-and-play nature, requiring no pre-training, provides strong environmental adaptability. More importantly, this invention offers higher accuracy and robustness compared to traditional deep learning detection methods. Summary of the Invention
[0007] The purpose of this invention is to overcome the shortcomings of the existing technology and propose an automatic counting method and system for industrial parts based on deep learning.
[0008] The objective of this invention is achieved through the following technical solution: Firstly, this invention provides an automatic counting method for industrial parts based on deep learning, the method comprising the following steps:
[0009] Step 1: Use a high-speed camera to align with the conveyor belt and capture images of the parts in real time;
[0010] Step 2: Preprocess the acquired images;
[0011] Step 3: Perform target detection on the preprocessed image based on the DAVE algorithm to obtain the detection results;
[0012] Step 4: Use the BoTSORT algorithm to perform multi-target tracking on the detected parts;
[0013] Step 5: Perform statistical analysis on the tracking results to count the parts, and output the counting results in a visual manner.
[0014] Furthermore, in step 3, the DAVE algorithm includes feature extraction, density detection, bounding box detection, and verification stages. The input image is encoded using ResNet-50 and Transformer to generate feature representations, an example prototype is constructed and associated with image features, a similarity tensor is obtained through a self-attention mechanism, a two-dimensional target location density map is generated through a decoder, bounding box parameters are predicted for the target center location to obtain candidate target bounding boxes, features are extracted and clustered from the detected candidate target bounding boxes and labeled examples, outliers are removed, and the final detection result is obtained.
[0015] Furthermore, in the feature extraction stage, the DAVE algorithm first extracts features from the input image using ResNet-50; assuming the input image is... H0 and W0 represent the height and width of the input image, respectively. After ResNet-50 encoding, feature maps are generated. Where h and w are the height and width of the feature map, and d is the number of feature channels; further processing is performed through the Transformer architecture. The Transformer's self-attention mechanism can capture long-distance dependencies between features at different locations in the image, and its calculation formula is as follows:
[0016]
[0017] Q, K, and V represent the query, key, and value matrices, respectively, and this mechanism yields richer semantic features.
[0018] Furthermore, in the density detection phase, the DAVE algorithm constructs example prototypes and associates them with image features to form a similarity tensor; assuming a bounding box group B E There are k example bounding boxes B E ={b i} i=1:k Each example bounding box b i This corresponds to the appearance features of an object; the OPE (Object Prototype Extraction) module extracts example prototypes from the feature map, and obtains a similarity tensor through dot product or other similarity measures. The calculation method is as follows:
[0019]
[0020] Where x and y are the position coordinates of the feature map, c is the feature channel index, and f is the feature map coordinates. I (x,y,c) is the feature value of the c-th channel at position (x,y) in the input image I. i (c) is the feature value of the c-th channel of the i-th bounding box. The similarity tensor is processed by the decoder to generate a two-dimensional target location density map. The formula used to estimate the center position of an object is as follows:
[0021]
[0022] N is obtained from the density map by nonmaximum suppression of NMS. c The center position of the object in Represents the center position coordinates of the i-th object; during density detection, the resolution of the density map is dynamically adjusted to adapt to parts of different sizes and densities.
[0023] Furthermore, in the bounding box detection stage, the DAVE algorithm predicts bounding box parameters for the target center location; assuming the feature map is upsampled to the size of the input image. And through the feature fusion module FFM and the similarity tensor By fusing the features, new feature representations are generated. The bounding box regression head Ω(·) is used to predict bounding box parameters, and the formula is as follows:
[0024]
[0025] Where Δx l Δy t ,Δx r ,Δy bThese are the offsets of the left, top, right, and bottom edges of the bounding box relative to the center position, thus obtaining the candidate target bounding box.
[0026] Furthermore, in the verification phase, the DAVE algorithm extracts features and clusters the detected candidate target bounding boxes and labeled examples, removing outliers; assuming the verification feature set is... The DAVE algorithm clusters features using a spectral clustering algorithm, identifying feature clusters belonging to the same category. In this way, the DAVE algorithm can identify and eliminate outliers, i.e., erroneous detection results, by analyzing the appearance features of candidate regions.
[0027] Furthermore, in step 4, the BoTSORT algorithm uses filtering and matching algorithms to achieve a unique tracking identifier for the target. It uses Kalman filtering to track the target, predicts the target's position in subsequent frames, calculates the similarity between the detection result and the prediction result in the current frame, matches the detection result with the tracked target, and updates the target's tracking information based on the matching result to ensure the continuity and accuracy of the target.
[0028] Furthermore, in the filtering stage, the BoTSORT algorithm uses a Kalman filter to predict and update the target's state; the core of this stage lies in maintaining the target's dynamic information through a state transition model and an observation model; assuming the target's state vector is x = (x, y, v) x ,v y ), where (x,y) represents the position of the target, (v x ,v y () represents the target's velocity; the state transition equation is used to predict the target's position in the next frame, and the current state is... Predicted state The formula is as follows:
[0029]
[0030] Where F is the state transition matrix, B is the control input matrix, and u t It is the control input, set to zero in target tracking; through the Kalman filter, BoTSORT is able to predict the possible location of the target based on previous state information in the absence of new observations.
[0031] Furthermore, in the matching phase, the BoTSORT algorithm performs matching by calculating the similarity between the detected result and the predicted target in the current frame; the matching process employs the Hungarian algorithm to minimize the cost between the detected target and the tracked target; assuming the detected target bounding box is b... det The predicted target bounding box is b pred Similarity is measured by calculating the Intersection over Union (IoU), as shown in the following formula:
[0032]
[0033] Through a matching process, BoTSORT can associate detection results with existing tracked targets, ensuring the continuity of each target in the video sequence; for unmatched detected targets, new tracked targets are created; for unmatched tracked targets, they are marked as lost and reassigned in subsequent frames; specifically, through Kalman gain K... t The target state is updated using the following formula:
[0034] K t =P t - H T HP t - H T +R) -1
[0035]
[0036] Where z t These are the detection observations of the current frame, where H is the observation matrix, R is the observation noise covariance matrix, and P is the detection observations. t - It is the prediction error covariance matrix.
[0037] Secondly, the present invention also provides an automatic counting system for industrial parts based on deep learning, the system comprising:
[0038] The image acquisition module is used to capture images of parts in real time by pointing a high-speed camera at the conveyor belt;
[0039] The preprocessing module is used to preprocess the images acquired by the image acquisition module;
[0040] The target detection module is used to perform target detection on the image preprocessed by the preprocessing module based on the DAVE algorithm, and obtain the detection results.
[0041] The multi-target tracking module is used to perform multi-target tracking on parts detected by the target detection module using the BoTSORT algorithm;
[0042] The counting and statistics module is used to perform statistical analysis on the tracking results of the multi-target tracking module, realize part counting, and output the counting results in a visual manner.
[0043] Compared with existing technologies, this invention has significant advantages. The DAVE algorithm generates high recall and high precision detection results through feature extraction, density detection, bounding box detection, and verification stages, ensuring the accuracy of part counting. It can achieve accurate counting of parts of different types and shapes without training, greatly reducing preparation time and resource consumption. The BoTSORT algorithm, based on filtering and matching algorithms, achieves unique tracking identification of targets, ensuring target continuity and accuracy, and avoiding target loss and miscounting. The system can acquire images, detect targets, track targets, and perform counting statistics in real time, suitable for the part counting needs of high-speed production lines. The counting statistics module has a data caching mechanism. When the system operating speed may affect the timeliness of counting (such as network congestion or temporary busy processing units), it can temporarily cache the counting data and continue accurate counting after the system recovers, avoiding counting errors caused by data loss. Attached Figure Description
[0044] Figure 1 This is a flowchart of the method of the present invention.
[0045] Figure 2 This is a flowchart of the DAVE detection algorithm in this invention, which describes in detail each step of the detection process.
[0046] Figure 3 This is a flowchart of the BoTSORT tracking algorithm in this invention, illustrating the various steps of the tracking process.
[0047] Figure 4 The test results of the system in different scenarios in this invention verify the applicability and stability of the system. Detailed Implementation
[0048] The specific embodiments of the present invention are described below to facilitate understanding of the invention by those skilled in the art. It should be noted that those skilled in the art can make various improvements and modifications to the present invention without departing from its principles, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.
[0049] like Figure 1 As shown, the present invention proposes an automatic counting method for industrial parts based on deep learning, which includes the following steps:
[0050] Step 1: Use a high-speed camera to align with the conveyor belt and acquire images of the parts in real time with high frame rate and high resolution to ensure the real-time performance and accuracy of image acquisition;
[0051] Step 2: The acquired images are processed by grayscale conversion, noise reduction, and normalization to improve image quality and adapt to changes in image quality under different environments;
[0052] Step 3: Use the DAVE algorithm to perform high-precision object detection on the preprocessed image, generating detection results with high recall and high precision. DAVE includes four stages: feature extraction, density detection, bounding box detection, and validation. The input image is encoded using ResNet-50 and Transformer to generate feature representations. Example prototypes are constructed and associated with image features. A similarity tensor is obtained through a self-attention mechanism. A two-dimensional target location density map is generated through a decoder. Bounding box parameters are predicted for the target center location to obtain candidate target bounding boxes. Feature extraction and clustering are performed on the detected candidate target bounding boxes and labeled examples. Outliers are removed to obtain the final detection results, such as... Figure 2 As shown, this algorithm can accurately count parts of different types and shapes without training, greatly reducing preparation time and resource consumption.
[0053] In the feature extraction stage, the DAVE algorithm first extracts features from the input image using ResNet-50. Assume the input image is... After ResNet-50 encoding, feature maps are generated. Where h and w are the height and width of the feature map, and d is the number of feature channels. Further processing using the Transformer architecture generates more expressive feature representations. The Transformer's self-attention mechanism can capture long-distance dependencies between features at different locations in the image, and its calculation formula is as follows:
[0054]
[0055] Q, K, and V represent the query, key, and value matrices, respectively, and this mechanism allows for the acquisition of richer semantic features.
[0056] In the density detection phase, the DAVE algorithm constructs example prototypes and associates them with image features, forming a similarity tensor through a self-attention mechanism to generate a two-dimensional target location density map. This invention assumes a bounding box group B... E There are k example bounding boxes B E ={b i} i=1:k Each example bounding box b i This corresponds to the appearance features of an object. The OPE (Object Prototype Extraction) module extracts example prototypes from the feature map and obtains a similarity tensor through dot product or other similarity metrics. The calculation method is as follows:
[0057]
[0058] The similarity tensor is processed by a decoder to generate a two-dimensional target location density map. The formula used to estimate the center position of an object is as follows:
[0059]
[0060] Extracting the object center location from the density map using nonmaximum suppression (NMS) During density detection, the resolution of the density map can be dynamically adjusted to accommodate parts of different sizes and densities. For example, for parts with higher density and smaller size, the density map resolution can be increased for more accurate positioning; for parts with lower density and larger size, the resolution can be appropriately reduced to improve processing speed while ensuring detection results.
[0061] In the bounding box detection stage, the DAVE algorithm predicts bounding box parameters at the target center location to obtain candidate target bounding boxes. It is assumed that the feature map is upsampled to the size of the input image. And through the Feature Fusion Module (FFM) and the similarity tensor By fusing the features, new feature representations are generated. The bounding box regression head Ω(·) is used to predict bounding box parameters, and the formula is as follows:
[0062]
[0063] Where Δx l Δy t ,Δx r ,Δy b These are the offsets of the left, top, right, and bottom edges of the bounding box relative to the center position, thus obtaining the candidate target bounding box.
[0064] In the validation phase, the DAVE algorithm extracts features and clusters the detected candidate object bounding boxes and labeled examples, removes outliers, and obtains the final detection results. Assume the validation feature set is... The DAVE algorithm clusters features using a spectral clustering algorithm to identify feature clusters belonging to the same category. In this way, the DAVE algorithm can identify and eliminate erroneous detection results, improving detection accuracy. Specifically, by analyzing the appearance features of candidate regions, outliers are identified and eliminated, thereby ensuring the accuracy and reliability of the detection results.
[0065] Step 4: Utilize the BoTSORT algorithm for multi-target tracking of detected parts to ensure target continuity and accuracy. BoTSORT includes a filtering stage and a matching stage. Based on filtering and matching algorithms, a unique tracking identifier is created for each target. Kalman filtering is used to track the target, predicting its position in subsequent frames. By calculating the similarity between the detection result and the prediction result in the current frame, the detection result is matched with the tracked target. The tracking information is updated based on the matching result to ensure target continuity and accuracy. Figure 3 As shown.
[0066] In the filtering phase, the BoTSORT algorithm uses a Kalman filter to predict and update the target's state, predicting the target's position in subsequent frames. The core of this phase lies in maintaining the target's dynamic information through a state transition model and an observation model. Assume the target's state vector is x = (x, y, v). x ,v y ), where (x,y) represents the position of the target, (v x ,v y () represents the target's velocity. The state transition equation is used to predict the target's position in the next frame; the current state is... Predicted state The formula is as follows:
[0067]
[0068] Where F is the state transition matrix, B is the control input matrix, and u t This is the control input (usually zero in target tracking). Using a Kalman filter, BoTSORT estimates the target's possible location by analyzing its historical motion information. It can predict the target's possible location based on previous state information even in the absence of new observations.
[0069] During the matching phase, the BoTSORT algorithm matches the detected targets with the predicted targets by calculating the similarity between the detected targets and the predicted targets in the current frame. The matching process typically employs the Hungarian algorithm to minimize the cost between the detected and tracked targets. If the detected targets are highly similar to the predicted locations, they are associated, updating the target's tracking information to ensure target continuity and accuracy. If a new target is detected but fails to match an existing tracked target, the algorithm creates a new tracked target; conversely, if a tracked target fails to match a detected target, it is marked as lost and reassigned in subsequent frames. In this way, the BoTSORT algorithm can maintain accurate tracking of multiple targets in complex scenes.
[0070] Assume the detected target bounding box is b det The predicted target bounding box is bpred Similarity is measured by calculating the Intersection over Union (IoU), as shown in the following formula:
[0071]
[0072] Through a matching process, BoTSORT associates detection results with existing tracked targets, ensuring the continuity of each target in the video sequence. For unmatched detected targets, the algorithm creates new tracked targets; for unmatched tracked targets, they are marked as lost and reassigned in subsequent frames. In this way, BoTSORT ensures accurate target tracking even in complex scenes. Specifically, through Kalman gain K... t The target state is updated using the following formula:
[0073]
[0074] Where z t These are the detection observations of the current frame, where H is the observation matrix, R is the observation noise covariance matrix, and P is the detection observations. t - It is the prediction error covariance matrix. Through this process, BoTSORT can ensure the continuity and accuracy of targets, achieving stable tracking of multiple targets.
[0075] Step 5: Based on the tracking results, count the number of times each part appears to achieve accurate part counting. Perform error analysis on the counting results to ensure the accuracy of the counting. Output the counting results in a visual way for easy viewing and verification by users. Store the counting results for subsequent analysis and query.
[0076] The counting and statistics system has a data caching mechanism. When it detects that the operating speed may affect the timeliness of counting (such as network congestion or temporary busy processing units), it can temporarily cache the counting data and continue accurate counting after the system recovers, avoiding counting errors caused by data loss. The counting effect of this invention is as follows: Figure 4 As shown.
[0077] Corresponding to the aforementioned embodiment of an automatic industrial parts counting method based on deep learning, this invention also provides an embodiment of an automatic industrial parts counting device based on deep learning. The system includes an image acquisition module, a preprocessing module, a target detection module, a multi-target tracking module, and a counting and statistics module; for the specific implementation process of each module, please refer to the specific steps of the aforementioned embodiment of the automatic industrial parts counting method based on deep learning.
[0078] The image acquisition module is used to capture images of parts in real time by aiming a high-speed camera at the conveyor belt.
[0079] The preprocessing module is used to preprocess the images acquired by the image acquisition module, including grayscale conversion, noise reduction, and normalization, in order to improve image quality.
[0080] The target detection module is used to perform target detection on the image preprocessed by the preprocessing module based on the DAVE algorithm, so as to realize the target detection function of parts and generate detection results with high recall and high accuracy.
[0081] The multi-target tracking module is used to perform multi-target tracking on the parts detected by the target detection module using the BoTSORT algorithm, ensuring the continuity and accuracy of the targets;
[0082] The counting and statistics module is used to perform statistical analysis on the tracking results of the multi-target tracking module, realize the counting of parts, output the counting results in a visual way, and store the counting results for subsequent analysis and query.
[0083] In summary, this invention relates to a deep learning-based automatic counting method and system for industrial parts. The system acquires images of parts on a conveyor belt in real time using an image acquisition module, and improves image quality using a preprocessing module. Subsequently, the DAVE algorithm is used for high-precision target detection, generating reliable detection results. Next, the BoTSORT algorithm is employed to perform stable multi-target tracking of the detected parts, ensuring target continuity and accuracy. Finally, a counting and statistics module analyzes the tracking results to achieve accurate counting, and provides visualization output and data storage functions for convenient user viewing and subsequent analysis. This system requires no training, is highly adaptable, and can efficiently and accurately complete the automatic counting task of industrial parts.
[0084] The above embodiments are used to explain and illustrate the present invention, but not to limit the present invention. Any modifications and changes made to the present invention within the spirit and scope of the claims shall fall within the protection scope of the present invention.
Claims
1. A method for automatic counting of industrial parts based on deep learning, characterized in that, The method includes the following steps: Step 1: Use a high-speed camera to align with the conveyor belt and capture images of the parts in real time; Step 2: Preprocess the acquired images; Step 3: Perform target detection on the preprocessed image based on the DAVE algorithm to obtain the detection results; Step 4: Use the BoTSORT algorithm to perform multi-target tracking on the detected parts; Step 5: Perform statistical analysis on the tracking results to count the parts, and output the counting results in a visual manner.
2. The method for automatic counting of industrial parts based on deep learning according to claim 1, characterized in that, Step 3 of the DAVE algorithm includes feature extraction, density detection, bounding box detection, and verification stages. The input image is encoded using ResNet-50 and Transformer to generate feature representations. Example prototypes are constructed and associated with image features. A similarity tensor is obtained through a self-attention mechanism. A two-dimensional target location density map is generated through a decoder. Bounding box parameters are predicted for the target center location to obtain candidate target bounding boxes. Feature extraction and clustering are performed on the detected candidate target bounding boxes and labeled examples. Outliers are removed to obtain the final detection result.
3. The method for automatic counting of industrial parts based on deep learning according to claim 2, characterized in that, In the feature extraction stage, the DAVE algorithm first extracts features from the input image using ResNet-50; assuming the input image is... H0 and W0 represent the height and width of the input image, respectively. After ResNet-50 encoding, feature maps are generated. Where h and w are the height and width of the feature map, and d is the number of feature channels; further processing is performed through the Transformer architecture. The Transformer's self-attention mechanism can capture long-distance dependencies between features at different locations in the image, and its calculation formula is as follows: Q, K, and V represent the query, key, and value matrices, respectively, and this mechanism yields richer semantic features.
4. The method for automatic counting of industrial parts based on deep learning according to claim 2, characterized in that, In the density detection phase, the DAVE algorithm constructs example prototypes and associates them with image features to form a similarity tensor; assuming a bounding box group B E There are k example bounding boxes B E ={b i } i=1:k Each example bounding box b i Corresponding to the appearance features of an object; through The OPE (Object Prototype Extraction) module extracts example prototypes from the feature map and obtains a similarity tensor through dot product or other similarity metrics. The calculation method is as follows: Where x and y are the position coordinates of the feature map, c is the feature channel index, and f is the feature map coordinates. I (x,y,c) is the feature value of the c-th channel at position (x,y) in the input image I. i (c) is the feature value of the c-th channel of the i-th bounding box. The similarity tensor is processed by the decoder to generate a two-dimensional target location density map. The formula used to estimate the center position of an object is as follows: N is obtained from the density map by nonmaximum suppression of NMS. c The center position of the object in Represents the center position coordinates of the i-th object; during density detection, the resolution of the density map is dynamically adjusted to adapt to parts of different sizes and densities.
5. The method for automatic counting of industrial parts based on deep learning according to claim 4, characterized in that, In the bounding box detection phase, the DAVE algorithm predicts bounding box parameters for the target center location; assuming the feature map is upsampled to the size of the input image. And through the feature fusion module FFM and the similarity tensor By fusing the features, new feature representations are generated. The bounding box regression head Ω(·) is used to predict bounding box parameters, and the formula is as follows: Where Δx l Δy t ,Δx r ,Δy b These are the offsets of the left, top, right, and bottom edges of the bounding box relative to the center position, thus obtaining the candidate target bounding box.
6. The method for automatic counting of industrial parts based on deep learning according to claim 2, characterized in that, During the validation phase, the DAVE algorithm extracts features and clusters the detected candidate target bounding boxes and labeled examples, removing outliers; assuming the validation feature set is... The DAVE algorithm clusters features using a spectral clustering algorithm, identifying feature clusters belonging to the same category. In this way, the DAVE algorithm can identify and eliminate outliers, i.e., erroneous detection results, by analyzing the appearance features of candidate regions.
7. The method for automatic counting of industrial parts based on deep learning according to claim 1, characterized in that, In step 4, the BoTSORT algorithm uses filtering and matching algorithms to achieve a unique tracking identifier for the target. It uses Kalman filtering to track the target, predicts the target's position in subsequent frames, calculates the similarity between the detection result and the prediction result in the current frame, matches the detection result with the tracked target, and updates the target's tracking information based on the matching result to ensure the continuity and accuracy of the target.
8. The method for automatic counting of industrial parts based on deep learning according to claim 7, characterized in that, In the filtering phase, the BoTSORT algorithm uses a Kalman filter to predict and update the target's state; the core of this phase lies in maintaining the target's dynamic information through a state transition model and an observation model; assuming the target's state vector is x = (x, y, v) x ,v y ), where (x,y) represents the position of the target, (v x ,v y () represents the target's velocity; the state transition equation is used to predict the target's position in the next frame, and the current state is... Predicted state The formula is as follows: Where F is the state transition matrix, B is the control input matrix, and u t It is the control input, set to zero in target tracking; through the Kalman filter, BoTSORT is able to predict the possible location of the target based on previous state information in the absence of new observations.
9. The method for automatic counting of industrial parts based on deep learning according to claim 7, characterized in that, During the matching phase, the BoTSORT algorithm performs matching by calculating the similarity between the detection result in the current frame and the predicted target; the matching process uses the Hungarian algorithm to minimize the cost between the detected target and the tracked target; Assume the detected target bounding box is b det The predicted target bounding box is b pred Similarity is measured by calculating the Intersection over Union (IoU), as shown in the following formula: Through the matching process, BoTSORT can associate the detection results with existing tracked targets, ensuring the continuity of each target in the video sequence; For a detected target that fails to match, a new tracking target is created; for a tracked target that fails to match, it is marked as lost and reassigned in a subsequent frame; specifically, this is achieved through Kalman gain K. t The target state is updated using the following formula: K t =P t - H T (HP t - H T +R) -1 Where z t These are the detection observations of the current frame, where H is the observation matrix, R is the observation noise covariance matrix, and P is the detection observations. t - It is the prediction error covariance matrix.
10. An automated industrial parts counting system based on deep learning that implements the method of any one of claims 1-9, characterized in that, The system includes: The image acquisition module is used to capture images of parts in real time by pointing a high-speed camera at the conveyor belt; The preprocessing module is used to preprocess the images acquired by the image acquisition module; The target detection module is used to perform target detection on the image preprocessed by the preprocessing module based on the DAVE algorithm, and obtain the detection results. The multi-target tracking module is used to perform multi-target tracking on parts detected by the target detection module using the BoTSORT algorithm; The counting and statistics module is used to perform statistical analysis on the tracking results of the multi-target tracking module, realize part counting, and output the counting results in a visual manner.
Citation Information
Cited By
Medical instrument part counting system based on YOLOv8 model
CN122199463A