Animal waste pathogen detection method based on machine learning
By constructing an animal fecal pathogen detection system based on a machine learning-based CNN-LSTM fusion model, the problems of low efficiency and poor accuracy of traditional detection methods are solved. This system enables rapid, accurate, and automated pathogen detection, is applicable to a variety of animals, reduces costs, and supports data traceability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-24
- Publication Date
- 2026-03-10
AI Technical Summary
Traditional methods for detecting pathogens in animal feces are inefficient, inaccurate, and complex to operate. Existing molecular biology techniques are insufficient for detecting a variety of pathogens and cannot meet the needs of rapid prevention and control.
An automated detection system was constructed by using a machine learning-based approach and a fusion model of convolutional neural network-long short-term memory network (CNN-LSTM) to combine sample processing, nucleic acid extraction, feature analysis and real-time quantitative PCR, integrating sample processing, feature analysis and intelligent detection into one system.
It has improved testing efficiency, shortened the time for a single test to 3-5 hours, achieved an accuracy rate of 96.3%, and a false positive rate of less than 2%. It is applicable to a variety of animals, reduces reliance on professional personnel, reduces costs by 40%-60%, and supports data traceability and disease epidemic trend analysis.
Abstract
Description
Technical Field
[0001] This invention relates to the field of testing engineering technology, specifically to a method for detecting pathogens in animal feces based on machine learning. Background Technology
[0002] Pathogens (such as bacteria, viruses, and parasites) in animal feces are a major source of animal disease transmission, threatening not only the economic benefits of the livestock industry but also potentially harming human health through the food chain and environmental contact. Traditional detection methods mainly rely on microscopic observation, culture identification, and serological testing, which have significant limitations: microscopic observation depends on manual experience and has a high rate of false negatives; culture identification takes 24-72 hours, making it difficult to meet the needs of rapid prevention and control; and serological testing is only applicable to specific pathogens, limiting its detection range.
[0003] In recent years, while molecular biology techniques (such as PCR) have improved detection sensitivity, they still require professional data interpretation and lack the ability to simultaneously detect multiple pathogens. Machine learning, with its powerful data mining and pattern recognition capabilities, has shown great potential in the field of biological detection; however, its application in the detection of pathogens in animal feces has not yet formed standardized methods and systems. There is an urgent need to build a complete solution integrating sample processing, feature analysis, and intelligent detection to solve the problems of low efficiency, poor accuracy, and complex operation of traditional techniques. Summary of the Invention
[0004] (a) Technical problems to be solved
[0005] To address the shortcomings of existing technologies, this invention provides a machine learning-based method for detecting pathogens in animal feces, thus solving the technical problems mentioned in the background section.
[0006] (II) Technical Solution
[0007] To achieve the above objectives, the present invention provides the following technical solution: A method for detecting pathogens in animal feces based on machine learning, comprising the following steps: (1) Sample collection and pretreatment: Collect fecal samples of the target animal, remove impurities from the samples, add sterile phosphate buffer at a volume ratio of 1:5-1:10 for homogenization, prepare a sample suspension with a concentration of 10-20 mg / mL, and store at 4℃ for later use; (2) Nucleic acid extraction and purification: Extract nucleic acid from the sample suspension in step (1) using the magnetic bead method, remove impurities such as proteins and polysaccharides by centrifugation purification, and obtain a pathogen nucleic acid solution with a purity of OD260 / 280 of 1.8-2.0; (3) Feature extraction and data preprocessing: Obtain the amplification curve characteristic parameters of the nucleic acid solution using real-time fluorescence quantitative PCR, including Ct value, amplification efficiency, Peak height, standardize the feature parameters to the [0,1] interval to form a feature dataset; (4) Machine learning model training: Construct a fusion model based on convolutional neural network-long short-term memory network (CNN-LSTM), use the feature dataset of known pathogen types as the training set, set the learning rate to 0.001-0.01 and the number of iterations to 50-200, optimize the model parameters through backpropagation algorithm, and obtain a mature detection model; (5) Sample detection: Input the feature data obtained after processing the sample to be detected in steps (1)-(3) into the detection model in step (4), and output the pathogen type and confidence level; (6) Result verification and analysis: Use gene sequencing to verify the detection results in step (5). When the confidence level is ≥95% and the sequencing results are consistent, the detection is deemed valid and a detection report is generated.
[0008] Preferably, in step (1), the target animals include pigs, cattle, chickens, and ducks, and the sample collection amount is 5-10g / sample.
[0009] Preferably, in step (4), the training set contains at least 1,000 known pathogen samples, covering more than 10 common pathogens such as Salmonella, Escherichia coli, and avian influenza virus.
[0010] Preferably, in step (6), if the confidence level is <95% or the sequencing results are inconsistent, steps (1)-(5) are repeated for a second test.
[0011] Preferably, the method for implementing any one of claims 1-4 comprises: a sample processing module for homogenizing, filtering, and preparing suspensions of fecal samples; a nucleic acid extraction module equipped with a magnetic bead extractor and purification reagents for nucleic acid extraction and purification; a feature analysis module connected to a real-time PCR instrument for extracting and standardizing amplification curve feature parameters; a model training module with a built-in CNN-LSTM fusion algorithm for model training and parameter optimization; a detection module for receiving feature data of the sample to be detected and outputting pathogen detection results; and a result verification module communicating with a gene sequencer for verifying the detection results and generating reports.
[0012] Preferably, the sample processing module includes an automatic homogenizer, a 0.22μm filter membrane, and a refrigeration unit, with the temperature control accuracy of the refrigeration unit being ±0.5℃.
[0013] Preferably, the model training module further includes a data augmentation unit, which expands the amount of training set data by adding Gaussian noise and feature shifting.
[0014] Preferably, the detection module has a visual interface that can display the pathogen type, confidence level, and detection time in real time.
[0015] Preferably, it also includes a data storage module for storing sample information, feature data and test reports, with a storage capacity of not less than 100,000 records.
[0016] (III) Beneficial Effects
[0017] Compared with existing technologies, this invention provides a machine learning-based method for detecting pathogens in animal feces, which has the following advantages:
[0018] 1. Significantly improved detection efficiency: Through automated analysis of feature data using machine learning models, the time for a single detection is reduced from 24-72 hours using traditional culture methods to 3-5 hours, meeting the needs for rapid disease prevention and control.
[0019] 2. High detection accuracy: The CNN-LSTM fusion model has an average recognition accuracy of 96.3% for 10 common pathogens, with a false positive rate of less than 2%, which is far superior to traditional PCR detection (accuracy of about 85%).
[0020] Easy to operate and widely applicable: The system integrates the entire process from sample processing to result output with full automation, reducing reliance on professional personnel; it can simultaneously detect multiple pathogens such as bacteria and viruses, and is suitable for various animals such as pigs, cattle, and poultry.
[0021] 3. Strong data traceability: The data storage module records information throughout the entire process, which facilitates the retrospective analysis of test results and the analysis of disease epidemic trends, providing data support for breeding management and epidemic prevention decisions.
[0022] 4. Controllable cost: Compared with high-end technologies such as gene sequencing, the cost of a single test in this system is reduced by 40%-60%, making it suitable for large-scale promotion and application. Detailed Implementation
[0023] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] A machine learning-based method for detecting pathogens in animal feces includes the following steps: (1) Sample collection and pretreatment: Collect fecal samples from the target animal, remove impurities from the sample, add sterile phosphate buffer at a volume ratio of 1:5-1:10 for homogenization, prepare a sample suspension with a concentration of 10-20 mg / mL, and store at 4℃ for later use; (2) Nucleic acid extraction and purification: Extract nucleic acid from the sample suspension in step (1) using the magnetic bead method, remove impurities such as proteins and polysaccharides by centrifugation, and obtain a pathogen nucleic acid solution with a purity of OD260 / 280 of 1.8-2.0; (3) Feature extraction and data preprocessing: Obtain nucleic acid using real-time quantitative PCR. The amplification curve features of the solution, including Ct value, amplification efficiency, and peak height, are standardized to the [0,1] interval to form a feature dataset; (4) Machine learning model training: Construct a fusion model based on convolutional neural network-long short-term memory network (CNN-LSTM), using the feature dataset of known pathogen types as the training set, setting the learning rate to 0.001-0.01 and the number of iterations to 50-200, and optimizing the model parameters through the backpropagation algorithm to obtain a mature detection model; (5) Sample detection: Input the feature data obtained after processing the sample to be detected in steps (1)-(3) into the detection model in step (4), and output the pathogen type and confidence level. (6) Result verification and analysis: The detection results of step (5) are verified by gene sequencing. When the confidence level is ≥95% and the sequencing results are consistent, the detection is deemed valid and a detection report is generated; In step (1), the target animals include pigs, cattle, chickens, and ducks, and the sample collection amount is 5-10g / sample; In step (4), the training set contains at least 1000 known pathogen sample data, covering more than 10 common pathogens such as Salmonella, Escherichia coli, and avian influenza virus; In step (6), if the confidence level is <95% or the sequencing results are inconsistent, steps (1)-(5) are repeated for a second detection; The method for implementing any one of claims 1-4 includes: The sample processing module is used for homogenizing, filtering, and preparing suspensions of fecal samples; the nucleic acid extraction module is equipped with a magnetic bead extractor and purification reagents for nucleic acid extraction and purification; the feature analysis module connects to a real-time PCR instrument for extracting and standardizing amplification curve feature parameters; the model training module has a built-in CNN-LSTM fusion algorithm for model training and parameter optimization; the detection module receives feature data of the samples to be tested and outputs pathogen detection results; the result verification module communicates with a gene sequencer for verifying detection results and generating reports; the sample processing module includes an automatic homogenizer, a 0.22μm filter membrane, and a refrigeration unit with a temperature control accuracy of ±0.5℃; the model training module also includes a data augmentation unit, which expands the training set data volume by adding Gaussian noise and feature shifting; the detection module has a visual interface that can display pathogen types, confidence levels, and detection time in real time; it also includes a data storage module for storing sample information, feature data, and detection reports, with a storage capacity of no less than 100,000 records; the detection efficiency of this invention is significantly improved: through automated analysis of feature data by a machine learning model, the single detection time is shortened from 24-72 hours of traditional culture methods to 3-5 hours, meeting the needs of rapid epidemic prevention and control; the detection accuracy is high: the CNN-LSTM fusion model can detect 10 common pathogens. The average identification accuracy reaches 96.3%, with a false positive rate of less than 2%, far superior to traditional PCR testing (accuracy of approximately 85%). It is easy to operate and widely applicable: the system integrates fully automated processes from sample processing to result output, reducing reliance on professional personnel; it can simultaneously detect multiple pathogens such as bacteria and viruses, suitable for various animals including pigs, cattle, and poultry; it offers strong data traceability: the data storage module records information throughout the entire process, facilitating result review and disease trend analysis, providing data support for livestock management and disease prevention decisions; and it is cost-effective: compared to high-end technologies such as gene sequencing, the system reduces the cost per test by 40%-60%, making it suitable for large-scale application.
[0025] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A machine learning-based animal fecal pathogen detection method, characterized by, The method comprises the following steps: (1) sample collection and pretreatment: collect the fecal sample of the target animal, remove the impurities in the sample, add sterile phosphate buffer solution at a volume ratio of 1:5-1:10 for homogenization, prepare a sample suspension with a concentration of 10-20 mg / mL, and store it at 4°C for standby; (2) nucleic acid extraction and purification: use magnetic bead method to extract nucleic acid from the sample suspension of step (1), remove protein, polysaccharide and other impurities by centrifugal purification, and obtain pathogen nucleic acid solution with purity OD260 / 280 of 1.8-2.0; (3) feature extraction and data preprocessing: use real-time fluorescent quantitative PCR to obtain the amplification curve characteristic parameters of the nucleic acid solution, including Ct value, amplification efficiency and peak height, standardize the characteristic parameters to the interval [0, 1] to form a feature data set; (4) machine learning model training: construct a fusion model based on convolutional neural network-long short-term memory network (CNN-LSTM), use the feature data set of known pathogen species as the training set, set the learning rate to 0.001-0.01 and the iteration number to 50-200, optimize the model parameters by back propagation algorithm, and obtain the trained detection model; (5) sample detection: input the feature data obtained by processing the sample to be detected according to steps (1)-(3) into the detection model of step (4), and output the pathogen species and confidence; (6) result verification and analysis: use gene sequencing method to verify the detection result of step (5), when the confidence is ≥95% and the sequencing result is consistent, determine that the detection is valid and generate a detection report.
2. The method of claim 1, wherein, In step (1), the target animal includes pig, cow, chicken and duck, and the sample collection amount is 5-10 g per portion.
3. The method of claim 1, wherein, In step (4), the training set contains at least 1000 known pathogen sample data, covering more than 10 common pathogens such as Salmonella, Escherichia coli and avian influenza virus.
4. The method of claim 1, wherein, In step (6), if the confidence is <95% or the sequencing result is inconsistent, repeat steps (1)-(5) for secondary detection.
5. A machine learning based animal fecal pathogen detection system, characterized by, For implementing the method of any one of claims 1-4, comprising: a sample processing module for homogenization, filtration and suspension preparation of the fecal sample; a nucleic acid extraction module equipped with a magnetic bead extractor and purification reagents for nucleic acid extraction and purification; a feature analysis module connected to a fluorescent quantitative PCR instrument for extracting and standardizing the amplification curve characteristic parameters; a model training module with built-in CNN-LSTM fusion algorithm for model training and parameter optimization; a detection module receiving the feature data of the sample to be detected and outputting the pathogen detection result; and a result verification module communicating with a gene sequencer for verification and report generation of the detection result.
6. The system of claim 5, wherein, The sample processing module comprises an automatic homogenizer, a 0.22 μm filter and a refrigeration unit, and the temperature control precision of the refrigeration unit is ±0.5°C.
7. The system of claim 5, wherein, The model training module further comprises a data enhancement unit which expands the training set data volume by adding Gaussian noise and feature translation.
8. The system of claim 5, wherein, The detection module has a visual interface that can display the pathogen species, confidence and detection time in real time.
9. The system of claim 5, wherein, It also includes a data storage module for storing sample information, feature data and detection reports, and the storage capacity is not less than 100,000 records.