A two-stage detection and classification system and method for parasite eggs

By employing a two-stage detection and classification system, utilizing environmental perception and adaptive imaging technology, and combining detection models at different magnifications with morphological feature extraction, the system solves the problem of detection stability across different microscope platforms and sample batches, achieving efficient and accurate classification of parasite eggs.

CN123072018APending Publication Date: 2026-11-10MOTIC CHINA GROUP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611316387.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-27
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

Existing technologies struggle to maintain stable parasite egg detection performance across different microscope platforms or batches of samples, particularly exhibiting low detection accuracy and efficiency in high-magnification image detection.

Method used

A two-stage detection and classification system is adopted, including an environmental perception module, an adaptive imaging module, and a target detection module. By sensing the working environment information and sample type, the imaging parameters are adaptively adjusted. Combined with detection models at different magnifications and morphological feature extraction, the collaborative detection of parasite eggs is achieved.

Benefits of technology

It improves the environmental generalization ability and stability of detection and classification tasks, avoids the problem of low interpretability caused by black-box decision-making, realizes collaborative work of multi-magnification images, and improves detection accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123072018A_ABST
    Figure CN123072018A_ABST
Patent Text Reader

Abstract

This application relates to the field of microscopic imaging and provides a two-stage detection and classification system and method for parasite eggs. An adaptive imaging module determines adaptive imaging parameters based on the sample type and working environment information of the parasite egg sample, capturing multiple frames of first images of the parasite egg sample at a first magnification and adaptive imaging parameters. The stage is moved according to a candidate target map, capturing second images of each candidate target in the candidate target map at a second magnification and adaptive imaging parameters. A target detection module uses a first detection model to detect each first image to obtain a candidate target map; a second detection model is used to detect the second images to obtain a second detection result; morphological features of the candidate targets in the second image are extracted based on the second detection result and input into a classifier to obtain the target classification result. This application enables magnification coordination in the detection and classification of parasite egg samples, improving the generalization ability of the detection and classification task to the environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of microscopic imaging, and more particularly to a two-stage detection and classification system and method for parasite eggs. Background Technology

[0002] In the diagnosis and teaching practice of parasitic diseases, deep learning-based target detection methods are commonly used to identify parasite eggs in samples. For example, networks such as YOLO and Faster R-CNN are used to perform end-to-end detection and classification on the microscopic images of parasite egg samples. A single neural network can simultaneously detect the location and type of parasite eggs in the sample. However, a single parasite egg sample often contains multiple different types of eggs. Some eggs can be directly observed under low magnification, while others can only be seen under high magnification. The optimal detection model configuration is different for different magnification images. A single neural network cannot take into account the detection stability of multiple magnification images. However, if low magnification is used uniformly, small targets and details are easily missed, affecting the detection accuracy. On the other hand, the field of view under high magnification is too small, and the required scanning time is too long, resulting in low detection efficiency.

[0003] In addition, existing deep learning networks are usually supervised learning on training sets collected under fixed laboratory environmental conditions. The imaging quality of the training set is affected by external factors such as temperature, humidity, light intensity and staining process parameters. When the microscope equipment model changes, the batch of slides is different or the laboratory environmental conditions fluctuate, the imaging effect often changes, resulting in a significant decrease in the detection accuracy of the existing detection model. In other words, the existing technology is difficult to maintain stable detection performance between different microscope platforms or different batches of samples. Summary of the Invention

[0004] This application provides a two-stage detection and classification system and method for parasite eggs, which can achieve multiplier synergy in the detection and classification of parasite egg samples and improve the generalization ability of the detection and classification task to the environment.

[0005] In a first aspect, embodiments of this application provide a two-stage detection and classification system for parasite eggs, comprising an environmental perception module, an adaptive imaging module, and a target detection module connected in sequence;

[0006] The environmental perception module is used to detect working environment information and send it to the adaptive imaging module;

[0007] The adaptive imaging module is used to determine adaptive imaging parameters based on the sample type and working environment information of the insect egg sample, control the stage to move according to a preset trajectory, capture multiple frames of the first image of the insect egg sample on the stage at a first magnification and adaptive imaging parameters, and send them to the target detection module; and control the stage to move according to the candidate target map, capture the second image of each candidate target in the candidate target map at a second magnification and adaptive imaging parameters, and send them to the target detection module; the second magnification is greater than the first magnification;

[0008] The target detection module is used to detect each first image using a first detection model, obtain a candidate target map and send it to the adaptive imaging module; it uses a second detection model to detect the second image, obtains a second detection result, extracts the morphological features of the candidate targets in the second image based on the second detection result and inputs them into the classifier to obtain the target classification result.

[0009] Optionally, the working environment information includes temperature information, humidity information, and light information; the environment perception module includes a temperature and humidity sensor and a light sensor respectively connected to the adaptive imaging module.

[0010] Optionally, the adaptive imaging module is specifically used to read the sample type of the insect egg sample via barcode or RFID; and input the sample type and working environment information into a pre-trained mapping network to obtain adaptive imaging parameters.

[0011] Optionally, the adaptive imaging parameters include exposure time, gain parameters, white balance parameters, and initial focal length.

[0012] Optionally, the target detection module is specifically used to detect the first image using a first detection model to obtain a first detection result. The first detection result includes the bounding boxes, classification groups, confidence scores, and location coordinates of multiple suspected targets in the first image. Candidate targets are then selected from each suspected target based on the classification groups and confidence scores, and the bounding boxes and location coordinates of the candidate targets are added to the candidate target map.

[0013] Optionally, the second detection result includes the bounding box and confidence score of the candidate target in the second image;

[0014] The target detection module is specifically used to extract the morphological features of candidate targets with a confidence level greater than the first confidence threshold, and input them into the classifier to obtain the target classification result of the candidate targets; the target detection module is also used to extract the morphological features of suspected targets in the first image that were not selected as candidate targets and whose confidence level is greater than the first confidence threshold, and input them into the classifier to obtain the target classification result of the suspected targets.

[0015] Optionally, the target detection module is also used to obtain the working environment information of the environment perception module; before inputting the morphological features into the classifier, the standardization parameters are determined according to the shooting magnification corresponding to the suspected target or candidate target, the morphological features are standardized according to the standardization parameters, and the standardized morphological features are compensated according to the working environment information.

[0016] Optionally, the object detection module is also used to construct multiple candidate models, automatically tune the hyperparameters of each candidate model to obtain multiple classifiers, and verify the evaluation scores of each classifier; the object detection module is also used to input the corresponding morphological features into the classifier with the highest evaluation score when the confidence of a candidate target or suspected target is greater than the second confidence threshold, to obtain the target classification result; when the confidence of a candidate target or suspected target is greater than or equal to the first confidence threshold and less than or equal to the second confidence threshold, the corresponding morphological features are input into the three classifiers with the highest evaluation scores, and the target classification result is obtained based on the output results of the three classifiers.

[0017] Optionally, the morphological features include geometric morphological features, grayscale texture features, and color space features; the geometric morphological features include pixel area, outline perimeter, roundness, fullness, and bounding box aspect ratio; the grayscale texture features include grayscale mean, grayscale standard deviation, edge pixel ratio, and Laplacian variance; the color space features include the hue mean, saturation mean, and lightness mean of the HSV color space, and the lightness mean, a-channel mean, and b-channel mean of the Lab color space.

[0018] Secondly, another embodiment of this application provides a two-stage detection and classification method for parasite eggs, applied to a two-stage detection and classification system for parasite eggs. The two-stage detection and classification system for parasite eggs includes an environmental perception module, an adaptive imaging module, and a target detection module connected in sequence. The method includes:

[0019] The environmental perception module detects the working environment information and sends it to the adaptive imaging module;

[0020] The adaptive imaging module determines the adaptive imaging parameters based on the sample type and working environment information of the insect egg sample, controls the stage to move according to the preset trajectory, and captures the first image of the insect egg sample on the stage at the first magnification and adaptive imaging parameters and sends it to the target detection module.

[0021] The target detection module uses the first detection model to detect each first image, obtains a candidate target map, and sends it to the adaptive imaging module;

[0022] The adaptive imaging module controls the stage to move according to the candidate target map, and captures second images of each candidate target in the candidate target map at the second magnification and adaptive imaging parameters, and sends them to the target detection module; the second magnification is greater than the first magnification.

[0023] The target detection module uses a second detection model to detect the second image and obtains a second detection result. Based on the second detection result, the morphological features of the candidate targets in the second image are extracted and input into the classifier to obtain the target classification result.

[0024] Compared with the prior art, the two-stage detection and classification system for parasite eggs provided in this application has at least the following beneficial effects: First, this application uses an environmental perception module to perceive the working environment information, and enables the adaptive imaging module to adaptively adjust the imaging parameters according to the sample type of the parasite egg sample and the working environment information, thereby compensating for the imaging effect shift caused by environmental changes, making the imaging quality of different samples in different environments similar, and improving the stability of subsequent target detection and classification; Second, this application uses different detection models to screen parasite egg targets in the first image captured at the first magnification and the second image captured at the second magnification, and performs type recognition by extracting morphological features after detection, dividing the detection target and target classification into two stages of tasks. The target classification task is performed by a separate classifier, which not only realizes the collaborative work of the two magnifications, but also avoids the problem of low interpretability caused by black-box decision-making in the classification task. Attached Figure Description

[0025] Figure 1 This is a structural diagram of a two-stage detection and classification system for parasite eggs according to this application;

[0026] Figure 2 This is a flowchart of a two-stage detection and classification method for parasite eggs according to this application. Detailed Implementation

[0027] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein.

[0028] Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or modules is not necessarily limited to those explicitly listed, but may include other steps or modules not explicitly listed or inherent to these processes, methods, products, or devices. The module divisions appearing in the embodiments of this application are merely logical divisions; in actual applications, there may be other division methods. For example, multiple modules may be combined into or integrated into another system, or some features may be ignored or not performed. In addition, the shown or discussed mutual couplings or direct couplings or communication connections may be through some interfaces, and the indirect couplings or communication connections between modules may be electrical or other similar forms, none of which are limited in the embodiments of this application. Moreover, the modules or sub-modules described as separate components may or may not be physically separated, may or may not be physical modules, or may be distributed among multiple circuit modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of this application.

[0029] In the diagnosis and teaching practice of parasitic diseases, deep learning-based target detection methods are commonly used to identify parasite eggs in samples. For example, networks such as YOLO and Faster R-CNN are used to perform end-to-end detection and classification on the microscopic images of parasite egg samples. A single neural network can simultaneously detect the location and type of parasite eggs in the sample. However, a single parasite egg sample often contains multiple types of eggs. Some eggs can be directly observed under low magnification, while others can only be seen under high magnification. The optimal detection model configuration is different for different magnification images. A single neural network cannot take into account the detection stability of multiple magnification images. However, if low magnification is used uniformly, small targets and details are easily missed, affecting detection accuracy. On the other hand, the field of view under high magnification is too small, and the required scanning time is too long, resulting in low detection efficiency.

[0030] In addition, existing deep learning networks are usually supervised learning on training sets collected under fixed laboratory environmental conditions. The imaging quality of the training set is affected by external factors such as temperature, humidity, light intensity and staining process parameters. When the microscope equipment model changes, the batch of slides is different or the laboratory environmental conditions fluctuate, the imaging effect often changes, resulting in a significant decrease in the detection accuracy of the existing detection model. In other words, the existing technology is difficult to maintain stable detection performance between different microscope platforms or different batches of samples.

[0031] To resolve the above issues, please refer to [link / reference]. Figure 1 This application provides a two-stage detection and classification system for parasite eggs, comprising an environmental perception module, an adaptive imaging module, and a target detection module connected in sequence.

[0032] The environmental perception module is used to detect working environment information and send it to the adaptive imaging module.

[0033] The working environment information includes temperature, humidity, and light information; the environment perception module includes a temperature and humidity sensor and a light sensor that are respectively connected to the adaptive imaging module.

[0034] The temperature and humidity sensor is used to detect temperature and humidity information and send it to the adaptive imaging module, while the light sensor is used to detect light information and send it to the adaptive imaging module.

[0035] The adaptive imaging module is used to determine adaptive imaging parameters based on the sample type and working environment information of the insect egg sample, control the stage to move according to a preset trajectory, capture multiple frames of the first image of the insect egg sample on the stage at a first magnification and adaptive imaging parameters, and send them to the target detection module; and control the stage to move according to the candidate target map, capture the second image of each candidate target in the candidate target map at a second magnification and adaptive imaging parameters, and send them to the target detection module; the second magnification is greater than the first magnification.

[0036] The adaptive imaging module is specifically a digital microscope equipped with an environmental sensing module. This module is used to identify the sample type of insect egg samples via barcodes or RFID. The sample type and working environment information are input into a pre-trained mapping network to obtain adaptive imaging parameters. These parameters include exposure time, gain, white balance, and initial focal length. Temperature, humidity, and light sensors are used to sense the environment, automatically adjusting the microscope's focus, exposure, and gain to ensure more stable image quality. In one embodiment, the pre-trained mapping network can be a multilayer perceptron network. The input layer dimension matches the sum of the sample type encoding dimension and the working environment information dimension. It has two hidden layers, and the output layer outputs adaptive imaging parameters such as exposure time, gain, white balance, and initial focal length. The training data for the mapping network comes from standard sample image acquisition records under different temperature, humidity, and light conditions. The training labels are manually calibrated optimal imaging parameters, and the training loss function is the mean squared error loss.

[0037] In one embodiment, the first magnification can be 10x and the second magnification can be 40x. The 10x magnification field of view diameter is about 2mm, which is suitable for rapid scanning of the entire film; the 40x magnification field of view diameter is about 0.5mm, which is suitable for detailed observation of the target area. The two magnifications each perform their respective functions and work together to locate the target area first and then examine it in detail.

[0038] The target detection module is used to detect each first image using a first detection model, obtain a candidate target map and send it to the adaptive imaging module; it uses a second detection model to detect the second image, obtains a second detection result, extracts the morphological features of the candidate targets in the second image based on the second detection result and inputs them into the classifier to obtain the target classification result.

[0039] The target detection module is specifically used to detect the first image using the first detection model and obtain the first detection result. The first detection result includes the bounding boxes, classification groups, confidence scores, and location coordinates of multiple suspected targets in the first image. Based on the classification groups and confidence scores, candidate targets are selected from each suspected target, and the bounding boxes and location coordinates of the candidate targets are added to the candidate target map.

[0040] At the first magnification, the image size of insect eggs is approximately in the hundreds of pixels range, with an area ranging from several thousand to tens of thousands of pixels squared. The first detection model can employ a lightweight detection network (such as YOLO-Nano) to quickly scan within the range of the first image and output the first detection result for each suspected target.

[0041] Specifically, in the preliminary screening stage, suspected targets can be divided into three major categories: nematodes (fertilized Ascaris eggs, unfertilized Ascaris eggs), hookworms / pinworms (hookworm eggs, pinworm eggs), and whipworms (whipworm eggs).

[0042] The target detection module includes a built-in magnification category mapping table to filter candidate targets for further detailed analysis at the second magnification level. This means that during the initial low-magnification screening, not only the confidence level but also the taxonomic group plays a role in determining whether a target should proceed to the detailed analysis stage. In the magnification category mapping table, whipworm eggs (drum-shaped outline, transparent plugs at both ends, low magnification is sufficient), hookworm eggs (long oval, thin shell, loose internal cells, distinct outline features), and pinworm eggs (flat on one side, D-shaped outline, unique morphology at low magnification) can be classified based on their overall outline and are primarily considered at the first magnification level. Fertilized Ascaris eggs (thick shell, uneven surface, containing a single round egg cell), unfertilized Ascaris eggs (thin shell, contents consisting of refractive granules, long oval), and impurities (lacking typical shell structure and internal cell differentiation) require examination of their internal structure and are primarily considered at the second magnification level. Therefore, suspected targets with a confidence level greater than the first confidence threshold (preferably 0.6) and whose classification group initially determined by the first detection model to belong to roundworm eggs or impurities are screened as candidate targets and sent to the second-level fine detection stage for classification and identification. Suspected targets with a confidence level greater than the first confidence threshold and whose classification group belongs to hookworms, pinworms, whipworms, etc., can have their morphological features directly extracted and sent to the classifier for accurate target classification results.

[0043] In actual operation, the adaptive imaging module controls the stage to move along a preset trajectory, taking pictures as it moves. The target detection module analyzes each first image in real time. Once a suspected target with a classification group and confidence level that meets the requirements for fine detection is detected, the coordinates of that point are recorded as a candidate target. After the entire egg sample is scanned, a candidate target map is generated, marking the locations of all candidate targets.

[0044] After the target detection module hands the candidate target map to the adaptive imaging module, the adaptive imaging module moves the stage according to the position coordinates of the candidate target and captures a second image of the candidate target at a second magnification.

[0045] The second detection result includes the bounding box and confidence score of the candidate targets in the second image.

[0046] The target detection module is specifically used to extract the morphological features of candidate targets with a confidence level greater than the first confidence threshold, and input them into the classifier to obtain the target classification result of the candidate targets; the target detection module is also used to extract the morphological features of suspected targets in the first image that were not selected as candidate targets and whose confidence level is greater than the first confidence threshold, and input them into the classifier to obtain the target classification result of the suspected targets.

[0047] At second magnification, the image size of insect eggs is approximately in the hundreds of pixels range, with an area ranging from tens of thousands to millions of pixels squared. Details such as eggshell thickness, number of germ cells, and operculum morphology can be clearly seen. Upon receiving the candidate target map, the adaptive imaging module switches to the second-magnification objective lens and moves the stage to the position of each candidate target on the map one by one. At each position, it automatically focuses and acquires a high-resolution second image, which is then fed into the second detection model to perform fine localization of the candidate targets in the second image. The model outputs accurate bounding boxes and confidence scores. For candidate targets with confidence scores greater than the first confidence threshold, the corresponding morphological features within the bounding box are extracted and fed into the classifier to obtain the target classification result.

[0048] After obtaining the target classification results for suspected / candidate targets, the system summarizes the number of eggs in the current egg sample for different target classification results and generates a detection report. Users can also view the comparison image of the corresponding target at the first and second magnification by clicking on the bounding box in the first or second image. The system also displays the specific values ​​and importance ranking of each morphological feature when the classifier determines the target classification result (i.e., why it was classified into this category). If the user finds an identification error, they can correct the category on the interface, and the correction record will be automatically sent back for subsequent iteration updates of the detection model and classifier.

[0049] Compared with the prior art, the two-stage detection and classification system for parasite eggs provided in this application has at least the following beneficial effects: First, this application uses an environmental perception module to perceive the working environment information, and enables the adaptive imaging module to adaptively adjust the imaging parameters according to the sample type of the parasite egg sample and the working environment information, thereby compensating for the imaging effect shift caused by environmental changes, making the imaging quality of different samples in different environments similar, and improving the stability of subsequent target detection and classification; Second, this application uses different detection models to screen parasite egg targets in the first image captured at the first magnification and the second image captured at the second magnification, and performs type recognition by extracting morphological features after detection, dividing the detection target and target classification into two stages of tasks. The target classification task is performed by a separate classifier, which not only realizes the collaborative work of the two magnifications, but also avoids the problem of low interpretability caused by black-box decision-making in the classification task.

[0050] In some embodiments, morphological features include geometric morphological features, grayscale texture features, and color space features. Specifically, morphological features may include:

[0051] 1. Geometric morphological features (5 dimensions):

[0052] f1 (area): The pixel area of ​​the bounding box region, reflecting the absolute size of the insect egg.

[0053] f2 (perimeter): The perimeter of the bounding box, reflecting the complexity of the edges.

[0054] f3 (circularity): 4π × area / perimeter², reflecting the degree to which the insect egg is nearly round.

[0055] f4 (solidity): area / convex_area, reflects the solidity of the area.

[0056] f5(aspect_ratio): width / height, the aspect ratio of the bounding box.

[0057] 2. Grayscale texture features (4-dimensional):

[0058] f6 (gray_mean): Gray mean value. The contents of fertilized Ascaris eggs are dense, resulting in a higher gray level.

[0059] f7 (gray_std): Gray standard deviation. The contents of unfertilized Ascaris eggs are granular, and the standard deviation is relatively large.

[0060] f8 (edge_density): Percentage of edge pixels, reflecting the clarity of the eggshell and internal structure.

[0061] f9 (laplacian_var): Laplacian variance, which reflects image sharpness and is also an indicator of focus quality.

[0062] 3. Color space characteristics (6 dimensions):

[0063] f10 (hue_mean): HSV hue mean, reflecting the hue of the coloring.

[0064] f11 (saturation_mean): Mean HSV saturation, reflecting the depth of staining.

[0065] f12 (value_mean): HSV brightness mean, reflecting the overall brightness.

[0066] f13 (lightness_mean): Lab brightness mean, which is more consistent with human visual perception.

[0067] f14(a_channel_mean): Lab a channel mean, reflecting red-green offset.

[0068] f15(b_channel_mean): Lab b channel mean, reflecting the yellow-blue shift.

[0069] The target detection module is also used to obtain the working environment information of the environment perception module; before inputting morphological features into the classifier, it determines the standardization parameters according to the shooting magnification corresponding to the suspected target or candidate target, performs standardization processing on the morphological features according to the standardization parameters, and performs feature compensation on the standardized morphological features according to the working environment information.

[0070] Specifically, the suspected target in the first image and the candidate target in the second image may both require morphological features to be extracted and fed into a classifier for recognition. This means that the input to the classifier will contain feature vectors corresponding to different magnifications. The image resolution and scale are different at different magnifications, and geometric features such as area and perimeter are absolute quantities calculated in pixels. When the classifier is working, it may mistakenly introduce the difference caused by the different magnifications into the classification and recognition process, resulting in unstable target classification accuracy. If a corresponding classifier is set for different magnifications, it will increase the classification cost. At this time, feature standardization can make up for the difference caused by magnification at a very low cost. This is also the advantage of decoupling detection and classification into different stages of tasks.

[0071] In addition, morphological characteristics are also affected by working environment information. Therefore, it is necessary to correct the classification according to the working environment information before classification so that the classification criteria only reflect the morphology of the insect eggs themselves and are not biased by the environment. Otherwise, different working environment information will also be used as a distinction by the classifier in the classification of insect eggs.

[0072] For example, when the working environment information indicates that the lighting is too dim, gray_mean and value_mean should be normalized. gray_mean and value_mean are two quantities representing brightness in morphological features, which are affected by the lighting. When the environment changes, the brightness and contrast of the image change, and gray_mean and value_mean will also be skewed. Therefore, when the working environment information indicates that the lighting is too dim, these two quantities need to be normalized.

[0073] In some embodiments, the object detection module is also used to construct multiple candidate models, automatically tune the hyperparameters of each candidate model, obtain multiple classifiers, and verify the evaluation scores of each classifier.

[0074] Specifically, we first define the set of candidate models: M = {ExtraTrees, RandomForest, LightGBM, XGBoost, SVM_RBF, GradientBoosting, KNN, LogisticRegression}.

[0075] Then, for each candidate model, Bayesian optimization or grid search is used to find the optimal hyperparameter combination on the validation set. Taking ExtraTrees as an example, the search range includes the number of trees, maximum depth, minimum number of split samples, etc. The candidate model with the optimal hyperparameter combination is used as a classifier.

[0076] The target detection module is further configured to input the corresponding morphological features into the classifier with the highest evaluation score when the confidence level of a candidate target or suspected target is greater than the second confidence threshold, thereby obtaining the target classification result; and to input the corresponding morphological features into the three classifiers with the highest evaluation scores when the confidence level of a candidate target or suspected target is greater than or equal to the first confidence threshold and less than or equal to the second confidence threshold, thereby obtaining the target classification result based on the output results of the three classifiers. The second confidence threshold is greater than the first confidence threshold, and is preferably 0.8.

[0077] When a classifier needs to be applied, the object detection module selects the classifier with the best evaluation score from among the various classifiers based on the current magnification and working environment information:

[0078]

[0079] in, This indicates that the magnification is mag and the operating environment information is e. envThe F1-macro score of classifier m is evaluated on a validation subset. The F1-macro score (macro-average F1 score) is a metric for evaluating model performance in multi-class classification tasks. It involves independently calculating the F1 score for each class and then taking the arithmetic mean of the F1 scores for all classes, assigning equal weight to each class, and is unaffected by sample size distribution. In formal applications, it can be used for ensemble decision-making. For targets with high confidence (greater than the second confidence threshold), the classifier with the highest evaluation score directly outputs the result. For targets with medium confidence (greater than or equal to the first confidence threshold and less than or equal to the second confidence threshold), the three classifiers with the highest evaluation scores are soft-voted and ensembled to reduce the risk of misclassification.

[0080] In the specific implementation process, the first / second detection model can be replaced by DETR (Transformer Detection). This model uses a self-attention mechanism to predict directly, does not require anchor boxes and non-maximum suppression, has strong global reasoning ability, but has a large amount of computation and insufficient real-time performance, and is not suitable for deployment in edge computing.

[0081] The classification task can be replaced by deep learning end-to-end classification or stacking ensemble. Deep learning end-to-end classification directly uses CNN (ResNet / EfficientNet) to classify images within bounding boxes. It does not require the construction of feature vectors, but it is a black box decision, with poor interpretability and requires a large amount of training data. Stacking ensemble uses the prediction results of multiple base classifiers as input to train a meta-classifier to make the final decision. It has strong generalization ability and can combine the advantages of multiple models, but the training complexity is high and it is prone to overfitting.

[0082] Please refer to Figure 2 Another embodiment of this application provides a two-stage detection and classification method for parasite eggs, applied to a two-stage detection and classification system for parasite eggs. The two-stage detection and classification system for parasite eggs includes an environmental perception module, an adaptive imaging module, and a target detection module connected in sequence. The method includes:

[0083] Step S1: The environmental perception module detects the working environment information and sends it to the adaptive imaging module.

[0084] In step S2, the adaptive imaging module determines the adaptive imaging parameters based on the sample type and working environment information of the insect egg sample, controls the stage to move according to the preset trajectory, and captures multiple frames of the first image of the insect egg sample on the stage at the first magnification and adaptive imaging parameters, and sends them to the target detection module.

[0085] Step S3: The target detection module uses the first detection model to detect each first image, obtains a candidate target map, and sends it to the adaptive imaging module.

[0086] Step S4: The adaptive imaging module controls the stage to move according to the candidate target map, and captures the second image of each candidate target in the candidate target map under the second magnification and adaptive imaging parameters and sends it to the target detection module; the second magnification is greater than the first magnification.

[0087] Step S5: The target detection module uses the second detection model to detect the second image and obtains the second detection result. Based on the second detection result, the morphological features of the candidate targets in the second image are extracted and input into the classifier to obtain the target classification result.

[0088] The specific limitations of the two-stage detection and classification method for parasite eggs provided in this embodiment can be found in the above embodiment of the two-stage detection and classification system for parasite eggs, and will not be repeated here.

[0089] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification. The above embodiments only illustrate several implementation methods of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the invention patent. It should be noted that for those skilled in the art, several modifications and improvements can be made without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A two-stage detection and classification system for parasite eggs, characterized in that, It includes an environment perception module, an adaptive imaging module, and a target detection module connected in sequence; The environmental perception module is used to detect working environment information and send it to the adaptive imaging module; The adaptive imaging module is used to determine adaptive imaging parameters based on the sample type of the insect egg sample and the working environment information, control the stage to move according to a preset trajectory, and capture multiple frames of the first image of the insect egg sample on the stage at the first magnification and the adaptive imaging parameters and send them to the target detection module. The platform is moved according to the candidate target map, and second images of each candidate target in the candidate target map are captured at a second magnification and the adaptive imaging parameters and sent to the target detection module; the second magnification is greater than the first magnification. The target detection module is used to detect each of the first images using a first detection model, obtain a candidate target map, and send it to the adaptive imaging module; The second detection model is used to detect the second image to obtain a second detection result. Based on the second detection result, the morphological features of the candidate targets in the second image are extracted and input into the classifier to obtain the target classification result.

2. The two-stage detection and classification system for parasite eggs according to claim 1, characterized in that, The working environment information includes temperature information, humidity information, and light information; the environment sensing module includes a temperature and humidity sensor and a light sensor respectively connected to the adaptive imaging module.

3. The two-stage detection and classification system for parasite eggs according to claim 1, characterized in that, The adaptive imaging module is specifically used to read the sample type of the insect egg sample through barcode or RFID; and input the sample type and the working environment information into a pre-trained mapping network to obtain adaptive imaging parameters.

4. The two-stage detection and classification system for parasite eggs according to claim 3, characterized in that, The adaptive imaging parameters include exposure time, gain parameters, white balance parameters, and initial focal length.

5. The two-stage detection and classification system for parasite eggs according to claim 1, characterized in that, The target detection module is specifically used to detect the first image using a first detection model to obtain a first detection result. The first detection result includes the bounding boxes, classification groups, confidence scores, and location coordinates of multiple suspected targets in the first image. Based on the classification groups and the confidence scores, candidate targets are selected from each suspected target, and the bounding boxes and location coordinates of the candidate targets are placed into the candidate target map.

6. The two-stage detection and classification system for parasite eggs according to claim 5, characterized in that, The second detection result includes the bounding box and confidence score of the candidate target in the second image; The target detection module is specifically used to extract the morphological features of candidate targets with a confidence level greater than the first confidence threshold, and input them into a classifier to obtain the target classification result of the candidate targets; the target detection module is also used to extract the morphological features of suspected targets in the first image that were not selected as candidate targets and whose confidence level is greater than the first confidence threshold, and input them into a classifier to obtain the target classification result of the suspected targets.

7. The two-stage detection and classification system for parasite eggs according to claim 6, characterized in that, The target detection module is also used to obtain the working environment information of the environment perception module; before inputting the morphological features into the classifier, it determines the standardization parameters according to the shooting magnification corresponding to the suspected target or the candidate target, performs standardization processing on the morphological features according to the standardization parameters, and performs feature compensation on the standardized morphological features according to the working environment information.

8. The two-stage detection and classification system for parasite eggs according to claim 6, characterized in that, The target detection module is also used to construct multiple candidate models, automatically tune the hyperparameters of each candidate model, obtain multiple classifiers, and verify the evaluation scores of each classifier. The target detection module is further configured to input the corresponding morphological features into the classifier with the highest evaluation score when the confidence level of the candidate target or suspected target is greater than the second confidence threshold, and obtain the target classification result; when the confidence level of the candidate target or suspected target is greater than or equal to the first confidence threshold and less than or equal to the second confidence threshold, the corresponding morphological features are input into the three classifiers with the highest evaluation scores, and the target classification result is obtained based on the output results of the three classifiers.

9. The two-stage detection and classification system for parasite eggs according to claim 1, characterized in that, The morphological features include geometric features, grayscale texture features, and color space features; the geometric features include pixel area, outline perimeter, roundness, fullness, and bounding box aspect ratio; the grayscale texture features include grayscale mean, grayscale standard deviation, edge pixel ratio, and Laplacian variance; the color space features include the hue mean, saturation mean, and lightness mean of the HSV color space, and the lightness mean, a-channel mean, and b-channel mean of the Lab color space.

10. A two-stage detection and classification method for parasite eggs, characterized in that, A two-stage detection and classification system for parasite eggs, comprising an environmental perception module, an adaptive imaging module, and a target detection module connected in sequence, including: The environmental perception module detects the working environment information and sends it to the adaptive imaging module; The adaptive imaging module determines the adaptive imaging parameters based on the sample type of the insect egg sample and the working environment information, controls the stage to move according to a preset trajectory, and captures multiple frames of the first image of the insect egg sample on the stage at the first magnification and the adaptive imaging parameters, and sends them to the target detection module. The target detection module uses a first detection model to detect each of the first images, obtains a candidate target map, and sends it to the adaptive imaging module; The adaptive imaging module controls the stage to move according to the candidate target map, and captures second images of each candidate target in the candidate target map at a second magnification and the adaptive imaging parameters, and sends them to the target detection module; the second magnification is greater than the first magnification. The target detection module uses a second detection model to detect the second image and obtains a second detection result. Based on the second detection result, it extracts the morphological features of candidate targets in the second image and inputs them into a classifier to obtain a target classification result.