Powder particle detection method and device, computer equipment, medium and program product

By iterative training and labeling optimization of the Chinese medicine powder particle detection model, the problems of low detection efficiency and low accuracy in the existing technology are solved, and more efficient and accurate powder particle detection is achieved.

CN120047670APending Publication Date: 2025-05-27JIANGSU KANION PHARMA CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510116019.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-24
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

In the prior art, the detection of Chinese medicine powder particles depends on subjective judgment of experts, resulting in low efficiency, low accuracy, and a large amount of manual labeling, which takes a long time.

Method used

The particle detection model is trained by a sample image set pre-labeled with powder particle information, the sample image set without labeling information is processed, the uncertainty is calculated and the samples with the highest uncertainty are selected for labeling and retraining until the model performance meets the target conditions.

Benefits of technology

It improves the accuracy and efficiency of powder particle detection, reduces the workload of manual annotation, and can repeatedly select the most informative samples to be trained, enhancing the model's adaptability to various situations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120047670A_ABST
    Figure CN120047670A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of target detection, and discloses a powder particle detection method and device, computer equipment, a medium and a program product. The method comprises the steps that a to-be-trained particle detection model is trained through a first sample powder image set marked with powder particle information in advance, and a first particle detection model is obtained; processing the second sample powder image set without annotation information through a first particle detection model to obtain a particle detection result corresponding to each second sample powder image; selecting a first number of second sample powder images with the highest uncertainty for labeling, and adding the second sample powder images into the first sample powder image set, so as to train the first particle detection model again through the new first sample powder image set until the performance of the first particle detection model meets the target performance condition, and obtaining a target particle detection model. According to the scheme, when the powder particle detection function is achieved, the accuracy is good, and the efficiency is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of object detection, and particularly to a method, device, computer device, medium and program product for detecting powder particles. Background Art

[0002] In the process of traditional Chinese medicine industrial production, detecting particles in traditional Chinese medicine powder is a key quality control link. Particle detection focuses on measuring and analyzing the particle size in traditional Chinese medicine powder. The accurate measurement of particle size has a significant impact on ensuring aspects such as the solubility, utilization rate, formulation molding process, production efficiency, and medication safety of traditional Chinese medicine.

[0003] In related technologies, experts observe pictures of traditional Chinese medicine powder and mark the particles in the pictures of traditional Chinese medicine powder according to experience, and then combine machine vision algorithms for particle detection. However, this method relies on the subjective judgment of experts, has high labor costs and technical thresholds, low accuracy, and requires a large amount of annotation, which is time-consuming and inefficient. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a method, device, computer device, medium and program product for detecting powder particles to solve the problems of low efficiency and low accuracy in particle detection.

[0005] In a first aspect, the present invention provides a method for detecting powder particles, the method comprising:

[0006] Obtain a first sample powder image set; the first sample powder images in the first sample powder image set are pre-annotated with powder particle information;

[0007] Train a to-be-trained particle detection model through the first sample powder image set to obtain a first particle detection model;

[0008] Obtain a second sample powder image set; the second sample powder image set does not contain annotation information;

[0009] Process the second sample powder image set through the first particle detection model to obtain particle detection results corresponding to each second sample powder image in the second sample powder image set;

[0010] Calculate and sort the uncertainty of the particle detection results corresponding to each second sample powder image, and select the first number of second sample powder images with the highest uncertainty;

[0011] After annotating the second sample powder images with the highest uncertainty and adding them to the first sample powder image set, retrain the first particle detection model with the new first sample powder image set until the performance of the first particle detection model meets the target performance conditions, obtaining the target particle detection model; the target particle detection model is used to process the target powder image to obtain the particle detection result.

[0012] In an alternative embodiment, the calculating the uncertainty of the particle detection results corresponding to the respective second sample powder images includes:

[0013] Obtain the total number of detection frames and the confidence levels of each detection frame in the particle detection result corresponding to each second sample powder image;

[0014] Calculate the uncertainty of the second sample powder image based on the quotient of the sum value of the confidence levels of each detection frame and the total number of detection frames.

[0015] In an alternative embodiment, the first sample powder image set includes a training set and a validation set; the retraining of the first particle detection model with the new first sample powder image set until the performance of the first particle detection model meets the target performance conditions includes:

[0016] Retrain the first particle detection model with the training set in the new first sample powder image set to obtain a second particle detection model;

[0017] Evaluate the performance of the second particle detection model with the validation set in the first sample powder image set to obtain the performance data of the second particle detection model; the performance data includes accuracy, recall, and mean average precision;

[0018] If the performance data of the second particle detection model does not meet the target performance conditions, re-obtain the second sample powder image set, process the new second sample powder image set with the first particle detection model, select the first quantity of second sample powder images with the highest uncertainty of the corresponding particle detection results, annotate them, and add them to the first sample powder image set, so as to retrain the first particle detection model with the new first sample powder image set until the performance of the first particle detection model meets the target performance conditions.

[0019] In an alternative embodiment, the evaluating the performance of the second particle detection model with the validation set in the first sample powder image set to obtain the performance data of the second particle detection model includes:

[0020] Process the first sample powder image with the second particle detection model to obtain the particle detection result corresponding to the first sample powder image;

[0021] Calculate the loss value of the particle detection result corresponding to the first sample powder image through the loss function to obtain the performance data of the second particle detection model; wherein, the loss function is composed of the weighted bounding box loss and the classification loss.

[0022] In an alternative embodiment, the steps of the target particle detection model processing the target powder image to obtain the particle detection result include:

[0023] Perform multi-scale feature extraction on the target powder image through the backbone network of the target particle detection model to obtain target powder feature maps at multiple levels;

[0024] Perform feature fusion on the target powder feature maps at multiple levels through the neck network of the target particle detection model to obtain a target powder feature fusion map;

[0025] Process the target powder feature fusion map through the head network of the target particle detection model to predict the position, confidence, and powder particle category of the powder particles, and obtain the particle detection result.

[0026] In an alternative embodiment, before obtaining the particle detection result, the method further includes:

[0027] Obtain the detection frames and confidences of the predicted powder particles;

[0028] Sort the detection frames according to the confidence level, sequentially select the target detection frames according to the sorting, and calculate the intersection over union between the target detection frame and the remaining detection frames;

[0029] Compare the intersection over union between the target detection frame and the remaining detection frames with a preset threshold respectively, and remove the detection frames whose intersection over union with the target detection frame is greater than the preset threshold.

[0030] In a second aspect, the present invention provides a powder particle detection device, and the device includes:

[0031] A first acquisition module, configured to acquire a first sample powder image set; the first sample powder images in the first sample powder image set are pre-annotated with powder particle information;

[0032] A first training module, configured to train a particle detection model to be trained through the first sample powder image set to obtain a first particle detection model;

[0033] A second acquisition module, configured to acquire a second sample powder image set; the second sample powder image set does not contain annotation information;

[0034] A second training module, configured to process the second sample powder image set through the first particle detection model to obtain particle detection results corresponding to each second sample powder image in the second sample powder image set;

[0035] An uncertainty module, configured to calculate and sort the uncertainty of the particle detection results corresponding to each second sample powder image, and select the first number of second sample powder images with the highest uncertainty;

[0036] A third training module, configured to label the first number of second sample powder images with the highest uncertainty and add them to the first sample powder image set, so as to retrain the first particle detection model through the new first sample powder image set until the performance of the first particle detection model meets the target performance conditions, and obtain a target particle detection model; the target particle detection model is used to process a target powder image to obtain a particle detection result.

[0037] In a third aspect, the present invention provides a computer device, including: a memory and a processor, which are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to execute the powder particle detection method according to the first aspect or any corresponding embodiment thereof.

[0038] In a fourth aspect, the present invention provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to cause a computer to execute the powder particle detection method according to the first aspect or any corresponding embodiment thereof.

[0039] In a fifth aspect, the present invention provides a computer program product, including computer instructions, and the computer instructions are used to cause a computer to execute the powder particle detection method according to the first aspect or any corresponding embodiment thereof.

[0040] The technical solution provided by the present invention may include the following beneficial effects:

[0041] The powder particle detection method provided by the present invention trains a to-be-trained particle detection model through a first sample powder image set pre-labeled with powder particle information to obtain a first particle detection model; then processes a second sample powder image set without annotation information through the first particle detection model to obtain particle detection results corresponding to each second sample powder image; then calculates and sorts the uncertainty of the particle detection results corresponding to each second sample powder image, and selects the first number of second sample powder images with the highest uncertainty; finally, annotates the first number of second sample powder images with the highest uncertainty and adds them to the first sample powder image set to retrain the first particle detection model through the new first sample powder image set until the performance of the first particle detection model meets the target performance conditions to obtain a target particle detection model; the target particle detection model is used to process a target powder image to obtain a particle detection result. In the above solution, by selecting the first number of second sample powder images with the highest uncertainty, annotating them and adding them to the first sample powder image set, retraining the first particle detection model, and repeating this process to repeatedly update the training set for iterative training until the performance of the first particle detection model meets the target performance conditions, it is possible to repeatedly select the second sample powder images with the richest information content, which results in the greatest prediction uncertainty, to be added to the model training, improving the accuracy of the first particle detection model for detecting powder particles in various situations, improving the accuracy of powder particle detection, and significantly reducing the number of samples that need to be manually annotated, thereby improving the efficiency of powder particle detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0043] Figure 1 is a flowchart of the powder particle detection method according to an embodiment of the present invention;

[0044] Figure 2 is a flowchart of another powder particle detection method according to an embodiment of the present invention;

[0045] Figure 3 is a flowchart of yet another powder particle detection method according to an embodiment of the present invention;

[0046] Figure 4 is a flowchart of the active learning according to an embodiment of the present invention;

[0047] Figure 5It is a structural block diagram of a powder particle detection device according to an embodiment of the present invention;

[0048] Figure 6 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Specific embodiments

[0049] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0050] In the process of traditional Chinese medicine industrial production, the detection of particles in traditional Chinese medicine powder is a key quality control link. Particle detection focuses on measuring and analyzing the particle size in traditional Chinese medicine powder. The accurate measurement of particle size has a significant impact on ensuring the solubility, utilization rate, formulation molding process, production efficiency, and medication safety of traditional Chinese medicine.

[0051] In the related art, experts observe pictures of traditional Chinese medicine powder and mark the particles in the pictures of traditional Chinese medicine powder according to experience, and combine machine vision algorithms for particle detection. However, this method relies on the subjective judgment of experts, has high labor costs and technical thresholds, low accuracy, and requires a large amount of annotation, which takes a long time and has low efficiency.

[0052] Therefore, the embodiments of the present invention provide a powder particle detection method. By continuously selecting sample powder images with higher uncertainty for annotation and then adding them to the training set, the model is iteratively trained, significantly reducing the manual annotation workload and improving the accuracy and efficiency of powder particle detection.

[0053] According to an embodiment of the present invention, an embodiment of a powder particle detection method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.

[0054] In this embodiment, a powder particle detection method is provided, which can be used in desktop computers, laptop computers, servers, etc. Figure 1 It is a flowchart of the powder particle detection method according to an embodiment of the present invention. As Figure 1 shown, the process includes the following steps:

[0055] Step S101, obtain a first set of sample powder images.

[0056] The first sample powder image set contains multiple first sample powder images. The first sample powder images can be traditional Chinese medicine powder images downloaded from the Internet or images obtained by self-shooting traditional Chinese medicine powder. The first sample powder images contain powder particles with different particle sizes and morphologies, and the types of particle sizes and morphologies are as many as possible to ensure that the to-be-trained particle detection model can learn diverse powder particle features. Powder particle information is pre-annotated in each first sample powder image, which can be annotated by relevant technical personnel. The powder particle information includes the central position, width, and height of the powder particles.

[0057] Step S102: Train the to-be-trained particle detection model with the first sample powder image set to obtain the first particle detection model.

[0058] The to-be-trained particle detection model is a pre-trained model with particle detection function that has not been trained yet. For example, a deep learning model with particle detection function can be used.

[0059] Step S103: Obtain the second sample powder image set.

[0060] The second sample powder image set contains multiple second sample powder images. The second sample powder image set does not contain annotation information, that is, powder particle information is not annotated in each second sample powder image in the second sample powder image set.

[0061] Step S104: Process the second sample powder image set with the first particle detection model to obtain the particle detection results corresponding to each second sample powder image in the second sample powder image set.

[0062] Process each second sample powder image in the second sample powder image set with the first particle detection model respectively to obtain the particle detection results corresponding to each second sample powder image.

[0063] Step S105: Calculate the uncertainty of the particle detection results corresponding to each second sample powder image and sort them, and select the first number of second sample powder images with the highest uncertainty.

[0064] Calculate the uncertainty of the particle detection results corresponding to each second sample powder image respectively, and sort the uncertainties corresponding to each second sample powder image from high to low. Select the first number of second sample powder images from high to low. The first number can be set according to requirements, for example, select 5. Exemplarily, the uncertainty calculation method in related technologies can be used to calculate the uncertainty of the particle detection results, such as intersection over union, confidence level, Monte Carlo (dropout), Bayesian deep learning, etc.

[0065] Step S106: Label the first quantity of second sample powder images with the highest uncertainty and add them to the first sample powder image set to retrain the first particle detection model with the new first sample powder image set until the performance of the first particle detection model meets the target performance conditions, obtaining the target particle detection model.

[0066] In the scenario of traditional Chinese medicine powder particle detection, the powder images with higher uncertainty contain more information. Specifically, the powder images with higher uncertainty have greater uncertainty in particle detection, and there may be more small particles, overlapping particles, particle aggregates, particles with irregular shapes, etc. that are difficult to identify. Therefore, selecting the first quantity of second sample powder images with the highest uncertainty can train the first particle detection model with as much information as possible, achieving better model training effects and model performance.

[0067] Optionally, experts are used to label the first quantity of second sample powder images selected. Compared with a large number of labels in related technologies, the workload required to label only the first quantity of second sample powder images is greatly reduced, reducing labor and time costs and improving efficiency.

[0068] The target performance conditions can be set according to actual needs. For example, if the target performance condition is set to an accuracy rate greater than 80%, the model needs to be iteratively trained until the accuracy rate is greater than 80%. That is to say, if the performance of the first particle detection model after one training does not meet the target performance conditions, return to step S103, and loop through steps S103 to S106 until the performance of the first particle detection model meets the target performance conditions, then the training can be ended. The first particle detection model after the end of training is used as the target particle detection model. It should be noted that the overall structures of the particle detection model to be trained, the first particle detection model, and the target particle detection model in this embodiment are the same, but there are differences in the specific corresponding model parameters at different stages.

[0069] The powder particle detection method provided in this embodiment trains a to-be-trained particle detection model through a first sample powder image set pre-labeled with powder particle information to obtain a first particle detection model; then processes a second sample powder image set without label information through the first particle detection model to obtain particle detection results corresponding to each second sample powder image; then calculates and sorts the uncertainty of the particle detection results corresponding to each second sample powder image, and selects the first number of second sample powder images with the highest uncertainty; finally, labels the first number of second sample powder images with the highest uncertainty and adds them to the first sample powder image set to retrain the first particle detection model through the new first sample powder image set until the performance of the first particle detection model meets the target performance conditions to obtain a target particle detection model; the target particle detection model is used to process a target powder image to obtain a particle detection result. In the above solution, by selecting the first number of second sample powder images with the highest uncertainty, labeling them and adding them to the first sample powder image set, retraining the first particle detection model, and repeating this process to repeatedly update the training set for iterative training until the performance of the first particle detection model meets the target performance conditions, it is possible to repeatedly select the second sample powder images with the richest information content, which leads to the greatest prediction uncertainty, to be added to the model training, improving the accuracy of the first particle detection model for detecting powder particles in various situations, improving the accuracy of powder particle detection, and significantly reducing the number of samples that need to be manually labeled, thus improving the efficiency of powder particle detection.

[0070] In this embodiment, a powder particle detection method is provided, which can be used in desktop computers, laptop computers, servers, etc. Figure 2 It is a flowchart of the powder particle detection method according to an embodiment of the present invention, as Figure 2 shown, and this process includes the following steps:

[0071] Step S201, obtain a first sample powder image set.

[0072] The first sample powder images in the first sample powder image set can clearly show the shape, size, and distribution characteristics of the powder particles, and are pre-labeled with powder particle information.

[0073] The powder particle information includes the central position (x, y), width (h), and height (w) of the powder particles. Specifically, experts pre-observed the shape, size, and distribution characteristics of the powder particles in the first sample powder image, marked the powder particles in the first sample powder image, and the marking can be in the form of a bounding box. The central position, width, and height correspond to the central coordinates, width, and height of the bounding box. During the subsequent model training process, the model can be adjusted by comparing the differences in the central position, width, and height between the bounding box marked by the expert and the detection box predicted by the model, so that the detection box predicted by the model is as close as possible to the bounding box marked by the expert.

[0074] Before training the to-be-trained particle detection model with the first sample powder image set, each first sample powder image in the first sample powder image set can also be preprocessed. Specifically, data augmentation processing is performed on each first sample powder image in the first sample powder image training set to improve the adaptability of the model to different shooting conditions and particle morphologies and enhance the generalization performance of the model. Among them, the data augmentation processing includes rotation, flipping, scaling, and color transformation.

[0075] Step S202: Train the to-be-trained particle detection model with the first sample powder image set to obtain the first particle detection model.

[0076] Specifically, set the number of training rounds. In each round of training, first, multi-scale feature extraction is performed on the first sample powder images in the first sample powder image set through the backbone network of the to-be-trained particle detection model to obtain first sample powder feature maps at multiple levels; then, feature fusion is performed on the first sample powder feature maps at multiple levels through the neck network of the to-be-trained particle detection model to obtain a first sample powder feature fusion map; finally, the first sample powder feature fusion map is processed through the head network of the to-be-trained particle detection model to predict the position, confidence, and powder particle category of the powder particles, obtaining the first sample particle detection result. After reaching the number of training rounds, the training ends, and the to-be-trained particle detection model at this time is used as the first particle detection model.

[0077] Step S203: Obtain the second sample powder image set.

[0078] The second sample powder image set does not contain annotation information.

[0079] For details, please refer to Figure 1 Step S103 of the embodiment shown, which will not be elaborated here.

[0080] Step S204: Process the second sample powder image set through the first particle detection model to obtain the particle detection results corresponding to each second sample powder image in the second sample powder image set.

[0081] First, multi-scale feature extraction is performed on the second sample powder images in the second sample powder image set through the backbone network of the first particle detection model to obtain second sample powder feature maps at multiple levels. Then, feature fusion is performed on the second sample powder feature maps at multiple levels through the neck network of the first particle detection model to obtain a second sample powder feature fusion map. Finally, the second sample powder feature fusion map is processed through the head network of the first particle detection model to predict the position, confidence, and powder particle category of the powder particles, and the particle detection results corresponding to each second sample powder image are obtained. Among them, the position of the powder particle is used to indicate the center position, width, and height of the detection box (bounding box) corresponding to the identified powder particle. The powder particle category is used to indicate whether there is a particle at this position, and the confidence is used to indicate the probability that there is a particle at this position. The area where there is no particle is the background. For example, if the particle detection result is "class keli: 0.75", then the powder particle category output by the first particle detection model is a particle, and the confidence is 0.75, indicating that the probability of there being a particle at this position is 0.75. Step S205, calculate the uncertainty of the particle detection results corresponding to each second sample powder image and sort them, and select the first number of second sample powder images with the highest uncertainty.

[0082] Optionally, obtain the total number of detection boxes and the confidence of each detection box in the particle detection result corresponding to each second sample powder image; calculate the uncertainty of the second sample powder image based on the quotient of the sum value of the confidences of each detection box and the total number of detection boxes.

[0083] Specifically, the uncertainty of the second sample powder image can be calculated by the following formula:

[0084]

[0085] where N is the total number of detection boxes, and P i is the confidence of the i-th detection box.

[0086] Step S206, label the first number of second sample powder images with the highest uncertainty and add them to the first sample powder image set to retrain the first particle detection model through the new first sample powder image set until the performance of the first particle detection model meets the target performance conditions, and obtain the target particle detection model.

[0087] First, retrain the first particle detection model using the training set in the new first sample powder image set to obtain a second particle detection model. That is, add the first quantity of second sample powder images that have been labeled to the first sample powder image set to form a new first sample powder image set, and then retrain the first particle detection model using the training set in the new first sample powder image set to obtain a second particle detection model. The training process is similar to the relevant content in step S202 and will not be elaborated here.

[0088] Next, evaluate the performance of the second particle detection model using the validation set in the first sample powder image set to obtain the performance data of the second particle detection model. This performance data includes Precision, Recall, and mean Average Precision (mAP50). Precision represents the ratio of the number of correctly predicted particles to the total number of predicted particles. Recall represents the proportion of the number of samples correctly predicted as positive samples among all actual positive samples. Mean Average Precision is the area calculated using the Precision-Recall curve and is used to indicate the prediction accuracy of the model at different thresholds.

[0089] Optionally, when evaluating the performance of the second particle detection model, the first sample powder image can be processed by the second particle detection model to obtain the particle detection result corresponding to the first sample powder image, and then the loss value of the particle detection result corresponding to the first sample powder image can be calculated using a loss function to obtain the performance data of the second particle detection model. Among them, this loss function is composed of a weighted bounding box loss and a classification loss.

[0090] Specifically, the model (the particle detection model to be trained, the first particle detection model, the second particle detection model, and the target particle detection model in this embodiment can all adopt the loss function introduced below) calculates the difference between the predicted bounding box of the particle position (that is, the detection box obtained by the model predicting the particles in the sample. It can be understood that the sample here refers to different things in different models. For example, in the particle detection model to be trained, it refers to the first sample powder image, and in the target particle detection model, it refers to the target powder image) and the ground truth box (that is, the bounding box marked by experts) through the bounding box loss L box By minimizing the output of the model for the particle position and its size can be made as close as possible to the ground truth box manually marked, so as to achieve the best possible prediction effect. The bounding box loss can be calculated by the following formula

[0091]

[0092] Among them, IoU is the intersection over union between the predicted bounding box of the particle position and the ground truth bounding box of the particle position. The formula for calculating IoU is as follows:

[0093]

[0094] Among them, A is the predicted bounding box of the particle position output by the model, and B is the ground truth bounding box of the particle position pre-annotated. is the L2 norm between the center points of the predicted bounding box of the particle position and the ground truth bounding box of the particle position. The formula for calculating the L2 norm is as follows:

[0095]

[0096] Among them, b x is the x coordinate of the predicted bounding box of the particle position, and b y is the y coordinate of the predicted bounding box of the particle position. is the x coordinate of the ground truth bounding box of the particle position. is the y coordinate of the ground truth bounding box of the particle position.

[0097] Among them, v is the difference in the width-to-height ratio between the predicted bounding box of the particle position and the ground truth bounding box of the particle position. The formula for calculating v is as follows:

[0098]

[0099] Among them, w is the width of the predicted bounding box of the particle position, h is the height of the predicted bounding box of the particle position, w * is the width of the ground truth bounding box of the particle position, and h * is the height of the ground truth bounding box of the particle position.

[0100] Among them, α is a weighting parameter. The formula for calculating α is as follows:

[0101]

[0102] Among them, c is the diagonal length of the smallest closed bounding box containing the predicted bounding box of the particle position and the ground truth bounding box of the particle position.

[0103] The model uses cross-entropy as the classification loss to calculate the prediction results for each class. By minimizing the classification loss it is possible to eliminate as much as possible the situation where the model misjudges powder as particles, thereby further improving the accuracy of particle size prediction. The classification loss is calculated through the following formula

[0104]

[0105] Among them, N is the total number of samples, y i is the true class of the i-th sample, is the predicted class of the i-th sample.

[0106] Total loss function of the model Composed of bounding box loss And classification loss Weighted, and by minimizing The accurate positioning of the particle position and the reduction of the misjudgment of powder as particles can be achieved. The total loss function of the model can be calculated by the following formula

[0107]

[0108] Where, λ box Is the loss weight corresponding to the bounding box loss of the particle position, and λ cls Is the loss weight corresponding to the classification loss.

[0109] Finally, if the performance data of the second particle detection model does not meet the target performance conditions, re-obtain the second sample powder image set, and process the new second sample powder image set through the first particle detection model. Select the first number of second sample powder images with the highest uncertainty of the corresponding particle detection results for annotation and add them to the first sample powder image set, so as to re-train the first particle detection model through the new first sample powder image set. Repeat this process, continuously select the new first number of second sample powder images for annotation to continuously update the first sample powder image set, and perform iterative training on the first particle detection model through the continuously updated first sample powder image set until the performance of the first particle detection model meets the target performance conditions. Take the first particle detection model at this time as the target particle detection model, and this target particle detection model is used to process the target powder image to obtain the particle detection result.

[0110] It should be noted that re-obtaining the second sample powder image set can be the second sample powder image set obtained by removing the first number of second sample powder images selected and annotated from the second sample powder image set before. During the model iterative training process, when all the second sample powder images are selected, that is, when the image resources are exhausted, the model iterative training process can also be stopped.

[0111] Optionally, powder images in multiple granulation scenarios can be collected separately as the first sample powder images and the second sample powder images to participate in the model training process, such as powder images in scenarios of dry granulation, wet granulation, fluidized bed granulation, etc., so as to improve the particle detection ability of the trained target particle detection model for the target powder images in different granulation scenarios and improve the model applicability.

[0112] Step S207, process the target powder image through the target particle detection model to obtain the particle detection result.

[0113] Specifically, the above step S207 includes:

[0114] Step S2071: Perform multi-scale feature extraction on the target powder image through the backbone network of the target particle detection model to obtain target powder feature maps at multiple levels.

[0115] The backbone network processes the input target powder image through a CSP (Cross-Stage Partial) module, divides the target powder feature map of the target powder image into multiple parts, and respectively extracts multi-scale features such as the edges and textures of powder particles to adapt to the characteristics of different sizes and shapes of powder particles, thereby optimizing the calculation efficiency. At the same time, depthwise separable convolutional layers are used to reduce the number of model parameters and the amount of computation, ensuring the lightweight and high efficiency of the target particle detection model when detecting powder particles, so as to quickly process a large number of target powder images.

[0116] Step S2072: Perform feature fusion on the target powder feature maps at multiple levels through the neck network of the target particle detection model to obtain a target powder feature fusion map.

[0117] The neck network fuses the target powder feature maps at multiple levels from the backbone network to enhance the representation ability of powder particle features, especially for powder particles with different particle sizes. Different-scale pooling operations are implemented through an SPPF (Spatial Pyramid Pooling Fast) module, and the target powder feature maps containing powder particles with different particle sizes are spliced together, significantly improving the detection ability of the model for powder particles with different particle sizes.

[0118] Step S2073: Process the target powder feature fusion map through the head network of the target particle detection model to predict the position, confidence, and powder particle category of the powder particles, and obtain particle detection results.

[0119] The head network is responsible for the final target detection and classification tasks, including a detection head and a classification head. The detection head uses convolutional layers and deconvolutional layers to predict the boundary regression values and the confidence of the existence of each powder particle, which is used to generate accurate particle detection results, which is crucial for subsequent quality analysis of traditional Chinese medicine powders and optimization of preparation processes. The classification head then classifies each target powder feature map using global average pooling, reduces the dimension of the target powder feature map, and outputs the probability distribution of each powder particle category, thereby achieving accurate classification of powder particles.

[0120] To further detect small particles in traditional Chinese medicine powder, a small target detection head is added to the head network to further enhance the detection ability of small particles. Through denser sampling and feature extraction, small particles can be more accurately located and identified, avoiding the omission or misjudgment of small particles during the detection process.

[0121] Optionally, before obtaining the particle detection results, post-processing can also be performed on the detection frames of each powder particle initially predicted to avoid multiple detection frames from repeatedly detecting the same particle. Specifically, first obtain the detection frames and confidence levels of each predicted powder particle; then sort the detection frames according to the confidence level, sequentially select the target detection frames according to the sorting, and calculate the intersection over union (IoU) between the target detection frame and the remaining detection frames; finally, compare the IoU between the target detection frame and the remaining detection frames with a preset threshold respectively, and remove the detection frames whose IoU with the target detection frame is greater than the preset threshold. That is to say, first calculate the IoU between the detection frame with the highest confidence level and each of the remaining detection frames, remove the remaining detection frames whose IoU with the detection frame with the highest confidence level exceeds the preset threshold, then calculate the IoU between the detection frame with the second highest confidence level and each of the remaining detection frames, and remove the remaining detection frames whose IoU with the detection frame with the second highest confidence level exceeds the preset threshold, and so on until all frames are processed. This preset threshold is set based on the overlapping or aggregation situation between particles. By setting an appropriate preset threshold, it is possible to remove the target detection frames with a high degree of overlapping or aggregation, reduce false detections and repeated detections, and improve the accuracy of particle detection. It should be noted that the post-processing process can also be added during the training stage to improve the accuracy of particle detection during the training stage.

[0122] Exemplarily, non-maximum suppression (NMS) is used to perform post-processing on the screening frames, and the formula is as follows:

[0123]

[0124] where B 1 and B 2 represent two candidate detection frames, |B 1 ∩B 2 | represents the intersection area of the two candidate detection frames, |B 1 ∪B 2 | represents the union area of the two candidate detection frames. When calculating IoU(B 1 ,B 2)When it is greater than a preset threshold, it is considered that the two candidate detection frames overlap, and thus the candidate detection frame with a lower confidence level is removed. The powder particle detection method provided in this embodiment trains a to-be-trained particle detection model through a first sample powder particle image set pre-annotated with powder particle information to obtain a first particle detection model; then processes a second sample powder particle image set without annotation information through the first particle detection model to obtain particle detection results corresponding to each second sample powder particle image; then calculates and sorts the uncertainty of the particle detection results corresponding to each second sample powder particle image, and selects the first quantity of second sample powder particle images with the highest uncertainty; finally, annotates the first quantity of second sample powder particle images with the highest uncertainty and adds them to the first sample powder particle image set to retrain the first particle detection model through the new first sample powder particle image set until the performance of the first particle detection model meets the target performance conditions to obtain a target particle detection model; the target particle detection model is used to process a target powder particle image to obtain a particle detection result. In the above solution, by selecting the first quantity of second sample powder particle images with the highest uncertainty, annotating them and adding them to the first sample powder particle image set, retraining the first particle detection model, and repeating this process to repeatedly update the training set for iterative training until the performance of the first particle detection model meets the target performance conditions, it is possible to repeatedly select the second sample powder particle images with the richest information content, which leads to the greatest prediction uncertainty, to be added to the model training, improving the accuracy of the first particle detection model for detecting powder particles in various situations, improving the accuracy of powder particle detection, and significantly reducing the number of samples that need to be manually annotated, improving the efficiency of powder particle detection.

[0125] As one or more specific application embodiments of the embodiments of the present invention, the optimal implementation scheme or the scheme that the inventor most wants to embody will be described below in combination with specific application scenarios.

[0126] Figure 3It is a schematic flowchart of the powder particle detection method according to an embodiment of the present invention. In this embodiment, YOLOv8 is used as the particle detection model to be trained. Specifically, first, data preparation is carried out. Product images can be collected from the industrial site to collect traditional Chinese medicine powder particle image data as sample powder images, ensuring that the sample powder images can clearly show the shape, size, and distribution characteristics of the particles. Then, a part of the sample powder images is accurately labeled by experts. The labeling format conforms to the requirements of YOLOv8, and the labeling content includes information such as the central position, height, width, and category of the particles. The training set and the validation set are divided according to the ratio of 8:2 to ensure that the data distribution of the training set and the validation set is representative. Then, data augmentation processing can be performed on the images in the training set, including rotation, flipping, scaling, color transformation, etc., to improve the adaptability of the model to different shooting conditions and particle morphologies and enhance the generalization performance of the model. Next, the particle detection model YOLOv8 to be trained is loaded based on the pre-trained weights, the training parameters (such as the learning rate, the number of training epochs, etc.) are configured, and the first particle detection model is obtained through preliminary training using the labeled training set. Then, the performance indicators of the first particle detection model are evaluated. The first particle detection model is evaluated through the validation set, and the accuracy, recall rate, and mean average precision are recorded. The performance of the first particle detection model in detecting particles of different particle sizes and shapes is analyzed. Since small particles are more common and easily missed in traditional Chinese medicine powder, the detection effect of the first particle detection model on small particles is focused on. Next, uncertainty screening is carried out based on active learning to continuously optimize the model. Figure 4 It is a schematic flowchart of active learning according to an embodiment of the present invention. Specifically, the first particle detection model is used to predict the sample powder images without labels (unlabeled image dataset), the uncertainty of the prediction results is calculated, and the 10 sample powder images with the highest uncertainty are selected and handed over to experts for labeling. Then, the labeled sample powder images are put into the training set, and the model is trained with the new training set. Among them, D 0 to D n-1 represent the sample powder images pre-labeled by experts, and Q 0 to Q n-1 represent the sample powder images that need to be labeled by experts selected from the unlabeled image dataset by the active learning algorithm. The above steps are repeated to perform iterative training on the first particle detection model. After each iterative training, the performance indicators of the model will be further improved. During the iterative training process, the proportion of training data can be gradually increased, for example, adjusted from the 8:2 division ratio to 7:3, 6:4, etc., to make full use of more data resources and further optimize the detection ability of the model. Finally, the first particle detection model whose performance indicators meet the task requirements and has a good detection effect on particles of different particle sizes and shapes is saved as the target particle detection model to achieve high-precision powder particle size detection through the target particle detection model.

[0127] Exemplarily, specific numerical experiments were conducted. Sample powder images were obtained by taking on-site images of traditional Chinese medicine powder particles. The image specifications were 4000 pixels × 3000 pixels, and a total of 600 images were collected. In the early stage of the experiment, 100 randomly selected sample powder images were pre-annotated manually as the initial dataset, and were divided into a training set and a validation set according to a ratio of 8:2. Finally, the training set consisted of 80 images and the validation set consisted of 20 images. When conducting model training, first, the 80 images in the training set were used for model training, and the number of training rounds was set to 100. To evaluate the performance of the model in each round of learning on the particle size detection task, we selected accuracy, recall, and mean average precision as evaluation metrics. After the model training was completed, first, the model was evaluated on the validation set formed by 20 images to analyze whether the evaluation metrics met the task requirements. If not, the trained model was used to predict on the remaining 500 unannotated sample powder images, the uncertainty of the prediction results was calculated, and the 10 sample powder images with the highest uncertainty were selected and handed over to experts for manual annotation. The active learning method was used to continuously optimize the model until the model evaluation metrics met the task requirements. To comprehensively display the experimental results, a control group was set up in this numerical experiment. The number of samples n finally input for training when the initial experimental group finally stopped was recorded. (n - 100) images were randomly selected from the initial 500 unannotated data for manual annotation, and the experiment was conducted using the same training parameters. The training results were compared with those under the active learning method.

[0128] Specifically, 200 images were marked through the active learning method to train the object detection model, and at the same time, 200 samples were also trained through random sampling. The task indicators of the two models are shown in Table 1 below:

[0129] Table 1: Statistical table of task indicators for the active learning method and the conventional method.

[0130] Method Number of samples Accuracy Recall Mean average precision Active learning 200 73.7% 61.9% 69.2% Random sampling 200 71.3% 59.8% 67.6%

[0131] By comparison, it can be seen that using active learning increased the accuracy by 73.7% - 71.3% = 2.5%, increased the recall by 61.9% - 59.8% = 2.1%, and increased the mean average precision by 69.2% - 67.6% = 1.6%. This indicates that the powder particle detection method provided in this embodiment is sufficient and effective.

[0132] In this embodiment, a powder particle detection device is further provided. This device is used to implement the above-mentioned embodiments and preferred implementation manners, and those that have been described will not be elaborated again. As used hereinafter, the term "module" can be a combination of software and / or hardware that realizes a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0133] This embodiment provides a powder particle detection device, as Figure 5 shown, including:

[0134] A first acquisition module 501, configured to acquire a first sample powder image set; the first sample powder images in the first sample powder image set are pre-annotated with powder particle information;

[0135] A first training module 502, configured to train a to-be-trained particle detection model through the first sample powder image set to obtain a first particle detection model;

[0136] A second acquisition module 503, configured to acquire a second sample powder image set; the second sample powder image set does not contain annotation information;

[0137] A second training module 504, configured to process the second sample powder image set through the first particle detection model to obtain particle detection results corresponding to each second sample powder image in the second sample powder image set;

[0138] An uncertainty module 505, configured to calculate and sort the uncertainty of the particle detection results corresponding to each second sample powder image, and select the first number of second sample powder images with the highest uncertainty;

[0139] A third training module 506, configured to add the first number of second sample powder images with the highest uncertainty after annotation to the first sample powder image set, and re-train the first particle detection model through the new first sample powder image set until the performance of the first particle detection model meets the target performance conditions to obtain a target particle detection model; the target particle detection model is used to process a target powder image to obtain a particle detection result.

[0140] In an alternative embodiment, the uncertainty module is further configured to: acquire the total number of detection frames and the confidence of each detection frame in the particle detection result corresponding to each second sample powder image; calculate the uncertainty of the second sample powder image based on the quotient of the sum value of the confidences of each detection frame and the total number of detection frames.

[0141] In an alternative embodiment, the first sample powder image set includes a training set and a validation set; the third training module is further configured to: retrain the first particle detection model with the training set in the new first sample powder image set to obtain a second particle detection model; evaluate the performance of the second particle detection model with the validation set in the first sample powder image set to obtain the performance data of the second particle detection model; the performance data includes accuracy, recall rate, and mean average precision; if the performance data of the second particle detection model does not meet the target performance conditions, re-obtain the second sample powder image set, process the new second sample powder image set through the first particle detection model, select the first number of second sample powder images with the highest uncertainty of the corresponding particle detection results for annotation and add them to the first sample powder image set, so as to retrain the first particle detection model with the new first sample powder image set until the performance of the first particle detection model meets the target performance conditions.

[0142] In an alternative embodiment, the third training module is further configured to: process the first sample powder image through the second particle detection model to obtain the particle detection result corresponding to the first sample powder image; calculate the loss value of the particle detection result corresponding to the first sample powder image through the loss function to obtain the performance data of the second particle detection model; wherein, the loss function is composed of a weighted bounding box loss and a classification loss.

[0143] In an alternative embodiment, the device further includes a target particle detection module, configured to: perform multi-scale feature extraction on the target powder image through the backbone network of the target particle detection model to obtain target powder feature maps at multiple levels; perform feature fusion on the target powder feature maps at multiple levels through the neck network of the target particle detection model to obtain a target powder feature fusion map; process the target powder feature fusion map through the head network of the target particle detection model to predict the position, confidence, and powder particle category of the powder particles to obtain the particle detection result.

[0144] In an alternative embodiment, the target particle detection module is further configured to: obtain the detection frames and confidence levels of the predicted powder particles; sort the detection frames according to the confidence levels, sequentially select the target detection frames according to the sorting, and calculate the intersection over union between the target detection frame and the remaining detection frames; compare the intersection over union between the target detection frame and the remaining detection frames with a preset threshold respectively, and remove the detection frames with an intersection over union greater than the preset threshold with the target detection frame.

[0145] The further function descriptions of the above-mentioned modules and units are the same as those in the corresponding embodiments above, and will not be elaborated here.

[0146] The powder particle detection device in this embodiment is presented in the form of functional units. Here, the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and a memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0147] An embodiment of the present invention further provides a computer device having the above Figure 5 powder particle detection device shown.

[0148] Please refer to Figure 6 , Figure 6 which is a schematic structural diagram of a computer device provided by an alternative embodiment of the present invention. As Figure 6 shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including a high-speed interface and a low-speed interface. Each component communicates with each other using different buses and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed within the computer device, including instructions stored in the memory or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some alternative embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a set of blade servers, or a multi-processor system). Figure 6 In

[0149] Figure, a single processor 10 is taken as an example.

[0150] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0151] The memory 20 may include a program storage area and a data storage area. The program storage area may store an operating system and application programs required for at least one function. The data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some alternative embodiments, the memory 20 may optionally include a memory remotely provided with respect to the processor 10, and these remote memories may be connected to the computer device through a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0152] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, a hard disk, or a solid-state drive; the memory 20 may further include a combination of the above types of memory.

[0153] The computer device further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30, and the output device 40 may be connected through a bus or other means. Figure 6 Taking connection through a bus as an example.

[0154] The input device 30 may receive input digital or character information and generate key signal inputs related to user settings and function controls of the computer device, such as a touch screen, a keypad, a mouse, a trackpad, a touchpad, a pointing stick, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED), and a haptic feedback device (e.g., a vibration motor), etc. The above display device includes but is not limited to a liquid crystal display, a light-emitting diode, a display, and a plasma display. In some alternative embodiments, the display device may be a touch screen.

[0155] Embodiments of the present invention also provide a computer-readable storage medium. The methods according to the embodiments of the present invention can be implemented in hardware, firmware, or be implemented as computer code that can be recorded on a storage medium, or be implemented as computer code that is originally stored in a remote storage medium or a non-transitory machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the methods described herein can be stored as such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid-state drive, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code, and when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the methods shown in the above embodiments are implemented.

[0156] A part of the present invention can be applied as a computer program product, for example, computer program instructions, which when executed by a computer, can call or provide the methods and / or technical solutions according to the present invention through the operation of the computer. Those skilled in the art should be able to understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Herein, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.

[0157] Although the embodiments of the present invention are described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations all fall within the protection scope of the present invention.

Claims

1. A powder particle detection method, characterized in that: The method comprises: Acquire a first sample powder image set; the first sample powder image in the first sample powder image set is pre-labeled with powder particle information; Training the to-be-trained particle detection model by using the first sample powder image set to obtain a first particle detection model; Acquire a second sample powder image set; the second sample powder image set does not contain annotation information; Processing the second sample powder image set by using the first particle detection model to obtain a particle detection result corresponding to each second sample powder image in the second sample powder image set; Calculating and sorting the uncertainty of the particle detection results corresponding to each of the second sample powder images, and selecting the first number of second sample powder images with the highest uncertainty; The first number of second sample powder images with the highest uncertainty are annotated and added to the first sample powder image set, so as to retrain the first particle detection model with the new first sample powder image set until the performance of the first particle detection model meets the target performance conditions, thereby obtaining a target particle detection model; the target particle detection model is used to process the target powder image to obtain a particle detection result.

2. The method according to claim 1, characterized in that The performing uncertainty calculation on the particle detection results corresponding to each of the second sample powder images includes: Obtaining the total number of detection frames and the confidence of each detection frame in the particle detection result corresponding to each second sample powder image; The uncertainty of the second sample powder image is calculated based on the quotient of the sum of the confidences of the respective detection frames and the total number of the detection frames.

3. The method according to claim 1, characterized in that The first sample powder image set includes a training set and a validation set; and retraining the first particle detection model using the new first sample powder image set until the performance of the first particle detection model meets the target performance condition includes: Retraining the first particle detection model using a training set in a new first sample powder image set to obtain a second particle detection model; Performing a performance evaluation on the second particle detection model through a validation set in the first sample powder image set to obtain performance data of the second particle detection model; the performance data includes accuracy, recall rate, and average precision mean; If the performance data of the second particle detection model does not meet the target performance conditions, the second sample powder image set is reacquired, and the new second sample powder image set is processed by the first particle detection model, and the first number of second sample powder images with the highest uncertainty in the corresponding particle detection results are selected for annotation and added to the first sample powder image set, so as to retrain the first particle detection model with the new first sample powder image set until the performance of the first particle detection model meets the target performance conditions.

4. The method according to claim 3, characterized in that The performing performance evaluation on the second particle detection model through the validation set in the first sample powder image set to obtain performance data of the second particle detection model includes: Processing the first sample powder image by using a second particle detection model to obtain a particle detection result corresponding to the first sample powder image; The loss value of the particle detection result corresponding to the first sample powder image is calculated by a loss function to obtain performance data of the second particle detection model; wherein the loss function is composed of a bounding box loss and a weighted classification loss.

5. The method according to any one of claims 1 to 4, characterized in that: The target particle detection model processes the target powder image to obtain the particle detection result, including the following steps: Performing multi-scale feature extraction on the target powder image through the backbone network of the target particle detection model to obtain target powder feature maps at multiple levels; Performing feature fusion on the target powder feature maps at multiple levels through the neck network of the target particle detection model to obtain a target powder feature fusion map; The target powder feature fusion image is processed by the head network of the target particle detection model to predict the position, confidence and powder particle category of the powder particles to obtain the particle detection result.

6. The method according to claim 5, characterized in that Before obtaining the particle detection result, the method further includes: Obtain the predicted detection frame and confidence level of each powder particle; Sort the detection frames according to their confidence levels, select the target detection frame in turn according to the ranking, and calculate the intersection-over-union ratio between the target detection frame and the remaining detection frames; The intersection-over-union ratio between the target detection frame and the remaining detection frames is compared with the preset threshold, and the detection frames whose intersection-over-union ratio with the target detection frame is greater than the preset threshold are removed.

7. A powder particle detection device, characterized in that: The device comprises: A first acquisition module is used to acquire a first sample powder image set; the first sample powder image in the first sample powder image set is pre-labeled with powder particle information; A first training module, used for training the to-be-trained particle detection model through the first sample powder image set to obtain a first particle detection model; A second acquisition module is used to acquire a second sample powder image set; the second sample powder image set does not contain annotation information; a second training module, configured to process the second sample powder image set by using the first particle detection model to obtain a particle detection result corresponding to each second sample powder image in the second sample powder image set; An uncertainty module, used to calculate and sort the uncertainty of the particle detection results corresponding to each of the second sample powder images, and select the first number of second sample powder images with the highest uncertainty; The third training module is used to annotate the first number of second sample powder images with the highest uncertainty and add them to the first sample powder image set, so as to retrain the first particle detection model with the new first sample powder image set until the performance of the first particle detection model meets the target performance conditions, thereby obtaining a target particle detection model; the target particle detection model is used to process the target powder image to obtain a particle detection result.

8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the powder particle detection method according to any one of claims 1 to 6 by executing the computer instructions.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the powder particle detection method according to any one of claims 1 to 6.

10. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to enable a computer to execute the powder particle detection method according to any one of claims 1 to 6.