A live pig intelligent submission optimization method and system based on resource constraints
By constructing a multimodal sample delivery value quantification model and a resource-constrained optimization algorithm, the problems of low sample delivery efficiency and resource waste in the swine disease early warning system were solved, achieving efficient and accurate sample delivery decisions, reducing the missed detection rate and resource waste, and improving the support capability for disease prevention and control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SOUTH CHINA AGRICULTURAL UNIVERSITY
- Filing Date
- 2026-04-09
- Publication Date
- 2026-06-02
AI Technical Summary
The existing swine disease early warning system has failed to effectively solve the problem of sample delivery, resulting in rapid disease spread, large losses, low efficiency and low return on investment. It has failed to prioritize the detection of individuals with high transmission risk or high pathogens, and has failed to comprehensively consider the differences in detection window periods and sample acquisition difficulties of different diseases, resulting in waste of resources and high false negative rates.
By constructing a multimodal value quantification model for sample submission based on 'benefit-cost', and combining it with resource constraints to conduct sample submission decision combination analysis, the sample submission objects and test combinations are optimized, and a structured task sheet is generated, including the target pig identity, sample type, test items, sampling time, etc. Unsupervised clustering analysis is performed using the DBSCAN density clustering algorithm, and the weight coefficients are dynamically adjusted to optimize the sample submission decision.
It significantly improved the utilization rate of pig testing data, reduced the rate of missed detections and invalid submissions, provided accurate decision support for disease prevention and control, and improved the efficiency of testing and resource utilization.
Smart Images

Figure CN122133876A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of livestock resource analysis, and more specifically, to a method and system for optimizing intelligent pig testing based on resource constraints. Background Technology
[0002] With the development of large-scale, intensive pig farming, modern farms typically need to manage a large number of pigs simultaneously in a single pigsty or production unit. Once a pig disease occurs, it is characterized by rapid spread, significant losses, and a short window of opportunity. Especially under high-density farming conditions, if effective testing and rapid confirmation of high-risk individuals are not implemented in the early stages, the optimal control opportunity can easily be missed, leading to widespread outbreaks and substantial economic losses.
[0003] Existing swine disease early warning systems generally stop at the disease alarm or preliminary diagnosis stage, without considering the issue of sending samples for testing, which is a significant shortcoming. On the one hand, due to the uncertainty in the judgment of anomaly identification or disease early warning models, a large number of suspected cases may be output every day. However, the PCR kits, laboratory capacity and sampling manpower of farms are limited. Traditional testing work mainly relies on the subjective experience of on-site veterinarians or breeders to conduct random sampling or sampling nearby. It is easy to prioritize sampling individuals with "obvious symptoms but low diagnostic value" while missing individuals with "atypical symptoms but high risk of transmission or high etiology".
[0004] Secondly, current sampling of abnormal pigs typically employs a single-sample full-test approach, such as collecting all blood samples and performing a full PCR test. Existing technologies do not comprehensively consider factors such as the detection window period for different diseases, the varying difficulty of obtaining different samples (e.g., saliva, feces, blood), whether to use single or mixed samples, and the testing cycle, resulting in low delivery efficiency and low return on investment.
[0005] Thirdly, existing sampling decisions are often static and fail to take into account recent on-site epidemiological history, current seasonal climate, risk of spread to neighboring pens, and the tendency for pigs in the same or neighboring pens to exhibit clustered symptoms. They also fail to consider the representativeness of the population, which can easily lead to duplicate sampling. Given the limited availability of PCR reagents, testing slots, laboratory processing capacity, sample collection time, and manpower, it is impossible to achieve the optimal allocation of priority testing resources.
[0006] Therefore, there is an urgent need for an intelligent testing and quantitative framework that can automatically generate the optimal testing targets and test combinations based on limited testing resources and multi-factor diagnostic value assessment after receiving existing abnormal early warning results in large-scale pig farms. This would improve the utilization rate of testing resources, reduce the rate of missed detections and invalid testing, and enhance the support of laboratory test results for herd prevention and control decisions. Summary of the Invention
[0007] This invention overcomes the shortcomings of the prior art and proposes an intelligent inspection optimization method and system for pigs based on resource constraints.
[0008] The first aspect of this invention provides a resource-constrained intelligent inspection optimization method for pigs, comprising: S11. Obtain pig monitoring resource information through a preset acquisition module, and perform data preprocessing on the pig monitoring resource information, which includes abnormal pig data; S12. For each abnormal pig i, construct a multimodal quantification model of the value of submission for testing based on the "benefit-cost" relationship, and calculate the comprehensive value score of submission for testing. The quantitative model includes two types of calculation factors: positive information gain and negative resource consumption, which decouple complex environmental and physiological factors that affect the decision to submit for testing. S13. By calculating the comprehensive test value score of abnormal pigs and analyzing the representativeness of the corresponding group, a decision combination is made based on the test object, sample type, sampling mixture category, biological sampling time window, and test items. The comprehensive diagnostic expected benefit of each decision combination is evaluated. The overall comprehensive diagnostic expected benefit is maximized as the objective function. The joint optimization solution is combined with multiple constraints to obtain the test decision result. S14. Generate a structured inspection task sheet based on the inspection decision results and send it to the preset execution terminal.
[0009] In this solution, S11 specifically refers to: The preset data acquisition module includes an anomaly identification module, a disease early warning module, a manual inspection module, or other monitoring modules; Pig monitoring resource information includes unique identifier, basic growth information, pig house, activity area, most recently active area, adjacent activity areas, abnormal monitoring time, abnormality type, abnormality degree, historical health records, abnormal situations in adjacent activity areas of the same pig house, and indoor environmental information.
[0010] In this solution, S11 further includes: The collected pig monitoring and testing resource information forms the decision input; Data preprocessing is performed on the decision input, including data cleaning, missing value completion, and data normalization. The preprocessing process also includes feature extraction and recognition of unstructured image and video data, quantization and encoding of the recognition information, and mapping all data to a unified numerical dimension.
[0011] In this solution, S12 specifically refers to: The multimodal inspection value quantification model is calculated as follows: ; in, to These are the weighting coefficients that are dynamically adjusted by the system. , , and These are positive benefit items, representing diagnostic uncertainty, risk of spatial spread of disease, disease severity, and population representativeness, respectively. The values of these four indicators are directly proportional to the priority of submission for testing. , and These are the reverse penalty terms, representing the testing cost, sample acquisition difficulty, and testing cycle, respectively. These three indicators are proportional to the resistance and cost of this sampling.
[0012] In this scheme, in S12, the group representativeness The calculations specifically also include: A quantitative assessment is conducted based on the exposure history, spatiotemporal characteristics, and symptom characteristics of pigs. A vector space is constructed, and a feature vector set of abnormal pigs is constructed based on the three-dimensional characteristics of the abnormal pigs. In the vector space, the DBSCAN density clustering algorithm is used to perform unsupervised clustering analysis on abnormal pigs. In the feature vector set, Euclidean distance is introduced to calculate the maximum and minimum distances in the feature vectors. The mean of the maximum and minimum distances is used as the cluster neighborhood radius. The minimum number of samples for the core point is set to 5. The feature vector set is used as the cluster sample data for iterative clustering until the preset number of iterations is reached. The corresponding multiple clusters and multiple centroids are recorded. High scores were assigned to the central point pigs. For pigs that are not at the center point, calculate their distance to the corresponding center point and mark it as the center distance. Then, adjust the height based on the center distance. The value decays linearly.
[0013] In this solution, S13 specifically refers to: Based on the selection of the test subjects, the detection rate of sample types, the discrimination of mixed sampling categories, the determination of biological sampling time windows, and the assignment of test items, a variety of decision combination analyses are performed to generate a candidate strategy space; The expected return of comprehensive diagnosis is calculated based on the candidate strategy space, and the objective function is set to maximize the expected return. Multiple constraints are set based on resource and cost constraints, time and throughput constraints, group redundancy constraints, and effectiveness constraints. Combinatorial optimization is introduced to calculate the global optimal solution of the objective function and obtain the test delivery decision result.
[0014] In this solution, S14 specifically refers to: The decision-making results for sending samples for testing include the target pig's identity information, pen location, recommended sample type, corresponding test items, single or mixed sample method, recommended sampling time window, priority order for sending samples for testing, and alternative testing plans; After on-site sampling and subsequent laboratory testing are completed, the system obtains the actual submission records, sample information and test results, and uses a unique identifier to map and associate them with the original structured submission task sheet for unified storage.
[0015] In this scheme, in step S14, the preset execution terminal includes a field execution terminal and a user visual terminal.
[0016] A second aspect of the present invention also provides a resource-constrained intelligent pig inspection optimization system, the system comprising: a memory, a processor, and an interaction interface, wherein the memory includes a resource-constrained intelligent pig inspection optimization program, and the resource-constrained intelligent pig inspection optimization program, when executed by the processor, performs the following steps: S11. Obtain pig monitoring resource information through a preset acquisition module, and perform data preprocessing on the pig monitoring resource information, which includes abnormal pig data; S12. For each abnormal pig i, construct a multimodal quantification model of the value of submission for testing based on the "benefit-cost" relationship, and calculate the comprehensive value score of submission for testing. The quantitative model includes two types of calculation factors: positive information gain and negative resource consumption, which decouple complex environmental and physiological factors that affect the decision to submit for testing. S13. By calculating the comprehensive test value score of abnormal pigs and analyzing the representativeness of the corresponding group, a decision combination is made based on the test object, sample type, sampling mixture category, biological sampling time window, and test items. The comprehensive diagnostic expected benefit of each decision combination is evaluated. The overall comprehensive diagnostic expected benefit is maximized as the objective function. The joint optimization solution is combined with multiple constraints to obtain the test decision result. S14. Generate a structured inspection task sheet based on the inspection decision results and send it to the preset execution terminal.
[0017] A third aspect of the present invention also provides a computer-readable storage medium comprising a resource-constrained intelligent pig inspection optimization program, wherein when the resource-constrained intelligent pig inspection optimization program is executed by a processor, it implements the steps of the resource-constrained intelligent pig inspection optimization method as described in any of the preceding claims.
[0018] This invention discloses a resource-constrained intelligent pig testing optimization method and system. The method includes: receiving multimodal abnormal pig data and testing resource information; constructing a multidimensional testing value quantification model based on "benefit-cost"; performing testing decision combination analysis in conjunction with resource constraints; finding the optimal solution through optimization algorithms; determining the testing objects, sample types, single / mixed sampling methods, and other testing combinations; finally, generating a structured task sheet and sending it to the terminal, and completing the unique identification association between sampling and testing results. The system is equipped with an intelligent data acquisition and optimization solution module, adaptable to different breeding scenarios, and can significantly improve the utilization rate of pig testing data, reduce the missed detection rate and invalid testing rate, provide accurate decision support for pig disease prevention and control, and solve the problems of inefficient testing decisions, missed detections, and resource waste after disease early warning in large-scale pig farms. Attached Figure Description
[0019] Figure 1 A flowchart of a resource-constrained intelligent inspection optimization method for pigs according to the present invention is shown; Figure 2 The flowchart of the pig feature clustering of the present invention is shown; Figure 3 A block diagram of a resource-constrained intelligent pig inspection optimization system according to the present invention is shown. Detailed Implementation
[0020] To better understand the above-mentioned objects, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It will be understood that, unless otherwise specified, the embodiments and features described in the embodiments of this application can be combined with each other.
[0021] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.
[0022] Figure 1 The flowchart of an intelligent pig inspection optimization method based on resource constraints according to the present invention is shown.
[0023] like Figure 1 As shown, the first aspect of the present invention provides a resource-constrained intelligent inspection optimization method for pigs, comprising: S11. Obtain pig monitoring resource information through a preset acquisition module, and perform data preprocessing on the pig monitoring resource information, which includes abnormal pig data; S12. For each abnormal pig i, construct a multimodal quantification model of the value of submission for testing based on the "benefit-cost" relationship, and calculate the comprehensive value score of submission for testing. The quantitative model includes two types of calculation factors: positive information gain and negative resource consumption, which decouple complex environmental and physiological factors that affect the decision to submit for testing. S13. By calculating the comprehensive test value score of abnormal pigs and analyzing the representativeness of the corresponding group, a decision combination is made based on the test object, sample type, sampling mixture category, biological sampling time window, and test items. The comprehensive diagnostic expected benefit of each decision combination is evaluated. The overall comprehensive diagnostic expected benefit is maximized as the objective function. The joint optimization solution is combined with multiple constraints to obtain the test decision result. S14. Generate a structured inspection task sheet based on the inspection decision results and send it to the preset execution terminal.
[0024] According to an embodiment of the present invention, S11 specifically includes: The preset data acquisition module includes an anomaly identification module, a disease early warning module, a manual inspection module, or other monitoring modules; Pig monitoring resource information includes unique identifier, basic growth information, pig house, activity area, most recently active area, adjacent activity areas, abnormal monitoring time, abnormality type, abnormality degree, historical health records, abnormal situations in adjacent activity areas of the same pig house, and indoor environmental information.
[0025] As can be understood in the embodiments, the anomaly identification module, disease early warning module, manual inspection module or other monitoring modules are all upstream pig collection modules, which can collect basic and activity information of the corresponding pigs (including abnormal pig data), etc. Other monitoring modules may include other sensors and collection modules that can collect pig monitoring resource information.
[0026] Simultaneously, this system reads current testing resource information and combines it with pig monitoring resource information to form input for testing decision-making. Each pig data entry includes at least the pig's unique identifier, basic growth information (age, weight, breed, etc.), pigpen location, activity area, most recently visited activity area, adjacent activity areas, abnormal monitoring time, abnormality type, abnormality severity, historical health records, abnormal situations in adjacent activity areas within the same pigpen, and the pigpen environment. Testing resource information includes at least the quantity of testing reagents, laboratory processing capacity, sampling time, sample collection cost, testing item fees, and testing cycles for different testing items.
[0027] According to an embodiment of the present invention, S11 further includes: The collected pig monitoring and testing resource information forms the decision input; Data preprocessing is performed on the decision input, including data cleaning, missing value completion, and data normalization. The preprocessing process also includes feature extraction and recognition of unstructured image and video data, quantization and encoding of the recognition information, and mapping all data to a unified numerical dimension.
[0028] As can be understood in the embodiments, the decision input can be used as input to the multimodal sample submission value quantification model for comprehensive sample submission value calculation. Mapping all data to a unified numerical dimension can provide a standardized data foundation for subsequent quantitative assessment.
[0029] According to an embodiment of the present invention, step S12 specifically includes: The multimodal inspection value quantification model is calculated as follows: ; in, to These are the weighting coefficients that are dynamically adjusted by the system. , , and These are positive benefit items, representing diagnostic uncertainty, risk of spatial spread of disease, disease severity, and population representativeness, respectively. The values of these four indicators are directly proportional to the priority of submission for testing. , and These are the reverse penalty terms, representing the testing cost, sample acquisition difficulty, and testing cycle, respectively. These three indicators are proportional to the resistance and cost of this sampling.
[0030] As can be understood from the embodiments, here, for each abnormal pig The system constructs a multimodal value quantification model for submitted samples based on the "benefit-cost" relationship, and calculates its comprehensive value score for submitted samples. This model decouples the complex environmental and physiological factors influencing the testing decision into two categories: positive information gain and negative resource consumption. The specific calculation formula is as follows: ; in, to These are the weighting coefficients that are dynamically adjusted by the system. , , and These are positive benefit items; the higher the values of these four indicators, the greater the amount of unknown information about the pig, or the stronger the potential threat it poses to the entire herd. Therefore, the higher the expected value that testing this pig can bring to disease prevention decisions, the higher its testing priority must be. , and These are reverse penalty items. In the daily operation of a farm, the higher these three indicators are, the greater the resistance and cost of performing the sampling. In order to allocate limited testing resources to higher-priority samples, these must be deducted from their total value. The specific quantitative definitions of the parameters are as follows: To address diagnostic uncertainty: Quantify the confidence level of the anomaly identification model in determining the individual's disease. If the model's confidence level in determining a common disease is extremely high (e.g., 99% probability of common indigestion), the entropy value approaches 0, indicating that there is no need to waste reagents to verify known facts; if the probability distribution is flat (e.g., it is impossible to distinguish between porcine reproductive and respiratory syndrome (PRRS) and early-stage African swine fever), the information entropy is extremely high, and the information gain from testing is extremely large, resulting in a high score. Risk of spatial spread of disease: Calculated based on a two-dimensional physical topology map of the pig within the pigpen. If the pig is located in an activity area near the air inlet, shares a common water line, or has an extremely high density of healthy pigs in its adjacent pens, its centrality as a "source node of infection" is extremely high. Once confirmed as a highly contagious disease, with a very wide impact range, it must be prioritized for testing and screening. Disease severity: Based on the severity score of clinical signs output by the front-end system (such as persistent hyperthermia, severe shortness of breath, and other life-threatening signs). The higher the severity, the more urgent the risk of disease deterioration and death, requiring priority diagnosis to guide emergency medication.
[0031] To ensure population representativeness: The system uses a density clustering algorithm to divide abnormal pigs with similar exposure histories, spatiotemporal proximity, and similar symptoms into symptom clusters. The detection results of typical individuals at the center of each cluster can represent the etiology of the entire population. Assign high values; while for marginal individuals within the same cluster, their Rapid decay helps avoid redundant sampling and wasting detection resources.
[0032] For testing costs: the normalized sum of the unit price of quantified collection consumables, targeted detection kits, and laboratory fees. Given the same information gain, prioritize testing subjects or methods with lower costs. The difficulty of obtaining samples is assessed by combining static baseline data of live pigs with the on-site environment. For example, collecting intravenous blood from a 120 kg fattening pig in a densely populated pen involves enormous restraint time and manpower consumption. The value is extremely high); while saliva collection from weaned pigs with similar symptoms is very easy ( (Value extremely low); Testing cycle: The estimated time from sample collection and delivery to the laboratory issuing the report. If a test requires an extremely long culture period, it may cause the optimal window for epidemic prevention intervention to be missed, significantly reducing its timeliness and requiring a time penalty.
[0033] Figure 2 The flowchart of the pig feature clustering of the present invention is shown.
[0034] According to an embodiment of the present invention, in S12, the group representativeness The calculations specifically also include: A quantitative assessment is conducted based on the exposure history, spatiotemporal characteristics, and symptom characteristics of pigs. A vector space is constructed, and a feature vector set of abnormal pigs is constructed based on the three-dimensional characteristics of the abnormal pigs. In the vector space, the DBSCAN density clustering algorithm is used to perform unsupervised clustering analysis on abnormal pigs. In the feature vector set, Euclidean distance is introduced to calculate the maximum and minimum distances in the feature vectors. The mean of the maximum and minimum distances is used as the cluster neighborhood radius. The minimum number of samples for the core point is set to 5. The feature vector set is used as the cluster sample data for iterative clustering until the preset number of iterations is reached. The corresponding multiple clusters and multiple centroids are recorded. High scores were assigned to the central point pigs. For pigs that are not at the center point, calculate their distance to the corresponding center point and mark it as the center distance. Then, adjust the height based on the center distance. The value decays linearly.
[0035] As can be understood from the embodiments, here, the standardized The value can be mapped to the [0,1] space, with the center point... The maximum value can be set to 1, and non-center points will undergo linear descent. Specifically, the following formula can be substituted: ; Where Q is the correction factor. The center distance of a certain abnormal pig. After attenuation value.
[0036] In this embodiment, the core of clustering involves standardizing and mapping the data to a vector space, determining the similarity between pigs based on density reachability, and dividing them into several "symptom clusters." Then, the intra-cluster location characteristics of individuals are determined through distance analysis of the cluster center points. Finally, a high Gi value is assigned to typical individuals at the center of the symptom cluster, while linear decay is applied to individuals at the cluster edges. This achieves accurate quantification of the group's representativeness, avoids redundant sampling of homogeneous samples, and improves the group coverage efficiency of detection resources. Each cluster corresponds to a center point.
[0037] Furthermore, the core premise of representative clustering is to transform three types of unstructured / structured features—exposure history, spatiotemporal characteristics, and symptom characteristics—into computable standardized numerical features, and to construct a unified-dimensional pig feature vector to achieve vector space mapping for all abnormal pigs, providing a data foundation for density calculation in the DBSCAN algorithm. The feature processing and quantization rules for the three types of features are as follows: all features are ultimately normalized to the [0,1] interval to eliminate dimensional differences.
[0038] Exposure history characteristics: Exposure history characteristics reflect the homology of disease exposure risk in pigs and are the core features for determining whether pigs belong to the same source of infection / transmission chain. Three core sub-features can be extracted and quantified: Same environmental exposure: Whether pigs share the same water line, feed trough, and ventilation area. If they share, assign a value of 1. If they do not share, assign a value linearly according to the sharing ratio (e.g., if they share the same water line but different feed troughs, assign a value of 0.5). Same batch / same group: If the pigs are from the same batch of introduction and are kept in the same group and separate pens, assign a value of 1; otherwise, assign a value of 0. Shared contact history: Whether there are records of pigs moving in the same area or having cross contact (determined by the farm positioning system / manual inspection records). If yes, assign a value of 1; otherwise, assign a value of 0. Finally, weighted fusion of sub-features: The exposure history comprehensive feature value F1 is obtained by summing the sub-features with equal weights (1 / 3 each), where F1∈[0,1].
[0039] Spatiotemporal characteristics: Spatiotemporal features reflect the temporal and spatial correlation of abnormal occurrences in pigs and are key features for determining the clustered transmission of diseases. Four core sub-features were extracted and quantified: Spatial distance: Based on the physical coordinates of the pigsty, calculate the physical distance between a single pig and the pen / activity area of other pigs, and normalize it to [0,1] (the closer the distance, the closer the value is to 1); Pig house topology association: Whether pigs are located in the same pig house or the same area unit. The same unit is assigned a value of 1, different units in the same pig house are assigned a value of 0.5, and different pig houses are assigned a value of 0. Anomaly occurrence time difference: The difference between the time when a pig is identified as abnormal and the earliest time of abnormality in the same pen, normalized by hours (the smaller the time difference, the closer the value is to 1, such as assigning a value of 1 within 1 hour and 0 for more than 24 hours). Activity trajectory overlap (optional): The overlap ratio of pigs' activity trajectories over the past 72 hours is calculated based on their location within the farm. This ratio is directly used as a feature value, ∈ [0,1]. Various sub-features can be weighted and fused, such as spatial distance (0.4), pigsty topological association (0.2), anomaly occurrence time difference (0.2), and activity trajectory overlap (0.2). The weighted summation yields the spatiotemporal comprehensive feature value F2, where F2 ∈ [0,1].
[0040] Symptom characteristics: Symptom characteristics reflect the homology of abnormal behaviors in pigs and are the core features for determining whether they belong to the same disease type. Two core sub-features are extracted and quantified: Symptom type similarity: Based on the symptom classification system of the on-site epidemic early warning system (such as fever, diarrhea, cyanosis, decreased appetite, etc.), a symptom type similarity matrix is constructed. Completely identical symptoms are assigned a value of 1, similar symptoms (such as respiratory symptoms: cough + wheezing) are assigned a value of 0.8, different symptoms (such as diarrhea + fever) are assigned a value of 0.3, and no common symptoms are assigned a value of 0. Symptom severity similarity: Pearson correlation coefficients are calculated for the severity of each symptom (quantified as 0-10 points). The correlation coefficients are directly used as feature values, with coefficients ∈ [0,1]. Sub-features are weighted and fused, such as symptom type similarity (0.6) and symptom severity similarity (0.4), and the weighted sum is used to obtain the comprehensive symptom feature value F3, where F3 ∈ [0,1].
[0041] Construct three-dimensional feature vectors based on F1-F3.
[0042] It is worth noting that all features are optional pig farming features. Based on the analysis needs, some sub-features can be added or deleted, or different values can be assigned to them to adapt to different farming calculation needs or meet the final inspection expectations.
[0043] According to an embodiment of the present invention, S13 specifically includes: Based on the selection of the test subjects, the detection rate of sample types, the discrimination of mixed sampling categories, the determination of biological sampling time windows, and the assignment of test items, a variety of decision combination analyses are performed to generate a candidate strategy space; The expected return of comprehensive diagnosis is calculated based on the candidate strategy space, and the objective function is set to maximize the expected return. Multiple constraints are set based on resource and cost constraints, time and throughput constraints, group redundancy constraints, and effectiveness constraints. Combinatorial optimization is introduced to calculate the global optimal solution of the objective function and obtain the test delivery decision result.
[0044] As can be understood from the embodiments, the candidate strategy space includes a variety of combined strategies, and combinations that do not meet the actual needs can be eliminated before optimization.
[0045] After obtaining the basic testing value and population representativeness of the abnormal pigs, the system intelligently matches the optimal testing combination strategy for the abnormal pig population by comprehensively considering factors such as current laboratory capabilities, on-site execution conditions, and pathological patterns. Specific decisions include: Selection of pigs for testing: The economic and breeding value of the pigs is used to prioritize their testing. For example, under the same symptom conditions, sows or breeding pigs are given significantly higher priority than ordinary fattening pigs. Sample type: Based on the disease pathological characteristics predicted by the front-end early warning model, the optimal sample carrier with the highest detection rate is recommended (including blood, feces, nasal and oral swabs, secretions, environmental samples, etc.). For example, nasal swabs or oral mucus are preferred for respiratory symptoms; feces or anal swabs are recommended for gastrointestinal abnormalities; whole blood is recommended for systemic high fever accompanied by cyanosis. Single-sample vs. pooled-sample decision-making: The system dynamically decides based on diagnostic uncertainty and testing costs. If multiple pigs in the same or adjacent pens exhibit homologous symptoms with low diagnostic uncertainty (such as suspected co-infection with epidemic diarrhea), the decision engine triggers the pooled testing mechanism, recommending "5-to-1" or "10-to-1" fecal pooled sample testing to significantly save reagent kits; if the abnormal individuals are isolated, sporadic, high-risk, and have high uncertainty, a single-sample, single-test instruction is forcibly generated. Biological sampling time window determination: Based on the incubation period and viral shedding patterns of different diseases, an effective time window for sample collection is set. System comparison of abnormal monitoring start time: If an alert indicates a suspected early stage of viral infection (e.g., day 1-2), blood should be collected immediately to capture the viremia phase; if the infection is in the middle or late stages (e.g., day 7 or later), on-site guidance should be provided to abandon blood collection and instead collect serum for antibody testing or collect stool for viral shedding, avoiding invalid submissions due to false negatives. Test assignment: Based on the value of the target pigs and the remaining resources, a test panel is precisely assigned to each sample, including one or more combinations of pathogen detection (PCR), complete blood count, biochemical indicators or inflammatory indicators.
[0046] The system calculates the expected comprehensive diagnostic benefit for all possible test combinations. With the objective function of maximizing the overall comprehensive diagnostic benefit, the system uses a combinatorial optimization algorithm to find the optimal solution in the candidate strategy space under the following multiple constraints: Resource and cost constraints: The total number of reagents consumed shall not exceed the available inventory, and the total testing cost shall not exceed the budget limit; Time and throughput constraints: The total sampling operation and walking time shall not exceed the remaining time of the veterinarian, and the total number of samples sent shall not exceed the daily processing throughput of the laboratory; Group redundancy constraint: For the same symptom cluster, a maximum limit on repeated sampling is forcibly set; Validity constraint: The sampling action must fall within the biological sampling time window of the target disease.
[0047] Finally, the system outputs the globally optimal testing decision result to the execution terminal. This result includes at least: a priority testing list and its corresponding sample types, test item assignment, single / pooled sample method, recommended sampling time window, on-site execution priority, and alternative testing solutions.
[0048] According to an embodiment of the present invention, S14 specifically includes: The decision-making results for sending samples for testing include the target pig's identity information, pen location, recommended sample type, corresponding test items, single or mixed sample method, recommended sampling time window, priority order for sending samples for testing, and alternative testing plans; After on-site sampling and subsequent laboratory testing are completed, the system obtains the actual submission records, sample information and test results, and uses a unique identifier to map and associate them with the original structured submission task sheet for unified storage.
[0049] Here, the alternative testing plan can be generated through multiple globally optimal solutions, such as the second-highest expected return decision combination.
[0050] According to an embodiment of the present invention, in step S14, the preset execution terminal includes a field execution terminal and a user visual terminal.
[0051] In this embodiment, the structured output and result association evaluation includes generating a structured testing task sheet from the optimal testing decision obtained through joint optimization and sending it to the on-site execution terminal. The structured testing task sheet includes at least: target pig identification information, pen location, recommended sample type, corresponding test items, single or mixed sample method, recommended sampling time window, testing priority order, and backup testing plan. After on-site sampling and subsequent laboratory testing are completed, the system obtains the actual testing records, sample information, and test results, and maps and associates them with the original structured testing task sheet using a unique identifier.
[0052] Based on the aforementioned closed-loop correlation data, the system automatically evaluates the actual effectiveness of the current test submission decision strategy. The evaluation dimensions include at least: whether high-value / high-risk cases were successfully identified, whether there were redundant submissions with the same symptom cluster, whether any invalid tests with low diagnostic value occurred, and the actual contribution of the selected test combination to the final etiological diagnosis. The system uses this effectiveness evaluation result as a feedback signal to dynamically adjust the weight coefficients and iterate parameters in the multidimensional test submission value quantification model, thereby driving continuous optimization of the subsequent test submission decision model.
[0053] According to an embodiment of the present invention, it further includes: During a breeding cycle, multiple data collection periods are set, and a fattening house is used as the research object. Pig monitoring resource information of non-abnormal pigs is collected, and the exposure history characteristics, spatiotemporal characteristics and symptom characteristics of pigs are extracted from the resource information to form a non-abnormal feature vector. During each data collection period, based on the exposure history, spatiotemporal characteristics, and symptom characteristics of abnormal pigs, the DBSCAN density clustering algorithm was used to perform unsupervised clustering analysis on the abnormal pigs. The cluster with the largest number of pigs was analyzed, and the abnormal pigs with the corresponding center point were regarded as high-value pigs. Calculate the high-value pigs for each collection period, extract the feature vectors corresponding to the high-value pigs, generate feature vectors for multiple collection periods, and sort them according to the time dimension to obtain an ordered set of comparative feature vectors. Select a non-abnormal pig and obtain a set of non-abnormal feature vectors based on multiple collection periods; The correlation between the comparative feature vector set and the non-abnormal feature vector set is calculated by using the vector difference threshold. The numerical difference between the feature vectors is calculated by Euclidean distance. If there is a correlation, the non-abnormal pig is dynamically marked as a potential risk object. For potential risk targets, the corresponding adjustment is to group representativeness. Alternatively, the pigs may be reclassified as abnormal, and a quantitative assessment may be conducted during the next data collection and analysis period based on the adjusted data.
[0054] In this embodiment, the dynamic setting process for abnormal pigs can be dynamically adjusted based on each frame of the data collection period. Potential risk objects set in the previous collection period may differ in the next collection period, allowing for dynamic adjustment and real-time risk assessment. In the correlation analysis, the distance between the non-abnormal feature vector and the comparison feature vector in each collection period is compared to see if it is less than a vector difference threshold. If the proportion of periods with a distance less than the threshold exceeds 50%, it indicates a correlation between the non-abnormal feature vector set and the comparison feature vector set, and potential risk objects are marked.
[0055] Here, for the sampling inspection of pigs with potential associated risks, this invention introduces processes such as data collection, cluster analysis, feature modeling, correlation calculation, risk labeling, and reassessment of submitted samples. It deeply integrates DBSCAN density clustering, Pearson correlation coefficient, Euclidean distance calculation, and various dimensions of the pig breeding cycle. At the same time, it combines the sample value quantification model (Vi) and the population representativeness (Gi) assessment system to achieve "precise sampling of abnormal pigs and early warning of pigs with potential risks", thus achieving the dual prevention and control goals.
[0056] Through the examples, it is possible to effectively analyze normal pigs with potential risks, and to dynamically mark and quantify the value of pigs sent for testing based on each collection and analysis period, thereby effectively improving risk prediction capabilities and the efficiency of pigsty testing in multiple scenarios.
[0057] The technical means of this embodiment are characterized by standardization, replicability, and ease of implementation. It does not require the addition of a large number of new hardware devices. It can be achieved simply by expanding the algorithm and adjusting the parameters on the basis of the existing Internet of Things monitoring and data platform. This effectively improves the early warning capability of potential risks and significantly reduces economic losses in breeding. At the same time, based on the dynamic control of the breeding cycle, it ensures the continuity of the existing epidemic prevention process in pig farms and has extremely high practical promotion value.
[0058] Example
[0059] A large-scale pig farm comprises eight fattening pens, each housing approximately 100 fattening pigs, totaling about 800 pigs. The fattening pens employ a free-range rearing system, with pigs roaming freely in open spaces without assigned pens. The farm is equipped with a pig anomaly detection system, an environmental monitoring system, an individual identification module, and manual inspection and data entry terminals. During a specific time period, the system, through continuous monitoring and combining image recognition, feeding behavior analysis, drinking behavior analysis, and manual inspection records, identified 26 abnormal pigs. Abnormal symptoms included fever, decreased feed intake, lethargy, mild coughing, rapid breathing, and cyanosis in some pigs. Simultaneously, the system retrieved the following testing resource information for the day: 16 available PCR test kits, 10 blood routine and biochemical test slots, 120 minutes of remaining sampling time available for on-site veterinarians, and a maximum of 20 samples that the collaborating laboratory could process that day.
[0060] The system first executes step S11, receiving data from the aforementioned 26 abnormal pigs and extracting each pig's unique identification, age, weight, breed, fattening pen location, most recent identification time, most recent activity area, abnormality monitoring time, abnormality type, abnormality severity, historical health records, abnormality distribution within the same pen, and environmental information such as temperature, humidity, and ventilation status, forming the input for the testing decision. Simultaneously, the system incorporates resource information such as reagent inventory, testing costs, laboratory processing capacity, sampling time limits, and testing cycles for each test item into the constraints, with the corresponding data requirements detailed in steps S12-S13.
[0061] Then, step S12 is executed, and the system calculates the comprehensive inspection value score for each of the 26 abnormal pigs. For fattening pig A, located in the air intake area of fattening pen No. 3, the upstream anomaly identification model output showed a significant discrepancy between "early infection with porcine reproductive and respiratory syndrome (PRRS)" and "suspected early stage of African swine fever," resulting in a high diagnostic uncertainty (Ui). Furthermore, the pig's activity area was close to the main airflow inlet of the pen, and several individuals with decreased feed intake had appeared consecutively in adjacent activity areas within the same pen within a short period, indicating a high risk of spatial spread. The severity is relatively high; combined with the pig's clinical signs of persistent high fever, lethargy, and mild cyanosis, the degree of severity is also relatively high. The overall value of the sample submitted for testing is still among the highest of all candidates, despite the large weight of the pig and the relatively difficult blood collection process, resulting in a higher sample acquisition difficulty (Di).
[0062] For several abnormal pigs exhibiting diarrhea symptoms consecutively in another fattening pen, the system combined the degree of overlap in their recent activity areas, the proximity of the onset of abnormalities, and the similarity of symptom presentation. Using density clustering, multi-dimensional clustering (exposure history characteristics, spatiotemporal characteristics, and symptom characteristics) was performed, identifying five pigs as belonging to the same symptom cluster. Within this cluster, individual B, located at the cluster center and exhibiting typical symptoms, showed high representativeness of the group. Their test results can represent the main etiological direction of this group, thus obtaining a higher comprehensive score; while other marginal individuals within the same cluster, due to their lower representativeness, have lower scores. The degradation is avoided, thus preventing the allocation of limited detection resources to homogeneous samples.
[0063] Next, step S13 is executed. The system generates test combination schemes for high-value candidate pigs and candidate symptom clusters. For pig A, considering its characteristics of high fever, cyanosis, high risk of transmission, and high uncertainty in etiology, the system generates candidate combinations such as "whole blood + PCR single sample detection," "whole blood + PCR combined with complete blood count," and "serum + inflammatory marker detection." Based on the biological characteristics of suspected diseases, the sampling time window is limited to sampling as soon as possible after abnormality indication to improve the detection probability in the acute phase. For representative individual B in the diarrhea symptom cluster and pigs in the same cluster, the system generates candidate schemes such as "fecal single sample PCR," "5-to-1 fecal mixed sample PCR," and "fecal + serum combined detection," and evaluates their applicability based on current test reagent inventory and budget constraints.
[0064] The system then optimizes its solution under the following constraints, aiming to maximize overall diagnostic benefits: total PCR reagent consumption must not exceed 16 samples; total testing costs must not exceed the budget limit; total sampling time and in-shed tracking time must not exceed 120 minutes; the laboratory's daily sample processing volume must not exceed 20 samples; the number of repeated submissions within the same symptom cluster must not exceed a preset threshold; and each sampling action must occur within the effective sampling window for the corresponding disease. After optimization, the system outputs a set of optimal submission decisions: single-sample PCR testing is arranged for 3 high-risk and high-uncertainty individuals, with 2 of them also receiving routine blood tests; a "5-in-1" fecal pooled PCR is used for 1 diarrhea symptom cluster; serological testing is arranged for 2 individuals with moderate abnormalities but located in critical transmission areas; and 2 candidate individuals and corresponding alternative test combinations are generated for switching if the target pig cannot be successfully located during on-site execution.
[0065] Finally, step S14 is executed. The system generates a structured submission task sheet based on the optimal submission decision and sends it to the on-site execution terminal. The task sheet clearly records the unique identifier of the target pig, its location in the fattening pen, the most recent location time, the most recent activity area, the identification screenshot, the anomaly type, the recommended sample type, the corresponding test items, the single or mixed sample method, the recommended sampling time window, the execution priority, and the backup plan. After entering the corresponding fattening pen, the on-site veterinarian first locates the target pig based on the most recent activity area and the target pig's image features provided in the task sheet. After confirming the target individual, the veterinarian uses a mobile terminal to read the pig's identifier and then reads the machine-readable identifier on the sample collection container. The system completes the consistency verification and binding of "pig identifier - sample container identifier - test item task" at the terminal front end. If the read identifier is inconsistent with the target in the task sheet, or if a single sample container is mistakenly used for the mixed sample task, the system immediately prompts and prohibits submission. For mixed sample tasks, the system also verifies whether the pigs participating in the mixed sample belong to the preset mixed sample set. Only after the verification is passed can the sampling registration be completed. After sampling is completed, the submission record is automatically uploaded to the system.
[0066] After the laboratory completes the testing, the test results are automatically transmitted back via the unique identifier corresponding to the sample container, and mapped and associated with the original structured submission task sheet. The system further evaluates the effectiveness of the submission strategy based on closed-loop data from "submission decision—on-site sampling—laboratory results," including whether high-value cases were identified, whether the rate of duplicate submissions for similar symptom clusters was reduced, the contribution of different test combinations to the final etiological diagnosis, and whether the results return meets timeliness requirements. Based on the evaluation results, the system corrects and updates the weighting coefficients in step 2, making the subsequent submission value ranking and test combination matching in similar scenarios more closely aligned with the actual epidemiological characteristics, activity patterns within the pig farm, and seasonal environmental changes.
[0067] Figure 3 A block diagram of a resource-constrained intelligent pig inspection optimization system according to the present invention is shown.
[0068] A second aspect of the present invention also provides a resource-constrained intelligent pig inspection optimization system, the system comprising: a memory, a processor, and an interaction interface, wherein the memory includes a resource-constrained intelligent pig inspection optimization program, and the resource-constrained intelligent pig inspection optimization program, when executed by the processor, performs the following steps: S11. Obtain pig monitoring resource information through a preset acquisition module, and perform data preprocessing on the pig monitoring resource information, which includes abnormal pig data; S12. For each abnormal pig i, construct a multimodal quantification model of the value of submission for testing based on the "benefit-cost" relationship, and calculate the comprehensive value score of submission for testing. The quantitative model includes two types of calculation factors: positive information gain and negative resource consumption, which decouple complex environmental and physiological factors that affect the decision to submit for testing. S13. By calculating the comprehensive test value score of abnormal pigs and analyzing the representativeness of the corresponding group, a decision combination is made based on the test object, sample type, sampling mixture category, biological sampling time window, and test items. The comprehensive diagnostic expected benefit of each decision combination is evaluated. The overall comprehensive diagnostic expected benefit is maximized as the objective function. The joint optimization solution is combined with multiple constraints to obtain the test decision result. S14. Generate a structured inspection task sheet based on the inspection decision results and send it to the preset execution terminal.
[0069] The interactive interface is used for data transmission with various terminals.
[0070] When the system is running, it can implement one or more steps of the above-described resource-constrained intelligent pig inspection optimization method.
[0071] A third aspect of the present invention also provides a computer-readable storage medium comprising a resource-constrained intelligent pig inspection optimization program, wherein when the resource-constrained intelligent pig inspection optimization program is executed by a processor, it implements the steps of the resource-constrained intelligent pig inspection optimization method as described in any of the preceding claims.
[0072] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.
[0073] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.
[0074] In addition, in the various embodiments of the present invention, each functional unit can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0075] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0076] Alternatively, if the integrated units of this invention are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.
[0077] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A resource-constrained intelligent inspection optimization method for pigs, characterized in that, include: S11. Obtain pig monitoring resource information through a preset acquisition module, and perform data preprocessing on the pig monitoring resource information, which includes abnormal pig data; S12. For each abnormal pig i, construct a multimodal quantification model of the submitted inspection value based on "benefit-cost" and calculate the comprehensive inspection value score. The quantitative model includes two types of calculation factors: positive information gain and negative resource consumption, which decouple complex environmental and physiological factors that affect the decision to submit for testing. S13. By calculating the comprehensive test value score of abnormal pigs and analyzing the representativeness of the corresponding group, a decision combination is made based on the test object, sample type, sampling mixture category, biological sampling time window, and test items. The comprehensive diagnostic expected benefit of each decision combination is evaluated. The overall comprehensive diagnostic expected benefit is maximized as the objective function. The joint optimization solution is combined with multiple constraints to obtain the test decision result. S14. Generate a structured inspection task sheet based on the inspection decision results and send it to the preset execution terminal; Specifically, S12 is: The multimodal inspection value quantification model is calculated as follows: ; in, to These are the weighting coefficients that are dynamically adjusted by the system. , , and These are positive benefit terms, representing diagnostic uncertainty, risk of spatial spread of the disease, disease severity, and population representativeness, respectively. , , and The values of these four indicators are directly proportional to the priority of the test submission; , and These are the reverse penalty terms, representing testing cost, sample acquisition difficulty, and testing cycle, respectively. , and These three indicators are directly proportional to the resistance and cost of sampling; In S12, group representativeness The calculations specifically also include: A quantitative assessment is conducted based on the exposure history, spatiotemporal characteristics, and symptom characteristics of pigs. A vector space is constructed, and a feature vector set of abnormal pigs is constructed based on the three-dimensional characteristics of the abnormal pigs. In the vector space, the DBSCAN density clustering algorithm is used to perform unsupervised clustering analysis on abnormal pigs. In the feature vector set, Euclidean distance is introduced to calculate the maximum and minimum distances in the feature vectors. The mean of the maximum and minimum distances is used as the cluster neighborhood radius. The minimum number of samples for the core point is set to 5. The feature vector set is used as the cluster sample data for iterative clustering until the preset number of iterations is reached. The corresponding multiple clusters and multiple centroids are recorded. High scores were assigned to the central point pigs. For pigs that are not at the center point, calculate their distance to the corresponding center point and mark it as the center distance. Then, linearly decay the high value based on the center distance.
2. The resource-constrained intelligent pig inspection optimization method according to claim 1, characterized in that, Specifically, S11 is as follows: The preset data acquisition module includes an anomaly identification module, a disease early warning module, a manual inspection module, or other monitoring modules; Pig monitoring resource information includes unique identifier, basic growth information, pig house, activity area, most recently active area, adjacent activity areas, abnormal monitoring time, abnormality type, abnormality degree, historical health records, abnormal situations in adjacent activity areas of the same pig house, and indoor environmental information.
3. The resource-constrained intelligent pig inspection optimization method according to claim 2, characterized in that, S11 further includes: The collected pig monitoring and testing resource information forms the decision input; Data preprocessing is performed on the decision input, including data cleaning, missing value completion, and data normalization. The preprocessing process also includes feature extraction and recognition of unstructured image and video data, quantization and encoding of the recognition information, and mapping all data to a unified numerical dimension.
4. The resource-constrained intelligent pig inspection optimization method according to claim 1, characterized in that, Specifically, S13 is: Based on the selection of the test subjects, the detection rate of sample types, the discrimination of mixed sampling categories, the determination of biological sampling time windows, and the assignment of test items, a variety of decision combination analyses are performed to generate a candidate strategy space; The expected return of comprehensive diagnosis is calculated based on the candidate strategy space, and the objective function is set to maximize the expected return. Multiple constraints are set based on resource and cost constraints, time and throughput constraints, group redundancy constraints, and effectiveness constraints. Combinatorial optimization is introduced to calculate the global optimal solution of the objective function and obtain the test delivery decision result.
5. The resource-constrained intelligent pig inspection optimization method according to claim 4, characterized in that, Specifically, S14 is: The decision-making results for sending samples for testing include the target pig's identity information, pen location, recommended sample type, corresponding test items, single or mixed sample method, recommended sampling time window, priority order for sending samples for testing, and alternative testing plans; After on-site sampling and subsequent laboratory testing are completed, the system obtains the actual submission records, sample information and test results, and uses a unique identifier to uniformly map and associate them with the original structured submission task sheet for storage.
6. The resource-constrained intelligent pig inspection optimization method according to claim 5, characterized in that, In step S14, the preset execution terminal includes a field execution terminal and a user visual terminal.
7. A resource-constrained intelligent pig inspection optimization system, characterized in that, The system includes: a memory, a processor, and an interaction interface. The memory includes a resource-constrained intelligent pig inspection optimization program. When the resource-constrained intelligent pig inspection optimization program is executed by the processor, it implements the steps of the resource-constrained intelligent pig inspection optimization method as described in any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a resource-constrained intelligent pig inspection optimization program, which, when executed by a processor, implements the steps of the resource-constrained intelligent pig inspection optimization method as described in any one of claims 1 to 6.