Segmented region object counting device, method and system based on fast instance segmentation

By using a segmented region target counting device and method based on fast instance segmentation, and utilizing a robotic arm, radar disk, and control equipment, combined with a high-speed camera assembly and gravity sensor, the problem of inefficient counting of items within a specified area in existing technologies is solved, achieving high-precision, unmanned, and rapid item recognition and counting.

CN116306765BActive Publication Date: 2026-11-27XIANGYA HOSPITAL CENT SOUTH UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310268615.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-17
Publication Date
2026-11-27
Estimated Expiration
2043-03-17

AI Technical Summary

Technical Problem

Most existing counting methods can only identify and count the entire image, and cannot count a specific region in the scene, or although they can count a specific region, their computational efficiency is low.

Method used

A segmented region target counting device and method based on fast instance segmentation is adopted. It utilizes a robotic arm, radar disk, and control equipment, combined with a high-speed camera component and a gravity sensor, to identify and count items within a specified area through an instance segmentation model. The counting and secondary refresh are performed using the fan-shaped area of ​​the radar disk and the gravity sensor.

Benefits of technology

It achieves high-precision counting of items within a specified area, improves computational efficiency, enables unmanned and rapid item recognition and counting, and reduces the error rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116306765B_ABST
    Figure CN116306765B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on quick instance segmentation's segmentation area target counting device, method and system, the device uses mechanical arm, radar disc and control equipment, mechanical arm includes high-speed camera component and mechanical arm component, control equipment is used to according to the identification information sent by high-speed camera component and the counting information collected by gravity sensor, mark and show using the preset radar disc mapping area, each radar disc mapping area is counted after material is identified and grabbed by mechanical arm, when a batch of materials are all identified and classified, the current material quantity is displayed in each sector area.The application can identify and count the quantity of different area goods in picture, accurately obtain specified area in real time, and identify the goods category in area and give the position of goods;It can count the material in specified area in scene, and the counting precision is high;High degree of intelligence, high computing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular discloses a segmentation region target counting device, method and system based on fast instance segmentation. Background Technology

[0002] With the vigorous advancement of automation, automatic real-time counting of items in various scenarios is required. Existing intelligent counting methods can only count items across the entire image and cannot distinguish the quantity of items in different areas. For example, patent CN114494823 invented a product recognition and detection counting method for retail scenarios, based on a deep learning-based crowd counting method. Patent CN201910609399.6 invented a deep learning-based vehicle counting method based on road surface extraction and segmentation. However, most methods can only recognize and count items across the entire image and cannot count specific areas within a scene. Patent CN201910609399.6 obtains the category prediction segmentation mask for roads and vehicles through two branches, reducing computational efficiency.

[0003] Therefore, most existing counting methods can only identify and count the entire image and cannot count a specific region in the scene; or although they can count a specific region in the scene, their computational efficiency is low, which is a technical problem that urgently needs to be solved. Summary of the Invention

[0004] This invention provides a segmented region target counting device, method, and system based on fast instance segmentation, aiming to solve the technical problem that most existing counting methods can only identify and count the entire image and cannot count a specified region in the scene; or although they can count a specified region in the scene, their computational efficiency is low.

[0005] One aspect of this invention relates to a segmented region target counting device based on rapid instance segmentation, comprising a robotic arm, a radar disk, and a control device. The robotic arm includes a high-speed camera assembly and a robotic arm assembly. The high-speed camera assembly is positioned above the material conveyor belt and the radar disk, and is used to move using a folding mechanical transmission mechanism. The end of the robotic arm assembly is equipped with a gripping mechanism, which has a rubber sleeve or a pneumatic silicone suction cup to reduce mechanical stress during gripping. The high-speed camera assembly is mounted above the gripping mechanism and is used to quickly capture and identify the product label of the material when the grooved fixture on the material conveyor belt displays it upwards. The robotic arm assembly then identifies and grips the material, rotates the bottle cap upwards, and places it in a designated position on the radar disk, completing the identification, classification, and counting. The radar disk has N fan-shaped regions distributed from the center outwards. The external expansion mechanism allows each area to hold a quantity of material that increases outwards from the center. Each area is equipped with a gravity sensor to count materials based on a preset weight. The control device connects to both a high-speed camera assembly and the gravity sensor. Based on the identification information transmitted from the high-speed camera assembly and the counting information collected by the gravity sensor, a preset radar disk mapping area is used for marking and displaying the data. Each radar disk mapping area counts materials after the robotic arm identifies and grasps them. Once a batch of materials has been identified and classified, the current quantity of materials is displayed in each sector. After verifying the radar disk gravity sensor readings, a second refresh is performed based on the gravity sensor counts in each sector. If there is any discrepancy between the grasping count and the gravity sensor count, the sector is displayed in yellow; if an error is clearly present, the sector is displayed in red and flashes as a warning; if there is no discrepancy, the sector is displayed in green.

[0006] Furthermore, the control equipment is also used to mark a region or type of material in the radar panel of a batch as gray after all of it has been extracted and used; if the information system still records that the material of that type has not been used up, a pop-up alarm will be issued immediately, with the prompt displayed in full-screen red, indicating that there is an error in the material of that type, and reminding the staff to check it in time.

[0007] Another aspect of the present invention relates to a segmented region target counting method based on fast instance segmentation, applied in the aforementioned segmented region target counting device based on fast instance segmentation. The segmented region target counting method based on fast instance segmentation includes the following steps:

[0008] Training sample set creation: Collect training images, label training images, and generate instance segmentation labels;

[0009] Instance segmentation model training: Detect the location region where the drug is located and output the classification confidence of the drug; output the region mask and classification confidence of different regions of the radar disk;

[0010] Segmentation result fusion: First, the location and classification of the drug are obtained using an instance segmentation model; then, the mask and classification of the location region where the drug is located are obtained; finally, the number of drugs within the mask of the location region where the drug is located is the number of drugs in the region.

[0011] Furthermore, the steps for creating the training sample set include:

[0012] Detecting the location of the medicine: The high-definition camera in the high-speed camera assembly continuously captures video of the medicine shooting area. The video shows the medicine placed in different areas according to different combinations, different directions and different positions.

[0013] Annotate training images: During the annotation process, the bounding boxes of the drugs in the training images are annotated. Different sector areas of the radar disk are also annotated, and the masks of different sector areas of the radar disk are annotated in a polygonal manner.

[0014] Instance segmentation dataset creation: First, based on the characteristic that most injectable drugs are circular in top-view imaging, a circular polygon mask is generated in the labeled training images, with the center of the labeled rectangle as the center and the average length and width of the rectangle as the diameter; then, the dataset is divided into training set and validation set in a 3:1 ratio.

[0015] Furthermore, the steps for fusing the segmentation results include:

[0016] The preprocessing module is used to randomly scale the training images and then crop them into fixed-size images to facilitate network processing and load relevant annotations.

[0017] Perform spatial transformation, color dithering, and Grid-Mask data augmentation on images cropped to a fixed size;

[0018] Load the pre-trained model trained on the COCO dataset to initialize the network parameters;

[0019] The model is trained on the training set until it converges. The detection results under different hyperparameters are obtained by measuring the detection accuracy of the training set on the validation set. The model with the highest accuracy on the validation set is selected as the final inference model.

[0020] Furthermore, the steps for fusing the segmentation results include:

[0021] Load the trained instance segmentation model;

[0022] Load the images captured by the camera and preprocess them;

[0023] Use an inference model to obtain the regional location and classification confidence of drugs in the image;

[0024] By fusing the results of instance segmentation with the regional location and classification confidence of drugs in the obtained images, the final drug count can be achieved.

[0025] Another aspect of the present invention relates to a segmented region target counting system based on fast instance segmentation, applied in the above-mentioned segmented region target counting device based on fast instance segmentation, the segmented region target counting system based on fast instance segmentation comprising:

[0026] The dataset creation module is used to create training sample sets: collecting training images, labeling training images, and creating instance segmentation datasets.

[0027] The instance segmentation model training module is used for training the instance segmentation model: detecting the location region where the drug is located, outputting the classification confidence of the drug; and outputting the region mask of different sector regions of the radar disk.

[0028] The identification and counting result fusion module is used for segmentation result fusion: First, the location and classification confidence of the drug are obtained using the instance segmentation model; then, the mask and classification confidence of different sector regions of the radar disk are obtained; finally, the number of drugs in the mask of the location region where the drug is located is the number of drugs in the region.

[0029] Furthermore, the dataset creation module includes:

[0030] The first detection unit is used to detect the location of the medicine: the high-definition camera in the high-speed camera assembly continuously captures video of the medicine shooting area. The video shows the medicine placed in different areas according to different combinations, different directions and different positions.

[0031] The annotation unit is used to annotate training images: during the annotation process, the bounding box of the medicine in the training image is annotated, and different sector areas of the radar disk are also annotated. The mask of different sector areas of the radar disk is annotated in a polygonal way.

[0032] The production unit is used to generate instance segmentation labels: First, in the labeled training images, based on the characteristic that most injectable drugs are circular in top-view imaging, a circular polygon mask is generated with the center of the labeled rectangle as the center and the average length and width of the rectangle as the diameter; then the dataset is divided into training set and validation set in a 3:1 ratio.

[0033] Furthermore, the identification and counting result fusion module includes:

[0034] The cropping unit is used to crop the training image to a fixed size after the preprocessing module randomly scales it, so that the network can process it and load the relevant annotations.

[0035] The processing unit is used to perform spatial transformation, color dithering, and Grid-Mask data augmentation on images cropped to a fixed size.

[0036] The loading unit is used to load a pre-trained model trained on the COCO dataset to initialize the network parameters;

[0037] The training unit is used to train the model on the training set until convergence. The detection results under different hyperparameters are obtained by measuring the detection accuracy of the training set on the validation set. The model with the highest accuracy on the validation set is selected as the final inference model.

[0038] Furthermore, the identification and counting result fusion module includes:

[0039] The second detection unit is used to load the trained instance segmentation model;

[0040] The preprocessing unit is used to load the images acquired by the camera and perform preprocessing.

[0041] The acquisition unit is used to obtain the regional location and classification confidence of drugs in an image using an inference model;

[0042] The fusion unit is used to fuse the results of instance segmentation, as well as the regional location and classification confidence of drugs in the obtained image, to achieve the final drug counting.

[0043] The beneficial effects achieved by this invention are as follows:

[0044] This invention provides a segmented region target counting device, method, and system based on rapid instance segmentation. The device employs a robotic arm, a radar disk, and a control device. The robotic arm includes a high-speed camera assembly and a robotic arm assembly. The high-speed camera assembly is mounted above the gripping mechanism to quickly capture and identify the product label of the material when the grooved fixture on the material conveyor belt displays it upwards. The robotic arm assembly then identifies and grips the material, rotates it so the bottle cap faces upwards, and places it in a designated position on the radar disk, completing the identification, classification, and counting. The radar disk counts based on a preset material weight. The control device is used to count based on the height... The identification information transmitted by the high-speed camera component and the counting information collected by the gravity sensor are marked and displayed using a preset radar disk mapping area. Each radar disk mapping area is counted after the robotic arm identifies and grasps the material. After all materials in a batch are identified and classified, the current quantity of materials is displayed in each sector area. When the radar disk gravity sensor is selected for verification, the gravity sensor count of each sector area is refreshed a second time. If there is any doubt between the grasping count and the gravity sensor count, the sector area is displayed in yellow; if there is a clear error, the sector area is displayed in red and flashes as a prompt; if there is no doubt, the sector area is displayed in green. The segmented area target counting device, method and system based on rapid instance segmentation provided by this invention can identify and count the quantity of items in different areas of the screen, accurately acquire a specified area in real time, identify the type of items in the area and give the location of the items; it can count the materials in a specified area of ​​the scene with high counting accuracy; it has a high degree of intelligence and high computing efficiency, and can realize unmanned and rapid identification and counting of injected drugs. Attached Figure Description

[0045] Figure 1 A flowchart illustrating an embodiment of the segmented region target counting method based on fast instance segmentation provided by the present invention;

[0046] Figure 2 for Figure 1 A detailed flowchart illustrating an embodiment of the steps for creating the training sample set is shown.

[0047] Figure 3 for Figure 1 A detailed flowchart of the steps for fusing the segmentation results shown in the first embodiment is illustrated.

[0048] Figure 4 for Figure 3 A detailed flowchart of the second embodiment of the segmentation result fusion steps is shown;

[0049] Figure 5 This is a schematic diagram of the SOLOV2 structure in the invention;

[0050] Figure 6 This is a schematic diagram of the SOLOV2 mask branch in the invention;

[0051] Figure 7 This is a schematic diagram of the Grid-Mask in the invention;

[0052] Figure 8 Flowchart for training the SOLOV2 instance segmentation network;

[0053] Figure 9 Flowchart for SOLOV2 instance segmentation network inference;

[0054] Figure 10 This is a flowchart of the overall reasoning stage of the present invention;

[0055] Figure 11 A functional block diagram of an embodiment of the segmented region target counting system based on fast instance segmentation provided by the present invention;

[0056] Figure 12 for Figure 11 A schematic diagram of the functional modules of an embodiment of the dataset creation module shown in the figure;

[0057] Figure 13 for Figure 11 The diagram shows a functional module schematic of the first embodiment of the identification and counting result fusion module.

[0058] Figure 14 for Figure 11 The diagram shows a functional module schematic of the second embodiment of the identification and counting result fusion module.

[0059] Explanation of icon numbers:

[0060] 10. Dataset creation module; 20. Instance segmentation model training module; 30. Recognition and counting result fusion module; 11. First detection unit; 12. Labeling unit; 13. Creation unit; 31. Cropping unit; 32. Processing unit; 33. Loading unit; 34. Training unit; 35. Second detection unit; 36. Preprocessing unit; 37. Acquisition unit; 38. Fusion unit. Detailed Implementation

[0061] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.

[0062] like Figures 1 to 10As shown, the first embodiment of the present invention proposes a segmented region target counting device based on rapid instance segmentation, including a robotic arm, a radar disk, and a control device. The robotic arm includes a high-speed camera assembly and a robotic arm assembly. The high-speed camera assembly is positioned above the material conveyor belt and the radar disk, and is used to move using a folding mechanical transmission mechanism. The end of the robotic arm assembly is equipped with a gripping mechanism, which has a rubber sleeve or a pneumatic silicone suction cup to reduce mechanical stress during gripping. The high-speed camera assembly is mounted above the gripping mechanism and is used to quickly capture and identify the product label of the material when the grooved fixing fixture on the material conveyor belt displays it upwards. The robotic arm assembly then identifies and grips the material, rotates the bottle cap upwards, and places it in a designated position on the radar disk, completing the identification, classification, and counting. The radar disk has N fan-shaped areas, and the N fan-shaped areas are distributed from... The system expands outwards from the center, with the capacity of each area increasing outwards from the center. Each area is equipped with a gravity sensor to count materials based on a preset weight. The control device connects to both a high-speed camera assembly and the gravity sensor. Based on the identification information transmitted from the high-speed camera assembly and the counting information collected by the gravity sensor, a preset radar disk mapping area is used for marking and displaying. Each radar disk mapping area counts materials after the robotic arm identifies and grasps them. Once a batch of materials has been identified and classified, the current quantity of materials is displayed in each sector. After verifying the radar disk gravity sensor count, a second refresh is performed on the gravity sensor counts of each sector. If there is any discrepancy between the grasp count and the gravity sensor count, the sector is displayed in yellow; if an error is clearly present, the sector is displayed in red and flashes as a warning; if there is no discrepancy, the sector is displayed in green.

[0063] In this embodiment, the robotic arm can be an integrated robotic arm. Its working principle is as follows: the integrated robotic arm is suspended on a vibrating circulating conveyor belt. When the grooved fixture on the vibrating circulating conveyor belt displays the product label of the material (e.g., vials) upwards, it quickly captures and identifies the label. The robotic arm component then identifies and grasps the material, rotates the bottle cap upwards, and places it in a designated position on the radar panel. This completes the identification, classification, and counting, reducing the workload of manual sorting and tray arrangement. The error rate is reduced through identification and counting. The radar panel is a material tray equipped with a gravity sensor. It counts based on a preset material weight. The display is shown in the software control interface of the management computer connected to the radar panel, showing various areas of the radar panel. The material weight can be used for secondary quantity verification, reducing the occurrence of errors. The principle is as follows: after the current batch of materials is placed on the radar panel, the rated material quantity in area N1 is A1, and its total weight is a1. If one piece of material is removed from area N1 during use, the material quantity A1 in that area decreases by 1, and the total weight a1 also decreases by 1 accordingly. This is ultimately displayed on the radar panel's interface on the computer-based control software. The control device is either a computer or a mobile device. It uses preset radar panel mapping areas for marking and display. Clicking on a sector-shaped area in the control device's information system software interface will display the material name and quantity in that area in a two-level window, and record the material's entry and exit times. Specifically, the data recording process is as follows: if one piece of material is removed from area N1 during use, the material quantity A1 in that area decreases by 1, and the total weight a1 also decreases by 1 accordingly. This is ultimately displayed on the radar panel's interface on the computer-based control software. When a certain area or type of material in the radar panel of a batch has been completely extracted and used, the area will be marked in gray. If the control equipment information system still records that the material of that type has not been used up, a pop-up alarm will be issued immediately. The alarm will be displayed in full-screen red and will indicate that there is an error in the material of that type, reminding the staff to check it in time.

[0064] Please see Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the segmented region target counting method based on fast instance segmentation provided by the present invention. In this embodiment, the segmented region target counting method based on fast instance segmentation is applied to the aforementioned segmented region target counting device based on fast instance segmentation. The segmented region target counting method based on fast instance segmentation includes the following steps:

[0065] Step S100: Training sample set creation: Collect training images, label training images, and generate instance segmentation labels.

[0066] Collect training images of pharmaceuticals, label the collected training images, and convert the labeled training images into an instance segmentation dataset to create a pharmaceutical instance segmentation dataset.

[0067] Step S200: Instance segmentation model training: Detect the location region where the drug is located, output the classification confidence of the drug; output the region mask of different regions of the radar disk.

[0068] The instance segmentation model is trained to detect the location region of the drug and output the classification confidence score of the drug, as well as region masks for different areas of the radar disk. The main tasks of the instance segmentation model are: first, to detect the location region of the drug and output the classification confidence score; and second, to output region masks for different areas of the radar disk. This instance segmentation model can use common real-time instance segmentation algorithms, such as CenterMask and SOLOv2. Taking SOLOv2 as an example, the network structure is as follows... Figure 5 As shown. First, the image is divided into S×S grids. The network output consists of two branches: a classification branch and a mask branch. The size of the classification branch is S×S×C, where C is the number of categories. The size of the mask branch is H×W×S. 2 S 2 To maximize the number of instances, their positions are mapped to the original image from top to bottom and left to right. The classification branch and the mask branch are responsible for predicting the object's location based on which grid the center of the target object falls into. The mask branch is further divided into a kernel branch and a feature branch. These two branches obtain the convolution kernel and the feature, respectively. During inference, the mask is obtained by performing a 1×1 convolution operation on the feature using the kernel.

[0069] To further improve the performance of the instance segmentation model, ResNet50vd was used as the backbone network, and DCN (Deformable Convolution) layers were added in stages 1-3. By adding an extra learnable offset parameter to each element, the receptive field of the convolution was adjusted, thereby better extracting image features and improving object detection accuracy. Simultaneously, the EMA (Exponential Moving Average) scheme was adopted, using the average value of the parameters over a period of time as the new parameters, making the training process smoother and reducing the impact of outliers on model training, thus improving the model's training effect. Spatial transformations (random flipping, random scaling, random image cropping, etc.), color jittering (brightness, transparency, saturation, etc.), and information deletion (adding random noise, random occlusion, etc.) were used. In addition, a novel information deletion method, Grid-Mask, was used. This method randomly discards a region on the image, which acts as a regularization term in the network to prevent overfitting. The schematic diagram is shown below. Figure 7 As shown.

[0070] Step S300, Segmentation Result Fusion: First, use the instance segmentation model to obtain the location and classification of the drug; then, obtain the mask and classification of the location region where the drug is located; finally, obtain the number of drugs within the mask of the location region where the drug is located, which is the number of drugs in the region.

[0071] The fusion segmentation results are obtained by first using a trained instance segmentation model to obtain the location and classification of the drug; then obtaining the mask and classification of the location region where the drug is located; and finally obtaining the number of drugs within the mask of the location region where the drug is located, which is the number of drugs in the region.

[0072] This embodiment provides a segmented region target counting method based on fast instance segmentation. The method involves: creating a training sample set by collecting and labeling training images; training an instance segmentation dataset; training an instance segmentation model by detecting the location of the drug and outputting the drug's classification confidence; and outputting region masks for different areas of the radar disc. The segmentation results are then fused: first, the instance segmentation model is used to obtain the drug's location and classification; then, the mask and classification of the drug's location region are obtained; finally, the number of drugs within the mask of the drug's location region is the total number of drugs in the region. This segmented region target counting method can identify and count the number of items in different regions of a scene, accurately acquire a specified region in real time, identify the types of items in the region, and provide the item's location. It can count materials in a specified region of a scene with high accuracy; it is highly intelligent and computationally efficient, enabling unmanned and rapid identification and counting of injected drugs.

[0073] Further, please see Figure 2 , Figure 2 for Figure 1 The detailed flowchart of step S100 shown in the figure is illustrated in this embodiment. In this embodiment, step S100 includes:

[0074] Step S110: Detect the location of the medicine: Use the high-definition camera in the high-speed camera assembly to continuously capture video of the medicine shooting area. The video shows the medicine placed in different areas according to different combinations, different directions and different positions.

[0075] High-definition cameras are used to continuously capture video of medicines placed in different combinations, directions, and positions within different areas. The advantages of this method for collecting training images are: 1. It eliminates the need for manual photography, resulting in fast acquisition. 2. The environment in which the training images are captured is consistent with the environment in which the system identifies and counts medicines, improving the system's robustness and recognition accuracy.

[0076] Step S120: Label the training images: During the labeling process, label the bounding boxes of the drugs in the training images. Also label different areas of the radar disk, using polygons to label the masks of different areas of the radar disk.

[0077] During the labeling process, it is necessary to label the bounding box of the drug and also label different areas of the radar disc, using polygons to label the area mask.

[0078] Step S130, Instance Segmentation Dataset Creation: First, in the labeled training images, based on the characteristic that most injectable drugs are circular in top-view imaging, a circular polygon mask is generated with the center of the labeled rectangle as the center and the average length and width of the rectangle as the diameter; then, the dataset is divided into training set and validation set in a 3:1 ratio.

[0079] First, based on the characteristic that most injectable drugs are circular in top-view imaging, a circular polygonal mask is generated using the center of the labeled rectangular frame as the center and the average length and width of the rectangle as the diameter. Then, the dataset is divided into a training set and a validation set in a 3:1 ratio. The training set is mainly used to train the model, while the validation set is mainly responsible for validating the model's performance and guiding the adjustment of relevant hyperparameters.

[0080] This embodiment provides a segmented region target counting method based on fast instance segmentation. The method detects the location of the drug by continuously capturing video of the drug's shooting area using a high-definition camera in a high-speed camera assembly. The video places the drug in different areas according to different combinations, directions, and positions. Training images are labeled: bounding boxes of the drugs in the training images are marked during the labeling process. Different areas of the radar disc are also labeled using polygonal methods to create masks for different areas of the radar disc. Instance segmentation dataset creation: first, based on the characteristic that most injectable drugs are circular in top-view imaging, a circular polygonal mask is generated using the center of the labeled rectangular frame as the center and the average length and width of the rectangle as the diameter. Then, the dataset is divided into training and validation sets at a 3:1 ratio. This embodiment's segmented region target counting method based on fast instance segmentation can identify and count the number of items in different areas of the scene, accurately acquire a specified area in real time, identify the type of items in the area, and provide the item's location. It can count materials in a specified area of ​​the scene with high accuracy; it has a high degree of intelligence and high computational efficiency, enabling unmanned and rapid identification and counting of injectable drugs.

[0081] Preferably, please see Figure 3 , Figure 3 for Figure 1The diagram shows a detailed flowchart of step S300 in the first embodiment. In this embodiment, step S300 includes two stages: a training stage and an inference stage. The training stage mainly involves updating parameters to train the model. In the training stage, step S300 includes:

[0082] Step S310: Use the preprocessing module to randomly scale the image to be trained and then crop it into a fixed-size image to facilitate network processing and load relevant annotations.

[0083] The preprocessing module randomly scales the image and then crops a fixed-size image from it to facilitate network processing, and loads relevant annotations.

[0084] Step S320: Perform spatial transformation, color dithering, and Grid-Mask data augmentation on the image cropped to a fixed size.

[0085] The image undergoes spatial transformation, color dithering, and Grid-Mask data augmentation.

[0086] Step S330: Load the pre-trained model trained on the COCO dataset and initialize the network parameters.

[0087] Load the pre-trained model trained on the COCO dataset to initialize the network parameters.

[0088] Step S340: Train the model on the training set until convergence. Obtain the detection results under different hyperparameters by using the detection accuracy of the training set on the validation set. Select the model with the highest accuracy on the validation set as the final inference model.

[0089] The model is trained on the training set until it converges. The detection results under different hyperparameters are obtained by measuring the detection accuracy of the training set on the validation set. The model with the highest accuracy on the validation set is selected as the final inference model.

[0090] This embodiment provides a segmentation region target counting method based on fast instance segmentation. A preprocessing module randomly scales the training image and then crops it into a fixed-size image to facilitate network processing, and loads relevant annotations. The cropped image undergoes spatial transformation, color dithering, and Grid-Mask data augmentation. A pre-trained model trained on the COCO dataset is loaded, and network parameters are initialized. The model is trained on the training set until convergence. Detection results under different hyperparameters are obtained by measuring the detection accuracy on the validation set. The model with the highest accuracy on the validation set is selected as the final inference model. This segmentation region target counting method can identify and count the number of items in different areas of a scene, accurately acquire a specified area in real time, identify the type of items in the area, and provide the item's location. It can count materials in a specified area of ​​a scene with high accuracy. It is highly intelligent, computationally efficient, and can enable unmanned and rapid identification and counting of injected drugs.

[0091] Further, see Figure 4 , Figure 4 for Figure 1 The detailed flowchart of step S300 in the second embodiment shown above, based on the first embodiment, further includes a reasoning stage in step S300. In the reasoning stage, step S300 includes:

[0092] Step S350: Load the trained instance segmentation model and initialize the network parameters.

[0093] Load the trained instance segmentation model and initialize the network parameters.

[0094] Step S360: Load the image acquired by the camera and perform preprocessing.

[0095] Load the images captured by the camera and preprocess them.

[0096] Step S370: Use an inference model to obtain the regional location and classification confidence of the medicine in the image.

[0097] Use inference models to obtain the regional location and classification of drugs.

[0098] Step S380: Combine the results of instance segmentation with the obtained regional location and classification confidence of drugs in the image to achieve the final drug count.

[0099] By combining the results of instance segmentation with the obtained regional location and classification confidence of drugs, the final drug count is achieved.

[0100] The segmented region target counting method based on fast instance segmentation provided in this embodiment, compared with the prior art, initializes network parameters by loading a pre-trained instance segmentation model; performs spatial transformation, color dithering, and Grid-Mask data augmentation on images cropped to a fixed size; loads and preprocesses images acquired by a camera; uses an inference model to obtain the regional location and classification confidence of drugs in the image; and fuses the results of instance segmentation with the obtained regional location and classification confidence of drugs in the image to achieve the final drug count. The segmented region target counting method based on fast instance segmentation provided in this embodiment can identify and count the number of items in different regions of a scene, accurately acquire a specified region in real time, identify the type of items in the region, and provide the location of the items; it can count materials in a specified region of a scene with high counting accuracy; it has a high degree of intelligence and high computational efficiency, enabling unmanned and rapid identification and counting of injected drugs.

[0101] like Figure 11 As shown, Figure 11 This is a functional block diagram of an embodiment of the segmented region target counting system based on fast instance segmentation provided by the present invention. This segmented region target counting system based on fast instance segmentation is applied in the aforementioned segmented region target counting device based on fast instance segmentation. The segmented region target counting system based on fast instance segmentation includes a dataset creation module 10, an instance segmentation model training module 20, and a recognition and counting result fusion module 30. The dataset creation module 10 is used to create a training sample set: collecting training images, labeling training images, and generating instance segmentation labels. The instance segmentation model training module 20 is used to train the instance segmentation model: detecting the location region of the drug, outputting the drug's classification confidence score, and outputting region masks for different areas of the radar disc. The recognition and counting result fusion module 30 is used to fuse segmentation results: first, using the instance segmentation model to obtain the location and classification of the drug; then, obtaining the mask and classification of the location region of the drug; finally, obtaining the number of drugs within the mask of the location region of the drug, which is the number of drugs in the region.

[0102] The dataset creation module 10 collects drug training images, labels the collected drug training images, and converts the labeled drug training images into an instance segmentation dataset through category classification, thereby creating a drug instance segmentation dataset.

[0103] The instance segmentation model training module 20 trains the instance segmentation model, detects the location region of the drug, and outputs the classification confidence score of the drug and region masks for different areas of the radar disk. The main tasks of the instance segmentation model are: first, to detect the location region of the drug and output the classification confidence score; and second, to output region masks for different areas of the radar disk. This instance segmentation model can use common real-time instance segmentation algorithms, such as CenterMask and SOLOv2. Taking SOLOv2 as an example, the network structure is as follows... Figure 5 As shown. First, the image is divided into S×S grids. The network output consists of two branches: a classification branch and a mask branch. The size of the classification branch is S×S×C, where C is the number of categories. The size of the mask branch is H×W×S. 2 S 2 To maximize the number of instances, their positions are mapped to the original image from top to bottom and left to right. The classification branch and the mask branch are responsible for predicting the object's location based on which grid the center of the target object falls into. The mask branch is further divided into a kernel branch and a feature branch. These two branches obtain the convolution kernel and the feature, respectively. During inference, the mask is obtained by performing a 1×1 convolution operation on the feature using the kernel.

[0104] To further improve the performance of the instance segmentation model, ResNet50vd was used as the backbone network, and DCN (Deformable Convolution) layers were added in stages 1-3. These layers added an extra learnable offset parameter to each element to adjust the receptive field of the convolution, thereby better extracting image features and improving object detection accuracy. Simultaneously, the EMA (Exponential Moving Average) scheme was employed, using the average value of the parameters over a period of time as the new parameters. This resulted in a smoother training process, reducing the impact of outliers on model training and improving training effectiveness. Data augmentation methods such as spatial transformation (random flipping, random scaling, random image cropping, etc.), color dithering (brightness, transparency, saturation, etc.), and information deletion (adding random noise, random occlusion, etc.) were used. Additionally, Grid-Mask was employed, which randomly discards a region on the image, essentially adding a regularization term to the network to prevent overfitting. A schematic diagram is shown below. Figure 7 As shown.

[0105] The identification and counting result fusion module 30 fuses the segmentation results. First, it uses a trained instance segmentation model to obtain the location and classification of the drug; then it obtains the mask and classification of the location region where the drug is located; finally, it obtains the number of drugs within the mask of the location region where the drug is located, which is the number of drugs in the region.

[0106] The segmented region target counting system based on fast instance segmentation provided in this embodiment, compared with the prior art, employs a dataset creation module 10, an instance segmentation model training module 20, and a recognition and counting result fusion module 30. The system involves: creating a training sample set by collecting and labeling training images; creating an instance segmentation dataset; training the instance segmentation model by detecting the location region of the drug and outputting the drug's classification confidence; and outputting region masks for different fan-shaped areas of the radar disc; and fusing the segmentation results by first using the instance segmentation model to obtain the drug's location and classification; then obtaining the mask and classification of the drug's location region; and finally obtaining the number of drugs within the mask of the drug's location region, which is the number of drugs in the region. This segmented region target counting system based on fast instance segmentation can identify and count the number of items in different regions of a scene, accurately acquire a specified region in real time, identify the type of items in the region, and provide the item's location; it can count materials in a specified region of a scene with high counting accuracy; it has a high degree of intelligence and high computational efficiency, enabling unmanned and rapid identification and counting of injected drugs.

[0107] Further, please see Figure 12 , Figure 12 for Figure 11 The diagram illustrates the functional modules of an embodiment of the dataset creation module. In this embodiment, the dataset creation module 10 includes a first detection unit 11, a labeling unit 12, and a creation unit 13. The first detection unit 11 is used to detect the location area of ​​the drug: it continuously captures video of the drug shooting area using a high-definition camera in a high-speed camera assembly. The video places the drug in different areas according to different combinations, directions, and positions. The labeling unit 12 is used to label training images: it labels the bounding boxes of the drugs in the training images during the labeling process, and also labels different areas of the radar disk, using polygons to label the masks of different areas of the radar disk. The creation unit 13 is used to create the instance segmentation dataset: first, in the labeled training images, based on the characteristic that most injectable drugs are circular under top-view imaging, a circular polygonal mask is generated with the center of the labeled rectangular frame as the center and the average length and width of the rectangular frame as the diameter; then, the dataset is divided into a training set and a validation set in a 3:1 ratio.

[0108] The first detection unit 11 uses a high-definition camera to continuously capture video of the drugs placed in different combinations, directions, and positions within different areas. The advantages of this method for collecting training images are: 1. It uses video capture, eliminating the need for manual photography and resulting in fast acquisition speed. 2. The environment in which the training images are captured is consistent with the environment in which the system identifies and counts the drugs, improving the system's robustness and recognition accuracy.

[0109] During the annotation process, annotation unit 12 needs to annotate the bounding box of the drug and also annotate different areas of the radar disk, using polygons to annotate the area mask.

[0110] Unit 13 first generates a circular polygon mask from the labeled drug training images. Based on the characteristic that most injectable drugs are circular in top-view imaging, the mask is created with the center of the labeled rectangle as the center and the average length and width of the rectangle as the diameter. Then, the dataset is divided into a training set and a validation set in a 3:1 ratio. The training set is mainly used to train the model, while the validation set is mainly responsible for validating the model's performance and guiding the adjustment of relevant hyperparameters.

[0111] The segmentation target counting system based on fast instance segmentation provided in this embodiment, compared with the prior art, includes a dataset production module 10 comprising a first detection unit 11, a labeling unit 12, and a production unit 13. It detects the location of the drug by continuously capturing video of the drug's shooting area using a high-definition camera in a high-speed camera assembly. This video places the drug in different areas according to different combinations, directions, and positions. It labels training images by marking the bounding boxes of the drugs in the training images and also labels different sector areas of the radar disk using polygonal methods to create masks for different sector areas of the radar disk. The instance segmentation dataset is then produced by first generating a circular polygonal mask in the labeled training images, based on the characteristic that most injectable drugs are circular under top-view imaging, using the center of the labeled rectangular frame as the center and the average length and width of the rectangular frame as the diameter. Finally, the dataset is divided into a training set and a validation set at a 3:1 ratio. The segmented region target counting system based on fast instance segmentation provided in this embodiment can identify and count the number of items in different areas of the screen, accurately acquire the specified area in real time, identify the type of items in the area and give the location of the items; it can count the materials in the specified area of ​​the scene with high counting accuracy; it has a high degree of intelligence and high computing efficiency, and can realize unmanned and rapid identification and counting of injected drugs.

[0112] Further, please see Figure 13 , Figure 13 for Figure 11The diagram shows a functional module schematic of the first embodiment of the recognition and counting result fusion module. In this embodiment, the recognition and counting result fusion module 30 includes a cropping unit 31, a processing unit 32, a loading unit 33, and a training unit 34. The cropping unit 31 is used to crop the image to be trained into a fixed-size image after random scaling using a preprocessing module, so as to facilitate network processing and load relevant annotations. The processing unit 32 is used to perform spatial transformation, color dithering, and Grid-Mask data augmentation on the cropped fixed-size image. The loading unit 33 is used to initialize the network parameters of the pre-trained model loaded on the COCO dataset. The training unit 34 is used to train the model on the training set until convergence, obtain the detection results under different hyperparameters through the detection accuracy of the training set on the validation set, and take the model with the highest accuracy on the validation set as the final inference model.

[0113] The cropping unit 31 uses the preprocessing module to randomly scale the image and then crop a fixed-size image from it to facilitate network processing, and loads relevant annotations.

[0114] The processing unit 32 performs spatial transformation, color dithering, and Grid-Mask data augmentation on the image.

[0115] Loading unit 33 loads the pre-trained model trained on the COCO dataset to initialize the network parameters.

[0116] Training unit 34 trains the model on the training set until convergence. It obtains the detection results under different hyperparameters by using the detection accuracy of the training set on the validation set. The model with the highest accuracy on the validation set is selected as the final inference model.

[0117] The segmented region target counting method based on fast instance segmentation provided in this embodiment, compared with the prior art, uses a cropping unit 31, a processing unit 32, a loading unit 33, and a training unit 34 in the recognition and counting result fusion module 30. It uses a preprocessing module to randomly scale the image to be trained and then crop it into a fixed-size image to facilitate network processing, and loads relevant annotations. The cropped fixed-size image undergoes spatial transformation, color dithering, and Grid-Mask data augmentation. The pre-trained model trained on the COCO dataset is loaded and the network parameters are initialized. The model is trained on the training set until convergence. The detection accuracy of the training set on the validation set is used to obtain detection results under different hyperparameters, and the model with the highest accuracy on the validation set is selected as the final inference model. The segmented region target counting method based on fast instance segmentation provided in this embodiment can identify and count the number of items in different areas of the image, accurately acquire a specified area in real time, identify the type of items in the area, and provide the location of the items. It can count materials in a specified area of ​​the scene with high counting accuracy; it has a high degree of intelligence and high computational efficiency, enabling unmanned and rapid identification and counting of injected drugs.

[0118] Further, please see Figure 14 , Figure 14 for Figure 11 The functional module diagram of the identification and counting result fusion module 30 shown in the second embodiment is based on the first embodiment. The identification and counting result fusion module 30 further includes a second detection unit 35, a preprocessing unit 36, an acquisition unit 37, and a fusion unit 38. The second detection unit 35 is used to load the trained instance segmentation model and initialize the network parameters; the preprocessing unit 36 ​​is used to load the image acquired by the camera and perform preprocessing; the acquisition unit 37 is used to use the inference model to obtain the regional location and classification confidence of the drug in the image; and the fusion unit 38 is used to fuse the result of instance segmentation and the obtained regional location and classification confidence of the drug in the image to achieve the final drug counting.

[0119] The second detection unit 35 loads the trained instance segmentation model and initializes the network parameters.

[0120] The preprocessing unit 36 ​​loads the image acquired by the camera and performs preprocessing.

[0121] Unit 37 uses an inference model to obtain the regional location and classification of drugs.

[0122] The fusion unit 38 combines the results of instance segmentation with the obtained regional location and classification confidence of the drugs to ultimately achieve the final drug count.

[0123] The segmented region target counting system based on fast instance segmentation provided in this embodiment, compared with the prior art, further employs a second detection unit 35, a preprocessing unit 36, an acquisition unit 37, and a fusion unit 38 in its recognition and counting result fusion module 30. This module initializes network parameters by loading a pre-trained instance segmentation model; performs spatial transformation, color jittering, and Grid-Mask data augmentation on images cropped to a fixed size; loads and preprocesses images acquired by a camera; uses an inference model to obtain the regional location and classification confidence of the drugs in the image; and fuses the instance segmentation results and the obtained regional location and classification confidence of the drugs in the image to achieve the final drug count. The segmented region target counting method based on fast instance segmentation provided in this embodiment can identify and count the quantity of items in different regions of a scene, accurately acquire a specified region in real time, identify the type of items in the region, and provide the location of the items; it can count materials in a specified region of a scene with high counting accuracy; it has a high degree of intelligence and high computational efficiency, enabling unmanned and rapid identification and counting of injected drugs.

[0124] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention. Clearly, those skilled in the art can make various alterations and modifications to the invention without departing from its spirit and scope. Thus, if these modifications and modifications of the invention fall within the scope of the claims and their equivalents, the invention is also intended to include these modifications and modifications.

Claims

1. A target counting device for segmented regions based on fast instance segmentation, characterized in that, The system includes a robotic arm, a radar disk, and control equipment. The robotic arm comprises a high-speed camera assembly and a robotic arm assembly. The high-speed camera assembly is positioned above the material conveyor belt and the radar disk, and operates using a folding mechanical transmission mechanism. The end of the robotic arm assembly is equipped with a gripping mechanism, which has a rubber sleeve or a pneumatic silicone suction cup to reduce mechanical stress during gripping. The high-speed camera assembly is mounted above the gripping mechanism and is used to quickly capture and identify the product label of the material when the grooved fixture on the material conveyor belt displays it upwards. The robotic arm assembly then identifies and grips the material, rotates the bottle cap upwards, and places it in a designated position on the radar disk, completing the identification, classification, and counting. The radar disk has N fan-shaped areas, expanding outwards from the center. Each area can accommodate... The quantity of materials increases outwards from the center, and each area is equipped with a gravity sensor to count based on the preset weight of a single material. The control device is connected to both the high-speed camera assembly and the gravity sensor. It uses a preset radar disk mapping area to mark and display the data based on the identification information transmitted by the high-speed camera assembly and the counting information collected by the gravity sensor. Each radar disk mapping area counts after the robotic arm identifies and grasps the material. Once a batch of materials has been identified and classified, the current quantity of materials is displayed in each sector area. After the radar disk gravity sensor is selected for verification, the count in each sector area is refreshed. If there is any discrepancy between the grasping count and the gravity sensor count, the sector area is displayed in yellow; if an error is clearly present, the sector area is displayed in red and flashes as a warning; if there is no discrepancy, the sector area is displayed in green.

2. The segmented region target counting device based on fast instance segmentation as described in claim 1, characterized in that, The control device is also used to mark a sector area as gray after all materials of a certain type or region in the radar panel of the batch have been extracted and used; if the information system still records that the materials of that type have not been used up, a pop-up alarm will be issued immediately, with the prompt displayed in full-screen red, indicating that there is an error in the materials of that type, and reminding the staff to check in time.

3. A method for counting targets in segmented regions based on fast instance segmentation, applied in the target counting device for segmented regions based on fast instance segmentation as described in claim 1 or 2, characterized in that, The segmented region target counting method based on fast instance segmentation includes the following steps: Training sample set creation: Collect training images, label training images, and generate instance segmentation labels; Instance segmentation model training: Detect the location region where the drug is located, output the classification confidence of the drug; output the mask of different sector regions of the radar disk; Segmentation result fusion: First, the location and classification of drugs are obtained using the instance segmentation model; then, the mask and classification of the radar disk fan-shaped region are obtained; finally, the number of drugs within the fan-shaped region mask is the number of drugs in the region.

4. The segmented region target counting method based on fast instance segmentation as described in claim 3, characterized in that, The steps for creating the training sample set include: Collect training images: Use the high-definition camera in the high-speed camera component to continuously capture video of the drug shooting area. The video shows the drugs placed in different areas according to different combinations, directions and positions. Then, training images are extracted from the video. Annotate training images: During the annotation process, the bounding boxes of the drugs in the training images are annotated. Different sector areas of the radar disk are also annotated, and the masks of different areas of the radar disk are annotated in a polygonal manner. Generate instance segmentation labels: First, in the labeled training images, based on the characteristic that most injectable drugs are circular in top-view imaging, a circular polygon mask is generated with the center of the labeled rectangle as the center and the average length and width of the rectangle as the diameter; then the dataset is divided into training set and validation set in a 3:1 ratio.

5. The segmented region target counting method based on fast instance segmentation as described in claim 4, characterized in that, The steps for fusing the segmentation results include: The preprocessing module is used to randomly scale the training images and then crop them into fixed-size images to facilitate network processing and load relevant annotations. Perform spatial transformation, color dithering, and Grid-Mask data augmentation on images cropped to a fixed size; Load the pre-trained model trained on the COCO dataset and initialize the network parameters; The model is trained on the training set until it converges. The detection results under different hyperparameters are obtained by measuring the detection accuracy of the training set on the validation set. The model with the highest accuracy on the validation set is selected as the final inference model.

6. The segmented region target counting method based on fast instance segmentation as described in claim 5, characterized in that, The steps for fusing the segmentation results include: Load the trained instance segmentation model and initialize the network parameters; Load the images captured by the camera and preprocess them; Use an inference model to obtain the regional location and classification confidence of drugs in the image; By fusing the results of instance segmentation with the regional location and classification confidence of drugs in the obtained images, the final drug count can be achieved.

7. A segmented region target counting system based on fast instance segmentation, applied in the segmented region target counting device based on fast instance segmentation as described in claim 1 or 2, characterized in that, The segmented region target counting system based on fast instance segmentation includes: The dataset creation module (10) is used to create training sample sets: collect training images, label training images, and generate instance segmentation labels; The instance segmentation model training module (20) is used for instance segmentation model training: segmenting the location region where the drug is located, outputting the classification confidence of the drug; and outputting the region mask of different sector regions of the radar disk. The identification and counting result fusion module (30) is used for segmentation result fusion: first, the location and classification of the drug are obtained using the instance segmentation model; then, the mask and classification of the radar disk fan-shaped region are obtained; the number of drugs in the radar disk fan-shaped region mask is the number of drugs in that fan-shaped region.

8. The segmented region target counting system based on fast instance segmentation as described in claim 7, characterized in that, The dataset creation module (10) includes: The first detection unit (11) is used to detect the location area of ​​the medicine: the high-definition camera in the high-speed camera assembly continuously captures the video of the medicine shooting area throughout the entire process. In the video, the medicine is placed in different areas according to different combinations, different directions and different positions. The annotation unit (12) is used to annotate training images: during the annotation process, the bounding box of the medicine in the training image is annotated, and different fan-shaped areas of the radar disk are also annotated. The mask of different fan-shaped areas of the radar disk is annotated in a polygonal way. The production unit (13) is used to produce the instance segmentation dataset: First, in the labeled training images, based on the characteristic that most injectable drugs are circular in the top view imaging case, a circular polygon mask is generated with the center of the labeled rectangle as the center and the average length and width of the rectangle as the diameter; then the dataset is divided into training set and validation set in a 3:1 ratio.

9. The segmented region target counting system based on fast instance segmentation as described in claim 8, characterized in that, The identification and counting result fusion module (30) includes: The cropping unit (31) is used to crop the training image into a fixed size image after the preprocessing module randomly scales it, so that the network can process it and load relevant annotations. The processing unit (32) is used to perform spatial transformation, color dithering, and Grid-Mask data augmentation on images cropped to a fixed size; Loading unit (33) is used to load a pre-trained model trained on the COCO dataset to initialize network parameters; The training unit (34) is used to train the model on the training set until convergence. The detection results under different hyperparameters are obtained by the detection accuracy of the training set on the validation set. The model with the highest accuracy on the validation set is taken as the final inference model.

10. The segmented region target counting system based on fast instance segmentation as described in claim 9, characterized in that, The identification and counting result fusion module (30) includes: The second detection unit (35) is used to load the trained instance segmentation model; The preprocessing unit (36) is used to load the image acquired by the camera and perform preprocessing. The acquisition unit (37) is used to obtain the location and classification confidence of the drug and radar disk sector in the image using the inference model; The fusion unit (38) is used to fuse the location and classification confidence in the result image of the instance segmentation to achieve the final drug count.

Citation Information

Patent Citations

  • Deep learning vehicle counting method based on road surface extraction and segmentation

    CN110443142A

  • Binocular vision and laterally mounted video camera-based passenger flow counting method

    CN102222265A

  • Systems, devices, and methods for determining space object attitude stabilities from radar cross-section statistics

    US20200278445A1