Method and system for improving sorting accuracy based on ai algorithm sorting line
Patent Information
- Application Number
- CN202411100220.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2044-08-12
AI Technical Summary
[0004]然而,相关技术中获取目标样本图像的方式,主要依靠人工进行布局拍摄,不仅耗费大量人力资源,而且样本采集效率低下
1、样本收集系统通过分拣设备端获取传送带上运输物体的图片信息,再通过回流装置改变运输物体在传送带上的拍摄角度,实现了对运输物体的多角度拍摄。
Smart Images

Figure CN119107587B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image sample collection technology, and in particular to a method and system for improving sorting accuracy on a sorting line based on AI algorithms. Background Technology
[0002] In industries such as grain, food, mining, and chemicals, sorting of goods is generally required. To improve efficiency, sorting equipment such as optical sorters are typically used for automated sorting. These machines primarily utilize intelligent recognition models to accurately identify different types of targets on the conveyor belt, such as plastics, metals, and glass, achieving fast and high-purity sorting. With this method, the quality of the data sample significantly impacts the recognition accuracy of the sorting equipment. The more comprehensive and accurate the data sample, the higher the accuracy of the sorting equipment when using the intelligent recognition model.
[0003] The intelligent recognition models on sorting equipment often require training with a large number of sample images to improve the accuracy of intelligent recognition. In related technologies, the collection of sample images mainly relies on manually setting up a camera platform to take pictures of the collected target categories of objects, thereby obtaining target sample images and constructing a training sample set.
[0004] However, the methods used in related technologies to acquire target sample images mainly rely on manual layout and shooting, which not only consumes a lot of human resources but also has low sample collection efficiency. Summary of the Invention
[0005] This application provides a method and system for improving sorting accuracy on a sorting line based on AI algorithms. It is used to quickly and cost-effectively acquire sample images of target categories from real production lines, thereby training the intelligent recognition model on the sorting equipment and improving the sorting accuracy of the sorting equipment.
[0006] Firstly, this application provides a method for improving sorting accuracy on a sorting line based on AI algorithms, applied to a sample collection system, the method comprising: The transport object for collecting the target sample is determined and placed on a conveyor belt; The first original image of the transported object is obtained through a sorting device equipped with a camera for taking pictures. The transport object that fell onto the return device was put back onto the conveyor belt for photographing to obtain a second original image. The return device has a height difference with the end of the conveyor belt, which is used to change the contact position between the transport object and the conveyor belt. The original images are input into the first detection model and the second detection model respectively, and it is determined whether the recognition results of the two models are consistent. The original images include the first original image and the second original image. The first detection model is mounted on the sorting equipment and the second detection model is mounted on the cloud server. If the recognition results of the two models for the original image are inconsistent, the original image is used to expand the target sample set.
[0007] Through the above embodiments, the sample collection system acquires image information of objects transported on the conveyor belt through the sorting equipment, and then changes the shooting angle of the transported objects on the conveyor belt through the return device, realizing multi-angle shooting of the transported objects. Simultaneously, by comparing the recognition results of the acquired raw images with those of the first and second detection models, valuable sample raw images are selected to expand the target sample set, thereby improving the comprehensiveness and accuracy of target sample collection. Furthermore, the cooperation between the sorting equipment and the return device automates the target sample collection process, reducing manual intervention and significantly improving the efficiency and quality of sample collection.
[0008] In some embodiments, the step of inputting the original image into a first detection model and a second detection model respectively, and determining whether the recognition results of the two models are consistent, specifically includes: The original image is input into the first detection model to identify the first category information and coordinate information of each transport object in the original image; The original image is input into the second detection model to identify the second category information of the transported object corresponding to each coordinate information; If the information of the first category is found to be the same as that of the second category, then the two models are determined to have the same recognition results. If the information of the first category is found to be different from that of the second category, it is determined that the recognition results of the two models are inconsistent.
[0009] Through the above embodiments, the sample collection system performs secondary verification on the identification type of each transport object identified by the first detection model using the second detection model, thereby improving the accuracy of category identification of the original images and improving the reliability of sample screening. This ensures that the images expanded into the target sample set have high value and helps to improve the recognition capability of the entire system.
[0010] In some embodiments, the step of inputting the original image into the second detection model and identifying the second category information of the transport object corresponding to each coordinate information specifically includes: The target image corresponding to each transport object is extracted from the original image, and the position of the target image is determined based on the coordinate information; Convert the target image into a three-channel image in a preset format; The three-channel image is input into the second detection model to identify the second category information corresponding to the three-channel image.
[0011] Through the above embodiments, the sample collection system extracts an image of a single transport object from the original image as the target image, converts it into a three-channel image of a preset format, and then inputs it into the second detection model for recognition. By preprocessing the target image, the influence of background noise can be reduced, allowing the second detection model to focus more on the features of the target object, thereby improving the recognition accuracy and facilitating the verification of the recognition results of the first model.
[0012] In some embodiments, after the step of determining the transport object for target sample collection, the method further includes: Match the height difference corresponding to the transported objects from the database; Adjust the height difference between the conveyor belt and the return device based on the height difference.
[0013] Through the above embodiments, the sample collection system introduces a mechanism for dynamically adjusting the height difference between the conveyor belt and the return device. By matching the height difference corresponding to the transported object from the database and adjusting the height accordingly, it can handle objects of various sizes and shapes. This allows the landing point of the transported object to be changed during its fall from the conveyor belt to the return device, thus enabling the acquisition of original images from different angles when the object re-enters the conveyor belt for imaging, thereby improving the quality of sample collection.
[0014] In some embodiments, if the recognition results of the two models for the original image are found to be inconsistent, the step of expanding the target sample set using the original image specifically includes: The SAM segmentation algorithm is called to automatically annotate the original image and generate annotation data; Receive the adjustment parameters of the labeled data from the technical personnel; The annotation data is fine-tuned based on the adjustment parameters to obtain the effective annotation data for the original image; Expand the target sample set using effectively labeled data.
[0015] Through the above embodiments, the sample collection system automatically labels the original images by introducing the SAM segmentation algorithm, and combines this with adjustments made by technicians to generate high-quality, effective labeled data. This human-machine collaborative approach improves labeling efficiency while ensuring accuracy. Automatic labeling reduces manual workload, while manual adjustments compensate for potential shortcomings of the automatic algorithm. This method not only rapidly expands the high-quality sample set but also continuously improves the system's recognition capabilities, providing strong support for iterative optimization of the model.
[0016] In some embodiments, after the step of augmenting the target sample set using the original images and effectively labeled data, the method further includes: Receive user-defined data increment thresholds; After detecting that the number of valid labeled data in the target sample set exceeds the data increment threshold, the newly added valid labeled data is input into the first detection model and the second detection model for optimization and training.
[0017] Through the above embodiments, the sample collection system, by setting a threshold and performing model tuning training after the threshold is reached, can promptly utilize newly added effective labeled data to improve model performance. This mechanism ensures that the model can continuously learn new sample features and adapt to the ever-changing environment.
[0018] In some embodiments, after the step of feeding the transport object that has fallen onto the return device back onto the conveyor belt for photographing to obtain a second original image, the method further includes: Count the number of times transported goods are returned; When the number of recirculations exceeds the preset cycle threshold, the transport object that has fallen on the recirculation device will no longer be sent back onto the conveyor belt for shooting.
[0019] Through the above embodiments, the sample collection system avoids resource waste and system inefficiency caused by repeatedly recycling the same object by limiting the number of times the transported object is returned. This mechanism not only optimizes the system's operating efficiency but also prevents damage to objects that may result from excessive recirculation. At the same time, this design also increases sample diversity and prevents the system from focusing excessively on certain specific samples.
[0020] Secondly, this application provides a sample collection system, which includes one or more processors and a memory; The memory is coupled to the one or more processors and is used to store computer program code, which includes computer instructions. The one or more processors call the computer instructions to enable the sample collection system to implement the method for improving sorting accuracy based on an AI algorithm sorting line provided in the above embodiments, which will not be described in detail here.
[0021] Thirdly, this application provides a computer-readable storage medium including instructions that, when executed on a sample collection system, enable the sample collection system to implement the method for improving sorting accuracy based on an AI algorithm sorting line provided in the above embodiments, which will not be elaborated here.
[0022] Fourthly, this application provides a computer program product that, when run on a sample collection system, enables the sample collection system to implement the method for improving sorting accuracy based on an AI algorithm sorting line provided in the above embodiments, which will not be elaborated here.
[0023] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: 1. The sample collection system acquires image information of objects transported on the conveyor belt through the sorting equipment, and then changes the shooting angle of the transported objects on the conveyor belt through the return device, thereby realizing multi-angle shooting of the transported objects.
[0024] 2. The sample collection system, through the cooperation of sorting equipment and return device, realizes the automated collection of target samples, reduces manual intervention, and significantly improves the efficiency and quality of sample collection.
[0025] 3. The sample collection system compares the original images captured with the recognition results of the first and second detection models to select valuable original images to expand the target sample set and use them for model optimization and training. This improves the comprehensiveness and accuracy of target sample collection, as well as the accuracy of model recognition. Attached Figure Description
[0026] Figure 1 This is a flowchart illustrating a method for improving sorting accuracy on a sorting line based on AI algorithms, as described in this application. Figure 2 This is another flowchart illustrating a method for improving sorting accuracy based on an AI algorithm sorting line in this application embodiment; Figure 3 This is an exemplary scenario diagram of the return device in this application sending a transported object that has fallen off the conveyor belt back onto the conveyor belt. Figure 4 This is an exemplary scenario diagram of the first detection model mounted on the sorting equipment recognizing the original image in an embodiment of this application; Figure 5 This is a schematic diagram of the physical device structure of a sample collection system in an embodiment of this application. Detailed Implementation
[0027] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to any or all possible combinations including one or more of the listed items.
[0028] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0029] To facilitate understanding, the application scenarios of the relevant technical embodiments are introduced below.
[0030] A waste treatment center in a large city processes tens of thousands of tons of mixed waste daily. To achieve effective resource recycling, the center introduced an advanced optical sorting system designed to automate the waste sorting process. This system is required to separate waste into four main categories: recyclables (such as plastic bottles and metal cans), food waste, hazardous waste, and other waste. However, the center's management quickly discovered that while the optical sorting system significantly improved sorting efficiency, its accuracy still needed improvement. Misjudgments frequently occurred, particularly when identifying items with similar shapes but different materials (such as plastic packaging and aluminum foil packaging) and when processing contaminated or damaged recyclables. This not only affected the purity of the recyclables but also increased the workload and cost of subsequent manual corrections. To improve the optical sorting system's accuracy, the center urgently needed a large number of high-quality, diverse waste sample images to train and optimize the AI model used for waste sorting and recognition. However, traditional methods of manually collecting sample images faced significant challenges: waste is diverse in type and form, and there are hygiene and safety risks involved. How to efficiently and safely acquire a large number of real waste sample images became a pressing issue.
[0031] To address the sample collection issue, the waste treatment center initially adopted a common approach. They set up a dedicated sample collection station next to the processing line, staffed with several trained personnel. These personnel randomly selected various types of waste samples from the processing line daily, cleaned them briefly, and placed them on a specially designed imaging platform. High-definition cameras were then used to photograph the waste from different angles. These images were subsequently used to train and update the AI model of the light sorter.
[0032] However, current technologies for acquiring target sample images primarily rely on manual setup and shooting. The manually arranged shooting environment differs from the actual conditions on a production line, and the acquired images cannot accurately reflect the various possible states of sorted waste on the conveyor belt. This results in a sample collection process that is not only labor-intensive but also inefficient and produces low-quality samples.
[0033] To address the aforementioned issues, this application provides a method and system for improving sorting accuracy on an AI-based sorting line. Based on this, when various types of waste move on the conveyor belt, the sample collection system can control a high-speed camera installed on the optical sorter to automatically capture the first batch of original images. The captured images are then directed to a specially designed return device, which alters the contact position between the waste and the conveyor belt. This allows for the capture of a second batch of original images when the waste re-enters the conveyor belt, obtaining sample images from different angles and states. Furthermore, a dual-model verification mechanism is employed, simultaneously inputting these original images into a fast-response model mounted locally on the optical sorter and a high-precision model in the cloud. When the recognition results of the two models are inconsistent, these valuable sample images are automatically collected to expand the target sample set. This achieves rapid, high-quality, and low-cost acquisition of sample images of the target category from a real production line.
[0034] To facilitate understanding, the method provided in this implementation will be described in detail below, using the above scenario as an example. Specifically, as follows... Figure 1 The diagram shown is a flowchart illustrating a method for improving sorting accuracy based on an AI algorithm sorting line in an embodiment of this application.
[0035] S101. Determine the transport object to be used for collecting the target sample.
[0036] In the process of collecting samples for waste sorting using sorting equipment, the user first needs to set up a transport object for the target sample collection on the sample collection system. This transport object is transported on a conveyor belt. For example, in one specific embodiment, if the sorting equipment used is a light sorter, the light sorter needs to separate plastic waste from glass waste. Therefore, the transport object placed on the conveyor belt for sorting is mixed waste containing both plastic and glass products. During the transport of this mixed waste on the conveyor belt, a camera mounted on the light sorter takes pictures, and the pictures are labeled and used for training the detection model to improve the accuracy of the detection model in identifying waste types. Therefore, in this embodiment, the transport object used for target sample collection is mixed waste.
[0037] It should be noted that sorting is generally required in industries such as grain, food, mining, and chemicals. To improve efficiency, optical sorters are typically used for automated sorting. These machines utilize intelligent recognition models to accurately identify different types of objects on the conveyor belt, such as plastics, metals, and glass, achieving rapid and high-purity sorting. For ease of understanding, this application primarily uses automated waste sorting as an example. However, the technical solution provided in this application is also applicable to sorting in other fields, and is not limited here.
[0038] It should also be noted that the sorting equipment provided in this application is mainly used in machinery and equipment that rely on the image recognition function of intelligent models to perform sorting work. In actual application scenarios, the sorting equipment includes, but is not limited to, optical sorters, which are not limited here.
[0039] S102. Obtain the first original image of the transported object through the sorting equipment.
[0040] Specifically, the transported objects to be sorted generally enter the conveyor belt through the feed inlet. During the transport process on the conveyor belt, the transported objects to be sorted will pass through the sorting equipment. At this time, the camera installed inside the sorting equipment will automatically take pictures of the transported objects on the conveyor belt, obtain the first original image and save it to provide material for subsequent model training.
[0041] S103. The transport object that fell on the return device is sent back onto the conveyor belt for shooting to obtain the second original image.
[0042] After being photographed at the sorting equipment end, objects transported on the conveyor belt fall into a return device at the end of the conveyor belt, then return to the conveyor belt and are photographed again to obtain a second original image. There is a certain height difference between the end of the conveyor belt and the return device, which facilitates the flipping of the transported objects during the fall, causing a change in the contact position between the object and the conveyor belt after returning. For example, before falling, a plastic bottle may be facing the positive direction of the conveyor belt's movement; after falling and returning to the conveyor belt, the bottle may be facing the opposite direction.
[0043] Specifically, such as Figure 3 The diagram shown is an exemplary scenario in which the return device in this application re-feeds a transported object that has fallen off the conveyor belt back onto the conveyor belt. Conveyor belt A is used to transport the object to the camera of the optical sorting device for imaging. Ramp B and conveyor belt C together constitute the return device. A camera is installed above conveyor belt A (the camera is mounted on the optical sorting device end, which is not located on the optical sorting device end). Figure 3 (Displayed in the image), used to obtain the original image of the objects being transported on the conveyor belt; the arrow direction indicates the direction of the conveyor belt's movement. Figure 4 The dashed lines in the diagram represent the virtual path of the transported object, which is not entirely the same as the actual trajectory of the transported object, and are not limited here.
[0044] Ramp B is used to receive transport objects that fall from conveyor belt A, causing them to slide onto conveyor belt C. Conveyor belt C then retransmits the transport objects that have slid down ramp B back onto conveyor belt A, allowing the transport objects that fell from conveyor belt A to re-enter conveyor belt A for imaging, thus obtaining the second original image.
[0045] It should be noted that due to the height difference between the end of the conveyor belt and the ramp B, the transported object will flip to some extent during the fall. In addition, the transported object may also be deflected due to collision during the process of entering the conveyor belt C from the ramp B. As a result, the transported object will be different from the one that was transported to conveyor belt A after being transported to C, in terms of direction, position and arrangement order, etc. This will result in a certain difference in the shooting angle between the second original image and the first original image.
[0046] S104. Input the original image into the first detection model and the second detection model respectively, and determine whether the recognition results of the two models are consistent.
[0047] After acquiring a wealth of raw images, the sample collection system needs to filter out truly valuable samples to optimize the overall system performance. This step introduces two detection models, and by comparing their recognition results, the quality and value of each image are determined.
[0048] The sample collection system inputs each original image (including a first original image and a second original image) into two detection models. The first detection model is mounted on a sorting device, while the second detection model runs on a cloud server. The two models have similar functions, but the second detection model is superior to the first detection model in terms of resource allocation and model complexity.
[0049] To facilitate understanding, the construction process of the first and second detection models is described below. Taking the first detection model as an example, users collect sample images and label them (e.g., labeling a transparent green bottle as "green_bottle" and a transparent blue bottle as "blue_bottle") to obtain a dataset. Then, a YOLO format training set is generated based on the dataset. Next, the YOLOv8 OBB object detection algorithm and the above training set are used for single-object detection training to identify target objects in the sample images and their relative positions. Then, the target objects in the above dataset are classified. According to the coordinate and category information in the annotation file, the target images (images corresponding to the target objects) are extracted from the original images (sample images) and placed in the category folder corresponding to the target's labeled category. Data processing is performed on the images in the above multiple category folders to convert the size of the target images to the same size (e.g., 112*112, 224*224, 320*320). Finally, the Transformer classification model is used to train the data in the above folders, enabling the generated classification model to correctly classify the targets, thus obtaining the first detection model.
[0050] Based on the above, the working process of the first detection model is as follows: after detecting the original image input, it identifies each target object in the original image through the internal YOLOv8 OBB single target detection, obtains multiple target images and their corresponding position information, and then inputs each target image into the transformer classification model for calculation to obtain the category information corresponding to each target image.
[0051] It should be noted that the Transformer classification model provided in this embodiment is a deep learning model based on a self-attention mechanism, which is widely used in text classification, image classification, and other fields. Further details will not be elaborated here.
[0052] Furthermore, the training process for the second detection model is basically the same as that for the first detection model. The difference lies in that the second detection model is hosted on a cloud server, which has better computing resources, resulting in a more complex classification model. Specifically, the YOLOv8X CLS algorithm and the aforementioned training set are used for model training, leading to a more complex, deeper, and larger model with better classification accuracy.
[0053] S105. If the recognition results of the two models for the original image are inconsistent, the original image is used to expand the target sample set.
[0054] Specifically, after the sample collection system inputs the original image into the first detection model and the second detection model respectively, each model outputs the recognition result of each transport object in the original image, i.e., the category of the transport object. The sample collection system checks whether the recognition results of transport objects at the same location are consistent in the two models. If they are inconsistent, the target sample set is expanded using the original image input to the models. For example, suppose in a specific embodiment, for the same original image, at location A in the image, the first detection model identifies the transport object at A as a red plastic bottle, while the second detection model identifies the transport object at A as a green plastic bottle. Then, it is determined that the recognition results of the two models for the original image are inconsistent (the red plastic bottle and the green plastic bottle need to be classified).
[0055] It should be noted that the expanded target sample set is used to fine-tune and train the first and second detection models to improve the accuracy of object category recognition by the first and second detection models. The specific training process will not be described here.
[0056] In the above embodiment, the sample collection system acquires image information of objects transported on the conveyor belt through the sorting equipment, and then changes the shooting angle of the transported objects on the conveyor belt through the return device, realizing multi-angle shooting of the transported objects. Simultaneously, for the original images captured, valuable sample images are selected to expand the target sample set by comparing their recognition results with the first and second detection models, thereby improving the comprehensiveness and accuracy of target sample collection. Furthermore, the cooperation between the sorting equipment and the return device automates the target sample collection process, reducing manual intervention and significantly improving the efficiency and quality of sample collection.
[0057] The following is a more detailed description of the process of the method provided in this implementation. Specifically, as follows... Figure 2 The diagram shown is another flowchart illustrating a method for improving sorting accuracy based on an AI algorithm sorting line in this application.
[0058] S201. Match the height difference corresponding to the transported object from the database and adjust the height difference between the conveyor belt and the return device.
[0059] During sample collection, the transported objects vary in shape and size. To ensure that objects of different sizes can fall smoothly from the conveyor belt onto the return device and change angle when re-entering the conveyor belt, the height difference between the conveyor belt and the return device needs to be dynamically adjusted according to the characteristics of the objects.
[0060] Specifically, the sample collection system pre-stores the size information of various common transport objects and their corresponding optimal height differences in a database. Once a transport object for sampling is determined, the system automatically searches the database for the object's information and matches the corresponding height difference. Then, based on this value, the control module adjusts the distance between the conveyor belt and the return device in real time via actuators such as servo motors or hydraulic devices. This ensures that during the process of the transport object falling and re-entering the conveyor belt, it will not fail to change its angle due to an insufficient height difference, nor will it be damaged or bounce off the conveyor belt due to an excessive height difference.
[0061] For example, if the sample to be collected is a small aluminum can, the database matches an optimal height difference of 10cm. The sample collection system will then control the actuator to raise the conveyor belt or lower the return device until the height difference reaches 10cm. When switching to a larger cardboard box sample, the matched height difference might be 2m, and the sample collection system will correspondingly increase the distance between the conveyor belt and the return device. This adaptive adjustment mechanism ensures that different transported objects can achieve ideal angle changes during the return process, thereby capturing diverse images.
[0062] In the above embodiments, the sample collection system incorporates a mechanism for dynamically adjusting the height difference between the conveyor belt and the return device. By matching the height difference values corresponding to the transported objects from the database and adjusting the height accordingly, the system can handle objects of various sizes and shapes. This allows the landing point of the transported object to change as it falls from the conveyor belt to the return device, enabling the acquisition of original images from different angles when the object re-enters the conveyor belt for imaging, thereby improving the quality of sample collection.
[0063] S202. Obtain original images of the transported objects through the sorting equipment and return device.
[0064] This step has already been described in steps S102 to S103 above, and will not be repeated here.
[0065] S203. When the number of recirculations exceeds the preset cycle threshold, the transport object that has fallen on the recirculation device will no longer be sent back onto the conveyor belt for shooting.
[0066] While recirculation devices can improve the sampling efficiency of transported objects, allowing the same object to circulate infinitely between the conveyor belt and the recirculation device not only consumes system resources but also reduces the sampling value of images after multiple cycles of shooting. Therefore, the sample collection system sets a preset loop threshold to control the number of times the transported object is recirculated.
[0067] Specifically, the sample collection system tracks the number of times objects from the same batch (placed on the conveyor belt for the first time within a preset time period) are returned. When an object from the same batch first falls from the conveyor belt to the return device, its corresponding counter is initialized to 1. Each time the object re-enters the conveyor belt and is photographed again, the counter increments by 1. Once the count reaches a preset cycle threshold (e.g., 3 or 5 times), the control module sends a command to the actuator to guide the object from the return device into the collection box, instead of continuing to send it back to the conveyor belt via the return device. In this way, the system achieves a balance between acquiring a sufficient number of sample images from multiple perspectives and avoiding unnecessary duplicate sampling.
[0068] S204. Identify the first category information and coordinate information of each transport object in the original image using the first detection model.
[0069] Specifically, the sample collection system acquires original images (first original image or second original image) of the transported objects through the camera on the sorting equipment client, and then inputs the original images into the first detection model to identify the first category information and coordinate information of each transported object present in the original image. For example... Figure 4The diagram shown is an exemplary scene of the first detection model mounted on a light sorter recognizing an original image in an embodiment of this application. 41 represents a target image in the original image. The first detection model identifies the transport object in the original image, obtaining multiple square target images (…). Figure 4 There are 6 target images, and each target image is numbered and classified. The first category information and coordinate information of each transported object are obtained.
[0070] S205. Extract the target image corresponding to each transport object from the original image and convert it into a three-channel image.
[0071] After step S204, the sample collection system crops the original image to extract the target image. Then, using the padding method, the size of the extracted target image is scaled down to a three-channel image in BGR format with a width and height of 640*640.
[0072] It should be noted that the padding method refers to adding a certain number of pixels around the edges of an image so that the size of the processed image meets specific requirements. It is a commonly used preprocessing method in the fields of computer vision and image processing, and will not be limited here.
[0073] In addition to scaling the captured target image to a 640*640BGR format, other formats such as 112*112BGR, 224*224BGR, and 320*320BGR can also be used; no specific limitation is made here.
[0074] S206. Identify the second category information of the three-channel image using the second detection model.
[0075] Specifically, the sample collection system uploads the three-channel image obtained in step S205 to the cloud server. The second detection model on the cloud server identifies the received three-channel image and determines the category of the transport object in the three-channel image, i.e., the second category information.
[0076] In the above embodiments, the sample collection system extracts an image of a single transport object from the original image as the target image, converts it into a three-channel image of a preset format, and then inputs it into the second detection model for recognition. By preprocessing the target image, the influence of background noise can be reduced, allowing the second detection model to focus more on the features of the target object, thereby improving the recognition accuracy and facilitating the verification of the recognition results of the first model.
[0077] S207. Are the information in the first category the same as the information in the second category?
[0078] It is understandable that each original image can identify one or more target images in the first detection model. When the first category information and the second category information of the same target image are different, it is determined that the recognition results of the two models are inconsistent, and the process proceeds to step S209; otherwise, it is determined that the recognition results of the two models are consistent, and the process proceeds to step S208.
[0079] For example, in one specific embodiment, it is necessary to classify glass products and plastic products. Suppose that at a certain moment, the sorting equipment acquires an original image M. A first detection model identifies the transport object (target image) at position (234, 267) in the original image M as a glass product. Then, the target image is uploaded to a second detection model for identification, and it is determined that the transport object in the target image is a plastic product. Therefore, the sample collection system determines that the first category information and the second category information are different.
[0080] S208. Determine that the recognition results of the two models are consistent.
[0081] If the two models are determined to have the same recognition results, it means that the first detection model at the sorting device end is accurate, and the original image input to the model will not affect the model's recognition results. Therefore, the original image is determined to have low sampling value and will not be used for the expansion of the target sample set.
[0082] S209. Use the SAM segmentation algorithm to automatically annotate the original image and generate annotation data.
[0083] If the recognition results of the two models are determined to be inconsistent, it means that the first detection model on the sorting device or the second detection model on the cloud server is inaccurate. The original image input to the model affects the recognition result of the model. Therefore, the original image is determined to have high sampling value and is used to expand the target sample set, thereby improving the recognition accuracy of the model (first detection model and second detection model).
[0084] Furthermore, to add the original images to the target sample set, preprocessing is required. Specifically, the sample collection system uses the SAM segmentation algorithm to automatically label the original images, generating labeled data. This reduces manual workload and improves labeling efficiency.
[0085] It should be noted that the SAM algorithm utilizes the self-attention mechanism of the Transformer to establish long-distance dependencies between different regions of the image, thereby achieving accurate segmentation of the target object, which will not be elaborated here.
[0086] S210. Expand the target sample set using manually fine-tuned labeled data.
[0087] Specifically, after step S209, the sample collection system can display the original image and its corresponding annotation data on a monitor. At this point, the user can interact with the sample collection system on the monitor, modifying the annotation data of the original image to compensate for any potential defects in the SAM segmentation algorithm. The target sample set is then expanded based on the manually fine-tuned annotation data to achieve the acquisition of sample images.
[0088] In the above embodiments, the sample collection system automatically labels the original images by introducing the SAM segmentation algorithm, and combines this with adjustments made by technicians to generate high-quality, effective labeled data. This human-machine collaborative approach improves labeling efficiency while ensuring accuracy. Automatic labeling reduces manual workload, while manual adjustments compensate for potential shortcomings of the automatic algorithm. This method not only rapidly expands the high-quality sample set but also continuously improves the system's recognition capabilities, providing strong support for iterative optimization of the model.
[0089] S211. Input the newly added valid labeled data into the first detection model and the second detection model for optimization and training.
[0090] Specifically, the manually fine-tuned labeled data is considered valid labeled data. The sample collection system adds the valid labeled data to the target sample set and simultaneously counts the number of valid labeled data, i.e., the data increment of the target sample set. When the data increment exceeds the user-defined data increment threshold, the newly added valid labeled data is input into the first and second detection models for optimization training. Based on the training results, the model parameters are adjusted to improve the model's accuracy in object recognition. The specific optimization training process is basically the same as the model training process in step S104, and will not be elaborated here.
[0091] In the above embodiments, the sample collection system sets a threshold and performs model tuning training after the threshold is reached, enabling it to promptly utilize newly added effective labeled data to improve model performance. This mechanism ensures that the model can continuously learn new sample features and adapt to the ever-changing environment.
[0092] The sample collection system of this invention is applied to electronic devices. Figure 5 A schematic diagram of the architecture of an electronic device suitable for implementing embodiments of the present invention is shown.
[0093] It should be noted that, Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.
[0094] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by instructions (computer programs), or by instructions (computer programs) controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor. The electronic device of this embodiment includes a storage medium and a processor, wherein the storage medium stores multiple instructions that can be loaded by the processor to execute any step of the method provided in the embodiments of the present invention.
[0095] Specifically, the storage medium and the processor are electrically connected directly or indirectly to enable data transmission or interaction. For example, these components can be electrically connected to each other via one or more signal lines. The storage medium stores computer-executable instructions that implement data access control methods, including at least one software functional module that can be stored in the storage medium in the form of software or firmware. The processor executes various functional applications and data processing by running the software program and module stored in the storage medium. The storage medium can be, but is not limited to, Random Access Memory (RAM), Read-Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc. The storage medium stores the program, and the processor executes the program after receiving the execution instructions.
[0096] Furthermore, the software programs and modules within the aforementioned storage medium may also include an operating system, which may include various software components and / or drivers for managing system tasks (e.g., memory management, storage device control, power management, etc.) and can communicate with various hardware or software components to provide an operating environment for other software components. The processor may be an integrated circuit chip with signal processing capabilities. The aforementioned processor may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc., which can implement or execute the methods, steps, and logic flowcharts disclosed in this embodiment. The general-purpose processor may be a microprocessor or any conventional processor.
[0097] Since the instructions stored in the storage medium can execute the steps in any of the methods provided in the embodiments of the present invention, the beneficial effects of any of the methods provided in the embodiments of the present invention can be achieved, as detailed in the preceding embodiments, and will not be repeated here.
[0098] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for improving sorting accuracy on a sorting line based on AI algorithms, applied to a sample collection system, characterized in that, The method includes: A transport object for collecting target samples is determined, and the transport object is placed on a conveyor belt; The first original image of the transported object is obtained through a sorting device equipped with a camera for taking pictures. The transport object that fell onto the return device was put back onto the conveyor belt for photographing to obtain a second original image. There is a height difference between the return device and the end of the conveyor belt, which is used to change the contact position between the transport object and the conveyor belt. The original images are input into the first detection model and the second detection model respectively, and it is determined whether the recognition results of the two models are consistent. The original images include the first original image and the second original image. The first detection model is mounted on the sorting equipment and the second detection model is mounted on the cloud server. If the recognition results of the two models for the original image are found to be inconsistent, the original image is used to expand the target sample set.
2. The method according to claim 1, characterized in that, The step of inputting the original image into the first detection model and the second detection model respectively, and determining whether the recognition results of the two models are consistent, specifically includes: The original image is input into the first detection model to identify the first category information and coordinate information of each transport object in the original image; The original image is input into the second detection model to identify the second category information of the transported object corresponding to each coordinate information; If the first category information is detected to be the same as the second category information, then the two models are determined to have the same recognition results; If the first category information is detected to be different from the second category information, it is determined that the recognition results of the two models are inconsistent.
3. The method according to claim 2, characterized in that, The step of inputting the original image into the second detection model to identify the second category information of the transport object corresponding to each coordinate information specifically includes: The target image corresponding to each transport object is extracted from the original image, and the position of the target image is determined based on the coordinate information; The target image is converted into a three-channel image in a preset format; The three-channel image is input into the second detection model to identify the second category information corresponding to the three-channel image.
4. The method according to claim 1, characterized in that, Following the step of determining the transport object for target sample collection, the method further includes: Match the height difference corresponding to the transported object from the database; The height difference between the conveyor belt and the return device is adjusted based on the height difference value.
5. The method according to claim 1, characterized in that, The step of using the original image to expand the target sample set if the recognition results of the two models for the original image are found to be inconsistent specifically includes: The SAM segmentation algorithm is called to automatically annotate the original image and generate annotation data; Receive adjustment parameters from technical personnel for the labeled data; The annotation data is fine-tuned according to the adjustment parameters to obtain the effective annotation data of the original image; The target sample set is expanded using the aforementioned effectively labeled data.
6. The method according to claim 5, characterized in that, Following the step of augmenting the target sample set using the original image and the effective labeled data, the method further includes: Receive user-defined data increment thresholds; After detecting that the number of valid labeled data in the target sample set exceeds the data increment threshold, the newly added valid labeled data is input into the first detection model and the second detection model for optimization and training.
7. The method according to claim 1, characterized in that, After the step of feeding the transport object that has fallen onto the return device back onto the conveyor belt for photographing to obtain a second original image, the method further includes: Count the number of times transported goods are returned; When the number of recirculations exceeds a preset cycle threshold, the transport object that has fallen onto the recirculation device will no longer be sent back onto the conveyor belt for shooting.
8. A sample collection system, characterized in that, The sample collection system includes: one or more processors and a memory; The memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the sample collection system to perform the method as described in any one of claims 1-7.
9. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are executed on the sample collection system, the sample collection system performs the method as described in any one of claims 1-7.
10. A computer program product, characterized in that, When the computer program product is run on the sample collection system, it causes the sample collection system to perform the method as described in any one of claims 1-7.
Citation Information
Patent Citations
Classification model training method and classification method
CN114511023A
Garbage detection method, computer equipment and medium
CN114937208A