Pig farm introduction optimization method and system based on artificial intelligence
By constructing a sow herd production state time transition matrix and using clustering algorithms to calculate the similarity of pig herd health status, the accuracy and biosecurity issues of pig farm introduction plans were solved, enabling precise introduction decisions and resource optimization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WENS FOODSTUFF GROUP CO LTD
- Filing Date
- 2026-04-29
- Publication Date
- 2026-05-29
AI Technical Summary
Existing pig farm introduction plans rely on manual experience, which leads to complex and error-prone calculations, makes it difficult to accurately grasp the timing of introduction, and makes it impossible to achieve systematic forward-looking predictions, thus affecting production efficiency and resource allocation.
Using an artificial intelligence-based approach, a time transition matrix of sow production status is constructed to predict the future quantity and timing of redundancy or introduction of breeding stock. Clustering algorithms are then used to calculate the similarity of health status among different regions of sows, generating plans for internal allocation and external introduction of breeding stock.
This has enabled precise and feasible decisions regarding the introduction of new breeds, optimized the herd structure, ensured biosecurity, and improved production efficiency and resource utilization.
Smart Images

Figure CN122114298A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of smart farming technology, and in particular to a method and system for optimizing pig breeding stock introduction in pig farms based on artificial intelligence. Background Technology
[0002] In large-scale pig farming, the formulation of a breeding stock plan is a crucial step in maintaining the farm's continuous and stable production and economic benefits. This plan requires precise calculations of the number of replacement gilts needed and their introduction time, based on the sow herd's production status, reproductive performance indicators, and future production goals. However, current mainstream practices still heavily rely on the manual experience of technicians. The typical procedure involves technicians periodically and manually compiling production indicators such as farrowing rate and re-mating rate, then combining these with fixed parameters such as gestation period and lactation period to manually calculate the number of replacement gilts needed for each production batch, and finally, based on the gilts' growth cycle, calculating their return time.
[0003] This traditional, experience-driven approach has significant drawbacks. First, the calculation process is cumbersome and complex, requiring simultaneous consideration of data from multiple batches and time points. Manual calculations are highly prone to errors, making it difficult to guarantee the accuracy of the introduced breeding stock. Second, it is difficult to accurately grasp the timing of introductions, often resulting in a mismatch between the return time of replacement pigs and actual breeding demand, leading to production gaps or resource backlogs. Third, this method lacks systematic forward-looking forecasting capabilities and cannot scientifically plan for future medium- and long-term breeding stock demand based on real-time production data.
[0004] With the expansion of breeding scale and the increasing demands for refined management, the aforementioned problems have become increasingly prominent. Therefore, the livestock industry urgently needs a technological solution capable of automating and intelligently formulating breeding plans to improve the accuracy, efficiency, and forward-looking nature of these plans, thereby achieving optimal allocation of replacement pig resources and maximizing pig farm capacity. Existing technologies have not yet effectively solved these problems. Summary of the Invention
[0005] To address at least one of the aforementioned technical problems, this invention proposes an artificial intelligence-based method and system for optimizing pig breeding stock introduction in pig farms.
[0006] The first aspect of this invention provides an artificial intelligence-based method for optimizing pig farm breeding stock introduction, comprising: Obtain the production parameters and real-time production data of each independent breeding area of the target pig farm, and construct the production status time transition matrix of the sow herd in each breeding area based on the production parameters and real-time production data; Based on the production status time transition matrix and the number of breeding sows at full capacity in the region, predict the redundant number or the number of breeding sows introduced in each batch in the future, as well as the corresponding introduction time. Real-time biosecurity monitoring data and health record data of sow herds in each breeding area are obtained. Based on the biosecurity monitoring data and health record data, the similarity of the comprehensive health status of sow herds in different breeding areas in terms of disease history, immune status and real-time health indicators is calculated by clustering algorithm. Based on the redundant quantity or the number of introduced breeds, the corresponding introduction time, and the similarity of overall health status, the internal sow allocation plan and the external breeding plan of the target pig farm are determined, thus forming the breeding optimization scheme of the target pig farm.
[0007] In this solution, the process of obtaining production parameters and real-time production data for each independent breeding area of the target pig farm, and constructing a production state time transition matrix for the sow herd in each breeding area based on the production parameters and real-time production data, specifically involves: Obtain the basic production parameters for each independent breeding area of the target pig farm. The basic production parameters include, but are not limited to, the standard gestation period days, the standard lactation period days, and the standard mating interval days. The system acquires real-time production indicator data for each independent breeding area from the production management system. This current production indicator data includes, but is not limited to, the number of breeding sows, farrowing rate, rebreeding rate, and culling rate for each production batch in both historical and current terms. Based on the number of breeding sows in each production batch and the farrowing rate, calculate and record the actual number of sows that successfully farrowed in each batch; Based on the standard gestation period days, standard lactation period days, and standard re-mating interval days, and combined with the mating time of each batch, the expected state transition time sequence of the sows in this batch from the time of mating is calculated, which sequentially goes through the gestation state, lactation state, post-weaning re-mating state, and finally enters the state where they can be mated again. For each production batch of sows in each breeding area, the actual number of sows is used as the initial population base. A discrete-time Markov chain model is applied to define the sow state as a state space, which includes pregnant, lactating, breeding-ready, and culled states. Using the farrowing rate, re-mating rate, and culling rate as state transition probability parameters, and the expected state transition time series as the state transition time nodes, the distribution of the number of sows transitioning from the current state to the next state at different time nodes is simulated. Through iterative calculation, a production state time transition matrix is constructed to characterize the distribution of the number of sows in different production states at different time nodes in the breeding area and their changing patterns over time.
[0008] In this scheme, the prediction of the redundant number or introduction number of breeding sows and the corresponding introduction time for each batch of breeding sows based on the production state time transition matrix and the number of breeding sows at full capacity in the region is as follows: Based on the production status time transition matrix of each breeding area, the predicted number of sows in the breeding state at each target mating time node within a future preset time period is extracted. Obtain the preset full-load breeding number for each breeding area. If the predicted number of sows in the breeding state is greater than or equal to the full-load breeding number, calculate the difference between the predicted number of sows in the breeding state and the full-load breeding number. Determine the difference as the number of redundant sows in the breeding area at the corresponding target breeding time node, and record the target breeding time node as the redundancy determination time. If the predicted number of sows in the breeding state is less than the number of sows at full capacity, then the difference between the number of sows at full capacity and the predicted number of sows in the breeding state is calculated, and this difference is determined as the number of sows required for breeding in the breeding area at the corresponding target breeding time node. Based on the required number of breeding stock, a preset parameter for the age of gilts to be ready for mating is obtained. Starting from the target mating time node, a reverse time-series calculation is performed with the age of gilts to be ready for mating as the interval to determine the corresponding time node when the required number of breeding stock is reached and ready for mating. This time node is recorded as the planned mating time of the gilts. Obtain the preset age parameter for gilts to return to the farm. Starting from the planned mating time of the gilts, perform reverse time-series calculations at intervals based on the age of the gilts to return to the farm to determine the time node when gilts need to be introduced into the breeding area, and obtain the introduction time information for the breeding area that needs to be introduced.
[0009] In this solution, the acquisition of real-time biosecurity monitoring data and health record data of sow herds in each breeding area, and the calculation of the comprehensive health status similarity of sow herds in different breeding areas in terms of disease history, immune status, and real-time health indicators based on the biosecurity monitoring data and health record data using a clustering algorithm, specifically involves: Acquire real-time biosecurity monitoring data and historical health record data of sow herds in each breeding area. The real-time biosecurity monitoring data includes, but is not limited to, body temperature monitoring data, respiratory symptom scores, and body surface lesion image data. The historical health record data includes, but is not limited to, records of diagnosed diseases and onset time, and records of executed immunization programs and vaccination times. Based on the real-time biosafety monitoring data, the population statistics of sow herds in each breeding area on each real-time health indicator are calculated. Combined with the disease history and immune status information extracted from the historical health record data, a comprehensive health status matrix including disease history dimension, immune status dimension and real-time health indicator dimension is constructed for each breeding area. Using the K-means clustering algorithm as the input sample, the comprehensive health status matrix of all breeding areas is used to set initial cluster centers. The category of each sample is updated through iterative calculation until the change in cluster centers is less than a preset threshold, thus completing the clustering operation. Calculate the cosine similarity between the comprehensive health status matrices corresponding to different breeding areas within the same cluster, and use the cosine similarity as the comprehensive health status similarity of sow herds in different breeding areas in terms of disease history, immune status and real-time health indicators.
[0010] In this scheme, the determination of the target pig farm's internal sow allocation plan and external sow introduction plan based on the redundant quantity or the number of introduced sows, the corresponding introduction time, and the overall health status similarity constitutes the target pig farm's introduction optimization scheme, specifically as follows: Based on the redundancy of each breeding area of the target pig farm and the number of breeding stock required, as well as the corresponding time of introduction, the set of breeding areas with redundancy and the set of breeding areas with the number of breeding stock required are selected. Set an internal allocation similarity threshold to determine whether the overall health status similarity between pairwise pairings of breeding area sets with redundant numbers and breeding area sets with breeding needs is greater than the internal allocation similarity threshold. When the overall health status similarity between two pairs is greater than the internal allocation similarity threshold, the two paired breeding areas are marked as candidate area pairs that can be internally allocated. Based on the number of redundant breeding areas in the pair and the number of breeding needs in the breeding areas with breeding needs, the theoretical number of sows that can be allocated between the candidate area pairs is calculated. Traverse all candidate region pairs, with the optimization objective of maximizing the total number of sows allocated, and with the upper limit of the actual redundancy of each redundant breeding region and the upper limit of the actual introduction demand of each breeding region as constraints, use integer programming to solve the theoretically available allocation quantity to obtain the final allocation quantity between each candidate region pair. Based on the final allocation quantity, the redundancy determination time corresponding to the redundancy quantity, and the introduction time corresponding to the introduction demand quantity, an internal sow allocation plan is generated, which includes the specific transfer-out area, transfer-in area, number of sows to be allocated, and execution time. Based on the internal sow allocation plan, determine whether all breeding areas of the target pig farm meet the required number of breeding stock. If not, determine an external breeding stock introduction plan. Combine the internal sow allocation plan and the external breeding stock introduction plan to form an optimized breeding stock introduction scheme for the target pig farm.
[0011] In this plan, the step of determining whether all breeding areas of the target pig farm meet the required number of breeding stock based on the internal sow allocation plan, and if not, determining an external breeding stock import plan, specifically involves: After the internal sow allocation plan is executed, the remaining breeding demand in each breeding area is updated, and the breeding areas that still have a breeding demand after the update are marked as external breeding demand areas. Obtain the import time corresponding to each region with demand for external breeding stock, and obtain the comprehensive health status information of the sow herds of external candidate breeding pig suppliers. Calculate the health status matching degree between each region with demand for external breeding stock and the comprehensive health status information of the sow herds of each external candidate breeding pig supplier. Set a health matching threshold for external breeding stock, determine whether the health status matching degree is greater than the health matching threshold for external breeding stock, and screen out qualified external candidate breeding pig suppliers with a matching degree greater than the threshold. Based on the remaining demand for breeding stock in each region and the timing of the introduction, and combined with the matching degree of the health status of qualified external candidate breeding pig suppliers, an external breeding stock quantity is allocated to each region at the corresponding introduction time node, generating an external breeding stock introduction plan that includes the introduction region, supplier, quantity, and timing.
[0012] A second aspect of the present invention also provides an artificial intelligence-based pig farm breeding optimization system, the system comprising: a memory and a processor, wherein the memory includes an artificial intelligence-based pig farm breeding optimization method program, and when the artificial intelligence-based pig farm breeding optimization method program is executed by the processor, the following steps are implemented: Obtain the production parameters and real-time production data of each independent breeding area of the target pig farm, and construct the production status time transition matrix of the sow herd in each breeding area based on the production parameters and real-time production data; Based on the production status time transition matrix and the number of breeding sows at full capacity in the region, predict the redundant number or the number of breeding sows introduced in each batch in the future, as well as the corresponding introduction time. Real-time biosecurity monitoring data and health record data of sow herds in each breeding area are obtained. Based on the biosecurity monitoring data and health record data, the similarity of the comprehensive health status of sow herds in different breeding areas in terms of disease history, immune status and real-time health indicators is calculated by clustering algorithm. Based on the redundant quantity or the number of introduced breeds, the corresponding introduction time, and the similarity of overall health status, the internal sow allocation plan and the external breeding plan of the target pig farm are determined, thus forming the breeding optimization scheme of the target pig farm.
[0013] This invention discloses an artificial intelligence-based method and system for optimizing pig farm breeding stock introduction. First, the invention acquires production parameters and real-time data from each breeding area of the target pig farm, constructs a time transition matrix of the sow herd's production state, and predicts the required number and timing of sow redundancy or introduction for each future batch. Second, it acquires biosecurity and health data of sow herds in each area, and uses a clustering algorithm to calculate the comprehensive health status similarity of pig herds in different areas in terms of disease history, immune status, and real-time health indicators. Finally, it combines the predicted data with the inter-regional health similarity to generate an optimized breeding stock introduction scheme that includes internal sow allocation plans and external introduction plans. This invention achieves data-driven, precise decision-making for breeding stock introduction and allocation, optimizing pig herd structure, ensuring biosecurity, and improving production efficiency. Attached Figure Description
[0014] Figure 1 A flowchart of an artificial intelligence-based optimization method for introducing pig breeds to a pig farm is shown below. Figure 2 This invention illustrates a flowchart of the time transition matrix for the production state of sow herds in each breeding area. Figure 3 The flowchart illustrating the present invention for determining the exogenous introduction plan is shown; Figure 4 The diagram shows a block diagram of an artificial intelligence-based pig farm breeding optimization system according to the present invention. Detailed Implementation
[0015] To better understand the above-mentioned objectives, 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 should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0016] 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.
[0017] Figure 1 The flowchart of an artificial intelligence-based method for optimizing pig breeding in pig farms according to the present invention is shown.
[0018] like Figure 1 As shown, the first aspect of this invention provides an artificial intelligence-based method for optimizing pig breeding stock introduction in pig farms, comprising: S102, Obtain the production parameters and real-time production data of each independent breeding area of the target pig farm, and construct the production status time transition matrix of the sow herd in each breeding area based on the production parameters and real-time production data; S104, Based on the production status time transition matrix and the number of breeding sows at full load in the region, predict the redundant number or the number of breeding sows introduced in each batch in the future and the corresponding introduction time. S106, Obtain real-time biosafety monitoring data and health record data of sow herds in each breeding area, and calculate the comprehensive health status similarity of sow herds in different breeding areas in terms of disease history, immune status and real-time health indicators based on the biosafety monitoring data and health record data using a clustering algorithm; S108. Based on the redundant quantity or the number of introduced pigs and the corresponding introduction time and the similarity of the overall health status, determine the internal sow allocation plan and the external introduction plan of the target pig farm, thus forming the introduction optimization scheme of the target pig farm.
[0019] It should be noted that by constructing a production state time transition matrix, the dynamic changes of sow herds between different production states can be accurately simulated, thereby achieving quantitative prediction of future sow inventory structure. Secondly, combined with the number of full-load matings in a region, this matrix can automatically calculate the sow shortage or redundancy at the time of each future mating batch, and accurately calculate the precise return time of replacement sows needed to fill the shortage, realizing automated decision-making from demand forecasting to time planning. Then, by analyzing the similarity of the comprehensive health status of sow herds in different breeding areas through clustering algorithms, the degree of biosecurity matching between different areas can be scientifically quantified, providing a crucial basis for assessing biosecurity risks for internal pig allocation. Finally, based on the above predictions, time, and matching information, the system can intelligently formulate an overall optimization plan that includes priority internal allocation and precise external breeding, maximizing the utilization of existing farm resources, controlling biosecurity risks, and accurately supplementing external breeding sources, thereby significantly improving the accuracy, safety, economy, and feasibility of breeding decisions.
[0020] Figure 2 The flowchart illustrating the construction of the production state time transition matrix for each breeding area sow herd according to the present invention is shown.
[0021] According to an embodiment of the present invention, the step of obtaining production parameters and real-time production data for each independent breeding area of the target pig farm, and constructing a production state time transition matrix for the sow herd in each breeding area based on the production parameters and real-time production data, specifically involves: Obtain the basic production parameters for each independent breeding area of the target pig farm. The basic production parameters include, but are not limited to, the standard gestation period days, the standard lactation period days, and the standard mating interval days. The system acquires real-time production indicator data for each independent breeding area from the production management system. This current production indicator data includes, but is not limited to, the number of breeding sows, farrowing rate, rebreeding rate, and culling rate for each production batch in both historical and current terms. Based on the number of breeding sows in each production batch and the farrowing rate, calculate and record the actual number of sows that successfully farrowed in each batch; Based on the standard gestation period days, standard lactation period days, and standard re-mating interval days, and combined with the mating time of each batch, the expected state transition time sequence of the sows in this batch from the time of mating is calculated, which sequentially goes through the gestation state, lactation state, post-weaning re-mating state, and finally enters the state where they can be mated again. For each production batch of sows in each breeding area, the actual number of sows is used as the initial population base. A discrete-time Markov chain model is applied to define the sow state as a state space, which includes pregnant, lactating, breeding-ready, and culled states. Using the farrowing rate, re-mating rate, and culling rate as state transition probability parameters, and the expected state transition time series as the state transition time nodes, the distribution of the number of sows transitioning from the current state to the next state at different time nodes is simulated. Through iterative calculation, a production state time transition matrix is constructed to characterize the distribution of the number of sows in different production states at different time nodes in the breeding area and their changing patterns over time.
[0022] It should be noted that a dynamic prediction model based on a discrete-time Markov chain was established by acquiring basic production parameters and real-time production index data for each independent breeding area of the pig farm. First, basic production parameters such as the standard gestation period days, standard lactation period days, and standard re-mating interval days were acquired. These parameters provide a defined time frame for the complete production cycle of a sow from mating to its next mating period. Simultaneously, the claims also acquired real-time production index data such as the number of mated sows, farrowing rate, re-mating rate, and culling rate for each production batch in both historical and current periods. These data reflect the dynamic changes in the pig herd during actual production. Based on this data, the method calculates the actual number of sows that successfully farrowed in each batch as the initial population base, and calculates the expected state transition time series for each batch of sows from gestation, lactation, post-weaning awaiting re-mating, to the final state where they are ready to be mated again, based on the basic production parameters and mating time. Then, this method defines the sow state as a state space including pregnancy, lactation, mating potential, and culling, and uses farrowing rate, re-mating rate, and culling rate as state transition probability parameters, and the expected state transition time series as the time nodes of state transition. By applying a discrete-time Markov chain model, the distribution of the number of sows transitioning from the current state to the next state is simulated at different time nodes, and the production state time transition matrix is finally constructed through iterative calculation.
[0023] The production state time transition matrix is a mathematical matrix that characterizes the distribution of the number of sows in different production states within a breeding area at various future time points and their changes over time. This matrix uses time as the row and sow state as the column, with each element representing the number of sows in a specific production state at a given time point. It quantitatively demonstrates the dynamic transition of the sow herd between various production states from the current time point, including the number of sows in pregnancy, lactation, breeding age, and culling. This matrix accurately simulates the changes in the number of sows across different production states, providing a data foundation for predicting future sow inventory structure and breeding capacity.
[0024] According to an embodiment of the present invention, the step of predicting the redundant number or the number of introduced sows and the corresponding introduction time for each batch of breeding sows based on the production state time transition matrix and the number of inseminations at full capacity in the region specifically includes: Based on the production status time transition matrix of each breeding area, the predicted number of sows in the breeding state at each target mating time node within a future preset time period is extracted. Obtain the preset full-load breeding number for each breeding area. If the predicted number of sows in the breeding state is greater than or equal to the full-load breeding number, calculate the difference between the predicted number of sows in the breeding state and the full-load breeding number. Determine the difference as the number of redundant sows in the breeding area at the corresponding target breeding time node, and record the target breeding time node as the redundancy determination time. If the predicted number of sows in the breeding state is less than the number of sows at full capacity, then the difference between the number of sows at full capacity and the predicted number of sows in the breeding state is calculated, and this difference is determined as the number of sows required for breeding in the breeding area at the corresponding target breeding time node. Based on the required number of breeding stock, a preset parameter for the age of gilts to be ready for mating is obtained. Starting from the target mating time node, a reverse time-series calculation is performed with the age of gilts to be ready for mating as the interval to determine the corresponding time node when the required number of breeding stock is reached and ready for mating. This time node is recorded as the planned mating time of the gilts. Obtain the preset age parameter for gilts to return to the farm. Starting from the planned mating time of the gilts, perform reverse time-series calculations at intervals based on the age of the gilts to return to the farm to determine the time node when gilts need to be introduced into the breeding area, and obtain the introduction time information for the breeding area that needs to be introduced.
[0025] It should be noted that by extracting the predicted number of sows in a breeding state at each future target breeding time node from the production state time transition matrix, quantitative data on the actual available breeding resources in the breeding area for each future batch were obtained. Next, the predicted number of sows was compared with the preset static production target of full-capacity breeding for each breeding area. Through difference calculation, it was determined whether the area had a surplus of sow resources or a shortage requiring additional breeding stock at each specific future time node. This directly transformed the prediction model into specific, quantitative production management demand instructions. Furthermore, by performing reverse time-series calculations using preset parameters for the age of gilts at mating and the age of gilts returning to the farm, two core time points were determined to meet the future breeding plan's requirements for gilts: the planned mating time of gilts and the return time of gilts to the farm. By precisely calculating the timing of the introduction of breeding stock, it ensures that replacement gilts can return to the farm at the most suitable time and complete the necessary isolation and adaptation, thereby reaching the ideal physiological and health status on the planned mating day. This not only significantly improves the feasibility of production plans and the completion rate of mating tasks, but also indirectly enhances the level of biosecurity management by reducing the uncertainty of pig herd turnover.
[0026] According to an embodiment of the present invention, the step of acquiring real-time biosecurity monitoring data and health record data of sow herds in each breeding area, and calculating the comprehensive health status similarity of sow herds in different breeding areas in terms of disease history, immune status, and real-time health indicators based on the biosecurity monitoring data and health record data using a clustering algorithm, specifically involves: Acquire real-time biosecurity monitoring data and historical health record data of sow herds in each breeding area. The real-time biosecurity monitoring data includes, but is not limited to, body temperature monitoring data, respiratory symptom scores, and body surface lesion image data. The historical health record data includes, but is not limited to, records of diagnosed diseases and onset time, and records of executed immunization programs and vaccination times. Based on the real-time biosafety monitoring data, the population statistics of sow herds in each breeding area on each real-time health indicator are calculated. Combined with the disease history and immune status information extracted from the historical health record data, a comprehensive health status matrix including disease history dimension, immune status dimension and real-time health indicator dimension is constructed for each breeding area. Using the K-means clustering algorithm as the input sample, the comprehensive health status matrix of all breeding areas is used to set initial cluster centers. The category of each sample is updated through iterative calculation until the change in cluster centers is less than a preset threshold, thus completing the clustering operation. Calculate the cosine similarity between the comprehensive health status matrices corresponding to different breeding areas within the same cluster, and use the cosine similarity as the comprehensive health status similarity of sow herds in different breeding areas in terms of disease history, immune status and real-time health indicators.
[0027] It's important to note that determining whether different pig herds are suitable for mixing or moving relies heavily on the experience of veterinarians and managers. This approach is subjective, difficult to standardize, and struggles to quickly handle complex comparisons across multiple regions. Clustering algorithms, however, can automatically and efficiently group the overall health background of all farming areas objectively. It transforms real-time monitoring data and historical health records for each region into a multi-dimensional feature matrix and uses clustering algorithms (such as K-means) to automatically group regions with similar health statuses into the same cluster based on the similarity of these features. This process is essentially data-driven objective classification, avoiding biases that might arise from pre-defined standards. More importantly, after clustering, different regions within the same cluster exhibit high intrinsic similarity in disease history, immune status, and real-time health indicators. By calculating the cosine similarity between these region pairs, a clear numerical indicator can be obtained to accurately measure the degree of biosecurity compatibility between any two regions. This similarity value directly reflects the potential risk level of disease transmission between pig herds in different regions. Therefore, when formulating internal allocation plans, a similarity threshold can be set. Only between regions with highly similar health status, i.e., where biosecurity risks are considered controllable, should the movement of sows be considered.
[0028] According to an embodiment of the present invention, the step of determining the internal sow allocation plan and external sow introduction plan of the target pig farm based on the redundant quantity or the number of introduced sows, the corresponding introduction time, and the similarity of overall health status, to constitute the introduction optimization scheme of the target pig farm, specifically includes: Based on the redundancy of each breeding area of the target pig farm and the number of breeding stock required, as well as the corresponding time of introduction, the set of breeding areas with redundancy and the set of breeding areas with the number of breeding stock required are selected. Set an internal allocation similarity threshold to determine whether the overall health status similarity between pairwise pairings of breeding area sets with redundant numbers and breeding area sets with breeding needs is greater than the internal allocation similarity threshold. When the overall health status similarity between two pairs is greater than the internal allocation similarity threshold, the two paired breeding areas are marked as candidate area pairs that can be internally allocated. Based on the number of redundant breeding areas in the pair and the number of breeding needs in the breeding areas with breeding needs, the theoretical number of sows that can be allocated between the candidate area pairs is calculated. Traverse all candidate region pairs, with the optimization objective of maximizing the total number of sows allocated, and with the upper limit of the actual redundancy of each redundant breeding region and the upper limit of the actual introduction demand of each breeding region as constraints, use integer programming to solve the theoretically available allocation quantity to obtain the final allocation quantity between each candidate region pair. Based on the final allocation quantity, the redundancy determination time corresponding to the redundancy quantity, and the introduction time corresponding to the introduction demand quantity, an internal sow allocation plan is generated, which includes the specific transfer-out area, transfer-in area, number of sows to be allocated, and execution time. Based on the internal sow allocation plan, determine whether all breeding areas of the target pig farm meet the required number of breeding stock. If not, determine an external breeding stock introduction plan. Combine the internal sow allocation plan and the external breeding stock introduction plan to form an optimized breeding stock introduction scheme for the target pig farm.
[0029] It should be noted that, based on redundancy and demand data, potential opportunities for resource allocation within the farm are identified, laying the foundation for maximizing the utilization of existing sow resources and reducing unnecessary external breeding, directly lowering the farm's breeding costs. Secondly, by introducing comprehensive health status similarity as a hard screening threshold, allocation is ensured only between areas with controllable biosecurity risks, i.e., areas with highly similar pig herd health backgrounds. This effectively eliminates the risk of cross-infection of diseases that may be caused by blind internal allocation, ensuring the overall health and stability of the pig herd. Furthermore, through objective function solutions including particle swarm optimization, integer programming with the goal of maximizing the total allocation quantity is used to find the globally optimal allocation scheme in a complex network composed of multiple redundant and demand areas, achieving optimal reallocation of farm resources and significantly improving the overall efficiency of resource utilization. Finally, this plan not only clarifies the areas and quantities of allocation and transfer, but also combines redundancy determination time and breeding time, giving each allocation action a precise execution time window. This makes the transformation process from decision-making to execution clear, orderly, and operable, greatly enhancing the executability of the production plan and the level of management refinement.
[0030] Figure 3 The flowchart illustrating the present invention for determining the exogenous introduction plan is shown.
[0031] According to an embodiment of the present invention, the step of determining whether all breeding areas of the target pig farm meet the required number of breeding stock based on the internal sow allocation plan, and if not, determining an external breeding stock import plan, specifically includes: After the internal sow allocation plan is executed, the remaining breeding demand in each breeding area is updated, and the breeding areas that still have a breeding demand after the update are marked as external breeding demand areas. Obtain the import time corresponding to each region with demand for external breeding stock, and obtain the comprehensive health status information of the sow herds of external candidate breeding pig suppliers. Calculate the health status matching degree between each region with demand for external breeding stock and the comprehensive health status information of the sow herds of each external candidate breeding pig supplier. Set a health matching threshold for external breeding stock, determine whether the health status matching degree is greater than the health matching threshold for external breeding stock, and screen out qualified external candidate breeding pig suppliers with a matching degree greater than the threshold. Based on the remaining demand for breeding stock in each region and the timing of the introduction, and combined with the matching degree of the health status of qualified external candidate breeding pig suppliers, an external breeding stock quantity is allocated to each region at the corresponding introduction time node, generating an external breeding stock introduction plan that includes the introduction region, supplier, quantity, and timing.
[0032] It should be noted that after the internal sow allocation plan is implemented, if the demand for breeding stock in each breeding area of the target pig farm is still not fully met, the system identifies the actual gaps that still exist after internal optimization. This ensures that external breeding stock is strictly limited to the necessary supplementary range, thereby avoiding resource waste and controlling additional biosecurity risks caused by indiscriminate breeding. Secondly, by calculating the health status matching degree between the demand areas within the farm and the pig herds of external candidate suppliers, and setting strict matching thresholds, an objective and quantitative biosecurity assessment standard is established for supplier selection. This ensures that only qualified suppliers whose health background is highly consistent with the target areas within the farm are considered, which significantly reduces the potential risk of introducing new pathogens or disrupting the existing health balance within the farm due to the introduction of external breeding stock. Finally, this method intelligently matches the determined remaining breeding stock demand, the precise breeding stock timeline, and the selected qualified suppliers, automatically generating an executable external breeding stock plan that includes specific breeding stock areas, designated suppliers, clear breeding stock quantities, and accurate breeding stock times. This achieves precision, efficiency, and feasibility of external breeding stock work while ensuring biosecurity.
[0033] According to an embodiment of the present invention, it further includes: When obtaining the mating age parameter of the replacement gilts, the individual identification information and individual development data of the replacement gilt herd to be introduced, which are provided by external candidate breeding pig suppliers and correspond to the number of breeding pigs to be introduced, are obtained simultaneously. The individual development data includes at least the current age, weight, backfat thickness and historical growth rate data of each replacement gilt. Based on the individual development data, a machine learning-based model for predicting the age of puberty is constructed. The model takes the current age, weight, backfat thickness, and historical growth rate data as input features and outputs the predicted age distribution of puberty for each gilt to be introduced for breeding. Based on the predicted age distribution of puberty, the mating age parameter of the gilts is optimized, and the personalized mating age prediction value of each gilt is calculated. By statistically analyzing the personalized mating age prediction values of all gilts corresponding to the number of breeding stock required, a statistical distribution of mating age is generated. Based on the statistical distribution of mating age, the demand for breeding stock is divided into the number of sows that can participate in mating on time and the number of sows that can participate in mating later. The number of sows that can participate in mating on time is the predicted number of replacement sows that will reach the personalized mating age before the target mating time node of the current batch.
[0034] Based on the difference between the number of breeding stock that can be bred on time and the number of breeding stock required, the additional number of breeding stock needed for the current batch is calculated. Based on the personalized prediction value of the age of mating corresponding to the number of breeding stock that can be bred on time, the reverse time series calculation is performed again to obtain the time of the first breeding stock introduction. Based on the personalized mating age prediction value corresponding to the number of delayed matings, the time for secondary introduction of seedlings to supplement subsequent batches is calculated, thereby generating a refined dynamic exogenous seedling introduction plan that includes batches and time sequence, in order to optimize the static prediction of introduction time and quantity in the seedling introduction optimization scheme.
[0035] It should be noted that in actual production, even gilts of the same age exhibit significant differences in physiological development. If a uniform introduction time is calculated based solely on a fixed average age at first mating, some slower-developing gilts will fail to mate on time in the target batch, leading to inaccurate predictions of the number of gilts introduced and disruption of the production rhythm. By incorporating individual development data from external suppliers and utilizing machine learning models to personalize the puberty date prediction for each gilt, the age at first mating parameter is dynamically optimized, generating statistical results reflecting the distribution of the group's age at first mating. Based on this distribution, this solution can intelligently divide the original demand for gilts into two parts: those that can mate on time and those that mate later. It further calculates the initial introduction time, the number of additional gilts needed, and the time for the second introduction, ultimately forming a batch-based, refined, dynamic introduction plan. It significantly improves the alignment between the introduction plan and the developmental patterns of individual organisms. Through proactive individualized prediction and dynamic segmentation mechanisms, it effectively ensures the accuracy of achieving the target breeding scale for each batch, enhances the stability of batch production and the efficiency of resource utilization, thereby overcoming the problem of plan failure caused by the neglect of individual differences in the original static prediction model.
[0036] Figure 4 The diagram shows a block diagram of an artificial intelligence-based pig farm breeding optimization system according to the present invention.
[0037] A second aspect of the present invention also provides an artificial intelligence-based pig farm breeding optimization system, comprising: a memory 401, a processor 402, and a communication interface 403. The memory includes an artificial intelligence-based pig farm breeding optimization method program, and the communication interface is used for data connection and communication between the memory and the processor. When the artificial intelligence-based pig farm breeding optimization method program is executed by the processor, it performs the following steps: Obtain the production parameters and real-time production data of each independent breeding area of the target pig farm, and construct the production status time transition matrix of the sow herd in each breeding area based on the production parameters and real-time production data; Based on the production status time transition matrix and the number of breeding sows at full capacity in the region, predict the redundant number or the number of breeding sows introduced in each batch in the future, as well as the corresponding introduction time. Real-time biosecurity monitoring data and health record data of sow herds in each breeding area are obtained. Based on the biosecurity monitoring data and health record data, the similarity of the comprehensive health status of sow herds in different breeding areas in terms of disease history, immune status and real-time health indicators is calculated by clustering algorithm. Based on the redundant quantity or the number of introduced breeds, the corresponding introduction time, and the similarity of overall health status, the internal sow allocation plan and the external breeding plan of the target pig farm are determined, thus forming the breeding optimization scheme of the target pig farm.
[0038] This invention discloses an artificial intelligence-based method and system for optimizing pig farm breeding stock introduction. First, the invention acquires production parameters and real-time data from each breeding area of the target pig farm, constructs a time transition matrix of the sow herd's production state, and predicts the required number and timing of sow redundancy or introduction for each future batch. Second, it acquires biosecurity and health data of sow herds in each area, and uses a clustering algorithm to calculate the comprehensive health status similarity of pig herds in different areas in terms of disease history, immune status, and real-time health indicators. Finally, it combines the predicted data with the inter-regional health similarity to generate an optimized breeding stock introduction scheme that includes internal sow allocation plans and external introduction plans. This invention achieves data-driven, precise decision-making for breeding stock introduction and allocation, optimizing pig herd structure, ensuring biosecurity, and improving production efficiency.
[0039] 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.
[0040] 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.
[0041] 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 variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for optimizing pig breeding stock introduction in pig farms based on artificial intelligence, characterized in that, Includes the following steps: Obtain the production parameters and real-time production data of each independent breeding area of the target pig farm, and construct the production status time transition matrix of the sow herd in each breeding area based on the production parameters and real-time production data; Based on the production status time transition matrix and the number of breeding sows at full capacity in the region, predict the redundant number or the number of breeding sows introduced in each batch in the future, as well as the corresponding introduction time. Real-time biosecurity monitoring data and health record data of sow herds in each breeding area are obtained. Based on the biosecurity monitoring data and health record data, the similarity of the comprehensive health status of sow herds in different breeding areas in terms of disease history, immune status and real-time health indicators is calculated by clustering algorithm. Based on the redundant quantity or the number of introduced breeds, the corresponding introduction time, and the similarity of overall health status, the internal sow allocation plan and the external breeding plan of the target pig farm are determined, thus forming the breeding optimization scheme of the target pig farm.
2. The method for optimizing pig breeding stock introduction based on artificial intelligence according to claim 1, characterized in that, The process involves acquiring production parameters and real-time production data for each independent breeding area of the target pig farm, and constructing a time transition matrix for the production status of the sow herd in each breeding area based on these parameters and data. Specifically: Obtain the basic production parameters for each independent breeding area of the target pig farm. The basic production parameters include, but are not limited to, the standard gestation period days, the standard lactation period days, and the standard mating interval days. The system acquires real-time production indicator data for each independent breeding area from the production management system. This current production indicator data includes, but is not limited to, the number of breeding sows, farrowing rate, rebreeding rate, and culling rate for each production batch in both historical and current terms. Based on the number of breeding sows in each production batch and the farrowing rate, calculate and record the actual number of sows that successfully farrowed in each batch; Based on the standard gestation period days, standard lactation period days, and standard re-mating interval days, and combined with the mating time of each batch, the expected state transition time sequence of the sows in this batch from the time of mating is calculated, which sequentially goes through the gestation state, lactation state, post-weaning re-mating state, and finally enters the state where they can be mated again. For each production batch of sows in each breeding area, the actual number of sows is used as the initial population base. A discrete-time Markov chain model is applied to define the sow state as a state space, which includes pregnant, lactating, breeding-ready, and culled states. Using the farrowing rate, re-mating rate, and culling rate as state transition probability parameters, and the expected state transition time series as the state transition time nodes, the distribution of the number of sows transitioning from the current state to the next state at different time nodes is simulated. Through iterative calculation, a production state time transition matrix is constructed to characterize the distribution of the number of sows in different production states at different time nodes in the breeding area and their changing patterns over time.
3. The method for optimizing pig breeding stock introduction based on artificial intelligence according to claim 1, characterized in that, The method for predicting the redundant number of breeding sows or the number of introduced sows and the corresponding introduction time for each batch of breeding sows based on the production state time transition matrix and the number of breeding sows at full capacity in the region is as follows: Based on the production status time transition matrix of each breeding area, the predicted number of sows in the breeding state at each target mating time node within a future preset time period is extracted. Obtain the preset full-load breeding number for each breeding area. If the predicted number of sows in the breeding state is greater than or equal to the full-load breeding number, calculate the difference between the predicted number of sows in the breeding state and the full-load breeding number. Determine the difference as the number of redundant sows in the breeding area at the corresponding target breeding time node, and record the target breeding time node as the redundancy determination time. If the predicted number of sows in the breeding state is less than the number of sows at full capacity, then the difference between the number of sows at full capacity and the predicted number of sows in the breeding state is calculated, and this difference is determined as the number of sows required for breeding in the breeding area at the corresponding target breeding time node. Based on the required number of breeding stock, a preset parameter for the age of gilts to be ready for mating is obtained. Starting from the target mating time node, a reverse time-series calculation is performed with the age of gilts to be ready for mating as the interval to determine the corresponding time node when the required number of breeding stock is reached and ready for mating. This time node is recorded as the planned mating time of the gilts. Obtain the preset age parameter for gilts to return to the farm. Starting from the planned mating time of the gilts, perform reverse time-series calculations at intervals based on the age of the gilts to return to the farm to determine the time node when gilts need to be introduced into the breeding area, and obtain the introduction time information for the breeding area that needs to be introduced.
4. The method for optimizing pig farm breeding stock based on artificial intelligence according to claim 1, characterized in that, The process involves acquiring real-time biosecurity monitoring data and health record data of sow herds in each breeding area. Based on this data, a clustering algorithm is used to calculate the comprehensive health status similarity of sow herds across different breeding areas in terms of disease history, immune status, and real-time health indicators. Specifically: Acquire real-time biosecurity monitoring data and historical health record data of sow herds in each breeding area. The real-time biosecurity monitoring data includes, but is not limited to, body temperature monitoring data, respiratory symptom scores, and body surface lesion image data. The historical health record data includes, but is not limited to, records of diagnosed diseases and onset time, and records of executed immunization programs and vaccination times. Based on the real-time biosafety monitoring data, the population statistics of sow herds in each breeding area on each real-time health indicator are calculated. Combined with the disease history and immune status information extracted from the historical health record data, a comprehensive health status matrix including disease history dimension, immune status dimension and real-time health indicator dimension is constructed for each breeding area. Using the K-means clustering algorithm as the input sample, the comprehensive health status matrix of all breeding areas is used to set initial cluster centers. The category of each sample is updated through iterative calculation until the change in cluster centers is less than a preset threshold, thus completing the clustering operation. Calculate the cosine similarity between the comprehensive health status matrices corresponding to different breeding areas within the same cluster, and use the cosine similarity as the comprehensive health status similarity of sow herds in different breeding areas in terms of disease history, immune status and real-time health indicators.
5. The method for optimizing pig breeding stock introduction based on artificial intelligence according to claim 1, characterized in that, The process of determining the internal sow allocation plan and external sow introduction plan of the target pig farm based on the redundant quantity or the number of introduced sows, the corresponding introduction time, and the similarity of overall health status constitutes the introduction optimization scheme of the target pig farm, specifically as follows: Based on the redundancy of each breeding area of the target pig farm and the number of breeding stock required, as well as the corresponding time of introduction, the set of breeding areas with redundancy and the set of breeding areas with the number of breeding stock required are selected. Set an internal allocation similarity threshold to determine whether the overall health status similarity between pairwise pairings of breeding area sets with redundant numbers and breeding area sets with breeding needs is greater than the internal allocation similarity threshold. When the overall health status similarity between two pairs is greater than the internal allocation similarity threshold, the two paired breeding areas are marked as candidate area pairs that can be internally allocated. Based on the number of redundant breeding areas in the pair and the number of breeding needs in the breeding areas with breeding needs, the theoretical number of sows that can be allocated between the candidate area pairs is calculated. Traverse all candidate region pairs, with the optimization objective of maximizing the total number of sows allocated, and with the upper limit of the actual redundancy of each redundant breeding region and the upper limit of the actual introduction demand of each breeding region as constraints, use integer programming to solve the theoretically available allocation quantity to obtain the final allocation quantity between each candidate region pair. Based on the final allocation quantity, the redundancy determination time corresponding to the redundancy quantity, and the introduction time corresponding to the introduction demand quantity, an internal sow allocation plan is generated, which includes the specific transfer-out area, transfer-in area, number of sows to be allocated, and execution time. Based on the internal sow allocation plan, determine whether all breeding areas of the target pig farm meet the required number of breeding stock. If not, determine an external breeding stock introduction plan. Combine the internal sow allocation plan and the external breeding stock introduction plan to form an optimized breeding stock introduction scheme for the target pig farm.
6. The method for optimizing pig breeding stock introduction based on artificial intelligence according to claim 1, characterized in that, The step involves determining whether all breeding areas of the target pig farm meet the required number of breeding stock based on the internal sow allocation plan. If not, an external breeding stock import plan is determined, specifically as follows: After the internal sow allocation plan is executed, the remaining breeding demand in each breeding area is updated, and the breeding areas that still have a breeding demand after the update are marked as external breeding demand areas. Obtain the import time corresponding to each region with demand for external breeding stock, and obtain the comprehensive health status information of the sow herds of external candidate breeding pig suppliers. Calculate the health status matching degree between each region with demand for external breeding stock and the comprehensive health status information of the sow herds of each external candidate breeding pig supplier. Set a health matching threshold for external breeding stock, determine whether the health status matching degree is greater than the health matching threshold for external breeding stock, and screen out qualified external candidate breeding pig suppliers with a matching degree greater than the threshold. Based on the remaining demand for breeding stock in each region and the timing of the introduction, and combined with the matching degree of the health status of qualified external candidate breeding pig suppliers, an external breeding stock quantity is allocated to each region at the corresponding introduction time node, generating an external breeding stock introduction plan that includes the introduction region, supplier, quantity, and timing.
7. A pig farm breeding optimization system based on artificial intelligence, characterized in that, The AI-based pig farm breeding optimization system includes a storage unit and a processor. The storage unit includes an AI-based pig farm breeding optimization method program. When the processor executes the AI-based pig farm breeding optimization method program, it performs the following steps: Obtain the production parameters and real-time production data of each independent breeding area of the target pig farm, and construct the production status time transition matrix of the sow herd in each breeding area based on the production parameters and real-time production data; Based on the production status time transition matrix and the number of breeding sows at full capacity in the region, predict the redundant number or the number of breeding sows introduced in each batch in the future, as well as the corresponding introduction time. Real-time biosecurity monitoring data and health record data of sow herds in each breeding area are obtained. Based on the biosecurity monitoring data and health record data, the similarity of the comprehensive health status of sow herds in different breeding areas in terms of disease history, immune status and real-time health indicators is calculated by clustering algorithm. Based on the redundant quantity or the number of introduced breeds, the corresponding introduction time, and the similarity of overall health status, the internal sow allocation plan and the external breeding plan of the target pig farm are determined, thus forming the breeding optimization scheme of the target pig farm.