Foreign body detection method, device, equipment and computer readable storage medium
Through the target detection and classification model of deep learning technology, tiny foreign objects mixed in the packaging bags of shell-shaped orthodontic appliances are identified, which solves the problems of low efficiency and high cost of manual inspection in the existing technology, and achieves efficient identification and troubleshooting. , improving user experience and production efficiency.
Patent Information
- Application Number
- CN202110777006.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-09
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-07-09
AI Technical Summary
Existing technology cannot effectively identify and check for tiny foreign objects, such as hair and filaments, that may be mixed into the packaging bags of shell-shaped orthodontic appliances, resulting in high manual inspection costs and low efficiency, affecting user experience and brand image.
Deep learning technology is used, and pre-trained target detection models and classification models are used to detect and classify the images to be detected in the pallet, identify whether foreign objects are mixed in the pallet, and improve the recognition accuracy through cropping and data expansion technology.
Effectively identify difficult-to-identify foreign objects in the pallet, reduce human resource occupation, reduce quality inspection costs, improve quality inspection efficiency, and improve user experience and production efficiency.
Smart Images

Figure CN113361487B
Abstract
Description
[Technical field]
[0001] The present invention relates to the field of medical devices, and in particular to foreign matter detection technology for medical device packaging, and in particular to a foreign matter detection method, device, equipment and computer-readable storage medium. [Background technology]
[0002] Shell-shaped orthodontic appliances based on polymer materials (such as invisible braces) are becoming more and more popular due to their advantages of beauty, convenience and ease of cleaning. Shell-shaped orthodontic appliances use the resilience generated by deformation to reposition teeth from one configuration to another.
[0003] The production process of shell-shaped orthodontic appliances (hereinafter referred to as: appliances) usually needs to go through the following procedures: light-curing mold molding -> using light-curing mold to press the appliance -> appliance cutting and shelling -> appliance grinding and cleaning -> appliance sorting and packaging.
[0004] Due to the long production process of braces and the complex impact of production environment factors, there is a very small probability that foreign objects such as hair and filaments will be mixed into the inner packaging bag during the sorting and packaging stage of the production line. Although it does not affect the wearing of the braces, it will bring a negative experience to users and thus have an adverse impact on the brand image. Therefore, it is necessary to identify foreign objects in time and clean them accordingly to avoid them being brought into the inner packaging bag of the braces.
[0005] However, foreign matter such as hair and filaments is very difficult to identify or is very tiny and difficult to detect. Therefore, the existing technology cannot effectively detect foreign matter that may be mixed into the inner packaging bag during the sorting and packaging stage by manually visually checking for foreign matter, and requires a large amount of human resources, which is costly, time-consuming and inefficient. [Summary of the invention]
[0006] Various aspects of the present invention provide a foreign matter detection method, device, apparatus and computer-readable storage medium for effectively detecting foreign matter that may be mixed into the packaging bag of an orthodontic appliance during the sorting and packaging stage.
[0007] One aspect of the present invention provides a foreign body detection method, comprising:
[0008] Acquiring an image to be inspected including a tray on which an orthodontic appliance is placed;
[0009] Using a pre-trained target detection model, perform target detection on the image to be detected;
[0010] In response to detecting a target from the image to be detected, cutting out a region image including the detected target from the image to be detected;
[0011] Using a pre-trained classification model, classify the region image to obtain a classification result of whether the region image includes a foreign object;
[0012] It is determined whether foreign matter is mixed in the tray based on the classification result.
[0013] According to the above aspects and any possible implementation manner, an implementation manner is further provided, wherein obtaining an image to be detected including a tray on which an orthodontic appliance is placed comprises:
[0014] The image of the tray with the orthodontic appliance placed thereon is collected by taking a bird's-eye view photograph, so as to obtain the image to be detected of the tray with the orthodontic appliance placed thereon.
[0015] According to the above aspects and any possible implementation manner, an implementation manner is further provided, wherein the step of cutting out a region image including the detected target from the image to be detected comprises:
[0016] According to a preset size expansion ratio, a region image that is larger than the target detection frame of the target and smaller than the target image is cropped from the target image.
[0017] According to the above aspects and any possible implementation manner, an implementation manner is further provided, wherein the step of cropping a region image that is larger than the target detection frame of the target and smaller than the target image from the target image according to a preset size expansion ratio comprises:
[0018] Taking the center position of the target detection frame as the center, according to a preset size expansion ratio of 1.0 to 1.2 times the size of the target detection frame, a regional image that is larger than the target detection frame of the target and smaller than the image to be detected is cropped from the image to be detected.
[0019] According to the above aspects and any possible implementation, there is further provided an implementation, further comprising:
[0020] In response to determining that foreign objects are mixed in the tray based on the classification result, a reminder message or an alarm message that foreign objects are mixed in the tray is sent.
[0021] According to the above aspects and any possible implementation, there is further provided an implementation, further comprising:
[0022] A training set is obtained, wherein the training set includes a plurality of sample images; wherein the plurality of sample images include a positive sample image in which a foreign object exists in a tray on which an orthodontic appliance is placed, and a negative sample image in which no foreign object exists in a tray on which an orthodontic appliance is placed, wherein the positive sample image is annotated with foreign object annotation information, and the foreign object annotation information annotated with the positive sample image includes foreign object position and size annotation information.
[0023] Using the target detection model to be trained, performing target detection on the sample images in the training set to obtain target detection results, wherein the target detection results include the location and size of the foreign object;
[0024] According to the target detection result of the sample image and the corresponding foreign object labeling information, the target detection model to be trained is trained until a first preset training completion condition is met to obtain the target detection model.
[0025] According to the above aspects and any possible implementation manner, an implementation manner is further provided, wherein obtaining a training set includes:
[0026] By taking pictures from a bird's-eye view, images of multiple trays with orthodontic appliances placed on them without foreign objects are collected to obtain a negative sample image set;
[0027] By taking pictures from a bird's-eye view, images of multiple trays with foreign objects and appliances placed on them are collected to obtain a positive sample image set;
[0028] The negative sample image set is downsampled, the positive sample image set is oversampled, and the training set is obtained based on the negative sample image set and the positive sample image set.
[0029] According to the above aspect and any possible implementation, there is further provided an implementation, wherein obtaining a training set further includes:
[0030] Performing data expansion based on the sample images already in the training set by a preset data expansion method to obtain an expanded sample image, and adding the expanded sample image to the training set;
[0031] Among them, the preset data expansion method includes any one or more of the following: adjusting the brightness of the image, adjusting the contrast of the image, translating, mirroring, rotating, adding noise, mosaic splicing, and blocking operations on the image.
[0032] According to the above aspects and any possible implementation manner, an implementation manner is further provided, wherein the target detection model to be trained is trained until a first preset training completion condition is met, and further comprising:
[0033] Using the target detection model to perform target detection on sample images in the training set;
[0034] In response to detecting a target from the sample image, cropping a regional image sample from the sample image that is larger than a target detection frame of the target and smaller than the sample image according to a preset size expansion ratio;
[0035] Using the classification model to be trained, classifying the regional image samples to obtain a classification result of whether the regional image samples include foreign matter;
[0036] According to the classification results of the regional image samples and the corresponding foreign body labeling information, the classification model to be trained is trained until a second preset training completion condition is met to obtain the classification model.
[0037] According to the above aspect and any possible implementation manner, an implementation manner is further provided, wherein the second preset training completion condition includes:
[0038] The number of training times for the classification model to be trained reaches a preset number of times, and / or the function value of the weighted cross entropy loss function calculated based on the classification results of the regional image samples and the corresponding foreign body annotation information is less than a preset threshold.
[0039] Another aspect of the present invention provides a foreign body detection device, comprising:
[0040] A first acquisition module is used to acquire an image to be detected including a tray on which an orthodontic appliance is placed;
[0041] A detection module, used to perform target detection on the image to be detected using a pre-trained target detection model;
[0042] A cropping module, configured to, in response to detecting a target from the image to be detected, crop a region image including the detected target from the image to be detected;
[0043] A classification module, used to classify the regional image using a pre-trained classification model to obtain a classification result of whether the regional image includes foreign matter;
[0044] A determination module is used to determine whether foreign matter is mixed into the tray based on the classification result.
[0045] According to the above aspect and any possible implementation manner, an implementation manner is further provided, wherein the first acquisition module is specifically configured to:
[0046] The image of the tray with the orthodontic appliance placed thereon is collected by taking a bird's-eye view photograph, so as to obtain the image to be detected of the tray with the orthodontic appliance placed thereon.
[0047] According to the above aspects and any possible implementation manner, an implementation manner is further provided, wherein the cropping module is specifically configured to:
[0048] According to a preset size expansion ratio, a region image that is larger than the target detection frame of the target and smaller than the target image is cropped from the target image.
[0049] According to the above aspects and any possible implementation manner, an implementation manner is further provided, wherein the cropping module is specifically configured to:
[0050] Taking the center position of the target detection frame as the center, according to a preset size expansion ratio of 1.0 to 1.2 times the size of the target detection frame, a regional image that is larger than the target detection frame of the target and smaller than the image to be detected is cropped from the image to be detected.
[0051] According to the above aspects and any possible implementation, there is further provided an implementation, further comprising:
[0052] The sending module is used for sending a reminder message or an alarm message of foreign objects mixed in the tray in response to determining that foreign objects are mixed in the tray based on the classification result.
[0053] According to the above aspects and any possible implementation, there is further provided an implementation, further comprising:
[0054] A second acquisition module is used to acquire a training set, wherein the training set includes a plurality of sample images; wherein the plurality of sample images include a positive sample image in which a foreign object exists in a tray on which an orthodontic appliance is placed, and a negative sample image in which no foreign object exists in a tray on which an orthodontic appliance is placed, wherein the positive sample image is annotated with foreign object annotation information, wherein the foreign object annotation information includes foreign object position and size annotation information;
[0055] The first training module is used to use the target detection model to be trained to perform target detection on the sample images in the training set to obtain target detection results, and the target detection results include the position and size of the foreign matter; and according to the target detection results of the sample images and the corresponding foreign matter labeling information, the target detection model to be trained is trained until the first preset training completion condition is met to obtain the target detection model.
[0056] According to the above aspect and any possible implementation manner, an implementation manner is further provided, wherein the second acquisition module is specifically configured to:
[0057] By taking pictures from a bird's-eye view, images of multiple trays with orthodontic appliances placed on them without foreign objects are collected to obtain a negative sample image set;
[0058] By taking photos from a bird's-eye view, multiple trays with foreign objects and appliances placed thereon are oversampled to obtain a positive sample image set;
[0059] The negative sample image set is downsampled, the positive sample image set is oversampled, and the training set is obtained based on the negative sample image set obtained by downsampling and the positive sample image set obtained by oversampling.
[0060] According to the above aspects and any possible implementation, there is further provided an implementation, further comprising:
[0061] An expansion module, used to perform data expansion based on the existing sample images in the training set by a preset data expansion method to obtain an expanded sample image, and add the expanded sample image to the training set;
[0062] Among them, the preset data expansion method includes any one or more of the following: adjusting the brightness of the image, adjusting the contrast of the image, translating, mirroring, rotating, adding noise, mosaic splicing, and blocking operations on the image.
[0063] According to the above aspects and any possible implementation manner, an implementation manner is further provided, wherein the detection module is further configured to perform target detection on the sample images in the training set using the target detection model;
[0064] The cropping module is further configured to, in response to detecting a target from the sample image, crop a regional image sample from the sample image that is larger than a target detection frame of the target and smaller than the sample image according to a preset size expansion ratio;
[0065] The device also includes:
[0066] The second training module is used to classify the regional image samples using the classification model to be trained to obtain a classification result of whether the regional image samples include foreign matter; and to train the classification model to be trained according to the classification result of the regional image samples and the corresponding foreign matter labeling information until the second preset training completion condition is met to obtain the classification model.
[0067] According to the above aspect and any possible implementation manner, an implementation manner is further provided, wherein the second preset training completion condition includes:
[0068] The number of training times for the classification model to be trained reaches a preset number of times, and / or the function value of the weighted cross entropy loss function calculated based on the classification results of the regional image samples and the corresponding foreign body annotation information is less than a preset threshold.
[0069] Another aspect of the present invention provides a device, comprising:
[0070] one or more processors;
[0071] a storage device for storing one or more programs,
[0072] When the one or more programs are executed by the one or more processors, the one or more processors implement the foreign matter detection method provided in the above aspect.
[0073] Another aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the foreign matter detection method provided in the above aspect.
[0074] It can be seen from the above technical scheme that the embodiment of the present invention obtains an image to be detected including a tray with an orthodontic appliance placed thereon, and then uses a pre-trained target detection model to perform target detection on the image to be detected. In response to detecting a target from the image to be detected, a regional image including the detected target is cropped from the image to be detected, and then the pre-trained classification model is used to classify the regional image to obtain a classification result of whether the regional image includes foreign matter, and then, based on the classification result, it is determined whether foreign matter is mixed in the tray. Thus, based on a deep learning method, foreign matter (hair, filaments, etc.) in the tray that is difficult for the human eye to identify can be effectively identified, thereby effectively troubleshooting foreign matter that may be mixed into the inner packaging bag during the sorting and packaging stage, so as to make corresponding cleaning in time to avoid bringing foreign matter into the inner packaging bag of the orthodontic appliance.
[0075] In addition, by adopting the technical solution provided by the present invention, based on a deep learning approach, it is possible to effectively identify foreign objects that are difficult to identify through a robust and reliable target detection model and classification model, thereby improving the accuracy of foreign object identification.
[0076] In addition, by adopting the technical solution provided by the present invention, based on a deep learning approach, it is possible to identify whether foreign objects (hair, filaments, etc.) that are difficult for the human eye to identify are mixed into the tray through a robust and reliable target detection model and classification model, thereby avoiding occupying operators and quality inspectors, saving human resources, reducing quality inspection costs, reducing quality inspection time, improving quality inspection efficiency, and reducing the workload of operators and quality inspectors, thereby improving production efficiency and helping to increase production capacity.
[0077] In addition, by adopting the technical solution provided by the present invention, based on a deep learning approach, a robust and reliable target detection model and classification model can be used to identify whether foreign objects (hair, filaments, etc.) that are difficult for the human eye to identify are mixed in the pallet. The recognition accuracy is high and it is reliable in complex production environments.
[0078] In addition, the technical solution provided by the present invention can effectively improve the user experience.
Brief Description of the Drawings
[0079] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0080] Figure 1 A schematic diagram of a flow chart of a foreign body detection method provided by an embodiment of the present invention;
[0081] Figure 2 A schematic diagram of a foreign body detection method provided by an application embodiment of the present invention;
[0082] Figure 3 A schematic diagram of a process for training a target detection model in one embodiment of the present invention;
[0083] Figure 4 A schematic diagram of a process of training a classification model in one embodiment of the present invention;
[0084] Figure 5 A schematic structural diagram of a foreign body detection device provided by another embodiment of the present invention;
[0085] Figure 6 A schematic structural diagram of a foreign body detection device provided by another embodiment of the present invention;
[0086] Figure 7 is a block diagram of an exemplary computer system / server 12 suitable for use in implementing embodiments of the present invention. [Specific implementation method]
[0087] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0088] It should be noted that the terminals involved in the embodiments of the present invention may include but are not limited to mobile phones, personal digital assistants (PDAs), wireless handheld devices, tablet computers, personal computers (PCs), MP3 players, MP4 players, wearable devices (for example, smart glasses, smart watches, smart bracelets, etc.), etc.
[0089] In addition, the term "and / or" in this article is only a description of the association relationship between the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0090] The main idea of the present invention is to adopt a deep learning approach, first using a target detection model to perform target detection on the image to be detected, and then using a classification model to perform classification, to detect whether the pallet includes foreign objects. This can effectively identify foreign objects in the pallet that are difficult for the human eye to identify (hair, filaments, etc.), thereby effectively troubleshooting foreign objects that may be mixed into the inner packaging bag during the sorting and packaging stage.
[0091] Figure 1 A schematic diagram of a flow chart of a foreign body detection method provided by an embodiment of the present invention is shown in FIG. Figure 1 shown.
[0092] 101. Acquire an image to be inspected including a tray on which an orthodontic appliance is placed.
[0093] 102. Perform object detection on the image to be detected using a pre-trained object detection model.
[0094] The result of performing target detection on the image to be detected may be that the target is detected or not detected, wherein the target may be a foreign object to be detected. If the target is not detected, the target detection result information obtained based on 102 is empty; if the target is detected, the target detection result information obtained based on 102 may include the size and position of the target detection frame.
[0095] 103. In response to detecting an object from the image to be detected, crop a region image including the detected object from the image to be detected.
[0096] 104. Classify the region image using a pre-trained classification model to obtain a classification result of whether the region image includes foreign matter.
[0097] The foreign matter in the embodiment of the present invention is an object of a preset category, such as hair, filaments, etc. The embodiment of the present invention does not limit the specific definition and scope of the foreign matter.
[0098] The classification result may be that the target is a foreign body or the target is not a foreign body (ie, the target is another object), or may include the probability that the target is a foreign body and the probability that the target is not a foreign body, which is not limited in the embodiment of the present invention.
[0099] 105. Determine whether foreign matter is mixed into the tray based on the classification result.
[0100] The classification result is that the target is a foreign object or the target is not a foreign object, and whether the tray is mixed with foreign objects can be determined accordingly based on the classification result.
[0101] If the classification result is the probability that the target is a foreign object and the probability that the target is not a foreign object, then in step 105, the probability that the target is a foreign object and the probability that the target is not a foreign object can be compared, and the classification result with a larger probability value can be selected to determine whether foreign objects are mixed into the tray. Specifically, if the probability that the target is a foreign object is greater than the probability that the target is not a foreign object, it is determined that foreign objects are mixed into the tray; if the probability that the target is a foreign object is less than the probability that the target is not a foreign object, it is determined that no foreign objects are mixed into the tray; if the probability that the target is a foreign object is equal to the probability that the target is not a foreign object, then according to a preset method, it is determined that foreign objects are mixed into the tray, or it is determined that no foreign objects are mixed into the tray, or an alarm is issued, which is not limited in the embodiment of the present invention.
[0102] It should be noted that part or all of the execution entities of 101 to 105 may be applications located in the local terminal, i.e., the terminal device of the service provider, or may also be functional units such as plug-ins or software development kits (SDK) set in the applications located in the local terminal, or may also be processing engines located in the network-side server, or may also be distributed systems located on the network side, and this embodiment does not specifically limit this.
[0103] It is understandable that the application may be a local program (nativeApp) installed on the terminal, or may be a webpage program (webApp) of a browser on the terminal, and this embodiment does not specifically limit this.
[0104] In the packaging stage of shell-shaped dental appliances, a batch of shell-shaped dental appliances need to be placed in corresponding grids of a tray in a predetermined order, and then subsequently packaged. In the process of realizing the present invention, the inventors found through analysis that the probability of foreign matter being mixed in the tray stage of the appliance packaging production line is relatively high.
[0105] In this embodiment, based on the deep learning method, foreign objects (hair, filaments, etc.) in the tray that are difficult for the human eye to identify can be effectively identified, thereby effectively checking the foreign objects that may be mixed into the inner packaging bag during the sorting and packaging stage, so as to make corresponding cleaning in time and avoid bringing foreign objects into the inner packaging bag of the orthodontic device, thereby effectively improving the user experience; and, through a robust and reliable target detection model and classification model, foreign objects that are difficult to identify can be effectively identified, the accuracy of foreign object identification can be improved, and it is reliable in complex production environments; in addition, it can avoid occupying operators and quality inspectors, save human resources, reduce quality inspection costs, reduce quality inspection time, improve quality inspection efficiency, and reduce the workload of operators and quality inspectors, thereby improving production efficiency and helping to increase production capacity.
[0106] Optionally, in a possible implementation of the present embodiment, in 101, an overhead photographing method may be adopted to capture an image of the tray on which the appliance is placed, so as to obtain an image to be detected of the tray on which the appliance is placed, and the present embodiment does not specifically limit this.
[0107] In a specific implementation, the tray with the orthodontic appliance placed on it can be arranged as a backlight, and appropriate lighting can be used to adjust the brightness and color of the light source, adjust the aperture and focal length of the industrial camera, and use a bird's-eye view to capture images of the tray with the orthodontic appliance placed on it. This ensures that the clarity of the grayscale image of the surface of the orthodontic appliance captured by the industrial camera is optimal, and the image to be detected is obtained, so as to improve the accuracy of subsequent target detection and classification.
[0108] Optionally, in a possible implementation of this embodiment, in 103, in response to detecting a target from the image to be detected, a regional image that is larger than a target detection frame of the target and smaller than the image to be detected can be cropped from the image to be detected according to a preset size expansion ratio.
[0109] Specifically, with the center position of the target detection frame as the center, a regional image larger than the target detection frame of the target and smaller than the image to be detected can be cropped from the image to be detected according to a preset size expansion ratio of 1.0 to 1.2 times the size of the target detection frame.
[0110] In this embodiment, a regional image that is larger than the target detection frame of the target and smaller than the image to be detected is cropped from the image to be detected according to a preset size expansion ratio of 1.0 to 1.2 times the size of the target detection frame, so that the regional image can include the complete target and can also enlarge the target to a large extent. In this way, when subsequent classification and recognition is performed based on the regional image, accurate classification results can be obtained, which helps to improve the accuracy of foreign object detection.
[0111] Figure 2Schematic diagram of a foreign body detection method provided by an application embodiment of the present invention. Figure 2 As shown, in the image to be detected 21, the target in the detection frame 201 is a scratch, not the preset foreign body hair; in the image to be detected 22, the target in the detection frame 202 is the foreign body hair. If the images to be detected 21 and 22 are directly subjected to foreign body detection, false detection may occur, for example, the scratch in the detection frame 201 is detected as hair. Based on the embodiment of the present invention, the corresponding regional image is cropped from the target detection frame output by the target detection model, and then a classification model is used for classification, so that the probability that the target in the target detection frame is the preset foreign body (hair) and the probability that it is other objects other than the preset foreign body can be obtained, so that other objects other than the preset foreign bodies such as scratches and graffiti can be excluded from the foreign bodies, so as to correctly distinguish whether the target in the target detection frame is the preset foreign body.
[0112] Optionally, in a possible implementation of the present embodiment, after 105, it may also include: in response to determining that foreign objects are mixed in the tray based on the classification result, sending a reminder message or an alarm message that foreign objects are mixed in the tray, so as to make corresponding cleaning in time to avoid bringing foreign objects into the inner packaging bag of the orthodontic device, thereby effectively improving the user experience.
[0113] Optionally, in a possible implementation of this embodiment, the target detection model and the classification model may be implemented based on deep learning, for example, by a neural network, but the embodiments of the present invention are not limited thereto.
[0114] Optionally, in a possible implementation of this embodiment, the target detection model to be trained may be trained in advance using a training set to obtain the target detection model. Figure 3 FIG. 1 is a flow chart of training a target detection model in one embodiment of the present invention. Figure 3 shown.
[0115] 301. Obtain a training set, where the training set includes multiple sample images.
[0116] Among them, the multiple sample images include positive sample images in which foreign objects are present in a tray with an orthodontic appliance placed therein, and negative sample images in which no foreign objects are present in the tray with an orthodontic appliance placed therein, the positive sample images and the negative sample images are respectively annotated with foreign object annotation information, the positive sample images are annotated with foreign object annotation information, and the foreign object annotation information includes foreign object position and size annotation information.
[0117] 302. Perform target detection on the sample images in the training set using the target detection model to be trained to obtain a target detection result, which includes the position and size of the foreign object.
[0118] Optionally, the target detection result may also include the confidence of the foreign object, that is, the probability of being a foreign object.
[0119] 303. According to the target detection result of the sample image and the corresponding foreign object labeling information, the target detection model to be trained is trained until a first preset training completion condition is met to obtain the target detection model.
[0120] Optionally, in a possible implementation of this embodiment, the first preset training completion condition may, for example, include but is not limited to: the number of training times for the target detection model to be trained reaches a preset number of times, and / or the difference between the target detection result of the sample image and the corresponding foreign object labeling information is less than a preset threshold.
[0121] In this embodiment, the target detection model to be trained can be trained in advance using a training set to obtain a target detection model so as to be used for target detection on the image to be detected.
[0122] Optionally, in a possible implementation of the present embodiment, in 301, a plurality of trays with orthodontic appliances placed thereon and without foreign objects may be imaged by taking pictures from a top-down perspective to obtain negative sample images; a plurality of trays with orthodontic appliances placed thereon and with foreign objects present may be imaged by oversampling pictures from a top-down perspective to obtain positive sample images; then, the negative sample image set may be downsampled, and the positive sample image set may be oversampled, and the training set may be obtained based on the negative sample image set obtained by the downsampling and the positive sample image set obtained by the oversampling.
[0123] In this embodiment, the sample image may be acquired in a manner similar to the above-mentioned method of acquiring the image to be detected.
[0124] Since the probability of foreign matter being mixed in a real production line is extremely small, less than about 0.1%, there is a serious problem of sample data imbalance. In this embodiment, the image set of the tray with foreign matter and the appliance is oversampled, and the image set without foreign matter is downsampled, so that the distribution of the number of positive and negative samples becomes balanced, so as to improve the performance of the trained target detection model and classification model.
[0125] Optionally, in another possible implementation of the present embodiment, in 301, after obtaining the training set by the above implementation, data expansion can be performed based on the existing sample images in the training set by a preset data expansion method to obtain an expanded sample image, and the expanded sample image is added to the training set.
[0126] Among them, the preset data expansion method may include, but is not limited to, any one or more of the following: adjusting the brightness of the image, adjusting the contrast of the image, translating, mirroring, rotating, adding noise, mosaic splicing, blocking operations, etc.
[0127] In this embodiment, a preset data expansion method is used to perform data expansion based on the existing sample images in the training set to obtain expanded sample images, and the expanded sample images are added to the training set, which helps to expand the diversity and richness of the sample images, thereby improving the robustness of the trained target detection model.
[0128] Optionally, in a possible implementation of this embodiment, the classification model to be trained may be trained in advance using a training set to obtain the classification model. Figure 4 FIG. 1 is a flow chart of training a classification model in one embodiment of the present invention. Figure 4 As shown, after 303, the classification model can be trained in the following manner.
[0129] 401. Use the target detection model to perform target detection on sample images in the training set.
[0130] 402. In response to detecting a target from a sample image, crop a regional image sample that is larger than a target detection frame of the target and smaller than the sample image from the sample image according to a preset size expansion ratio.
[0131] 403. Classify the regional image samples using the classification model to be trained to obtain a classification result of whether the regional image samples include foreign matter.
[0132] 404. According to the classification results of the regional image samples and the corresponding foreign body labeling information, the classification model to be trained is trained until a second preset training completion condition is met to obtain a classification model.
[0133] Since the probability of foreign matter being mixed in is extremely small, in this embodiment, in order to reduce the false alarm rate (i.e., the influence of scratches, graffiti, etc. needs to be excluded), the target detection model and the classification model are combined. After the target is detected by the target detection model, the corresponding regional image is cropped with a size ratio of 1.0 to 1.2 times that of the target detection frame, and combined with its foreign matter category annotation information, the image classification model is trained to obtain the classification result of whether the regional image sample includes foreign matter.
[0134] Optionally, in another possible implementation of this embodiment, the second preset training completion condition in 404 may include, but is not limited to: the number of training times for the classification model to be trained reaches a preset number of times, and / or the function value of the weighted cross-entropy loss (WCE loss) calculated based on the classification results of the regional image samples and the corresponding foreign body annotation information is less than a preset threshold.
[0135] Optionally, in a possible implementation of this embodiment, the function value of the weighted cross entropy loss function may be calculated based on the following method:
[0136]
[0137] Among them, WCE represents the function value of the weighted cross entropy loss function, w p is the weight value corresponding to the positive sample (i.e., the positive sample image with foreign matter), which is a preset constant not less than 0 and not greater than 1; i Mark information for foreign objects; i For classification results.
[0138] In practical applications, foreign objects such as hair and filaments are small in size, and the pixels of foreign objects such as hair and filaments account for a small proportion of the pixels of the regional image, and will be submerged by the background in the gradient return of the loss function. This embodiment improves the classification loss function to a weighted WCE loss to train the classification model to be trained, thereby improving the training effect and the detection performance of the trained classification model.
[0139] Optionally, in a possible implementation of this embodiment, in the process of training the target detection model, an existing target detection framework can be used, such as the detection library mmdetection based on PyTorch, and a publicly published target detection model (such as the RCNN series or the YOLO series, etc.) can be used. The parameters of the target detection model to be trained are initialized to the parameter values of ImageNet or MSCOCO pre-training by using the transfer learning method, and the target detection model to be trained is then trained using the training set on this basis. In the process of training the classification model, the publicly published classification model (such as the ResNet series) can be used as a reference, and the parameters of the classification model to be trained can be initialized to the parameter values of ImageNet pre-training by using the transfer learning method, and the classification model can be trained using the training set on this basis.
[0140] In the model training based on deep learning, since the model contains many parameters, in order to achieve the purpose of training convergence and better results, a large amount of training data (millions of data) is required, and it is usually impossible to collect and annotate such a large amount of data sets. ImageNet and MSCOCO are two relatively large public data sets. Researchers have done a lot of research work on these two data sets, and have trained classification and detection models with good effects on these two data sets. In this embodiment, the method of transfer learning is adopted. The parameters of the target detection model to be trained are first initialized to the pre-trained parameter values on the public data sets of ImageNet and MSCOCO, and the parameters of the classification model to be trained are initialized to the pre-trained parameter values of ImageNet. On this basis, the parameters are updated using the data set of the targeted task, which can accelerate the convergence of the target detection model to be trained and the classification detection model to be trained, and improve the training effect.
[0141] The technical solution of the embodiment of the present invention based on deep learning can usually be implemented through the following process when applied:
[0142] a), obtaining a sample (an appliance or mold) and acquiring an electronic representation (i.e., an image) of the sample;
[0143] b) annotating the sample images with corresponding foreign body annotation information, obtaining a number of positive sample images with foreign bodies and negative sample images without foreign bodies, forming a data set, and dividing the data set into a training set, a validation set, and a test set according to a certain ratio;
[0144] c) Design a deep learning model (i.e., the target detection model to be trained and the classification model to be trained), train the deep learning model using the training set; set evaluation indicators, and select the best deep learning model through the validation set;
[0145] d) Set evaluation indicators to evaluate the performance of the selected deep learning model test set. If the deployment requirements are not met, return to step a) to continue collecting samples and continue the process, or return to step c) to change the design of the deep learning model and continue the process; if the deployment requirements are met, enter the deployment phase of step e);
[0146] e), deploy the deep learning model, obtain the image to be detected, and apply the deep learning model deployed in d) for quality detection.
[0147] f) Post-process the quality inspection results. If it is confirmed that foreign matter is mixed in the pallet, provide text feedback or alarm.
[0148] Optionally, in a possible implementation of this embodiment, the sample images in the training set can be updated according to the needs of the production line, and the target detection model can be updated by iterative training at a first preset period, and the classification model can be updated by iterative training at a second preset period, wherein the first preset period is longer than the second preset period.
[0149] Since there are many images to be detected and the probability of foreign matter being mixed in is extremely small, the possibility of false alarms increases over time. In this embodiment, a staged model update iteration method is adopted to update the sample images in the training set according to the detection requirements of the production line and iteratively train the target detection model and the classification model to meet the detection requirements of the production line in a timely manner. Among them, the classification model training time is relatively short, and it is updated in a shorter cycle, so that the classification model can reflect the real-time production line situation; the target detection model training time is relatively long, and the target detection model is updated in a longer cycle. The staged model update iteration method is more efficient. While ensuring the foreign matter detection rate, it can effectively reduce the false detection rate and improve the detection accuracy. In this embodiment, the target detection model is combined with the classification model, and the staged model update iteration strategy is used to efficiently deal with the problem of high false detection rate caused by the extremely low probability of foreign matter being mixed in.
[0150] In this embodiment, an image to be detected including a tray with an orthodontic appliance placed thereon is acquired, and then a pre-trained target detection model is used to perform target detection on the image to be detected. In response to detecting a target from the image to be detected, a regional image including the detected target is cropped from the image to be detected. The pre-trained classification model is then used to classify the regional image to obtain a classification result of whether the regional image includes foreign matter. Based on the classification result, it is determined whether foreign matter is mixed into the tray. Thus, based on a deep learning approach, foreign matter (hair, filaments, etc.) in the tray that is difficult for the human eye to identify can be effectively identified, thereby effectively troubleshooting foreign matter that may be mixed into the inner packaging bag during the sorting and packaging stage, so that corresponding cleaning can be performed in a timely manner to avoid bringing foreign matter into the inner packaging bag of the orthodontic appliance.
[0151] In addition, by adopting the technical solution provided by the present invention, based on a deep learning approach, it is possible to effectively identify foreign objects that are difficult to identify through a robust and reliable target detection model and classification model, thereby improving the accuracy of foreign object identification.
[0152] In addition, by adopting the technical solution provided by the present invention, based on a deep learning approach, it is possible to identify whether foreign objects (hair, filaments, etc.) that are difficult for the human eye to identify are mixed into the tray through a robust and reliable target detection model and classification model, thereby avoiding occupying operators and quality inspectors, saving human resources, reducing quality inspection costs, reducing quality inspection time, improving quality inspection efficiency, and reducing the workload of operators and quality inspectors, thereby improving production efficiency and helping to increase production capacity.
[0153] In addition, by adopting the technical solution provided by the present invention, based on a deep learning approach, a robust and reliable target detection model and classification model can be used to identify whether foreign objects (hair, filaments, etc.) that are difficult for the human eye to identify are mixed in the pallet. The recognition accuracy is high and it is reliable in complex production environments.
[0154] In addition, the technical solution provided by the present invention can effectively improve the user experience.
[0155] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0156] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0157] Figure 5 A schematic diagram of the structure of a foreign body detection device provided by another embodiment of the present invention is shown in FIG. Figure 5 As shown. The foreign body detection device of this embodiment may include a first acquisition module 501, a detection module 502, a cropping module 503, a classification module 504 and a determination module 505. Among them, the first acquisition module 501 is used to acquire an image to be detected including a tray with an orthodontic appliance placed thereon; the detection module 502 is used to perform target detection on the image to be detected using a pre-trained target detection model; the cropping module 503 is used to, in response to detecting a target from the image to be detected, crop a region image including the detected target from the image to be detected; the classification module 504 is used to classify the region image using a pre-trained classification model to obtain a classification result of whether the region image includes a foreign body; the determination module 505 is used to determine whether a foreign body is mixed in the tray based on the classification result.
[0158] It should be noted that part or all of the foreign object detection device provided in this embodiment may be an application located in the local terminal, or may also be a functional unit such as a plug-in or software development kit (SDK) set in the application located in the local terminal, or may also be a search engine located in a network-side server, or may also be a distributed system located on the network side. This embodiment does not specifically limit this.
[0159] It is understandable that the application may be a local program (nativeApp) installed on the terminal, or may be a webpage program (webApp) of a browser on the terminal, and this embodiment does not specifically limit this.
[0160] In this way, based on the deep learning method, foreign objects (hair, filaments, etc.) in the tray that are difficult for the human eye to identify can be effectively identified, thereby effectively checking for foreign objects that may be mixed into the inner packaging bag during the sorting and packaging stage, so as to make corresponding cleaning in time and avoid bringing foreign objects into the inner packaging bag of the orthodontic device.
[0161] Optionally, in a possible implementation of this embodiment, the first acquisition module 501 is specifically used to: acquire an image of the tray with the orthodontic appliance placed thereon by taking a bird's-eye view, so as to obtain the image to be detected of the tray with the orthodontic appliance placed thereon.
[0162] Optionally, in a possible implementation of this embodiment, the cropping module 503 is specifically used to: crop a region image that is larger than the target detection frame of the target and smaller than the image to be detected from the image to be detected according to a preset size expansion ratio.
[0163] Optionally, in a possible implementation of this embodiment, the cropping module 503 is specifically used to: with the center position of the target detection frame as the center, and according to a preset size expansion ratio of 1.0 to 1.2 times the size of the target detection frame, crop a regional image that is larger than the target detection frame of the target and smaller than the image to be detected from the image to be detected.
[0164] Figure 6 A schematic diagram of the structure of a foreign body detection device provided by another embodiment of the present invention is shown in FIG. Figure 6 As shown, the foreign matter detection device of this embodiment further includes: a sending module 601, which is used to send a reminder message or an alarm message of foreign matter mixed in the tray in response to determining that foreign matter is mixed in the tray based on the classification result.
[0165] In addition, see Figure 6, the foreign body detection device of the above embodiment may also include: a second acquisition module 602 and a first training module 603. The second acquisition module 602 is used to acquire a training set, and the training set includes a plurality of sample images; wherein the plurality of sample images include a positive sample image of a tray with a brace placed therein and a negative sample image of a tray with a brace placed therein and no foreign body, and the positive sample image is annotated with foreign body annotation information, and the foreign body annotation information includes foreign body position and size annotation information; the first training module 603 is used to perform target detection on the sample images in the training set using the target detection model to be trained to obtain target detection results, and the target detection results include the position and size of the foreign body; and according to the target detection results of the sample images and the corresponding foreign body annotation information, the target detection model to be trained is trained until the first preset training completion condition is met to obtain the target detection model.
[0166] Optionally, in a possible implementation of the present embodiment, the second acquisition module 602 is specifically used to: acquire images of a plurality of trays with foreign objects and orthodontic appliances placed thereon by taking pictures from a bird's-eye view to obtain negative sample images; oversample images of a plurality of trays with foreign objects and orthodontic appliances placed thereon by taking pictures from a bird's-eye view to obtain positive sample images; downsample the negative sample image set, oversample the positive sample image set, and obtain the training set based on the negative sample image set obtained by downsampling and the positive sample image set obtained by oversampling.
[0167] In addition, see Figure 6 The foreign body detection device of the above embodiment may further include: an expansion module 604, which is used to perform data expansion based on the existing sample images in the training set through a preset data expansion method to obtain an expanded sample image, and add the expanded sample image to the training set; wherein the preset data expansion method may, for example, include but is not limited to any one or more of the following: adjusting the brightness of the image, adjusting the contrast of the image, translating, mirroring, rotating, adding noise, mosaic splicing, and occluding operations on the image.
[0168] Optionally, in a possible implementation of this embodiment, the detection module 502 is further used to perform target detection on the sample images in the training set using the target detection model; the cropping module 503 is further used to, in response to detecting the target from the sample image, crop the regional image sample that is larger than the target detection frame and smaller than the sample image according to a preset size expansion ratio from the sample image. Figure 6The foreign object detection device of the above embodiment may also include: a second training module 605, which is used to classify the regional image samples using the classification model to be trained to obtain a classification result of whether the regional image samples include foreign objects; and train the classification model to be trained according to the classification result of the regional image samples and the corresponding foreign object labeling information until the second preset training completion condition is met to obtain the classification model.
[0169] Optionally, in another possible implementation of this embodiment, the second preset training completion condition may, for example, include but is not limited to: the number of training times for the classification model to be trained reaches a preset number of times, and / or the function value of the weighted cross entropy loss function calculated based on the classification results of the regional image samples and the corresponding foreign body annotation information is less than a preset threshold.
[0170] It should be noted that Figures 1 to 4 The corresponding method in the embodiment can be obtained by Figure 5-6 The foreign body detection device provided in the embodiment shown is implemented. For detailed description, please refer to Figure 1 to Figure 4 The relevant contents in the corresponding embodiments will not be repeated here.
[0171] In this embodiment, an image to be detected including a tray with an orthodontic appliance placed thereon is acquired, and then a pre-trained target detection model is used to perform target detection on the image to be detected. In response to detecting a target from the image to be detected, a regional image including the detected target is cropped from the image to be detected. The pre-trained classification model is then used to classify the regional image to obtain a classification result of whether the regional image includes foreign matter. Based on the classification result, it is determined whether foreign matter is mixed into the tray. Thus, based on a deep learning approach, foreign matter (hair, filaments, etc.) in the tray that is difficult for the human eye to identify can be effectively identified, thereby effectively troubleshooting foreign matter that may be mixed into the inner packaging bag during the sorting and packaging stage, so that corresponding cleaning can be performed in a timely manner to avoid bringing foreign matter into the inner packaging bag of the orthodontic appliance.
[0172] In addition, by adopting the technical solution provided by the present invention, based on a deep learning approach, it is possible to effectively identify foreign objects that are difficult to identify through a robust and reliable target detection model and classification model, thereby improving the accuracy of foreign object identification.
[0173] In addition, by adopting the technical solution provided by the present invention, based on a deep learning approach, it is possible to identify whether foreign objects (hair, filaments, etc.) that are difficult for the human eye to identify are mixed into the tray through a robust and reliable target detection model and classification model, thereby avoiding occupying operators and quality inspectors, saving human resources, reducing quality inspection costs, reducing quality inspection time, improving quality inspection efficiency, and reducing the workload of operators and quality inspectors, thereby improving production efficiency and helping to increase production capacity.
[0174] In addition, by adopting the technical solution provided by the present invention, based on a deep learning approach, a robust and reliable target detection model and classification model can be used to identify whether foreign objects (hair, filaments, etc.) that are difficult for the human eye to identify are mixed in the pallet. The recognition accuracy is high and it is reliable in complex production environments.
[0175] In addition, the technical solution provided by the present invention can effectively improve the user experience.
[0176] Figure 7 A block diagram of an exemplary computer system / server 12 suitable for use in implementing embodiments of the present invention is shown. Figure 7 The computer system / server 12 shown is merely an example and should not bring any limitation to the functionality and scope of use of embodiments of the present invention.
[0177] like Figure 7 As shown, computer system / server 12 is represented in the form of a general-purpose computing device. Components of computer system / server 12 may include, but are not limited to: one or more processors or processing units 16, storage devices or system memory 28, and buses 18 that connect different system components (including system memory 28 and processing units 16).
[0178] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0179] Computer system / server 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by computer system / server 12, including volatile and nonvolatile media, removable and non-removable media.
[0180] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer system / server 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 7 not shown, usually called a "hard drive"). Although Figure 7 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0181] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0182] The computer system / server 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), one or more devices that enable a user to interact with the computer system / server 12, and / or any device that enables the computer system / server 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 44. In addition, the computer system / server 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the computer system / server 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the computer system / server 12, including, but not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0183] The processing unit 16 executes various functional applications and data processing by running the programs stored in the system memory 28, such as implementing Figure 1 The image processing method provided by the corresponding embodiment.
[0184] Another embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements Figure 1 The image processing method provided by the corresponding embodiment.
[0185] Specifically, any combination of one or more computer-readable media can be used. Computer-readable media can be computer-readable signal media or computer-readable storage media. Computer-readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: electrical connections with one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this document, computer-readable storage media can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.
[0186] Computer-readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0187] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0188] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0189] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0190] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or page components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0191] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0192] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0193] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0194] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A foreign body detection method, It is characterized in that include: Acquiring an image to be inspected including a tray on which an orthodontic appliance is placed; Using a pre-trained target detection model, perform target detection on the image to be detected; In response to detecting a target from the image to be detected, cutting out a region image including the detected target from the image to be detected; Using a pre-trained classification model, classify the region image to obtain a classification result of whether the region image includes a foreign object; Determine whether foreign matter is mixed into the tray based on the classification result; the foreign matter includes: hair, or filaments; The classification model is trained using a weighted cross entropy loss function; The sample images in the training set are updated according to the needs of the production line. The target detection model is updated by iterative training in a first preset cycle. The classification model is updated by iterative training in a second preset cycle. The first preset cycle is longer than the second preset cycle.
2. The method according to claim 1, It is characterized in that The step of acquiring an image to be detected of a tray on which an orthodontic appliance is placed comprises: The image of the tray with the orthodontic appliance placed thereon is collected by taking a bird's-eye view photograph, so as to obtain the image to be detected of the tray with the orthodontic appliance placed thereon.
3. The method according to claim 1, It is characterized in that The step of cutting out a region image including the detected target from the image to be detected comprises: According to a preset size expansion ratio, a region image that is larger than the target detection frame of the target and smaller than the target image is cropped from the target image.
4. The method according to claim 3, It is characterized in that The step of cropping a region image that is larger than the target detection frame of the target and smaller than the target image from the target image according to a preset size expansion ratio includes: Taking the center position of the target detection frame as the center, according to a preset size expansion ratio of 1.0 to 1.2 times the size of the target detection frame, a regional image that is larger than the target detection frame of the target and smaller than the image to be detected is cropped from the image to be detected.
5. The method according to claim 1, It is characterized in that Also includes: In response to determining that foreign objects are mixed in the tray based on the classification result, a reminder message or an alarm message that foreign objects are mixed in the tray is sent.
6. The method according to any one of claims 1 to 5, It is characterized in that Also includes: Acquire a training set, the training set comprising a plurality of sample images; wherein the plurality of sample images comprise a positive sample image in which a foreign object exists in a tray on which an orthodontic appliance is placed, and a negative sample image in which no foreign object exists in a tray on which an orthodontic appliance is placed, the positive sample image being annotated with foreign object annotation information, the foreign object annotation information comprising foreign object position and size annotation information; Using the target detection model to be trained, performing target detection on the sample images in the training set to obtain target detection results, wherein the target detection results include the location and size of the foreign object; According to the target detection result of the sample image and the corresponding foreign object labeling information, the target detection model to be trained is trained until a first preset training completion condition is met to obtain the target detection model.
7. The method according to claim 6, It is characterized in that The obtaining of the training set comprises: By taking pictures from a bird's-eye view, images of multiple trays with orthodontic appliances placed on them without foreign objects are collected to obtain a negative sample image set; By taking pictures from a bird's-eye view, images of multiple trays with foreign objects and appliances placed on them are collected to obtain a positive sample image set; The negative sample image set is downsampled, the positive sample image set is oversampled, and the training set is obtained based on the negative sample image set obtained by downsampling and the positive sample image set obtained by oversampling.
8. The method according to claim 7, It is characterized in that The obtaining of the training set further includes: Performing data expansion based on the sample images already in the training set by a preset data expansion method to obtain an expanded sample image, and adding the expanded sample image to the training set; The preset data expansion method includes any one or more of the following: adjusting the brightness of the image, adjusting the contrast of the image, translating, mirroring, rotating, adding noise, mosaic splicing, and blocking operations on the image.
9. The method according to claim 6, It is characterized in that The method further includes training the target detection model to be trained until a first preset training completion condition is met: Using the target detection model to perform target detection on sample images in the training set; In response to detecting a target from the sample image, cropping a regional image sample from the sample image that is larger than a target detection frame of the target and smaller than the sample image according to a preset size expansion ratio; Using the classification model to be trained, classifying the regional image samples to obtain a classification result of whether the regional image samples include foreign matter; According to the classification results of the regional image samples and the corresponding foreign body labeling information, the classification model to be trained is trained until a second preset training completion condition is met to obtain the classification model.
10. The method according to claim 9, It is characterized in that The second preset training completion condition includes: The number of training times for the classification model to be trained reaches a preset number of times, and / or the function value of the weighted cross entropy loss function calculated based on the classification results of the regional image samples and the corresponding foreign body annotation information is less than a preset threshold.
11. A foreign body detection device, It is characterized in that include: A first acquisition module is used to acquire an image to be detected including a tray on which an orthodontic appliance is placed; A detection module, used to perform target detection on the image to be detected using a pre-trained target detection model; A cropping module, configured to, in response to detecting a target from the image to be detected, crop a region image including the detected target from the image to be detected; A classification module, used to classify the regional image using a pre-trained classification model to obtain a classification result of whether the regional image includes foreign matter; A determination module, used for determining whether foreign matter is mixed into the tray based on the classification result; the foreign matter includes: hair or filaments; The classification model is trained using a weighted cross entropy loss function; The sample images in the training set are updated according to the needs of the production line. The target detection model is updated by iterative training in a first preset cycle. The classification model is updated by iterative training in a second preset cycle. The first preset cycle is longer than the second preset cycle.
12. The device according to claim 11, It is characterized in that The first acquisition module is specifically used to: The image of the tray with the orthodontic appliance placed thereon is collected by taking a bird's-eye view photograph, so as to obtain the image to be detected of the tray with the orthodontic appliance placed thereon.
13. The device according to claim 11, It is characterized in that The cutting module is specifically used for: According to a preset size expansion ratio, a region image that is larger than the target detection frame of the target and smaller than the target image is cropped from the target image.
14. The device according to claim 12, It is characterized in that The cutting module is specifically used for: Taking the center position of the target detection frame as the center, according to a preset size expansion ratio of 1.0 to 1.2 times the size of the target detection frame, a regional image that is larger than the target detection frame of the target and smaller than the image to be detected is cropped from the image to be detected.
15. The device according to claim 11, It is characterized in that Also includes: The sending module is used for sending a reminder message or an alarm message of foreign objects mixed in the tray in response to determining that foreign objects are mixed in the tray based on the classification result.
16. The device according to any one of claims 11 to 15, It is characterized in that Also includes: A second acquisition module is used to acquire a training set, wherein the training set includes a plurality of sample images; wherein the plurality of sample images include a positive sample image in which a foreign object exists in a tray on which an orthodontic appliance is placed, and a negative sample image in which no foreign object exists in a tray on which an orthodontic appliance is placed, wherein the positive sample image is annotated with foreign object annotation information, wherein the foreign object annotation information includes foreign object position and size annotation information; The first training module is used to use the target detection model to be trained to perform target detection on the sample images in the training set to obtain target detection results, and the target detection results include the position and size of the foreign matter; and according to the target detection results of the sample images and the corresponding foreign matter labeling information, the target detection model to be trained is trained until the first preset training completion condition is met to obtain the target detection model.
17. The device according to claim 16, It is characterized in that The second acquisition module is specifically used for: By taking pictures from a bird's-eye view, images of multiple trays with orthodontic appliances placed on them without foreign objects are collected to obtain a negative sample image set; By taking photos from a bird's-eye view, multiple trays with foreign objects and appliances placed thereon are oversampled to obtain a positive sample image set; The negative sample image set is downsampled, the positive sample image set is oversampled, and the training set is obtained based on the negative sample image set obtained by downsampling and the positive sample image set obtained by oversampling.
18. The device according to claim 17, It is characterized in that Also includes: An expansion module, used to perform data expansion based on the existing sample images in the training set by a preset data expansion method to obtain an expanded sample image, and add the expanded sample image to the training set; The preset data expansion method includes any one or more of the following: adjusting the brightness of the image, adjusting the contrast of the image, translating, mirroring, rotating, adding noise, mosaic splicing, and blocking operations on the image.
19. The device according to claim 16, It is characterized in that The detection module is further used to perform target detection on the sample images in the training set using the target detection model; The cropping module is further configured to, in response to detecting a target from the sample image, crop a regional image sample from the sample image that is larger than a target detection frame of the target and smaller than the sample image according to a preset size expansion ratio; The device also includes: The second training module is used to classify the regional image samples using the classification model to be trained to obtain a classification result of whether the regional image samples include foreign matter; and to train the classification model to be trained according to the classification result of the regional image samples and the corresponding foreign matter labeling information until the second preset training completion condition is met to obtain the classification model.
20. The device according to claim 19, It is characterized in that The second preset training completion condition includes: The number of training times for the classification model to be trained reaches a preset number of times, and / or the function value of the weighted cross entropy loss function calculated based on the classification results of the regional image samples and the corresponding foreign body annotation information is less than a preset threshold.
21. A device, It is characterized in that The device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 10.
22. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.
