Closed-loop precise feeding system and method for pregnant sows based on 3D vision and edge calculation
By using a closed-loop system based on 3D vision and edge computing, non-contact, automated, and high-precision measurement of backfat thickness in sows and dynamic adjustment of feed amount have been achieved, solving the problems of lagging and inaccurate body condition data in existing technologies and improving the level of breeding management.
Patent Information
- Application Number
- CN202511237081.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-01
- Publication Date
- 2025-10-17
AI Technical Summary
Existing technologies cannot automatically, contactlessly, and with high precision acquire key body condition data (backfat thickness) of sows at the moment of feeding, resulting in delayed and inaccurate feeding decision data, making it difficult to achieve precision management.
A closed-loop system based on 3D vision and edge computing is adopted. Through an identity recognition module, a 3D vision acquisition module, an edge computing module, and a feeding execution module, combined with a Point Transformer model, end-to-end backfat thickness measurement and real-time feeding control are performed to achieve contactless, automated, and high-precision backfat thickness measurement and dynamic feeding adjustment.
It enables high-frequency, stress-free automated body condition monitoring, improves the accuracy and robustness of backfat measurement, reduces system latency, and builds a true closed-loop precision feeding control system, thereby improving animal welfare and breeding management efficiency.
Smart Images

Figure CN120787833A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of intelligent agricultural equipment and precise livestock breeding technology, in particular to an intelligent feeding system and method integrating three-dimensional machine vision, edge computing and automatic control technology, and specifically to a closed-loop precise feeding system and method for pregnant sows. BACKGROUND
[0002] The body condition management of pregnant sows is a key link in modern livestock breeding, and the back fat thickness is directly related to the reproductive performance, litter size, lactation ability and service life of sows. Individualized and precise feeding is of great significance to ensure sow health, improve breeding efficiency and save feed costs. Therefore, an automatic and intelligent precise feeding system has become an important development direction in the field.
[0003] At present, the existing technical solutions mainly exist in the following categories: first, the traditional system based on electronic feeding station (ESF), which identifies individual identity through RFID and executes preset fixed feeding amount, but the adjustment of feeding strategy is heavily dependent on manual use of back fat meters for periodic and contact-type measurement, which has problems of high labor intensity, low measurement efficiency, easy to cause stress to sows and strong subjectivity of data, resulting in lagging body condition data update and inability to realize real precise control. Second, some improved solutions based on machine vision, such as the patent with publication number CN112379645A, which measures weight through a weighbridge and makes decisions in combination with an expert system, but weight is not the most direct indicator of sow energy reserves and reproductive condition, and the precision is limited; for example, the patent with application number CN202310965322 proposes a method based on 2D image processing technology to estimate pig weight, which is easily disturbed by complex lighting, shadows and animal posture in the breeding farm, and cannot obtain depth information, so the accuracy and robustness of the measurement result are insufficient. In addition, the automatic feeding station hardware represented by the patent with application number CN201721571918 realizes the basic automatic feeding function, but lacks real-time and automatic body condition sensing capability, and is essentially an open-loop execution system that requires human intervention.
[0004] Therefore, there is a core bottleneck in the existing technology: it is impossible to automatically, non-contact and high-precision obtain key body condition data (back fat thickness) of sows at the moment of feeding. This leads to significant lag and inaccuracy of the data on which the feeding decision is based, making it difficult to form an efficient "perception-decision-execution" closed loop for so-called "precise feeding", which restricts the further improvement of breeding management level. SUMMARY
[0005] The application aims to provide a 3D vision and edge computing based closed-loop precise feeding system and method for pregnant sows, realize non-contact, automatic and high-precision real-time measurement of the back fat thickness of sows, and effectively solve the problem of inaccurate decision-making caused by lagging body condition data in traditional feeding methods.
[0006] A 3D vision and edge computing based closed-loop precise feeding system for pregnant sows, comprising: An identity recognition module configured at the entrance of a feeding station, used for individual identity recognition of sows entering the feeding station; A 3D vision acquisition module configured above the feeding station, used for acquiring three-dimensional point cloud data of the back of sows in the station; An edge computing module in communication connection with the 3D vision acquisition module, used for receiving the three-dimensional point cloud data and running a back fat thickness measurement algorithm to obtain a current back fat thickness value in real time, wherein the back fat thickness measurement algorithm uses a point cloud processing network model based on a self-attention mechanism to perform end-to-end feature extraction and regression on preprocessed point clouds, and directly outputs a back fat thickness prediction value; A main controller in communication connection with the identity recognition module and the edge computing module, used for calling archive data of corresponding sows according to received sow identity information, and dynamically generating a precise feeding control instruction according to the received current back fat thickness value and the archive data; A discharging execution module in electrical connection with the main controller, used for executing the precise feeding control instruction to complete quantitative feeding.
[0007] Further, the point cloud processing network model based on the self-attention mechanism is a Point Transformer model.
[0008] Further, the deep learning prediction unit is configured to input the preprocessed sow back point cloud as a whole to the Point Transformer model, and directly regress and output a single floating point value representing the back fat thickness through forward propagation of the network.
[0009] Further, the edge computing module and the main controller interact data through a serial communication interface.
[0010] Further, the 3D vision acquisition module comprises at least one depth camera; when two depth cameras are included, they are respectively set as a top view angle and a side rear view angle, and data of the two angles are fused through a point cloud registration algorithm to generate a more complete three-dimensional model of sows.
[0011] The application also relates to a 3D vision and edge computing based closed-loop precise feeding method for pregnant sows, comprising the following steps: S1: Identify the sow entering the feeding station through the identity recognition module; S2: Collect the three-dimensional point cloud data of the sow's back after recognition through the 3D vision acquisition module; S3: The edge computing module receives the point cloud data and calculates the current backfat thickness value in real time through the point cloud-based backfat thickness measurement algorithm; S4: The main controller receives the current backfat thickness value, retrieves the archive data of the sow combined with its identity information, dynamically calculates the current feeding amount, and generates a control instruction; S5: The discharging execution module executes the precise feeding operation according to the control instruction.
[0012] Further, in the step S4, the model for dynamically calculating the current feeding amount is: current feeding amount = f (pregnancy age, real-time backfat thickness).
[0013] Further, the end-to-end feature extraction and regression in step S3 means that the network model automatically learns the three-dimensional features related to backfat thickness without the need for manual pre-definition or search for P2 point position.
[0014] A computer-readable storage medium having a computer program stored thereon, the program being executed by a processor to implement the steps of the method.
[0015] An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method when executing the program.
[0016] Compared with the prior art, the beneficial effects of the present application are: 1. High-frequency, stress-free automated body condition monitoring is achieved: The backfat measurement function is integrated into the automatic feeding station for sow daily feeding, and accurate measurement can be automatically completed at each feeding time without manual intervention. Compared with the traditional method of relying on manual handheld devices for weekly measurement, the present application improves the data collection frequency to the "meal level", significantly improving the timeliness and continuity of the data, and providing high-density data support for individualized fine management of sows.
[0017] 2. The accuracy and robustness of backfat measurement are improved: By using 3D depth vision technology to directly obtain three-dimensional point cloud data of the sow's back, the present application can directly measure the spatial geometric dimensions and output accurate physical values at the millimeter level, avoiding the problem of traditional 2D image methods being easily disturbed by factors such as light, shadow, and posture, and the measurement results are more objective, repeatable, and environmentally adaptable.
[0018] 3. Reduced system latency and network dependence, improved real-time performance and reliability: By deploying complex point cloud processing and deep learning algorithms on edge computing units (such as Jetson), local real-time processing of visual data is achieved, avoiding network latency and instability caused by uploading massive raw data to the cloud, ensuring efficient and stable operation of the system in weak network environment of pig farms, meeting the high real-time requirements of feeding process.
[0019] 4. A truly closed-loop precision feeding control system is built: Through high-speed communication between the edge computing unit and the main controller, a closed-loop control mechanism of "real-time sensing - immediate decision - precise execution" is realized, making the feeding amount dynamically adjustable according to the real-time backfat data of the meal, completely solving the fundamental problem of body condition data lagging behind feeding decisions in traditional solutions, and realizing the leap from stage-based extensive management to meal-level fine management.
[0020] 5. Improved animal welfare and breeding management efficiency: Through non-contact and automated measurement, the stress impact of manual operation on sows is significantly reduced, improving animal welfare; at the same time, the system structure is compact and highly integrated, enabling unmanned operation, suitable for modern large-scale pig farms, with high practicality and promotional value. BRIEF DESCRIPTION OF DRAWINGS
[0021] Figure 1 Overall assembly diagram for pregnant sow feeding station; Figure 2 Overall flowchart of closed-loop precision feeding; Figure 3 Final fused point cloud model. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions of the embodiments of the present disclosure will be described clearly and completely below in conjunction with the drawings of the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the described embodiments of the present disclosure, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present disclosure.
[0023] Embodiment: Implementation process of a pregnant sow closed-loop precision feeding method based on 3D vision and edge computing In this embodiment, the method is implemented based on the system hardware platform as shown in Figure 1 The system hardware platform mainly includes an identity recognition module, a 3D vision acquisition module, an edge computing module, a main controller, and a discharging execution module. The overall flow of the method is as shown in Figure 2 The method mainly includes the following steps: S1: Identify the sow entering the feeding station through the identity recognition module When the sow enters the feeding station, the RFID reader installed at the entrance automatically reads the electronic tag embedded in the sow's ear tag, obtaining its unique identity (ID). The main controller (such as STM32 series microcontroller) receives this identity information and confirms whether the sow has been registered in the system. If the identification is successful, the system enters the next step; if the identification fails, the system can issue a prompt signal and prohibit feeding.
[0024] S2: Collect the three-dimensional point cloud data of the sow's back after identification through the 3D vision acquisition module After successful identity recognition, the main controller sends a trigger signal to the 3D vision acquisition module. The depth camera (such as Intel RealSense D435 or Azure Kinect DK) installed directly above the feeding station is started, and the depth image and RGB image of the sow's back are collected.
[0025] S3: The edge computing module receives the point cloud data and calculates the current backfat thickness value in real time through the point cloud-based backfat thickness measurement algorithm; After receiving the depth image and RGB image, the Jetson uses the camera intrinsic parameters to convert the depth image into three-dimensional point cloud data, generating the original three-dimensional point cloud of the sow's back. The point cloud-based backfat measurement algorithm is executed, and the accurate backfat thickness value is returned to the STM32 through the UART serial port within seconds. Jetson is a series of embedded computing platforms launched by NVIDIA, which is an edge computing module, specifically designed for edge computing and artificial intelligence applications. The Jetson series module is equipped with a powerful GPU and CPU, which can handle complex computing tasks such as deep learning algorithms. The three-dimensional point cloud data is transmitted to the edge computing module (such as NVIDIA Jetson series embedded AI computing platform) through the USB or Ethernet interface. The backfat thickness measurement algorithm running on the edge computing module processes the point cloud data in real time, which specifically includes: S3.1, Point cloud data preprocessing This operation aims to generate clean, regular, and target sow point cloud that can be used for model analysis from the original data collected by the depth camera. It includes: a. Video analysis and point cloud generation, the system first synchronously analyzes the RGB image and depth image from the video stream recorded by the depth camera. Using the camera intrinsic parameters, each pixel point of the depth image is converted into a three-dimensional space coordinate, thereby generating the original point cloud data.
[0026] b. Combined denoising, to eliminate the noise interference of the complex environment of the pig farm, a set of combined filtering strategy is adopted. First, through the straight-through filter, most of the background outside the field of view is quickly removed; then the DBSCAN clustering segmentation algorithm based on density is used to effectively separate the point cloud cluster of the main sow from the surrounding scattered noise points (such as limit fence, ground stains); finally, through statistical filtering, the isolated outliers generated by measurement error are removed.
[0027] c. Point cloud simplification, to improve the running efficiency of the algorithm, the voxel downsampling method is adopted. By setting the size of the three-dimensional grid (voxel), the centroid of all points in each voxel is used to represent the voxel, thereby significantly reducing the data volume of the point cloud while preserving the key geometric features of the sow's back.
[0028] S3.2, dual-view point cloud fusion To solve the problem that the single overhead view may be blocked by the sow's upper facilities (such as the anti-jumping fence), resulting in incomplete back point cloud, a preferred embodiment of the present invention adopts a dual-camera (one overhead, one side rear view) scheme, and generates a more complete three-dimensional sow model through point cloud registration technology. The process includes: a. Coarse registration, using the Fast Point Feature Histogram (FPFH) and Random Sample Consensus (RANSAC) algorithm, the two-way point cloud is quickly aligned.
[0029] b. Fine registration, based on coarse registration, the Iterative Closest Point (ICP) algorithm is used for fine alignment, and finally a more complete and detailed sow point cloud model is generated, as shown in Figure 3
[0030] S3.3, end-to-end backfat prediction based on deep learning In this stage, the deep learning model replaces the traditional geometric feature analysis method, realizing end-to-end prediction from point cloud to backfat value, and its specific implementation includes the following aspects: a. Model architecture (Model Architecture) The embodiment adopts an advanced point cloud processing network model, specifically a Point Transformer model. The model adopts a hierarchical structure of encoder-decoder. The core is that a vector self-attention mechanism is introduced into the model, which can calculate the correlation weight between each point and all other points when the network processes the point cloud, thereby effectively capturing the global shape features and long-distance dependence of the sow's back. At the same time, the model can aggregate the local neighborhood information of the points layer by layer through multi-level feature extraction, thereby strengthening the perception ability of the local geometric details of the point cloud (such as the curvature and slope change of the key positions of the back). This architecture combining global context and local details overcomes the limitations of traditional methods that are difficult to balance both.
[0031] b. Prediction Principle and Output The working principle of the model is end-to-end regression prediction. The preprocessed sow back point cloud is input into the encoder of the Point Transformer network as a whole, and the network automatically learns and extracts a high-dimensional feature vector that can represent the core geometric information of the point cloud through self-attention layers and local aggregation layers. The feature vector is then sent to a regression head (usually composed of several fully connected layers), which finally directly outputs a single floating-point value, which is the predicted P2 point backfat thickness of the sow (unit: mm). The entire process is completely data-driven, without the need for manual pre-definition or algorithmic search for the location of the P2 point. The model automatically learns the three-dimensional spatial features most relevant to the backfat thickness during training, greatly improving the prediction accuracy and generalization ability for sows of different sizes. The predicted value is then sent to the main controller through the UART serial port.
[0032] c. Model Training Process In order to make the model have high-precision prediction ability, it needs to be supervised learning training, the process includes: Data collection and labeling: In the pig farm environment, a large number of sow back three-dimensional point cloud samples are collected, and high-precision equipment (such as veterinary B-ultrasound backfat instrument) is used to measure the real P2 point backfat thickness corresponding to each sample simultaneously, forming a "point cloud-label" data pair, and constructing a training data set.
[0033] Data augmentation: To improve the generalization ability and robustness of the model, data augmentation operations such as random rotation, small range translation, anisotropic scaling and adding Gaussian noise are performed on the input point cloud data before training to simulate various poses and noise disturbances that may occur in actual measurement.
[0034] Model training: The processed data is input into the network, and the mean squared error (MSE) is used as the loss function to calculate the difference between the model prediction value and the true label value. The gradient of the loss with respect to the network weights is calculated by the backpropagation algorithm, and the Adam optimizer is selected to update the network parameters for multiple rounds (Epoch) until the loss function value of the model on the independent validation set converges to a stable value.
[0035] Model deployment: After training, the optimized model weight file is solidified and deployed to the edge computing unit (Jetson) of the feeding station for fast real-time inference prediction in actual application.
[0036] S4: The main controller receives the current backfat thickness value and retrieves its archive data combined with the identity information of the sow, dynamically calculates the feeding amount and generates control instructions; The edge computing module sends the calculated backfat thickness value to the main controller through the serial communication interface (such as UART). The main controller retrieves its archive information (such as gestational age, historical body condition data, etc.) from the local or cloud database according to the received backfat data and the identity ID of the sow, and calculates the feeding amount according to the preset dynamic feeding model (for example: this feeding amount = f(gestational age, real-time backfat thickness)) to generate corresponding control instructions (such as motor rotation pulse number or valve opening time).
[0037] S5: The feeding execution module executes precise feeding operation according to the control instructions; The main controller sends control instructions to the feeding execution module to drive the step motor or servo motor to drive the feeding mechanism for quantitative feeding, and can also control the water valve to supply water simultaneously. After feeding is completed, the system records the feeding log (including time, sow ID, backfat thickness, feeding amount, etc.), and controls the exit door to open, and the system resets after the sow leaves, waiting for the next feeding task.
Claims
1. A closed-loop precision feeding system for pregnant sows based on 3D vision and edge computing, characterized by: include: The identification module is located at the entrance of the feeding station and is used to identify the individual sows entering the feeding station; A 3D vision acquisition module is configured above the feeding station and is used to collect three-dimensional point cloud data of the sow's back in the station; an edge computing module, communicatively connected to the 3D vision acquisition module, for receiving the three-dimensional point cloud data and running a backfat thickness measurement algorithm to calculate a current backfat thickness value in real time, wherein the backfat thickness measurement algorithm uses a point cloud processing network model based on a self-attention mechanism to perform end-to-end feature extraction and regression on the preprocessed point cloud and directly output a predicted backfat thickness value; a main controller, respectively communicating with the identity recognition module and the edge computing module, for retrieving the corresponding sow's archival data based on the received sow identity information, and dynamically generating precise feeding control instructions based on the received current backfat thickness value and the archival data; The feeding execution module is electrically connected to the main controller and is used to execute the precise feeding control instructions to complete quantitative feeding.
2. The system according to claim 1, wherein: The point cloud processing network model based on the self-attention mechanism is a Point Transformer model.
3. The system according to claim 2, characterized in that The deep learning prediction unit is configured to: input the preprocessed sow back point cloud as a whole into the Point Transformer model, and directly regress and output a single floating-point value representing the back fat thickness through the forward propagation of the network.
4. The system according to claim 1, wherein: The edge computing module and the main controller exchange data via a serial communication interface.
5. The system according to claim 1, wherein: The 3D vision acquisition module includes at least one depth camera; when two depth cameras are included, they are set to a top-down perspective and a side-rear perspective respectively, and the data from the two perspectives are fused through a point cloud registration algorithm to generate a more complete sow three-dimensional model.
6. A closed-loop precision feeding method for the system according to any one of claims 1 to 5, characterized in that: The following steps are involved: S1: Identify the sows entering the feeding station through the identification module; S2: Collect the identified 3D point cloud data of the sow’s back through the 3D vision acquisition module; S3: The edge computing module receives the point cloud data and calculates the current backfat thickness value in real time using a backfat thickness measurement algorithm based on the point cloud; S4: The main controller receives the current backfat thickness value, retrieves the sow's archival data in combination with the sow's identity information, dynamically calculates the current feeding amount, and generates a control instruction; S5: The feeding execution module performs precise feeding operations according to the control instructions.
7. The method according to claim 6, characterized in that In step S4, the model for dynamically calculating the current feeding amount is: current feeding amount = f (gestational age, real-time backfat thickness).
8. The method according to claim 6, characterized in that The end-to-end feature extraction and regression in step S3 means that the network model automatically learns the three-dimensional features related to backfat thickness without manually pre-defining or searching the position of point P2.
9. A computer-readable storage medium having a computer program stored thereon, wherein the program implements the steps of the method according to claim 6 or 8 when executed by a processor.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to claim 6 or 8 when executing the program.
Citation Information
Patent Citations
Drools rule engine-based internet-of-things management and control system and method for group-breeding sow feeding station
CN112379645A
Pig weight estimation method based on image processing
CN116703897A
A feeding station for breeding pig growth performance survey
CN207461130U
Method and system for automatically detecting backfat body and automatically feeding animals
CN110754426A
Pig feeding method, device and system for measuring fat thickness based on terahertz
CN114403023A
