A method for identifying disordered parts based on improved YOLOv8
By improving the YOLOv8 model, dividing sub-image regions, and optimizing the model structure and loss function, the problem of low efficiency in part recognition under complex scenarios of traditional methods is solved, and efficient and accurate recognition of disordered parts is achieved.
Patent Information
- Application Number
- CN202510090947.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2045-01-21
AI Technical Summary
Traditional part recognition methods are inefficient and inaccurate in complex scenarios and with diverse parts. The YOLO algorithm has reduced accuracy and consumes a lot of computing power in the recognition of disordered parts.
Based on the improved YOLOv8 model, effective image texture and contour complexity are determined by dividing the image into sub-image regions. The ConTainer, HorNet, and LightConv network modules are used to optimize the model. The training loss function is optimized using the EIoU and Focal-Loss functions, and recognition is performed in conjunction with a standard parts library.
It improves the accuracy, detection speed and precision of disordered parts identification, reduces computing power, and enhances the model's adaptability and recognition efficiency in complex scenarios.
Smart Images

Figure CN119992287B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision, and more particularly to a method for identifying disordered parts based on an improved YOLOv8. Background Technology
[0002] In automated production processes, accurately and quickly identifying and processing disordered parts is one of the core tasks for improving the automation level of production lines. In recent years, deep learning technology, especially convolutional neural networks (CNNs), has made significant progress in the field of image recognition. The YOLO (You Only Look Once) algorithm, as an advanced real-time object detection technology, can predict the category and location of objects in an image through a single forward propagation, greatly improving processing speed.
[0003] For example, Chinese Patent Publication No. CN117237937A discloses a method for identifying disordered parts based on the PointNet++ network. Key steps of the method include local feature extraction. A farthest-point sampling strategy is used through an ensemble abstraction layer to obtain center points, and K neighboring points are selected around each center point to form local regions, thus obtaining richer local features. Subsequently, a PointNet layer is used to capture the relationships between points within these local regions, repeating this process twice to deepen feature learning. Next, a Maxpooling layer is used to optimize the disordered point cloud data and redundant features, reducing complexity. Finally, an MLP network is used to classify the processed features, achieving the point cloud classification task. To prevent overfitting, the AdamW optimizer and loss functions with label smoothing and cosine decay are used. Overall, this method significantly improves the accuracy and speed of disordered part classification.
[0004] For example, Chinese Patent Publication No. CN118366006A discloses a method and system for part recognition based on an improved Mask R-CNN instance segmentation network. The recognition method includes: constructing a part recognition model based on an improved Mask R-CNN network; the improved Mask R-CNN network includes: replacing the backbone network of the Mask R-CNN network with a MobiLenetv3 network, and replacing the FPN network connected to the backbone network with a bidirectional feature fusion network M-FPN. This invention can accurately and quickly identify parts in disordered and complex environments, while the model used is lightweight, simple, computationally inexpensive, and requires low-end equipment.
[0005] However, the following problems still exist in the existing technology.
[0006] In practice, traditional part identification methods rely on simple sensors and pre-defined algorithms. These methods are inefficient and inaccurate when dealing with complex scenarios and diverse parts. Meanwhile, although the YOLO algorithm has shown superior performance in many application scenarios, its accuracy decreases when dealing with complex and ever-changing industrial environments, especially when identifying disordered parts on a production line, and it consumes a great deal of computing power. Summary of the Invention
[0007] To address this, the present invention provides a method for identifying disordered parts based on an improved YOLOv8, which solves the problem that traditional part identification methods rely on simple sensors and pre-defined algorithms. These methods are inefficient and inaccurate when dealing with complex scenarios and diverse parts. At the same time, although the YOLO algorithm has shown superior performance in many application scenarios, its accuracy decreases and it consumes a lot of computing power when dealing with complex and ever-changing industrial environments, especially when identifying disordered parts on production lines.
[0008] To achieve the above objectives, the present invention provides a method for identifying disordered parts based on an improved YOLOv8, comprising:
[0009] Acquire several disordered part images, divide the disordered part images into several sub-image regions based on the part contours, and determine the effective image texture and contour complexity of the parts in the sub-image regions.
[0010] The specific variation index of the sub-image region is determined based on the number of effective image textures and the contour complexity, so as to classify the specific variation category of the sub-image region.
[0011] Based on the specific variation category corresponding to each of the sub-image regions, disordered parts are identified, including:
[0012] The sub-image regions are homogenized, labels are assigned to the sub-image regions, and the dataset is divided. The dataset is then input into a pre-configured improved YOLOv8 model to identify part categories.
[0013] Alternatively, determine the part images within the sub-image region and compare them with a standard parts library to identify the part category;
[0014] The improvement process of the YOLOv8 model includes adding a ConTainer network module to the YOLOv8 model detection head, determining the HorNet network module as the backbone network of the YOLOv8 model, introducing a lightweight network LightConv module, and optimizing the loss function during model training.
[0015] Furthermore, the process of determining the effective image texture value and contour complexity of the part within the sub-image region includes,
[0016] Determine a number of texture pixels and their corresponding texture widths on the parts within the sub-image region;
[0017] Perform grayscale relationship analysis based on the texture pixels;
[0018] Textures whose gray level is less than or equal to a preset gray level and whose texture width is within a reference width are determined to be valid image textures;
[0019] Determine several edge contour segments of the part within the sub-image region;
[0020] The average curvature of the aforementioned edge contour segments is determined to be the contour complexity.
[0021] Furthermore, the process of determining the specific variation index of the sub-image region includes,
[0022] The ratio of the number of effective textures in the baseline image to the number of effective textures in the image is determined as the first influencing feature.
[0023] The ratio of baseline contour complexity to contour complexity is determined as the second influencing feature;
[0024] The weighted sum of the first and second influencing features is determined to be the Specific Variation Index.
[0025] Furthermore, the specific variation categories of the segmented sub-image regions, wherein,
[0026] If the specific variation index is greater than or equal to the preset specific variation index, then the sub-image region is classified as a non-specific variation category.
[0027] If the specific variation index is less than the preset specific variation index, then the sub-image region is classified as a specific variation category.
[0028] Furthermore, the disordered parts are identified based on the specific variation categories corresponding to each of the sub-image regions, wherein...
[0029] If the sub-image region is a non-specific variation category, then the part image within the sub-image region is determined and compared with a standard parts library to identify the part category;
[0030] If a sub-image region is a specific variant category, then the sub-image region is normalized, a label is set for the sub-image region and the dataset is divided. The dataset is then input into a pre-configured improved YOLOv8 model to identify the part category.
[0031] Furthermore, the unification of the sub-image regions includes,
[0032] Several sub-image regions are placed on a preset region background image.
[0033] Furthermore, the process of adding the ConTainer network module to the YOLOv8 model detection head includes,
[0034] Add the ConTainer network module to the front of the detector head of the YOLOv8 model;
[0035] The ConTainer network module integrates feature sets from different network layers and transmits these feature sets to the detection head.
[0036] The feature set includes convolutional layers for object classification and bounding box regression.
[0037] Furthermore, the process of introducing the lightweight network LightConv module includes,
[0038] It was determined that the LightConv module would replace the original C2f module of the YOLOv8 neck network;
[0039] The LightConv module performs a preliminary linear transformation on the sub-image region;
[0040] The sub-image region is passed to a lightweight convolutional layer;
[0041] By combining linear layers and gated signals, the sub-image region after lightweight convolution is nonlinearized;
[0042] The nonlinear sub-image region is transferred to other linear layers.
[0043] Furthermore, the process of optimizing the loss function during model training includes,
[0044] Replace the CIoU function with the EIoU function;
[0045] Based on the EIoU function, the Focal-Loss function is introduced;
[0046] The EIoU function calculates the difference between width and height based on the CIoU function, replacing the aspect ratio of the CIoU function.
[0047] Furthermore, the process of comparing the part with a standard parts library to identify the part category includes,
[0048] Determine the similarity between the part images within the sub-image region and the part images in the standard parts library;
[0049] The part category in the standard parts library corresponding to the maximum similarity is determined as the part category within the sub-image region;
[0050] The standard parts library contains several parts images pre-stored.
[0051] Compared with existing technologies, this invention acquires several disordered part images, divides the disordered part images into several sub-image regions based on the part contours, determines the effective image texture and contour complexity of the parts within each sub-image region, determines the specific variation index of the sub-image region based on the number of effective image textures and contour complexity, and classifies the specific variation category of the sub-image region, and identifies the disordered parts according to the specific variation category corresponding to each sub-image region, including: unifying the sub-image regions, setting labels for the sub-image regions and dividing the dataset, inputting the dataset into a pre-configured improved YOLOv8 model to identify the part category; or, determining the part images within the sub-image regions and comparing them with a standard part library to identify the part category, thereby reducing computational power and improving the efficiency of part identification.
[0052] In particular, this invention determines the specific variation index of a sub-image region based on the effective image texture quantity and contour complexity, providing data for classifying the specific variation categories of the sub-image region. In practice, during factory assembly line sorting, disordered parts are often directly identified. Since disordered parts contain various types of parts with different characteristics, these differences affect the ease of identification at the back end. For example, some parts with complex structures and textures are difficult to identify, while others are easy to identify. Therefore, using the same method to identify some ordered parts would lead to wasted computing power and low part identification efficiency. Based on this, this invention considers calculating the specific variation index of the sub-image region to classify specific variation categories. For sub-image regions with non-specific variation categories, the part category is directly identified based on a standard part library. For sub-image regions with specific variation categories, the YOLOv8 model is improved to identify the part category. In particular, the process of identifying the effective image texture quantity and contour complexity is relatively simple, which can reduce computing power and improve the accuracy, detection speed, and precision of identifying disordered parts.
[0053] In particular, this invention adds a ConTainer network module to the YOLOv8 model detection head. The ConTainer network module combines GNN, Transformer and MLP-Mixers methods, and utilizes remote interaction and local convolution operations to effectively integrate and understand images. Without changing the feature vector size, it improves the model's adaptability to complex scenes and recognition accuracy. Compared with existing models, ConTainer achieves higher accuracy with fewer parameters and faster convergence speed, and makes more accurate predictions of the existence and location of targets, thereby improving the accuracy, detection speed and precision of disordered parts recognition.
[0054] In particular, this invention identifies the HorNet network module as the backbone network of the YOLOv8 model. In existing models, the backbone network is mostly the C2f network module. However, in actual operation, the C2f network module can lead to the loss of some important features when processing data, especially high-dimensional data. This loss of information may affect the model's recognition of subtle features in the image, thereby reducing the accuracy of target detection. Based on this, this invention replaces the C2f network module with the HorNet network module. The HorNet module combines the local perception capability of traditional CNNs with the global perception capability of Transformers, and introduces global second-order convergence to enhance feature extraction capabilities. It can effectively capture global statistical information and subtle spatial relationships in the image, improving the accuracy, detection speed, and precision of identifying disordered parts.
[0055] In particular, this invention introduces the lightweight network LightConv module to improve the YOLOv8 neck network. The LightConv module has a fixed context window and determines the importance of elements through a set of weights that do not change with the time step, realizing effective information processing of disordered parts from linear to nonlinear and back to linear. The LightConv module makes the recognition structure simpler, has fewer parameters, and reduces network complexity. While maintaining high-speed processing capabilities, it reduces the model's demand for computing resources and improves the accuracy, detection speed, and precision of disordered part recognition.
[0056] In particular, this invention optimizes the loss function during YOLOv8 model training. In practice, the aspect ratio of the CIoU function is somewhat ambiguous, which may lead to instability when dealing with targets with extreme scale differences. Based on this, this invention replaces the CIoU function with the EIoU function and introduces the Focal-Loss function to solve the sample imbalance problem. By optimizing the EIoU function, the localization of sub-image regions is further refined, reducing the error caused by the aspect ratio ambiguity of the CIoU function, and improving the accuracy and robustness of identifying disordered parts. Attached Figure Description
[0057] Figure 1 This is a schematic diagram illustrating the steps of an embodiment of the invention for identifying disordered parts based on an improved YOLOv8 method.
[0058] Figure 2 A logic block diagram for determining the effective image texture of a part within a sub-image region, as shown in the embodiments of the invention;
[0059] Figure 3 A logic block diagram illustrating the specific variation categories for dividing sub-image regions in an embodiment of the invention;
[0060] Figure 4 This is a logic block diagram for identifying disordered parts according to an embodiment of the invention.
[0061] Figure 5 A schematic diagram of the improved YOLOv8 network structure according to an embodiment of the invention;
[0062] Figure 6 This is a schematic diagram of the LightConv network structure according to an embodiment of the invention. Detailed Implementation
[0063] To make the objectives and advantages of the present invention clearer, the present invention will be further described below with reference to embodiments; it should be understood that the specific embodiments described herein are merely for explaining the present invention and are not intended to limit the present invention.
[0064] Preferred embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.
[0065] Please see Figure 1 , Figure 1 This is a schematic diagram illustrating the steps of an improved YOLOv8-based method for identifying disordered parts according to an embodiment of the invention. The improved YOLOv8-based method for identifying disordered parts according to the present invention includes:
[0066] Acquire several disordered part images, divide the disordered part images into several sub-image regions based on the part contours, and determine the effective image texture and contour complexity of the parts in the sub-image regions.
[0067] The specific variation index of the sub-image region is determined based on the number of effective image textures and the contour complexity, so as to classify the specific variation category of the sub-image region.
[0068] Based on the specific variation category corresponding to each of the sub-image regions, disordered parts are identified, including:
[0069] The sub-image regions are homogenized, labels are assigned to the sub-image regions, and the dataset is divided. The dataset is then input into a pre-configured improved YOLOv8 model to identify part categories.
[0070] Alternatively, determine the part images within the sub-image region and compare them with a standard parts library to identify the part category;
[0071] The improvement process of the YOLOv8 model includes adding a ConTainer network module to the YOLOv8 model detection head, determining the HorNet network module as the backbone network of the YOLOv8 model, introducing a lightweight network LightConv module, and optimizing the loss function during model training.
[0072] Specifically, there are no restrictions on the source of images of several disordered parts. For example, they can be real-time footage of the factory assembly line or historical footage stored in the factory. Of course, both the footage and the historical footage have been authorized, which will not be elaborated here.
[0073] It is understood that the outline of a part can be a single outline of a part or an overlapping outline of several parts. As long as it is possible to divide the sub-image region, it is acceptable. Those skilled in the art can also choose the division method based on the actual situation, which will not be elaborated here.
[0074] Specifically, there are no restrictions on how the dataset is divided. For example, in implementation, 70% of the data can be used for training, 15% for validation, and 15% for testing. Those skilled in the art can also use other division methods, as long as it can ensure that the model can be trained normally and the training results can be obtained. This will not be elaborated further.
[0075] Specifically, there are no restrictions on how the standard parts library is determined. For example, an existing open-source parts library can be used directly as the standard parts library, or several parts images can be collected in advance to build the standard parts library. Those skilled in the art can choose according to the actual situation, which will not be elaborated here.
[0076] Specifically, this invention identifies the HorNet network module as the backbone network of the YOLOv8 model. Those skilled in the art will understand that in existing models, the backbone network is mostly a C2f network module. However, in actual operation, the C2f network module, especially when processing high-dimensional data, can lead to the loss of some important features. This information loss may affect the model's ability to recognize subtle features in images, thereby reducing the accuracy of target detection. Therefore, this invention replaces the C2f network module with the HorNet network module. The HorNet module is a deep learning module based on recursive gated convolution, combining the local perception capabilities of traditional CNNs and the global perception capabilities of Transformers. It introduces global second-order convergence, enhancing feature extraction capabilities and effectively capturing global statistical information and subtle spatial relationships in images, thus improving the accuracy, detection speed, and precision of identifying disordered parts.
[0077] Please see Figure 2 , Figure 2This is a logic block diagram illustrating the determination of the effective image texture of a part within a sub-image region, as described in an embodiment of the invention. Specifically, the process of determining the effective image texture and contour complexity of a part within a sub-image region includes:
[0078] Determine a number of texture pixels and their corresponding texture widths on the parts within the sub-image region;
[0079] Perform grayscale relationship analysis based on the texture pixels;
[0080] Textures whose gray level is less than or equal to a preset gray level and whose texture width is within a reference width are determined to be valid image textures;
[0081] Determine several edge contour segments of the part within the sub-image region;
[0082] The average curvature of the aforementioned edge contour segments is determined to be the contour complexity.
[0083] Specifically, there are no restrictions on the method of obtaining several texture pixels on the part within the sub-image region, as long as the texture can be extracted. For example, a simple image segmentation algorithm can be used to directly perform image recognition on the sub-image region to obtain the texture features on the part within the sub-image region. Other methods can also be used in this field for image recognition and extraction, which will not be elaborated here.
[0084] Specifically, grayscale relationship analysis is performed to determine the effective texture of parts within a sub-image region. In reality, parts may have scratches. If grayscale analysis is not performed and all textures are identified as effective textures, the number of effective image textures will increase, leading to a deviation in the specific variation index and misclassification of specific variation categories in the sub-image region. Therefore, performing grayscale analysis on the texture of parts within a sub-image region can make subsequent feature extraction and recognition more accurate.
[0085] Specifically, the preset gray level is calculated in advance. Several historical disordered part images are obtained in advance and the corresponding historical gray levels are obtained. The average value of the historical gray levels is determined to be the preset gray level.
[0086] Specifically, the baseline width is calculated in advance. Several historical disordered part images are obtained in advance and their corresponding historical widths are acquired. The average of the historical widths is determined as the baseline width.
[0087] Specifically, there is no limitation on the way the edge contour segments are divided. For example, in implementation, the edge contour segments can be divided into several contour segments of equal length. Those skilled in the art can also use other methods to divide them, which will not be elaborated here.
[0088] Understandably, the process of identifying the effective image texture and contour complexity of sub-image regions is relatively simple, which can effectively reduce computational power and improve computational efficiency.
[0089] Specifically, the process of determining the specific variation index of a sub-image region includes,
[0090] The ratio of the number of effective textures in the baseline image to the number of effective textures in the image is determined as the first influencing feature.
[0091] The ratio of baseline contour complexity to contour complexity is determined as the second influencing feature;
[0092] The weighted sum of the first and second influencing features is determined to be the Specific Variation Index.
[0093] Specifically, the baseline effective image texture count is calculated in advance. The effective image texture count of several historical sub-image regions is obtained in advance and the average value is calculated. The average value is then determined as the baseline effective image texture count.
[0094] Specifically, the baseline contour complexity is calculated in advance by acquiring the contour complexity of several historical sub-image regions and calculating the average value, which is then determined as the baseline contour complexity.
[0095] Specifically, the sum of the weight coefficients of the first and second influencing features is 1, the weight coefficient of the first influencing feature is 0.46, and the weight coefficient of the second influencing feature is 0.54.
[0096] Please see Figure 3 , Figure 3 This is a logic block diagram illustrating the classification of specific mutation categories for dividing sub-image regions according to an embodiment of the invention. Specifically, the classification of specific mutation categories for sub-image regions, wherein...
[0097] If the specific variation index is greater than or equal to the preset specific variation index, then the sub-image region is classified as a non-specific variation category.
[0098] If the specific variation index is less than the preset specific variation index, then the sub-image region is classified as a specific variation category.
[0099] Specifically, the preset specific mutation index is selected within the range of [0.65, 0.78].
[0100] Specifically, this invention determines the specific variation index of a sub-image region based on the effective image texture quantity and contour complexity, providing data for classifying the specific variation categories of the sub-image region. In practice, during factory assembly line sorting, disordered parts are often directly identified. Since disordered parts contain various types of parts with different characteristics, these differences affect the ease of identification at the back end. For example, some parts with complex structures and textures are difficult to identify, while others are easy to identify. Therefore, using the same method to identify some ordered parts would lead to wasted computing power and low part identification efficiency. Based on this, this invention considers calculating the specific variation index of the sub-image region to classify specific variation categories. For sub-image regions without specific variation categories, the part category is directly identified based on a standard part library. For sub-image regions with specific variation categories, the YOLOv8 model is improved to identify the part category. In particular, the process of identifying the effective image texture quantity and contour complexity is relatively simple, which can reduce computing power and improve the accuracy, detection speed, and precision of identifying disordered parts.
[0101] Please see Figure 4 , Figure 4 This is a logic block diagram illustrating the identification of disordered parts according to an embodiment of the invention. Specifically, disordered parts are identified based on the specific variation category corresponding to each of the sub-image regions, wherein...
[0102] If the sub-image region is a non-specific variation category, then the part image within the sub-image region is determined and compared with a standard parts library to identify the part category;
[0103] If a sub-image region is a specific variant category, then the sub-image region is normalized, a label is set for the sub-image region and the dataset is divided. The dataset is then input into a pre-configured improved YOLOv8 model to identify the part category.
[0104] Please see Figure 5 , Figure 5 This is a schematic diagram of an improved YOLOv8 network structure according to an embodiment of the invention. Specifically, unifying the sub-image regions includes:
[0105] Several sub-image regions are placed on a preset region background image.
[0106] Specifically, the shape of the preset area background image is not limited. Preferably, for ease of identification, a rectangular background image is selected as the area background image in the implementation. Those skilled in the art can also choose according to the actual situation, which will not be elaborated here.
[0107] Specifically, the process of adding the ConTainer network module to the YOLOv8 model detection head includes:
[0108] Add the ConTainer network module to the front of the detector head of the YOLOv8 model;
[0109] The ConTainer network module integrates feature sets from different network layers and transmits these feature sets to the detection head.
[0110] The feature set includes convolutional layers for object classification and bounding box regression.
[0111] Specifically, this invention adds a ConTainer network module to the detection head of the YOLOv8 model. The ConTainer network module is a general building block for multi-head context aggregation. By combining the ConTainer network module with GNN, Transformer and MLP-Mixers, it utilizes remote interaction and local convolution operations to effectively integrate and understand images. Without changing the feature vector size, it improves the model's adaptability to complex scenes and recognition accuracy. Compared with existing models, ConTainer achieves higher accuracy with fewer parameters and faster convergence speed, making more accurate predictions of the existence and location of targets, and improving the accuracy, detection speed and precision of disordered parts recognition.
[0112] Please see Figure 6 , Figure 6 This is a schematic diagram of the LightConv network structure according to an embodiment of the invention. Specifically, the process of introducing the lightweight network LightConv module includes:
[0113] It is determined that the LightConv module replaces the original C2f module of the YOLOv8 neck network;
[0114] The LightConv module performs a preliminary linear transformation on the sub-image region;
[0115] The sub-image region is passed to a lightweight convolutional layer;
[0116] By combining linear layers and gated signals, the sub-image region after lightweight convolution is nonlinearized;
[0117] The nonlinear sub-image region is transferred to other linear layers.
[0118] Specifically, there are no restrictions on the method of performing the initial linear transformation. For example, in implementation, the steps are as follows:
[0119] Projection mapping is performed on the features of the input sub-image region to expand the original dimension;
[0120] The features after expanding the original dimensions are input into the gated linear unit, and the gated signal is activated using a non-linear activation function.
[0121] The output value is obtained by multiplying the gate signal by the activation signal.
[0122] The LightConv module is used to normalize the weights of features in the sub-image regions.
[0123] The output value is fused with the features processed by the LightConv module to obtain the output features;
[0124] Of course, those skilled in the art can also use other methods to perform preliminary linear transformations, which will not be elaborated here.
[0125] Understandably, through an efficient information processing path of linear-nonlinear-linear, the YOLOv8 model can accurately capture high-level features in sequence data while maintaining high computational efficiency.
[0126] Specifically, this invention introduces the lightweight LightConv module to improve the YOLOv8 neck network. LightConv is a lightweight convolutional method primarily used to reduce the computational complexity and number of parameters of traditional convolutions while maintaining or improving model performance. It features a fixed context window and determines the importance of elements through a set of weights that do not change with the time step. This enables efficient information processing of disordered parts, from linear to nonlinear and back to linear. LightConv simplifies the recognition structure, reduces the number of parameters, and lowers network complexity. While maintaining high-speed processing capabilities, it reduces the model's demand for computational resources, improving the accuracy, detection speed, and precision of disordered part recognition.
[0127] Specifically, the process of optimizing the loss function during model training includes,
[0128] Replace the CIoU function with the EIoU function;
[0129] Based on the EIoU function, the Focal-Loss function is introduced;
[0130] The EIoU function calculates the difference between width and height based on the CIoU function, replacing the aspect ratio of the CIoU function.
[0131] Specifically, the CIoU function is a loss function used for object detection. It is an improvement on the traditional IoU function, which comprehensively considers factors such as the overlap of bounding boxes, the distance between center points, and the aspect ratio, so as to more accurately measure the similarity between two bounding boxes.
[0132] The EIoU function is an improved IoU loss function used in object detection tasks to measure the degree of overlap between the predicted bounding box and the ground truth bounding box. It is an optimization based on CIoU, mainly by calculating the difference in width and height between the predicted bounding box and the ground truth bounding box separately, rather than just considering the aspect ratio.
[0133] The Focal-Loss function is an improved cross-entropy loss function used to address the class imbalance problem in object detection.
[0134] Specifically, this invention optimizes the loss function during YOLOv8 model training. In practice, the aspect ratio of the CIoU function is somewhat ambiguous, which may lead to instability when dealing with targets with extreme scale differences. Therefore, this invention replaces the CIoU function with the EIoU function and introduces the Focal-Loss function to solve the sample imbalance problem. By optimizing the EIoU function, the localization of sub-image regions is further refined, reducing the error caused by the aspect ratio ambiguity of the CIoU function, and improving the accuracy and robustness of identifying disordered parts.
[0135] Specifically, the process of identifying part categories by comparing similarity with a standard parts library includes,
[0136] Determine the similarity between the part images within the sub-image region and the part images in the standard parts library;
[0137] The part category in the standard parts library corresponding to the maximum similarity is determined as the part category within the sub-image region;
[0138] The standard parts library contains several parts images pre-stored.
[0139] Specifically, there are no restrictions on the method for calculating similarity. For example, structural similarity index method, convolutional neural network feature comparison method, feature matching method, and direct pixel difference method can all be used. In practice, to save computational resources, the direct pixel difference method is used to determine the similarity of part images. The specific steps are as follows.
[0140] Adjust the two images to the same size;
[0141] Determine each pair of corresponding pixels in the image and calculate the difference between their RGB values;
[0142] The similarity of images is assessed based on the calculated number of differing pixels or the sum of the difference values.
[0143] Understandably, if the difference is small, the two images are considered to be highly similar; if the difference is large, the two images are considered to be less similar. This approach provides high reliability and recognition accuracy for parts with simpler features.
[0144] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of the present invention.
[0145] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for identifying disordered parts based on an improved YOLOv8, characterized in that, include: Acquire several disordered part images, divide the disordered part images into several sub-image regions based on the part contours, and determine the effective image texture and contour complexity of the parts in the sub-image regions. The specific variation index of the sub-image region is determined based on the number of effective image textures and the contour complexity, so as to classify the specific variation category of the sub-image region. Based on the specific mutation categories corresponding to each of the sub-image regions, disordered parts are identified. include, The sub-image regions are homogenized, labels are assigned to the sub-image regions, and the dataset is divided. The dataset is then input into a pre-configured improved YOLOv8 model to identify part categories. Alternatively, determine the part images within the sub-image region and compare them with a standard parts library to identify the part category; The improvement process of the improved YOLOv8 model includes adding a ConTainer network module to the detection head of the YOLOv8 model, determining the HorNet network module as the backbone network of the YOLOv8 model, introducing a lightweight network LightConv module, and optimizing the loss function during model training. The process of determining the specific variation index of the sub-image region includes: The ratio of the number of effective textures in the baseline image to the number of effective textures in the image is determined as the first influencing feature. The ratio of baseline contour complexity to contour complexity is determined as the second influencing feature; The weighted sum of the first and second influencing features is determined to be the idiosyncratic variation index; The disordered parts are identified based on the specific variation categories corresponding to each of the sub-image regions. If the sub-image region is a non-specific variation category, then the part image within the sub-image region is determined and compared with a standard parts library to identify the part category; If a sub-image region is a specific variant category, then the sub-image region is normalized, a label is set for the sub-image region and the dataset is divided. The dataset is then input into a pre-configured improved YOLOv8 model to identify the part category.
2. The method for identifying disordered parts based on improved YOLOv8 according to claim 1, characterized in that, The process of determining the effective image texture and contour complexity of the parts within the sub-image region includes: Determine a number of texture pixels and their corresponding texture widths on the parts within the sub-image region; Perform grayscale relationship analysis based on the texture pixels; Textures whose gray level is less than or equal to a preset gray level and whose texture width is within a reference width are determined to be valid image textures; Determine several edge contour segments of the part within the sub-image region; The average curvature of the aforementioned edge contour segments is determined to be the contour complexity.
3. The method for identifying disordered parts based on improved YOLOv8 according to claim 1, characterized in that, The specific variation categories of the segmented sub-image regions, wherein... If the specific variation index is greater than or equal to the preset specific variation index, then the sub-image region is classified as a non-specific variation category. If the specific variation index is less than the preset specific variation index, then the sub-image region is classified as a specific variation category.
4. The method for identifying disordered parts based on improved YOLOv8 according to claim 1, characterized in that, The process of unifying the sub-image regions includes... Several sub-image regions are placed on a preset region background image.
5. The method for identifying disordered parts based on improved YOLOv8 according to claim 1, characterized in that, The process of adding the ConTainer network module to the YOLOv8 model detection head includes: Add the ConTainer network module to the front of the detector head of the YOLOv8 model; The ConTainer network module integrates feature sets from different network layers and transmits these feature sets to the detection head. The feature set includes convolutional layers for object classification and bounding box regression.
6. The method for identifying disordered parts based on improved YOLOv8 according to claim 1, characterized in that, The process of introducing the lightweight network LightConv module includes: It is determined that the LightConv module replaces the original C2f module of the YOLOv8 neck network; The LightConv module performs a preliminary linear transformation on the sub-image region; The sub-image region is passed to a lightweight convolutional layer; By combining linear layers and gated signals, the sub-image region after lightweight convolution is nonlinearized; The nonlinear sub-image region is transferred to other linear layers.
7. The method for identifying disordered parts based on improved YOLOv8 according to claim 1, characterized in that, The process of optimizing the loss function during model training includes: Replace the CIoU function with the EIoU function; The Focal-Loss function is introduced based on the EIoU function; The EIoU function calculates the difference between width and height based on the CIoU function, replacing the aspect ratio of the CIoU function.
8. The method for identifying disordered parts based on improved YOLOv8 according to claim 1, characterized in that, The process of comparing the part with a standard parts library to identify the part category includes, Determine the similarity between the part images within the sub-image region and the part images in the standard parts library; The part category in the standard parts library corresponding to the maximum similarity is determined as the part category within the sub-image region; The standard parts library contains several parts images pre-stored.
Citation Information
Patent Citations
Unordered part identification method based on PointNet + + network
CN117237937A
Part identification method and system based on improved Mask R-CNN instance segmentation network
CN118366006A
Image recognition method, device and equipment and storage medium
CN112580707A
Improved YOLOV8-based disordered part detection method and system
CN118608823A