Feces parasitic ovum detection method based on machine learning and deep learning

Through the fecal parasite egg detection method based on machine learning and deep learning, the problem of insufficient sensitivity and specificity in identifying parasite eggs by microscopic detection is solved, and efficient and accurate automated recognition is achieved, reducing labor costs.

CN120014310APending Publication Date: 2025-05-16ADVANCED RES INST OF WUHAN UNIV OF TECH SHANGYU DISTRICT SHAOXING CITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411808115.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

Existing microscopic detection methods have insufficient sensitivity and specificity when identifying parasite eggs, and the detection results are subjective, low efficiency, and prone to errors, especially during large-scale screening.

Method used

Using a fecal parasite egg detection method based on machine learning and deep learning, a full field of digital slice is generated through optical microscope scanning, rectangular box annotation and feature extraction is performed, and a deep learning object detection model yoloV10 and a random forest algorithm are combined to realize automated parasite egg recognition.

Benefits of technology

It improves detection efficiency and accuracy, reduces labor costs, effectively avoids identification errors caused by morphological similarity, and reduces the dependence on the high professional skills of detective personnel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120014310A_ABST
    Figure CN120014310A_ABST
Patent Text Reader

Abstract

The invention discloses an excrement parasitic ovum detection method based on machine learning and deep learning, belongs to the technical field of parasitic ovum detection, and solves the problem that a microscope detection method has certain limitation in parasitic ovum recognition. Comprising the following steps: preparing a parasite egg slide; scanning the parasite egg slide by using an optical microscope to generate a full-view digital slice; carrying out overlapping cutting on the full-view digital slice to generate segmented image data; marking each egg in the segmented image data by a rectangular frame, and generating a marking file according to the center point coordinate of the rectangular frame, the width and height of the rectangular frame and the egg type corresponding to the rectangular frame; and dividing the annotation file into a training set and a test set, carrying out model training by using a deep learning target detection model yoV10, and requiring to output an egg position and an egg type. According to the invention, automatic parasite ovum recognition is realized, the detection efficiency and accuracy are improved, and the labor cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of parasite egg detection, and in particular to a method for detecting fecal parasite eggs based on machine learning and deep learning. Background Art

[0002] Parasitic infections are a common health problem worldwide, especially in tropical and subtropical regions, where parasites pose a major threat to human health. Common parasites include worms, protozoa, and ectoparasites. Worms such as roundworms, hookworms, and tapeworms often infect humans through contaminated food, water, or direct contact. Protozoa such as amoebas and giardia are usually transmitted through water sources, causing symptoms such as diarrhea and gastrointestinal discomfort. Ectoparasites such as scabies and lice are transmitted through direct contact, causing skin lesions. Parasitic infections not only directly endanger human health, such as causing malnutrition and anemia, but may also cause chronic diseases and immune system disorders. Prevention and control measures include raising public health awareness, improving drinking water and food safety conditions, strengthening environmental sanitation management, and taking targeted treatments. With global climate change and increased population mobility, the risk of parasitic infections may increase further. Therefore, it is necessary to strengthen research on parasites worldwide and take more effective prevention and control measures to reduce their threats to public health.

[0003] At present, there are many methods for detecting parasitic infections, mainly including traditional microscopy, immunological testing, molecular biology testing and serological testing. Microscopy is the most commonly used diagnostic method. By examining parasite eggs, worm bodies or cysts in samples such as feces, blood, and urine, the presence of parasites can be directly observed. Immunological testing mainly relies on antigen-antibody reactions. Through serological tests or enzyme-linked immunosorbent assays (ELISA) and other technologies, it detects whether the human body has specific antibodies or antigens for parasitic infections. It is suitable for some common parasitic diseases. Molecular biological techniques such as polymerase chain reaction (PCR) can improve the sensitivity and specificity of diagnosis by amplifying parasite-specific DNA sequences, especially in cases with trace parasites or difficult to observe under a microscope. In addition, serological testing can help confirm the diagnosis by detecting the immune response triggered by the infection. Although the existing detection methods have improved in accuracy and reliability, each method has different limitations. It is usually necessary to conduct a comprehensive evaluation in combination with clinical manifestations and multiple test results for accurate diagnosis and timely treatment.

[0004] Among them, microscopic detection is still the most mainstream method for parasite detection due to its low cost and relatively simple operation.

[0005] However, the microscopic detection method has certain limitations when identifying parasite eggs. First, the sensitivity and specificity of its detection are insufficient, especially when the parasite load is low, it is easy to produce false negative results. Secondly, the morphological identification of parasite eggs depends largely on the experience of technicians, which makes the test results subjective. In addition, the microscopic detection method requires manual operation and is not efficient, especially in large-scale screening, it is prone to errors. Different types of parasite eggs have different morphologies, and the types of parasites in different environments are also different, which increases the complexity of detection. For some parasites, their eggs are difficult to find or identify in the sample, which may lead to misdetection or missed detection.

[0006] Therefore, it is necessary to provide a fecal parasite egg detection method based on machine learning and deep learning that can realize automated parasite egg identification, improve detection efficiency and accuracy, and reduce labor costs.

[0007] Therefore, a fecal parasite egg detection method based on machine learning and deep learning is proposed to solve or alleviate the above problems. Summary of the invention

[0008] The purpose of the present invention is to solve the shortcomings of the prior art and propose a method for detecting fecal parasite eggs based on machine learning and deep learning.

[0009] In order to achieve the above object, the present invention adopts the following technical solutions:

[0010] A method for detecting fecal parasite eggs based on machine learning and deep learning, comprising the following steps:

[0011] Preparation of parasite egg slides;

[0012] The parasite egg slides were scanned using an optical microscope to generate full-field digital slices;

[0013] Overlapping and cutting the full-field digital slices to generate segmented image data;

[0014] Mark each insect egg in the segmented image data with a rectangular frame, and generate a marking file according to the coordinates of the center point of the rectangular frame, the width and height of the rectangular frame, and the insect egg type corresponding to the rectangular frame;

[0015] The labeled files are divided into training sets and test sets, and the deep learning target detection model yoloV10 is used for model training, and the output of the egg location and egg type is required;

[0016] Manual feature extraction is performed on the outputted egg positions and egg types to obtain feature values, and the feature values ​​are preprocessed;

[0017] The preprocessed feature values ​​are used to classify the egg types using the random forest algorithm. If the classification result is consistent with the egg type output by the deep learning target detection model yoloV10, the result is output. If the classification result is inconsistent with the egg type output by the deep learning target detection model yoloV10, the classification result of the random forest algorithm is output and specially marked.

[0018] Preferably, the step of marking each insect egg in the segmented image data with a rectangular frame, and generating a marking file according to the coordinates of the center point of the rectangular frame, the width and height of the rectangular frame, and the insect egg type corresponding to the rectangular frame, comprises the following steps:

[0019] Import the segmented image data into the image annotation tool labelimg;

[0020] The image annotation tool labelimg loads the segmented image data and automatically generates corresponding coordinate information, which includes the coordinates of the center point of the rectangular frame and the width and height of the rectangular frame;

[0021] The rectangular boxes are manually marked to correspond to the egg types, and the annotation files are generated based on the coordinate information.

[0022] Preferably, the ratio of the training set to the test set is 8:2.

[0023] Preferably, the eigenvalues ​​include contour area, contour approximate perimeter, minimum circumscribed circle, ratio of contour area to convex hull area, color features, texture features, and local eigenvalues.

[0024] Preferably, the manual feature extraction method of the contour area, contour approximate perimeter, minimum circumscribed circle, and the ratio of contour area to convex hull area comprises the following steps:

[0025] Use OpenCV operators to find contours on segmented image data;

[0026] The contour area is obtained by calculating the size of the area enclosed by the contour using Formula 1: Among them, (x i ,y i ) is the coordinate of each vertex of the contour, n is the number of points of the contour, (x n+1 ,y n+1 ) is the coordinate of the first point;

[0027] The contour perimeter is obtained by calculating the Euclidean distance between adjacent points using Formula 2: Among them, (x i ,y i ) and (x i+1 ,y i+1 ) are the adjacent vertices of the contour, and P is the perimeter of the contour;

[0028] Calculate the center of the circle (x c ,y c ) and radius r determine the minimum circumscribed circle, and the formula three is The formula 4 is

[0029] The ratio of the contour area to the convex hull area is calculated by formula 5, which is: Among them, (x i ,y i ) are the vertices of the convex hull, n hull is the number of vertices of the convex hull, and Area Ratio is the ratio of the contour area to the convex hull area.

[0030] Preferably, the manual feature extraction method of color features comprises the following steps:

[0031] Each color channel of the RGB color space in the segmented image data is divided into 12 continuous intervals;

[0032] The number of pixels in each interval is counted and normalized to obtain the characteristic value of the color feature.

[0033] Preferably, the manual feature extraction method of texture features comprises the following steps:

[0034] Performing histogram equalization processing on the grayscale processed segmented image data, and compressing the 256-level grayscale value of the segmented image data to 16 levels;

[0035] Calculate the gray-level co-occurrence matrix, traverse each pixel in the segmented image data, take it as the center and find the pixel pair with a specific spatial position relationship according to the selected calculation parameters, count the number of occurrences of the gray value combination of the pixel pair, and arrange the results into anti-vibration to obtain the gray-level co-occurrence matrix;

[0036] The normalization process is completed by dividing the value of each element in the gray level co-occurrence matrix by the sum of all element values;

[0037] Statistics are calculated for the gray level co-occurrence matrix that has completed the normalization process as texture features, and the statistics include energy entropy, contrast, inverse moment and correlation.

[0038] Preferably, the calculation parameters include a sliding window size, a step size, and a direction, the sliding window size is 5×5, the step size is d=1, and the directions include 0°, 45°, 90°, and 135°.

[0039] Preferably, the manual feature extraction method of local eigenvalues ​​comprises the following steps:

[0040] The gray-scaled segmented image data is smoothed by Gaussian blur, and convolution is performed using Gaussian kernels of various scales to obtain several images with different blur levels and form a Gaussian pyramid.

[0041] Calculate the difference between two adjacent layers of images in the Gaussian pyramid to generate a Gaussian difference pyramid;

[0042] In the Gaussian difference pyramid, each pixel and its adjacent 8 pixels and the 9×2 pixels corresponding to the upper and lower scales are compared to find the local maximum or minimum points as candidate key points;

[0043] The position, scale and response value of key points are accurately determined by fitting a three-dimensional quadratic function, and low-contrast key points and unstable edge response points are removed.

[0044] Based on the gradient direction of the local image, one or more main directions are assigned to each key point;

[0045] In the neighborhood around each keypoint, the local image gradient is calculated at a selected scale and the gradient information is converted into a 128-dimensional vector as the local eigenvalue.

[0046] Preferably, the method of classifying the egg types using a random forest algorithm on the pre-processed feature values ​​comprises the following steps:

[0047] A plurality of sample subsets are randomly selected from the preprocessed eigenvalues ​​by using a self-service sampling method, wherein the sample subsets match some eigenvalues ​​and perform node splitting;

[0048] The sample subsets and their matching feature values ​​are used to train decision trees. Each decision tree recursively selects the optimal feature partitioning until the stopping condition is met and outputs the classification result. The conditions include that the node purity reaches a threshold and the number of node samples is less than a set value.

[0049] The classification results of all decision trees are weighted averaged to form the final classification decision.

[0050] The present invention has the following beneficial effects:

[0051] 1. The present invention uses a combination of machine learning and deep learning algorithms to achieve automated parasite egg identification, improve detection efficiency and accuracy, and reduce labor costs;

[0052] 2. Effectively improve the recognition accuracy of insect egg types and avoid abnormal recognition of insect eggs with similar shapes;

[0053] 3. Effectively reduce labor costs and lower the high requirements for professional skills of testers. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0055] Figure 1 It is a flowchart of the present invention. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0057] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0058] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0059] In the description of the present invention, it should be understood that the terms "center", "up", "down", "left", "right", "vertical", "horizontal", "inside", "outside" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, or are the orientations or positional relationships in which the product of the invention is conventionally placed when in use, or are the orientations or positional relationships conventionally understood by those skilled in the art. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.

[0060] Furthermore, the terms “first”, “second”, “third”, etc. are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.

[0061] In the description of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0062] A fecal parasite egg detection method based on machine learning and deep learning, such as Figure 1 As shown, the following steps are included:

[0063] Preparation of parasite egg slides;

[0064] The parasite egg slides were scanned using an optical microscope to generate full-field digital slices;

[0065] Overlapping and cutting the full-field digital slices to generate segmented image data;

[0066] Mark each insect egg in the segmented image data with a rectangular frame, and generate a marking file according to the coordinates of the center point of the rectangular frame, the width and height of the rectangular frame, and the insect egg type corresponding to the rectangular frame;

[0067] The labeled files are divided into training set and test set, and the deep learning target detection model yoloV10 is used for model training. The output of the egg location and egg type is required. Specifically, the ratio of the training set to the test set is 8:2.

[0068] Manual feature extraction is performed on the outputted egg positions and egg types to obtain feature values, and the feature values ​​are preprocessed, wherein the feature values ​​include contour area, contour approximate perimeter, minimum circumscribed circle, ratio of contour area to convex hull area, color features, texture features, and local feature values;

[0069] The preprocessed feature values ​​are used to classify the egg types using the random forest algorithm. If the classification result is consistent with the egg type output by the deep learning target detection model yoloV10, the result is output. If the classification result is inconsistent with the egg type output by the deep learning target detection model yoloV10, the classification result of the random forest algorithm is output and specially marked.

[0070] By using the deep learning target detection model yoloV10, the location of insect eggs can be effectively located and their types can be identified. However, the yoloV10 model relies on large-scale data sets to automatically learn high-level features. It has strong complexity and semantic understanding capabilities, but is weak in extracting spatial information. In addition, deep learning models generally lack effective use of domain expert knowledge. In the application of insect egg type identification, the model may make category discrimination errors due to the high similarity between some insect eggs.

[0071] In contrast, traditional feature extraction methods can directly incorporate the prior knowledge of domain experts into the model by manually designing features. This method can not only utilize the existing theoretical framework, but also customize features according to specific problems, thereby enhancing the pertinence of features. Features extracted in this way are usually more accurate for target identification, especially in the subtle differences of egg types, which can effectively reduce misjudgments.

[0072] In order to further improve the recognition accuracy, the extracted insect egg feature data can be secondary classified in combination with the random forest algorithm. The specific operation is to compare the output category of the deep learning target detection model yoloV10 with the classification result of the random forest. If the two are consistent, the recognition result of yoloV10 is directly output; if they are inconsistent, the result of the random forest is used and specially marked to prompt the inspector to conduct a manual review. This process not only improves the accuracy of insect egg category recognition and avoids recognition errors caused by morphological similarities, but also effectively reduces labor costs and reduces dependence on high professional skills of inspectors.

[0073] In summary, by combining the advantages of deep learning and traditional feature extraction methods, the accuracy and efficiency of insect egg detection can be significantly improved by combining intelligent algorithms with manual review. This method not only ensures high-precision identification, but also optimizes the workflow.

[0074] Preferably, each insect egg in the segmented image data is marked with a rectangular frame, and a marking file is generated according to the coordinates of the center point of the rectangular frame, the width and height of the rectangular frame, and the insect egg type corresponding to the rectangular frame, including the following steps:

[0075] Import the segmented image data into the image annotation tool labelimg;

[0076] The image annotation tool labelimg loads the segmented image data and automatically generates the corresponding coordinate information, which includes the center point coordinates of the rectangular box and the width and height of the rectangular box;

[0077] The rectangular boxes are manually marked to correspond to the egg types, and the annotation files are generated based on the coordinate information.

[0078] By automatically generating coordinate information through the image annotation tool labelImg and combining it with manual annotation of insect egg types, the annotation efficiency can be improved, the consistency and accuracy of data annotation can be ensured, and it is convenient to generate standardized annotation files, which is helpful for subsequent model training and data processing. This method can save a lot of time and energy when processing large-scale data sets, improve productivity, and ensure the quality and consistency of the labeled data, thereby improving the training effect of the model.

[0079] Preferably, the manual feature extraction method of contour area, contour approximate perimeter, minimum circumscribed circle, and ratio of contour area to convex hull area comprises the following steps:

[0080] Use OpenCV operators to find contours on segmented image data;

[0081] The contour area is obtained by calculating the size of the area enclosed by the contour using formula 1: Among them, (x i ,y i ) is the coordinate of each vertex of the contour, n is the number of points of the contour, (x n+1 ,y n+1 ) is the coordinate of the first point;

[0082] The contour perimeter is obtained by calculating the Euclidean distance between adjacent points using Formula 2: Among them, (x i ,y i ) and (x i+1 ,y i+1 ) are the adjacent vertices of the contour, and P is the perimeter of the contour;

[0083] Calculate the center of the circle (x c ,y c ) and radius r determine the minimum circumscribed circle, formula 3 is Formula 4 is

[0084] The ratio of the contour area to the convex hull area is calculated by formula 5. Formula 5 is: Among them, (x i ,y i ) are the vertices of the convex hull, n hull is the number of vertices of the convex hull, and Area Ratio is the ratio of the contour area to the convex hull area.

[0085] Through the above method, the extraction of manual features such as contour area, approximate contour perimeter, minimum circumscribed circle, and the ratio of contour area to convex hull area in segmented image data can be completed in a more formal and process-oriented manner. These feature values ​​can provide multi-dimensional insect egg morphological information, which is helpful for the identification and classification of insect eggs.

[0086] Preferably, the manual feature extraction method of color features comprises the following steps:

[0087] Each color channel of the RGB color space in the segmented image data is divided into 12 continuous intervals, the value of each color channel in the RGB color space is between 0 and 255, and the value of each color channel is 256;

[0088] The number of pixels in each interval is counted and normalized to obtain the characteristic value of the color feature.

[0089] By completing the manual feature extraction of color features through the above method steps, the influence of the surface dimension value can be avoided.

[0090] Preferably, the manual feature extraction method of texture features comprises the following steps:

[0091] Performing histogram equalization processing on the grayscale processed segmented image data, and compressing the 256-level grayscale value of the segmented image data to 16 levels;

[0092] Calculate the gray-level co-occurrence matrix, traverse each pixel in the segmented image data, take it as the center, find the pixel pair with a specific spatial position relationship according to the selected calculation parameters, count the number of occurrences of the gray value combination of the pixel pair, and arrange the results to obtain the gray-level co-occurrence matrix, where the calculation parameters include the sliding window size, step size, and direction. The sliding window size is 5×5, the step size is d=1, and the directions include 0°, 45°, 90°, and 135°;

[0093] The normalization process is completed by dividing the value of each element in the gray level co-occurrence matrix by the sum of all element values;

[0094] The statistics of the normalized gray-level co-occurrence matrix are calculated as texture features, including energy entropy, contrast, inverse moment and correlation.

[0095] Through the above method steps, the grayscale segmented image data is subjected to histogram equalization processing to increase the dynamic range of the grayscale value, thereby improving the overall contrast effect of the image, and then the statistics are calculated through the grayscale co-occurrence matrix as the texture feature, so as to reflect the different aspects of the image texture, such as uniformity, complexity, clarity and regularity, etc., to provide multi-dimensional and comprehensive texture features. These features have important applications in the task of target recognition, and can not only enhance the detail capture ability of image analysis, but also make a comprehensive analysis of different levels, directions and scales of texture, with good robustness, and can even effectively perform image processing and target recognition under complex backgrounds.

[0096] Preferably, the manual feature extraction method of local eigenvalues ​​comprises the following steps:

[0097] The gray-scaled segmented image data is smoothed by Gaussian blur, and convolution is performed using Gaussian kernels of various scales to obtain several images with different blur levels and form a Gaussian pyramid.

[0098] Calculate the difference between two adjacent layers of images in the Gaussian pyramid to generate a Gaussian difference pyramid;

[0099] In the Gaussian difference pyramid, each pixel and its adjacent 8 pixels and the 9×2 pixels corresponding to the upper and lower scales are compared to find the local maximum or minimum points as candidate key points;

[0100] The position, scale and response value of key points are accurately determined by fitting a three-dimensional quadratic function, and low-contrast key points and unstable edge response points are removed.

[0101] Based on the gradient direction of the local image, one or more main directions are assigned to each key point;

[0102] In the neighborhood around each keypoint, the local image gradient is calculated at a selected scale and the gradient information is converted into a 128-dimensional vector as the local eigenvalue.

[0103] Through the above method steps, the differential images between different scales are calculated and the corresponding key points are generated. After determining the scale, position and direction of the key points, a 128-dimensional eigenvalue is generated to describe the local eigenvalue of the key points. The Gaussian difference pyramid constructed therein can also enhance the local features in the image and suppress noise. After accurately locating the key points, the low-contrast key points and unstable edge response points are removed to improve the matching stability and noise resistance. Directions are assigned to the key points so that the feature descriptor is invariant to image rotation.

[0104] Preferably, the pre-processed feature values ​​are classified into egg types using a random forest algorithm, comprising the following steps:

[0105] The preprocessed eigenvalues ​​are randomly selected using the bootstrap sampling method to select multiple sample subsets, and the sample subsets match some eigenvalues ​​and perform node splitting;

[0106] The sample subsets and their matching feature values ​​are used to train the decision tree. Each decision tree recursively selects the optimal feature partition until the stopping condition is met and outputs the classification result. The conditions include that the node purity reaches the threshold and the number of node samples is less than the set value.

[0107] The classification results of all decision trees are weighted averaged to form the final classification decision.

[0108] Through the above steps, the prediction results of the random forest algorithm composed of multiple decision tree algorithms can effectively reduce the variance of the model and improve the accuracy and stability of classification.

[0109] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for detecting fecal parasite eggs based on machine learning and deep learning, characterized in that: The following steps are included: Preparation of parasite egg slides; The parasite egg slides were scanned using an optical microscope to generate full-field digital slices; Overlapping and cutting the full-field digital slices to generate segmented image data; Mark each insect egg in the segmented image data with a rectangular frame, and generate a marking file according to the coordinates of the center point of the rectangular frame, the width and height of the rectangular frame, and the insect egg type corresponding to the rectangular frame; The labeled files are divided into training sets and test sets, and the deep learning target detection model yoloV10 is used for model training, and the output of the egg location and egg type is required; Manual feature extraction is performed on the outputted egg positions and egg types to obtain feature values, and the feature values ​​are preprocessed; The preprocessed feature values ​​are used to classify the egg types using the random forest algorithm. If the classification result is consistent with the egg type output by the deep learning target detection model yoloV10, the result is output. If the classification result is inconsistent with the egg type output by the deep learning target detection model yoloV10, the classification result of the random forest algorithm is output and specially marked.

2. The method for detecting fecal parasite eggs based on machine learning and deep learning according to claim 1, characterized in that: The method of marking each insect egg in the segmented image data with a rectangular frame, and generating a marking file according to the coordinates of the center point of the rectangular frame, the width and height of the rectangular frame, and the insect egg type corresponding to the rectangular frame, comprises the following steps: Import the segmented image data into the image annotation tool labelimg; The image annotation tool labelimg loads the segmented image data and automatically generates corresponding coordinate information, which includes the coordinates of the center point of the rectangular frame and the width and height of the rectangular frame; The rectangular boxes are manually marked to correspond to the egg types, and the annotation files are generated based on the coordinate information.

3. The method for detecting fecal parasite eggs based on machine learning and deep learning according to claim 1, characterized in that: The ratio of the training set to the test set is 8:

2.

4. The method for detecting fecal parasite eggs based on machine learning and deep learning according to claim 1, characterized in that: The characteristic values ​​include contour area, contour approximate perimeter, minimum circumscribed circle, ratio of contour area to convex hull area, color features, texture features, and local characteristic values.

5. The method for detecting fecal parasite eggs based on machine learning and deep learning according to claim 4, characterized in that: The manual feature extraction method of the contour area, contour approximate perimeter, minimum circumscribed circle, and the ratio of contour area to convex hull area comprises the following steps: Use OpenCV operators to find contours on segmented image data; The contour area is obtained by calculating the size of the area enclosed by the contour using Formula 1: Among them, (x i ,y i ) is the coordinate of each vertex of the contour, n is the number of points of the contour, (x n+1 ,y n+1 ) is the coordinate of the first point; The contour perimeter is obtained by calculating the Euclidean distance between adjacent points using Formula 2: Among them, (x i ,y i ) and (x i+1 ,y i+1 ) are the adjacent vertices of the contour, and P is the perimeter of the contour; Calculate the center of the circle (x c ,y c ) and radius r determine the minimum circumscribed circle, and the formula three is The formula 4 is The ratio of the contour area to the convex hull area is calculated by formula 5, which is: Among them, (x i ,y i ) are the vertices of the convex hull, n hull is the number of vertices of the convex hull, and Area Ratio is the ratio of the contour area to the convex hull area.

6. The method for detecting fecal parasite eggs based on machine learning and deep learning according to claim 4, characterized in that: The manual feature extraction method of the color feature comprises the following steps: Each color channel of the RGB color space in the segmented image data is divided into 12 continuous intervals; The number of pixels in each interval is counted and normalized to obtain the characteristic value of the color feature.

7. The method for detecting fecal parasite eggs based on machine learning and deep learning according to claim 4, characterized in that: The manual feature extraction method of texture features comprises the following steps: Performing histogram equalization processing on the grayscale processed segmented image data, and compressing the 256-level grayscale value of the segmented image data to 16 levels; Calculate the gray-level co-occurrence matrix, traverse each pixel in the segmented image data, take it as the center and find the pixel pair with a specific spatial position relationship according to the selected calculation parameters, count the number of occurrences of the gray value combination of the pixel pair, and arrange the results into anti-vibration to obtain the gray-level co-occurrence matrix; The normalization process is completed by dividing the value of each element in the gray level co-occurrence matrix by the sum of all element values; Statistics are calculated for the gray level co-occurrence matrix that has completed the normalization process as texture features, and the statistics include energy entropy, contrast, inverse moment and correlation.

8. The method for detecting fecal parasite eggs based on machine learning and deep learning according to claim 7, characterized in that: The calculation parameters include a sliding window size, a step size, and a direction. The sliding window size is 5×5, the step size is d=1, and the directions include 0°, 45°, 90°, and 135°.

9. The method for detecting fecal parasite eggs based on machine learning and deep learning according to claim 4, characterized in that: The manual feature extraction method of the local eigenvalue comprises the following steps: The gray-scaled segmented image data is smoothed by Gaussian blur, and convolution is performed using Gaussian kernels of various scales to obtain several images with different blur levels and form a Gaussian pyramid. Calculate the difference between two adjacent layers of images in the Gaussian pyramid to generate a Gaussian difference pyramid; In the Gaussian difference pyramid, each pixel and its adjacent 8 pixels and the 9×2 pixels corresponding to the upper and lower scales are compared to find the local maximum or minimum points as candidate key points; The position, scale and response value of key points are accurately determined by fitting a three-dimensional quadratic function, and low-contrast key points and unstable edge response points are removed. Based on the gradient direction of the local image, one or more main directions are assigned to each key point; In the neighborhood around each keypoint, the local image gradient is calculated at a selected scale and the gradient information is converted into a 128-dimensional vector as the local eigenvalue.

10. The method for detecting fecal parasite eggs based on machine learning and deep learning according to claim 1, characterized in that: The method of using a random forest algorithm to classify the egg types of the pre-processed feature values ​​comprises the following steps: A plurality of sample subsets are randomly selected from the preprocessed eigenvalues ​​by using a self-service sampling method, wherein the sample subsets match some eigenvalues ​​and perform node splitting; The sample subsets and their matching feature values ​​are used to train decision trees. Each decision tree recursively selects the optimal feature partitioning until a stopping condition is met and outputs a classification result. The conditions include that the node purity reaches a threshold and the number of node samples is less than a set value. The classification results of all decision trees are weighted averaged to form the final classification decision.