Intelligent weight monitoring method, system and device for bred pigs and storage medium
Through the multi-dimensional data fusion and attention mechanism, combined with the hierarchical-increment hybrid prediction model and reinforcement learning algorithm, the problems of insufficient data fusion and low prediction accuracy in the existing breeding pig weight monitoring methods are solved, and high-precision weight prediction and intelligent linkage of feeding management is achieved.
Patent Information
- Application Number
- CN202510392359.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2045-03-31
AI Technical Summary
The existing weight monitoring methods for breeding pigs have problems such as insufficient data fusion, low prediction accuracy, and insufficient linkage with feeding management.
By establishing a multi-dimensional data fusion mechanism, the image feature data is deeply fused with the IoT sensor data, and dynamic weight adjustment of features is achieved in combination with the attention mechanism. The hierarchical-increment hybrid prediction model is used for body remodeling, and a feeding scheme is generated through reinforcement learning algorithms.
It significantly improves the accuracy of weight prediction, achieves seamless connection with feeding management, forms a complete intelligent breeding solution, improves the accuracy and efficiency of weight monitoring, and realizes the intelligence and precision of feeding management.
Smart Images

Figure CN119919242A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing, and in particular to a method, system, device and storage medium for intelligent weight monitoring of farmed pigs. Background Art
[0002] At present, a variety of measurement methods have been developed in the field of pig weight monitoring. Traditional weight monitoring methods mainly rely on manual weighing, which requires pigs to be driven into weighing cages for measurement. This method is not only time-consuming and labor-intensive, but also easily causes stress reactions in pigs, affecting their growth and development. With the development of computer vision technology, a weight estimation method based on image processing has emerged. By collecting image information of pigs and extracting body feature parameters, weight prediction is performed. At the same time, the application of Internet of Things technology in the field of breeding is also becoming increasingly widespread. Various sensors are used to collect pig behavior data and environmental parameters, providing more data support for weight monitoring.
[0003] However, existing weight monitoring methods still have some obvious shortcomings. First, a single image feature or behavioral data is difficult to accurately reflect the actual weight of the pigs, and the prediction accuracy is limited. Secondly, existing methods generally lack targeted analysis of different growth stages and fail to fully consider the differences in growth and development patterns. Furthermore, in the data processing process, the ability to identify and process abnormal data is insufficient, and it is easily affected by environmental factors and equipment failures. In addition, existing methods often regard weight monitoring as an independent link, fail to form an effective linkage with feeding management, and it is difficult to adjust feeding strategies in a timely manner based on monitoring results. Summary of the invention
[0004] The present application provides a method, system, device and storage medium for intelligent weight monitoring of farmed pigs, which is used to solve the technical problems of insufficient data fusion and low prediction accuracy in existing methods for monitoring the weight of farmed pigs. By establishing a multi-dimensional data fusion mechanism, the image feature data and IoT sensor data are deeply integrated, and the dynamic weight adjustment of the features is realized by combining the attention mechanism, which significantly improves the accuracy of weight prediction and realizes seamless connection with feeding management.
[0005] In a first aspect, the present application provides a method for intelligent weight monitoring of farmed pigs, the method comprising: performing image acquisition and processing on farmed pigs through a multi-angle stereoscopic image acquisition network to obtain an original image data set including a top view, a side view and a 45-degree angle view; performing image enhancement and noise reduction processing according to the original image data set through an adaptive histogram equalization algorithm and an improved Gaussian filter, and performing target segmentation processing in combination with a background separation algorithm based on regional growth to obtain normalized image data; performing feature extraction based on the normalized image data through a contour-skeleton dual feature extraction algorithm, and performing key point positioning based on curvature analysis A skeleton framework is constructed to obtain feature vector data containing body shape parameters; the feature vector data and the behavior data collected by the Internet of Things sensor are subjected to multi-source data fusion processing through a deep learning behavior pattern recognition algorithm, and anomalies are corrected through a spatiotemporal data cleaning algorithm to obtain a fused feature data set; based on the fused feature data set, weight modeling is performed through a hierarchical-incremental hybrid prediction model, and weight optimization is performed in combination with a feature importance adaptive adjustment algorithm based on an attention mechanism to obtain a weight prediction result; based on the weight prediction result, a feeding plan is generated through a reinforcement learning algorithm, and growth status analysis is performed in combination with a group abnormality warning mechanism to obtain a target feeding management strategy.
[0006] In a second aspect, the present application provides a weight intelligent monitoring system for farmed pigs, the weight intelligent monitoring system for farmed pigs comprising: An acquisition module is used to perform image acquisition and processing on farmed pigs through a multi-angle stereo image acquisition network to obtain an original image data set including a top view, a side view, and a 45-degree angle view; A denoising module is used to perform image enhancement and denoising processing according to the original image data set through an adaptive histogram equalization algorithm and an improved Gaussian filter, and perform target segmentation processing in combination with a background separation algorithm based on region growing to obtain normalized image data; An extraction module is used to extract features based on the normalized image data through a contour-skeleton dual feature extraction algorithm, and to construct a skeleton framework in combination with key point positioning based on curvature analysis to obtain feature vector data containing body shape parameters; A fusion module is used to perform multi-source data fusion processing on the feature vector data and the behavior data collected by the IoT sensor through a deep learning behavior pattern recognition algorithm, and perform anomaly correction through a spatiotemporal-related data cleaning algorithm to obtain a fused feature data set; A modeling module, used to perform weight modeling based on the fused feature data set through a hierarchical-incremental hybrid prediction model, and to optimize weights by combining a feature importance adaptive adjustment algorithm based on an attention mechanism to obtain a weight prediction result; A generation module is used to generate a feeding plan based on the weight prediction result through a reinforcement learning algorithm, analyze the growth status in combination with a group abnormality warning mechanism, and obtain a target feeding management strategy.
[0007] The third aspect of the present application provides an intelligent weight monitoring device for farmed pigs, wherein the memory stores machine-readable instructions executable by the processor. When the intelligent weight monitoring device for farmed pigs is running, the processor communicates with the memory via a bus, and when the machine-readable instructions are executed by the processor, the steps of the above-mentioned intelligent weight monitoring method for farmed pigs are performed.
[0008] A fourth aspect of the present application provides a computer-readable storage medium, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the above-mentioned intelligent weight monitoring method for farmed pigs.
[0009] In the technical solution provided by the present application, an original image data set including a top view, a side view and a 45-degree angle view is obtained through a multi-angle stereo image acquisition network, which effectively avoids the information loss caused by a single perspective and improves the integrity and reliability of data acquisition. Image enhancement and noise reduction processing are performed through an adaptive histogram equalization algorithm and an improved Gaussian filter, and target segmentation processing is performed in combination with a background separation algorithm based on regional growth, which can effectively improve image quality and accurately separate target areas, laying the foundation for subsequent feature extraction. At the same time, a contour-skeleton dual feature extraction algorithm is used for feature extraction, and a skeleton framework is constructed in combination with key point positioning based on curvature analysis, thereby realizing the accurate extraction and quantitative expression of the body shape characteristics of farmed pigs. By converting the feature vector The data is combined with the behavioral data collected by the IoT sensors for multi-source data fusion processing, and anomalies are corrected through a data cleaning algorithm with spatiotemporal correlation, which significantly improves the accuracy and reliability of the data. Weight modeling is performed based on the hierarchical-incremental hybrid prediction model, and weight optimization is performed based on the feature importance adaptive adjustment algorithm based on the attention mechanism. This not only improves the accuracy of the prediction model, but also realizes targeted modeling for different growth stages. Finally, the feeding plan is generated through the reinforcement learning algorithm, and the growth status is analyzed in combination with the group abnormality warning mechanism, which realizes the effective connection between monitoring results and feeding management, forming a complete intelligent breeding solution, which not only significantly improves the accuracy and efficiency of weight monitoring, but also realizes the intelligence and precision of feeding management. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0011] Figure 1 This is a schematic diagram of an embodiment of a method for intelligently monitoring the weight of pigs in an embodiment of the present application; Figure 2 This is a schematic diagram of an embodiment of an intelligent weight monitoring system for pig farming in an embodiment of the present application; Figure 3 This is a schematic diagram of the structure of an intelligent weight monitoring device for farmed pigs in an embodiment of the present application. DETAILED DESCRIPTION
[0012] The embodiments of the present application provide a method, system, device and storage medium for intelligent weight monitoring of farmed pigs. The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described here can be implemented in an order other than that illustrated or described here. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0013] For ease of understanding, the specific process of the embodiment of the present application is described below. Figure 1 , an embodiment of the intelligent weight monitoring method for breeding pigs in the embodiment of the present application includes: Step S101, performing image acquisition and processing on farmed pigs through a multi-angle stereoscopic image acquisition network to obtain an original image data set including a top view, a side view and a 45-degree angle view; Step S102: performing image enhancement and noise reduction processing according to the original image data set through an adaptive histogram equalization algorithm and an improved Gaussian filter, and performing target segmentation processing in combination with a background separation algorithm based on region growing, to obtain normalized image data; Step S103, extracting features through the contour-skeleton dual feature extraction algorithm based on the normalized image data, and constructing a skeleton framework in combination with key point positioning based on curvature analysis to obtain feature vector data containing body shape parameters; Step S104: perform multi-source data fusion processing on the feature vector data and the behavior data collected by the IoT sensor through a deep learning behavior pattern recognition algorithm, perform anomaly correction through a spatiotemporal-related data cleaning algorithm, and obtain a fused feature data set; Step S105: Based on the fused feature data set, weight modeling is performed through a hierarchical-incremental hybrid prediction model, and weight optimization is performed in combination with a feature importance adaptive adjustment algorithm based on an attention mechanism to obtain a weight prediction result; Step S106: Based on the weight prediction result, a feeding plan is generated through a reinforcement learning algorithm, and growth status analysis is performed in combination with a group abnormality warning mechanism to obtain a target feeding management strategy.
[0014] It is understandable that the execution subject of the present application can be a weight intelligent monitoring system for pig farming, or a terminal or a server, which is not limited here. The present application embodiment is described by taking the server as the execution subject as an example.
[0015] Specifically, the image acquisition and processing of farmed pigs is carried out through a multi-angle stereo image acquisition network. The network arranges multiple high-definition cameras in the farm for synchronous shooting. To ensure the image quality, the system is equipped with an infrared sensor, which automatically switches to infrared imaging mode when the light is insufficient. During the image acquisition process, when the pig is detected to enter the designated area, the depth sensor obtains the precise distance information between the pig and the camera for image correction. In addition, the camera adopts adaptive focusing technology to automatically adjust the focal length and exposure parameters according to the ambient light intensity, and synchronously acquires the top view, side view and 45-degree angle view to form the original image data set. When processing the acquired original image data set, the adaptive histogram equalization algorithm is first used to enhance the image. The algorithm redistributes the grayscale value of the original image by calculating the image grayscale distribution histogram, so that the image contrast is improved. Subsequently, the improved Gaussian filter is used for noise reduction processing, which effectively removes noise points while retaining the edge details of the image. In the target segmentation stage, the background separation algorithm based on region growth is used to accurately extract the target pig from the background. The algorithm first selects seed points in the target area, and then gradually expands the area according to the similarity of pixel gray values to obtain the complete target contour and form normalized image data.
[0016] Based on the normalized image data, the contour-skeleton dual feature extraction algorithm is used for feature extraction. The algorithm first extracts the outer contour curve of the target, and then obtains the central axis information of the target through skeleton processing. On this basis, combined with the key point positioning technology based on curvature analysis, the feature points such as ear root, acromion, and buttocks are accurately located. By calculating the distance and angle relationship between these feature points, the skeletal frame model of the pig is constructed, and the body parameters such as body length, body height, and body width are obtained to form feature vector data. When the feature vector data is fused with the behavioral data collected by the IoT sensor, the behaviors such as eating, drinking, and exercise are first identified and classified by the deep learning behavior pattern recognition algorithm. The algorithm identifies the characteristics of different behavior patterns by analyzing the time series characteristics of the sensor data. Then, the data is detected and corrected for outliers through the spatiotemporal data cleaning algorithm. The algorithm identifies and corrects abnormal data points by analyzing the temporal continuity and spatial correlation of the data, ensures the accuracy and reliability of the data, and generates a fused feature data set.
[0017] Based on the fusion feature data set, the hierarchical-incremental hybrid prediction model is used for weight modeling. The model first stratifies the data according to the growth stage and establishes sub-models for different stages. The weights of each feature are dynamically adjusted through the feature importance adaptive adjustment algorithm based on the attention mechanism. The algorithm optimizes the feature weights by calculating the correlation and importance scores between features. At the same time, it adopts an incremental learning strategy to continuously absorb new data samples, continuously optimize the prediction performance, and obtain the weight prediction results. According to the weight prediction results, a feeding plan is generated through a reinforcement learning algorithm. The algorithm formulates personalized feeding strategies by analyzing factors such as growth curves and nutritional requirements. At the same time, combined with the group abnormality warning mechanism, by analyzing the discrete degree of the group growth curve, abnormal growth individuals are discovered in time. For example, in a breeding batch, when it is found that the growth rate of a certain pig is significantly lower than the average level of the group, the system will analyze its behavioral data such as feed intake and activity, and combine the changing trend of body shape characteristics to determine the cause of the abnormality. If it is found that the feed intake is insufficient, the system will adjust the feed formula and feeding strategy accordingly; if it is found that the activity is abnormal, it will focus on its health status. In this way, a scientific and reasonable target feeding management strategy is formed.
[0018] For example, in a farm, when a batch of newborn piglets enter the fattening stage, the system first obtains the body shape data of the pigs through multi-angle image acquisition. Through image processing and feature extraction, the body shape parameters of each pig are obtained. At the same time, the IoT sensor records the feeding, drinking and activity data of each pig. The system integrates and analyzes these data to monitor the growth status of each pig in real time. When the system detects that the feed intake of a certain pig suddenly decreases and the activity increases, and combined with image analysis, it finds that its weight gain rate is lower than expected, and immediately issues an early warning. The system analysis found that this anomaly was related to the recent temperature changes, and then adjusted the feeding environment parameters and optimized the feed formula, successfully helping the pig to return to normal growth. This precise monitoring and management method significantly improves the breeding efficiency and reflects the practical value of this solution.
[0019] In the embodiment of the present application, the original image data set including the top view, the side view and the 45-degree angle view is obtained through the multi-angle stereo image acquisition network, which effectively avoids the information loss caused by a single perspective and improves the integrity and reliability of data acquisition. The image enhancement and noise reduction processing are performed by the adaptive histogram equalization algorithm and the improved Gaussian filter, and the target segmentation processing is performed in combination with the background separation algorithm based on regional growth, which can effectively improve the image quality and accurately separate the target area, laying the foundation for subsequent feature extraction. At the same time, the contour-skeleton dual feature extraction algorithm is used for feature extraction, and the skeleton framework is constructed in combination with the key point positioning based on curvature analysis, so as to realize the accurate extraction and quantitative expression of the body shape characteristics of farmed pigs. By combining the feature vector data Multi-source data fusion processing is carried out with the behavioral data collected by the IoT sensors, and anomalies are corrected through a data cleaning algorithm with spatiotemporal correlation, which significantly improves the accuracy and reliability of the data. Weight modeling is performed based on the hierarchical-incremental hybrid prediction model, and weight optimization is performed based on the feature importance adaptive adjustment algorithm based on the attention mechanism. This not only improves the accuracy of the prediction model, but also realizes targeted modeling for different growth stages. Finally, feeding plans are generated through a reinforcement learning algorithm, and growth status analysis is performed in combination with a group abnormality warning mechanism, which realizes the effective connection between monitoring results and feeding management, forming a complete intelligent breeding solution, which not only significantly improves the accuracy and efficiency of weight monitoring, but also realizes the intelligence and precision of feeding management.
[0020] In a specific embodiment, the process of executing step S101 may specifically include the following steps: (1) Obtain light intensity and distance data through environmental parameter measurement, perform three-dimensional spatial positioning of the breeding area, and obtain basic scene data; (2) Calculate the acquisition parameters based on the basic scene data, dynamically adjust the device parameters, and obtain the optimized acquisition settings; (3) Input the optimized acquisition settings into the image acquisition system, scan the target area at multiple angles, and obtain the original scanning data; (4) Perform time synchronization processing on the original scan data, and perform coordinate correction based on the spatial position information to obtain time-space registration data; (5) Performing view classification processing based on the spatiotemporal registration data, performing projection transformation on data of different viewpoints, and obtaining a multi-view sequence; (6) The multi-view sequences are integrated and processed according to the temporal relationship, and the original image dataset containing the top view, side view and 45-degree angle view is obtained by data merging.
[0021] Specifically, environmental information of the farm is obtained through environmental parameter measurement. The ambient light sensor captures the light intensity value of the breeding area and records the changes in light intensity at different times. The depth sensor measures the distance data of each point in the space by emitting infrared light and receiving the return signal. These data together construct the three-dimensional spatial coordinate system of the breeding area. After spatial registration, the point cloud data obtained by the depth sensor forms complete three-dimensional scene information. Each spatial point contains position coordinates and environmental parameter information, thereby obtaining the basic data of the scene. When calculating the acquisition parameters based on the basic data of the scene, the time distribution characteristics of the light intensity data are first analyzed to calculate the average light level and fluctuation range of different areas. For areas with insufficient light, the infrared fill light module will automatically adjust the fill light intensity; for areas with too strong light, the exposure parameters of the camera are adjusted to compensate. At the same time, the distance between the camera and the target is calculated based on the depth data, and the focal length parameters are dynamically adjusted to ensure image clarity. These adjusted parameter combinations form optimized acquisition settings.
[0022] After the optimized acquisition settings are input into the image acquisition system, the breeding area is scanned from multiple angles. Multiple cameras perform collaborative acquisition of the target area according to the preset scanning path. During the scanning process, each camera automatically adjusts the acquisition parameters according to the optimized acquisition settings to ensure that clear images can be obtained under different lighting conditions and shooting angles. The scanned image data contains information such as shooting time, spatial position, and acquisition parameters, forming the original scan data. When the original scan data is processed in time synchronization, the timestamp information of each image is first extracted, and the images from different cameras are arranged in time series. Since there are slight differences in the acquisition time of multiple cameras, time alignment processing is required. The images at asynchronous moments are processed by interpolation algorithms to ensure that the images of all perspectives correspond to the same time point. At the same time, combined with the spatial position information, the image is converted and corrected in the coordinate system to eliminate the distortion caused by the difference in camera installation position and angle, and obtain the spatiotemporal registration data.
[0023] When performing view classification processing based on spatiotemporal registration data, the image data is first divided into top view, side view, and 45-degree view according to the camera’s installation position and shooting angle. Figure 3 For each type of image, geometric correction is performed through the projection transformation algorithm to unify the images taken at different perspectives into a standard perspective. In this process, depth information is used to assist in the calculation of projection transformation parameters to ensure that the geometric relationship of the transformed images is accurate and form a standardized multi-perspective sequence. When integrating the multi-perspective sequence according to the temporal relationship, a time index is first established to combine images from different perspectives at the same time. For each image group at each time point, a quality assessment is performed and the image with the best image quality is selected as the representative image of the perspective. Finally, the selected top view, side view and 45-degree angle view are combined to form a complete original image data set. In the process of weight monitoring of pigs, when a pig enters the monitoring area, the ambient light sensor detects the light intensity of the area, and the depth sensor simultaneously obtains the spatial distance information. Based on these environmental parameters, the camera automatically adjusts the exposure time and focal length. Multiple cameras simultaneously shoot the pig to generate a series of original images. After time synchronization processing, these images ensure that the top view, side view and 45-degree angle view completely correspond to the same moment. Through projection transformation, images taken at different angles are converted to a standard perspective to generate a complete set of multi-perspective image data.
[0024] In a specific embodiment, the process of executing step S102 may specifically include the following steps: (1) Perform grayscale value statistical analysis on the original image data set, construct a grayscale distribution histogram, and obtain grayscale distribution feature data; (2) Calculate the image brightness threshold range based on the grayscale distribution feature data, perform interval mapping on the pixel values, and obtain brightness balance data; (3) The brightness equalization data is weighted according to the pixel neighborhood relationship, and the image noise is processed by weighted average to obtain the noise reduction processing data; (4) Detect the edge area of the denoised data, determine the growth seed points of the target area, and obtain the initial segmentation data; (5) Expand the initial segmentation data according to pixel similarity, dynamically update the target boundary, and obtain the target contour data; (6) The target contour data is separated from the background and foreground, and the edge is smoothed to obtain the normalized image data.
[0025] Specifically, grayscale value statistical analysis is performed on these images. Grayscale value statistical analysis is to convert color images into grayscale images, calculate the number of pixels at each grayscale level, and construct a grayscale distribution histogram. In the grayscale conversion process, the weighted average method is used to convert the values of the three RGB channels into a single grayscale value, and the frequency of occurrence of pixels at each grayscale level is recorded to form grayscale distribution feature data. According to the grayscale distribution feature data, the brightness threshold range of the image is calculated. By analyzing the distribution characteristics of the grayscale histogram, the maximum grayscale value, minimum grayscale value and peak position of the image are determined, and a brightness mapping relationship is established. For areas with uneven brightness distribution, a piecewise linear mapping method is used to map the original grayscale value to a new grayscale range, so that the brightness distribution of the image is more balanced. This process maintains the overall contrast of the image while improving the visibility of details, forming brightness balance data.
[0026] When performing noise reduction processing on brightness equalization data, the neighborhood relationship of pixels is first defined. For each pixel point, the 8 neighborhood pixels around it are selected, the grayscale difference between the central pixel and the neighborhood pixels is calculated, and the weight value is assigned according to the degree of difference. The weight value decreases as the grayscale difference increases, ensuring that pixels with similar grayscale values have greater influence. By weighted averaging the neighborhood pixels, new pixel values are obtained, which effectively suppresses random noise, retains the edge features of the image, and forms noise reduction processing data. Edge area detection is performed on the noise-reduced data, mainly to identify the significant change areas in the image. The position and intensity of the edge are determined by calculating the gradient information of the image, including the grayscale change rate in the horizontal and vertical directions. On the basis of edge detection, the areas with stable and representative grayscale changes in the image are selected as seed points. These seed points will be used as the starting position for subsequent region growth, thereby obtaining the initial segmentation data.
[0027] Expanding the region of the initial segmented data according to pixel similarity is a key step achieved through the region growing algorithm. Starting from the selected seed point, check the grayscale values of its adjacent pixels. When the grayscale difference between the adjacent pixels and the current region is less than the preset threshold, merge them into the current region. As the region continues to expand, the target boundary is gradually formed. During the expansion process, the statistical characteristics of the region, including the average grayscale value and standard deviation, are dynamically updated to ensure the accuracy of the boundary and obtain the target contour data. When separating the background and foreground of the target contour data, the contour tracking algorithm is used to extract the complete boundary of the target. The extracted boundary is smoothed to remove small mutations caused by noise and region growing process, making the boundary smoother and more continuous. The pixels in the target area are marked as foreground through the filling algorithm, and the remaining areas are marked as background. The foreground and background separation is completed to obtain the normalized image data.
[0028] For example, when monitoring the weight of pigs in a farm, after obtaining a set of original images including top view, side view and 45-degree angle view, the grayscale value conversion is performed first. By analyzing the grayscale distribution of each perspective image, it is found that due to uneven lighting, the abdominal area of the pig in the side view is darker, while the back area is brighter. After brightness equalization processing, the brightness distribution of the image is more reasonable, and the detail information of the abdominal area is enhanced. In the process of denoising, the scattered noise caused by the pig house environment is focused on, and the clarity of the pig outline is effectively retained through neighborhood weighted averaging. During edge detection, seed points are selected at the boundary between the pig and the ground, and gradually expanded through regional growth to accurately extract the complete outline of the pig. Finally, the outline is smoothed to obtain a clear and accurate pig image segmentation result, which provides a reliable image basis for subsequent feature extraction and weight estimation.
[0029] In a specific embodiment, the process of executing step S103 may specifically include the following steps: (1) Extract boundary points from the normalized image data, calculate the gradient change value between adjacent points, and obtain the target contour point set; (2) Interpolate and connect the target contour point set according to the spatial distribution, smooth the contour curve, and obtain continuous contour data; (3) Perform distance transformation calculation on the continuous contour data to determine the center line position of the target area and obtain the skeleton initial point set; (4) The skeleton initial point set is branched according to the topological structure, and the branch nodes are trimmed and merged to obtain the trunk skeleton data; (5) Calculate the local curvature based on the backbone skeleton data, extract features from the extreme points of curvature, and obtain key feature point data; (6) Map the key feature point data to a spatial position, locate and annotate the ear root point, acromion point, and hip point, and obtain the annotated position data; (7) Measure the distance of the marked position data, calculate the Euclidean distance between adjacent feature points, and obtain the body length parameter data; (8) Vertically project the body length parameter data and the trunk skeleton data, calculate the body height value, and obtain the body height parameter data; (9) Scan the continuous contour data horizontally at the marked position data, calculate the target width value, and obtain the body width parameter data; (10) The body length parameter data, body height parameter data and body width parameter data are combined and sorted to generate feature vector data containing body shape parameters.
[0030] Specifically, the Sobel operator is used to calculate the image gradient, and the gradient value of each pixel is obtained by performing convolution operations in the horizontal and vertical directions. In the process of boundary point extraction, the gradient threshold is set to 1.5 times the average gradient of the image. When the gradient value of the pixel point is higher than the threshold, it is marked as a boundary candidate point. The gradient change value between adjacent boundary candidate points is calculated to generate a target contour point set, thereby accurately describing the outline of the farmed pig. After obtaining the target contour point set, in order to obtain a continuous and smooth contour curve, the cubic spline interpolation method is used to connect the discrete contour points. During the interpolation process, according to the spatial distribution characteristics of the contour points, the density of the interpolation nodes is adaptively adjusted to ensure that the interpolation points are denser in the area with larger curvature, so as to more accurately describe the detailed characteristics of the body shape of the farmed pig. The Gaussian smoothing algorithm is applied to the contour curve generated by interpolation to eliminate the local fluctuations introduced by interpolation and obtain continuous and smooth contour data.
[0031] When performing distance transformation calculation on continuous contour data, the Euclidean distance transformation algorithm is used to calculate the distance from each pixel point inside the contour to the nearest boundary point. By finding the local maximum point in the distance transformation graph, the center line position of the target area is determined, thereby obtaining the skeleton initial point set, laying the foundation for the subsequent skeleton framework construction. After obtaining the skeleton initial point set, branch judgment and pruning and merging are performed based on topological structure analysis, and its mathematical model is expressed as: ; in, represents the connection strength between branch points p and q, is the branch direction weight coefficient, For Node The distance value of is the attenuation coefficient, The path length, n is the number of associated nodes.
[0032] When calculating the local curvature of the backbone skeleton data, the following formula is used: ; in, is the curvature value, X(t) and Y(t) are the skeleton curve parameter equations, , is the first-order derivative, X''(t), Y''(t) are the second-order derivatives, is the smoothing factor.
[0033] When calculating the body height, the following projection model is established: ; in, is the estimated value of body height, is the skeleton curve equation, is the distance weight function, is the projection angle, a and b are the boundaries of the integration interval.
[0034] After obtaining the key feature point data, spatial position mapping is performed to accurately locate the positions of the ear root point, acromion point and hip point. During the positioning process, the feature point positioning rule library is established by combining anatomical features and image features, and the target point position is determined by matching the feature template with the highest similarity. The Euclidean distance of the marked position points is calculated to obtain the body length parameter data. At the same time, the body length data and the trunk skeleton data are vertically projected to obtain the body height parameter. When performing a horizontal scan to calculate the body width, the marked position points are used as the reference, and the scan is performed in a direction perpendicular to the trunk skeleton, and the target width value is determined by boundary detection. Finally, the parameters such as body length, height, and width are standardized and combined to form feature vector data.
[0035] For example, about 2,000 discrete contour points are obtained through boundary point extraction, and continuous contour curves are formed through interpolation and smoothing. The initial skeleton point set generated by distance transformation calculation contains about 200 nodes, and 85 key nodes on the trunk skeleton are retained after branch pruning. Three groups of feature points, namely the ear root point, acromion point and hip point, are accurately located through curvature analysis, and the body length parameters are calculated. The body height data is obtained by combining vertical projection calculation, and the body width parameters are measured by horizontal scanning. These parameters are sorted in a standard format to generate a feature vector.
[0036] In a specific embodiment, the process of executing step S104 may specifically include the following steps: (1) Time series marking of feature vector data, arranging the body shape parameters at different time points in chronological order, and obtaining time series feature data; (2) Establish a time window based on the time series characteristic data, perform data continuity test within the window, and obtain sequence integrity data; (3) Time-align the sequence integrity data with the behavioral data collected by the IoT sensors, determine the data collection time node, and obtain aligned time series data; (4) Classify the behavior types of aligned time series data, and combine multidimensional features through food intake, water intake, and activity intensity to obtain behavioral characteristic data; (5) Segment the behavior feature data according to the temporal and spatial correlation, identify the mutation points within the data segment, and obtain abnormal labeled data; (6) Perform statistical analysis on the abnormally marked data, calculate the mean and standard deviation within the data segment, and obtain statistical feature data; (7) Establish a threshold interval based on the statistical feature data, correct the data points that exceed the threshold, and obtain smoothed data; (8) Perform correlation analysis on the smoothed data and the behavioral feature data, establish a correlation matrix between the features, and obtain correlation data; (9) Combine the features of the correlation data, merge the highly correlated features, and obtain the reduced-dimensional feature data; (10) Integrate the dimension-reduced feature data with the time series feature data and reorganize them according to the time dimension to obtain a fused feature data set.
[0037] Specifically, a timestamp is added to each body parameter. The timestamp includes year, month, day, hour, minute, and second, accurate to the second level, to ensure the time sequence of the data. The body parameters with timestamps are arranged in chronological order to form ordered time series feature data, laying the foundation for subsequent data analysis. Establishing a time window is an important means of analyzing continuous data. The size of the time window is set according to the frequency of data collection, usually set to 24 hours, and the data is checked for continuity within the window. The continuity check includes data integrity check and time interval consistency check. The data integrity check is used to identify data missing points, and the time interval consistency check is used to ensure the stability of the sampling interval and generate sequence integrity data.
[0038] The sequence integrity data needs to be time-aligned with the behavioral data collected by the IoT sensors. IoT sensors include feed intake sensors, water intake sensors, and activity intensity sensors. During the time alignment process, the data from different sources are matched according to the collection time nodes based on the timestamp to ensure the time consistency of the data and form aligned time series data. When the aligned time series data is divided into behavioral types, the feed intake data is first analyzed, including the single feed intake and daily feeding frequency. The water intake data records the single water intake and the interval between water intake. The activity intensity data records the movement amplitude and duration through the motion sensor. These behavioral indicators are combined with multi-dimensional features to construct behavioral feature data to fully reflect the behavioral status of farmed pigs.
[0039] When segmenting behavioral feature data according to spatiotemporal correlation, the continuity and spatial position relationship of the behavior need to be considered. The data is segmented by sliding using the sliding window algorithm, and the window size is dynamically adjusted according to the duration of the behavior. In each data segment, the Z-score method is used to identify the numerical mutation points, mark the mutation points, and generate abnormal labeled data. The marked abnormal data is statistically analyzed to calculate the statistical characteristics such as the mean, standard deviation, skewness, and kurtosis in each data segment. These statistical indicators reflect the distribution characteristics and change patterns of the data and form statistical feature data. Based on the statistical feature data, the 3σ criterion is used to establish a reasonable threshold interval for the data. For data points that exceed the threshold interval, the moving average method is used to correct them to obtain smoothed data.
[0040] When the smoothing data is associated with the behavioral feature data, the Pearson correlation coefficient is used to calculate the correlation between the features. The correlation coefficient is organized into a matrix form, and each element in the matrix represents the correlation strength between the two features to form correlation data. When the correlation data is combined, the features with correlation coefficients higher than the threshold are merged. The merging process uses the principal component analysis method to retain the main feature information, reduce the data dimension, and generate reduced-dimensional feature data. Finally, the reduced-dimensional feature data and the time series feature data are reorganized according to the time dimension. The temporal sequence of the data is maintained during the reorganization process, and the multi-dimensional feature information is integrated to form a fused feature data set. The fused data set contains both time series features and reduced-dimensional behavioral features, providing complete data support for subsequent weight prediction.
[0041] For example, first obtain the body parameters of the pig, such as body length, height, and width, and add an accurate timestamp to the data. Perform a data continuity test with a 24-hour time window, and find that the data is missing due to equipment maintenance, and fill in the missing values through linear interpolation. Align the complete body data with the behavioral data collected during the same period, including the pig's feed intake data (recording the time and amount of each feed intake), water intake data (recording the time and amount of water intake), and activity intensity data (recording the movement status and intensity value). Combine the behavioral data with multi-dimensional features to construct a behavioral feature vector. Slide segment the data to identify abnormal feeding records caused by feeding equipment failure and mark them as abnormal points. Calculate the statistical characteristics of the data segment, establish a reasonable threshold interval, and correct the abnormal feeding data. Through correlation analysis, it is found that there is a strong correlation between feed intake and activity intensity, and these two features are merged and reduced in dimension. All features are reorganized according to the time dimension to form a complete feature data set.
[0042] In a specific embodiment, the process of executing step S105 may specifically include the following steps: (1) Divide the fused feature data set into growth stages, perform stratified processing on the data according to the time span, and obtain stratified feature data; (2) Calculate the statistical distribution characteristics of each layer of data based on the hierarchical characteristic data, normalize the data, and obtain standardized hierarchical data; (3) Perform feature mapping on the standardized hierarchical data according to the input dimension, quantify the correlation strength between features, and obtain feature weight data; (4) Calculate the attention score for the feature weight data, dynamically adjust the weight based on the feature importance score, and obtain the attention distribution data; (5) Perform a weighted combination of the attention distribution data and the standardized hierarchical data, redistribute the feature contribution, and obtain weighted feature data; (6) Establish a prediction parameter matrix based on the weighted feature data, perform reverse propagation on the historical prediction error, and obtain error correction data; (7) Incrementally update the error correction data, extract and integrate the features of the newly added data samples, and obtain updated feature data; (8) Performing prediction calculations on the updated feature data to generate weight value estimation results and obtain a predicted value sequence; (9) Compare and verify the predicted value sequence with the measured weight data, calculate the prediction error range, and obtain error statistics; (10) Conduct credibility assessment on the error statistics, determine the predicted value through confidence interval analysis, and obtain the weight prediction result.
[0043] Specifically, when dividing the growth stage of the fused feature data set, the growth period is divided into five stages according to the physiological characteristics of pigs: piglet period (0-30 days), nursery period (31-70 days), early growth period (71-110 days), mid-growth period (111-150 days) and fattening period (more than 151 days). The data is layered according to the time span of different growth stages to form layered feature data. Each layer contains the body parameters, behavioral characteristics and environmental factor data of that stage. The layered feature data is statistically distributed, including indicators such as the mean, standard deviation, skewness and kurtosis of each layer of data. The feature data of each layer is normalized, and the maximum and minimum normalization method is used to map the data to the [0, 1] interval to obtain standardized hierarchical data. Standardization ensures the comparability between features of different dimensions.
[0044] When performing feature mapping on the standardized hierarchical data, a feature space mapping matrix is constructed to calculate the correlation strength between features. The correlation strength is quantified by the mutual information and the Pearson correlation coefficient to generate feature weight data. The following formula is used to calculate the attention score of the feature weight data: ; in, represents the attention score between features r and c, is the attention weight coefficient, and are the vector representations of features r and c respectively, is the Gaussian kernel parameter, is the feature importance score, and n is the feature dimension.
[0045] The standardized hierarchical data is weighted and combined according to the attention distribution data, and the contribution of the features is redistributed to obtain weighted feature data. After the prediction parameter matrix is established, the historical prediction error is reversed, and the model parameters are optimized using the gradient descent method to generate error correction data. The features of the newly added data samples are extracted and integrated to achieve incremental updates and obtain updated feature data.
[0046] When predicting the updated feature data, the following prediction model is used: ; in, is the predicted weight at time t, is the output layer weight, is the activation function, is the input feature weight, is the input feature vector, is the bias term, is the error term, m is the number of hidden layer nodes, and p is the input feature dimension.
[0047] The predicted value sequence is compared and verified with the measured weight data, the prediction error range is calculated, and error statistics are generated. The error statistics are evaluated for credibility, and the predicted value is determined through confidence interval analysis to obtain the weight prediction result.
[0048] For example, the growth data of the pig from birth to 150 days is collected for analysis. First, the data is stratified according to the growth stage. For example, in the mid-growth stage (111-150 days), the collected data include behavioral characteristics such as daily feed intake, water intake, activity intensity, and body length, height, and width. These raw data are normalized to make different types of feature data comparable. By calculating the correlation strength between features, it is found that there is a strong correlation between feed intake and body parameters, and the ambient temperature and feeding behavior also show a significant correlation. Based on these correlations, the attention mechanism is used to dynamically adjust the feature weights, focusing on feature indicators that are strongly correlated with weight gain. When predicting weight, the model not only considers the current feature data, but also integrates historical growth trends, and continuously optimizes the prediction accuracy through error back propagation. When new feed intake data or body measurement data are input, the model can quickly update parameters, adapt to the dynamic changes of growth and development, and output weight prediction results.
[0049] In a specific embodiment, the process of executing step S106 may specifically include the following steps: (1) Perform time series analysis on weight prediction results, calculate the growth rate change trend, and obtain growth trend data; (2) Establish growth cycle segmentation points based on growth trend data, calculate nutritional requirements for different growth stages, and obtain nutritional requirement data; (3) Calculate the deviation between the nutritional requirement data and the standard growth curve, conduct a quantitative assessment of the growth status, and obtain status assessment data; (4) Perform group distribution statistics on the status assessment data, calculate the individual growth difference coefficient, and obtain group difference data; (5) Classify the group difference data according to the threshold range, mark and identify abnormal individuals, and obtain abnormal marked data; (6) Design a nutritional supplement plan based on abnormal marker data, dynamically adjust the nutritional ratio, and obtain nutritional ratio data; (7) Convert the nutrient ratio data into feed formula parameters, quantitatively plan the feeding strategy, and obtain feeding plan data; (8) Arrange the time nodes of the feeding plan data, generate specific feeding operation instructions, and obtain feeding operation data; (9) Associating and integrating feeding operation data with abnormal marking data, establishing a feedback tracking mechanism, and obtaining regulatory tracking data; (10) Comprehensively analyze and process the supervision and tracking data to form a feeding and management plan and obtain the target feeding and management strategy.
[0050] Specifically, first calculate the weight growth rate between adjacent time points, and obtain the changing trend of the growth rate by the difference method. The calculation of the growth rate takes into account the time interval factor, and uses the weight gain per unit time as an evaluation index to form growth trend data. According to the growth trend data, the key segmentation points of the growth cycle are determined, and the growth cycle is divided into different stages. Each growth stage has its own specific nutritional demand characteristics. Based on the growth stage and weight prediction results, the required amount of nutrients such as protein, energy, and minerals is calculated to generate nutritional demand data. The nutritional demand calculation is based on the nutritional standards in the standard feeding manual and is dynamically adjusted in combination with actual growth conditions.
[0051] The calculated nutritional requirement data is compared with the standard growth curve, and the deviation value between the actual growth curve and the standard curve is calculated. Deviation calculation includes two dimensions: absolute deviation and relative deviation. The growth status is quantitatively evaluated by setting scoring standards to form status evaluation data. Evaluation indicators include growth rate, weight compliance rate, and development uniformity. The generated status evaluation data is statistically analyzed for group distribution, and the growth difference coefficient between individuals in the group is calculated. The calculation of the difference coefficient adopts the coefficient of variation method, which reflects the discrete degree of growth and development of individuals in the group. The group difference data obtained through statistical analysis can intuitively reflect the overall growth status of the breeding group.
[0052] The group difference data is divided into levels according to the preset threshold range, and the normal development interval, mild abnormal interval and severe abnormal interval are set. Individuals falling into the abnormal interval are marked, and their abnormal type and degree are recorded to generate abnormal marking data. The marking process comprehensively considers multiple indicators such as growth rate, feed intake and behavioral characteristics. Targeted nutritional supplementation plans are formulated based on abnormal marking data, and differentiated nutritional intervention measures are adopted for abnormal individuals of different levels. The dynamic adjustment of nutritional ratio follows the principle of nutritional balance, and the nutritional ratio data is formed by optimizing the proportional relationship of various nutrients. During the ratio adjustment process, key indicators such as the ratio of energy to protein and amino acid balance are focused on.
[0053] The nutritional ratio data is converted into specific feed formula parameters, including the ratio and addition amount of various raw materials. The nutritional value, price factors and availability of raw materials are taken into consideration in the formula design process. The optimal ratio scheme is determined through the linear programming method to generate feeding plan data. The feeding plan clearly stipulates specific parameters such as daily feeding amount, feeding frequency and feeding time. The feeding plan data is arranged at time nodes and a detailed feeding operation process is formulated. The operation instructions include daily feeding schedules, feed preparation methods and precautions to form feeding operation data. The formulation of the operating procedures fully considers the physiological characteristics and behavioral habits of farmed pigs.
[0054] The feeding operation data and abnormal marking data are linked and integrated to establish a complete supervision and tracking system. The tracking mechanism includes multiple links such as regular weight measurement, recording feeding conditions and observing behavioral performance to form supervision and tracking data. Through tracking data, problems that arise in the feeding process are discovered and solved in a timely manner. Finally, a comprehensive analysis of the supervision and tracking data is conducted to form a complete feeding management plan. The management plan includes feeding goals, operating procedures, and emergency plans, and a target feeding management strategy is formed through continuous optimization.
[0055] For example, after obtaining the weight prediction results, time series analysis revealed that some individuals grew slowly in the middle of their growth period. Data analysis revealed that the daily feed intake of these individuals was lower than normal, and their activity was relatively low. This group of individuals with abnormal growth was monitored, and it was found that their feeding behavior was mainly concentrated in the early morning and evening, while normal individuals showed a more uniform feeding pattern. Based on this finding, the feeding plan for abnormal individuals was adjusted to increase the feed supply in the morning and evening, and an appropriate amount of attractant was added to the feed to improve palatability. Through continuous follow-up observation, the feed intake of abnormal individuals gradually returned to normal levels, and the growth rate also improved significantly. Throughout the adjustment process, the breeders strictly implemented the established operating procedures, regularly recorded the individual feed intake and weight change data, and adjusted the feeding plan in a timely manner according to the monitoring results, achieving balanced growth of the breeding population.
[0056] The above describes the intelligent weight monitoring method for pig farming in the embodiment of the present application. The following describes the intelligent weight monitoring system for pig farming in the embodiment of the present application. Figure 2 In the embodiment of the present application, an intelligent weight monitoring system for pig farming includes: An acquisition module is used to perform image acquisition and processing on farmed pigs through a multi-angle stereo image acquisition network to obtain an original image data set including a top view, a side view, and a 45-degree angle view; A denoising module is used to perform image enhancement and denoising processing according to the original image data set through an adaptive histogram equalization algorithm and an improved Gaussian filter, and perform target segmentation processing in combination with a background separation algorithm based on region growing to obtain normalized image data; An extraction module is used to extract features based on the normalized image data through a contour-skeleton dual feature extraction algorithm, and to construct a skeleton framework in combination with key point positioning based on curvature analysis to obtain feature vector data containing body shape parameters; A fusion module is used to perform multi-source data fusion processing on the feature vector data and the behavior data collected by the IoT sensor through a deep learning behavior pattern recognition algorithm, and perform anomaly correction through a spatiotemporal-related data cleaning algorithm to obtain a fused feature data set; A modeling module, used to perform weight modeling based on the fused feature data set through a hierarchical-incremental hybrid prediction model, and to optimize weights by combining a feature importance adaptive adjustment algorithm based on an attention mechanism to obtain a weight prediction result; A generation module is used to generate a feeding plan based on the weight prediction result through a reinforcement learning algorithm, analyze the growth status in combination with a group abnormality warning mechanism, and obtain a target feeding management strategy.
[0057] Through the coordinated cooperation of the above components, the original image data set including top view, side view and 45-degree angle view is obtained through the multi-angle stereo image acquisition network, which effectively avoids the information loss caused by a single perspective and improves the integrity and reliability of data acquisition. The adaptive histogram equalization algorithm and the improved Gaussian filter are used for image enhancement and noise reduction, and the background separation algorithm based on regional growth is used for target segmentation. It can effectively improve the image quality and accurately separate the target area, laying the foundation for subsequent feature extraction. At the same time, the contour-skeleton dual feature extraction algorithm is used for feature extraction, and the key point positioning based on curvature analysis is combined to construct the skeleton framework, which realizes the accurate extraction and quantitative expression of the body characteristics of farmed pigs. Vector data is fused with behavioral data collected by IoT sensors for multi-source data processing, and anomalies are corrected through a spatiotemporal data cleaning algorithm, which significantly improves the accuracy and reliability of the data. Weight modeling is performed based on a hierarchical-incremental hybrid prediction model, and weight optimization is performed using a feature importance adaptive adjustment algorithm based on an attention mechanism. This not only improves the accuracy of the prediction model, but also achieves targeted modeling for different growth stages. Finally, a reinforcement learning algorithm is used to generate a feeding plan, and a group abnormality warning mechanism is used to analyze the growth status, which effectively connects the monitoring results with feeding management, forming a complete intelligent breeding solution. This not only significantly improves the accuracy and efficiency of weight monitoring, but also achieves intelligent and precise feeding management.
[0058] Based on the same technical concept, the embodiment of the present application also provides an intelligent weight monitoring device for pig farming. Figure 3 As shown, it is a structural diagram of the intelligent weight monitoring device 300 for pig farming provided by the embodiment of the present application, including a processor 301, a memory 302, and a bus 303. Among them, the memory 302 is used to store execution instructions, including a memory 3021 and an external memory 3022; the memory 3021 here is also called an internal memory, which is used to temporarily store the operation data in the processor 301, and the data exchanged with the external memory 3022 such as a hard disk. The processor 301 exchanges data with the external memory 3022 through the memory 3021. When the intelligent weight monitoring device 300 for pig farming is running, the processor 301 communicates with the memory 302 through the bus 303.
[0059] The present application also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the method for intelligent weight monitoring of farmed pigs.
[0060] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, systems and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0061] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable an intelligent weight monitoring device for pig farming (which can be a personal computer, server, or network equipment, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0062] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for intelligently monitoring the weight of pigs, characterized in that: The intelligent weight monitoring method for breeding pigs comprises: The images of farmed pigs are collected and processed through a multi-angle stereo image acquisition network to obtain an original image dataset including top view, side view and 45-degree angle view; According to the original image data set, image enhancement and noise reduction processing is performed by using an adaptive histogram equalization algorithm and an improved Gaussian filter, and target segmentation processing is performed in combination with a background separation algorithm based on region growing to obtain normalized image data; According to the normalized image data, feature extraction is performed through a contour-skeleton dual feature extraction algorithm, and a skeleton framework is constructed in combination with key point positioning based on curvature analysis to obtain feature vector data containing body shape parameters; The feature vector data and the behavior data collected by the IoT sensor are subjected to multi-source data fusion processing through a deep learning behavior pattern recognition algorithm, and anomaly correction is performed through a spatiotemporal-related data cleaning algorithm to obtain a fused feature data set; Based on the fused feature data set, weight modeling is performed through a hierarchical-incremental hybrid prediction model, and weight optimization is performed in combination with a feature importance adaptive adjustment algorithm based on an attention mechanism to obtain a weight prediction result; Based on the weight prediction results, a feeding plan is generated through a reinforcement learning algorithm, and a growth status analysis is performed in combination with a group abnormality early warning mechanism to obtain a target feeding management strategy.
2. The intelligent weight monitoring method for pig farming according to claim 1, characterized in that: The multi-angle stereo image acquisition network is used to perform image acquisition and processing on the farmed pigs to obtain an original image data set including a top view, a side view and a 45-degree angle view, including: By measuring environmental parameters, we can obtain light intensity and distance data, locate the breeding area in three dimensions, and obtain basic scene data. Calculate acquisition parameters based on the basic scene data, dynamically adjust device parameters, and obtain optimized acquisition settings; The optimized acquisition settings are input into an image acquisition system to perform multi-angle scanning on the target area to obtain raw scanning data; Performing time synchronization processing on the original scan data, and performing coordinate correction in combination with the spatial position information to obtain time-space registration data; Performing view classification processing according to the spatiotemporal registration data, performing projection conversion on data of different view angles, and obtaining a multi-view sequence; The multi-view sequences are integrated and processed according to the time sequence relationship, and an original image data set including a top view, a side view and a 45-degree angle view is obtained by data merging.
3. The intelligent weight monitoring method for pig farming according to claim 1, characterized in that: The method of performing image enhancement and noise reduction processing by using an adaptive histogram equalization algorithm and an improved Gaussian filter according to the original image data set and performing target segmentation processing by combining a background separation algorithm based on region growing to obtain normalized image data includes: Performing grayscale value statistical analysis on the original image data set, constructing a grayscale distribution histogram, and obtaining grayscale distribution feature data; Calculate the image brightness threshold range according to the grayscale distribution feature data, perform interval mapping on the pixel values, and obtain brightness balance data; The brightness equalization data is weighted according to the pixel neighborhood relationship, and the image noise is weighted averaged to obtain noise reduction processing data; Performing edge region detection on the noise reduction processed data, determining growth seed points in the target region, and obtaining initial segmentation data; Expand the initial segmentation data according to pixel similarity, dynamically update the target boundary, and obtain target contour data; The target contour data is subjected to background and foreground separation and edge smoothing processing to obtain normalized image data.
4. The intelligent weight monitoring method for pig farming according to claim 1, characterized in that: The feature extraction is performed based on the normalized image data through the contour-skeleton dual feature extraction algorithm, and the skeleton framework is constructed in combination with the key point positioning based on curvature analysis to obtain feature vector data containing body shape parameters, including: Extracting boundary points from the normalized image data, calculating gradient change values between adjacent points, and obtaining a target contour point set; Interpolating and connecting the target contour point set according to spatial distribution, smoothing the contour curve, and obtaining continuous contour data; Performing distance transformation calculation on the continuous contour data to determine the center line position of the target area and obtain a skeleton initial point set; The skeleton initial point set is subjected to branch judgment according to the topological structure, and the branch nodes are trimmed and merged to obtain the trunk skeleton data; Calculate local curvature based on the backbone skeleton data, extract features of the extreme points of curvature, and obtain key feature point data; Mapping the key feature point data to a spatial position, positioning and marking the ear base point, the acromion point, and the hip point to obtain marked position data; Performing distance measurement on the marked position data, calculating the Euclidean distance value between adjacent feature points, and obtaining body length parameter data; The body length parameter data and the trunk skeleton data are vertically projected to calculate the body height value to obtain the body height parameter data; Scanning the continuous contour data transversely at the marked position data, calculating the target width value, and obtaining body width parameter data; The body length parameter data, the body height parameter data and the body width parameter data are combined and sorted to generate feature vector data containing body shape parameters.
5. The intelligent weight monitoring method for pig farming according to claim 1, characterized in that: The feature vector data and the behavior data collected by the IoT sensor are subjected to multi-source data fusion processing through a deep learning behavior pattern recognition algorithm, and anomaly correction is performed through a spatiotemporal associated data cleaning algorithm to obtain a fused feature data set, including: Performing time series marking on the feature vector data, arranging the body shape parameters at different time points in time sequence, and obtaining time series feature data; Establishing a time window according to the time series characteristic data, performing data continuity check within the window, and obtaining sequence integrity data; Time-align the sequence integrity data with the behavior data collected by the IoT sensor, determine the data collection time node, and obtain aligned time series data; The aligned time series data are classified into behavioral types, and multi-dimensional feature combinations are performed through feed intake, water intake, and activity intensity to obtain behavioral feature data; The behavior feature data is segmented according to the temporal and spatial correlation, and the mutation points in the data segment are marked to obtain abnormal marking data; Performing statistical analysis on the abnormally marked data, calculating the mean and standard deviation within the data segment, and obtaining statistical characteristic data; Establishing a threshold interval according to the statistical feature data, and correcting the data points exceeding the threshold to obtain smoothed data; Perform correlation analysis on the smoothed data and the behavior feature data, establish a correlation matrix between the features, and obtain correlation data; Performing feature combination on the correlation data, merging high correlation features, and obtaining dimension-reduced feature data; The dimension-reduced feature data and the time series feature data are integrated and reorganized according to the time dimension to obtain a fused feature data set.
6. The intelligent weight monitoring method for pig farming according to claim 1, characterized in that: Based on the fused feature data set, weight modeling is performed through a hierarchical-incremental hybrid prediction model, and weight optimization is performed in combination with a feature importance adaptive adjustment algorithm based on an attention mechanism to obtain a weight prediction result, including: Dividing the fused feature data set into growth stages, performing layered processing on the data according to the time span, and obtaining layered feature data; Calculating the statistical distribution characteristics of each layer of data according to the hierarchical characteristic data, normalizing the data to obtain standardized hierarchical data; Perform feature mapping on the standardized hierarchical data according to the input dimension, quantify the correlation strength between the features, and obtain feature weight data; Calculating the attention score of the feature weight data, dynamically adjusting the weight by feature importance score, and obtaining attention distribution data; Performing a weighted combination of the attention distribution data and the standardized hierarchical data, and redistributing the feature contribution to obtain weighted feature data; A prediction parameter matrix is established according to the weighted feature data, and the historical prediction error is reversely transferred to obtain error correction data; Incrementally updating the error correction data, extracting and integrating features of the newly added data samples, and obtaining updated feature data; Performing prediction calculation on the updated characteristic data to generate weight value estimation results and obtain a prediction value sequence; Compare and verify the predicted value sequence with the measured weight data, calculate the prediction error range, and obtain error statistics; The error statistics are evaluated for credibility, and the predicted value is determined through confidence interval analysis to obtain a weight prediction result.
7. The intelligent weight monitoring method for pig farming according to claim 1, characterized in that: The feeding plan is generated based on the weight prediction result through the reinforcement learning algorithm, and the growth status is analyzed in combination with the group abnormal warning mechanism to obtain the target feeding management strategy, including: Performing time series analysis on the weight prediction results, calculating the growth rate change trend, and obtaining growth trend data; Establish growth cycle segmentation points according to the growth trend data, calculate the nutritional requirements for different growth stages, and obtain nutritional requirement data; Calculate the deviation between the nutritional requirement data and the standard growth curve, quantitatively evaluate the growth status, and obtain status evaluation data; Performing group distribution statistics on the status assessment data, calculating individual growth difference coefficients, and obtaining group difference data; The group difference data is classified according to the threshold range, and abnormal individuals are marked and identified to obtain abnormal marked data; Designing a nutritional supplementation plan according to the abnormal marker data, dynamically adjusting the nutritional ratio, and obtaining nutritional ratio data; The nutrient ratio data is converted into feed formula parameters, and a feeding strategy is quantitatively planned to obtain feeding plan data; Arrange the feeding plan data at a certain time, generate specific feeding operation instructions, and obtain feeding operation data; Associating and integrating the feeding operation data with the abnormal marking data, establishing a feedback tracking mechanism, and obtaining supervision tracking data; The supervision and tracking data are comprehensively analyzed and processed to form a feeding management plan and obtain a target feeding management strategy.
8. An intelligent weight monitoring system for farmed pigs, used to implement the intelligent weight monitoring method for farmed pigs as described in any one of claims 1 to 7, characterized in that: The intelligent weight monitoring system for breeding pigs comprises: An acquisition module is used to perform image acquisition and processing on farmed pigs through a multi-angle stereo image acquisition network to obtain an original image data set including a top view, a side view, and a 45-degree angle view; A denoising module is used to perform image enhancement and denoising processing according to the original image data set through an adaptive histogram equalization algorithm and an improved Gaussian filter, and perform target segmentation processing in combination with a background separation algorithm based on region growing to obtain normalized image data; An extraction module, used to extract features based on the normalized image data through a contour-skeleton dual feature extraction algorithm, and to construct a skeleton framework in combination with key point positioning based on curvature analysis, to obtain feature vector data containing body shape parameters; A fusion module is used to perform multi-source data fusion processing on the feature vector data and the behavior data collected by the IoT sensor through a deep learning behavior pattern recognition algorithm, and perform anomaly correction through a spatiotemporal-related data cleaning algorithm to obtain a fused feature data set; A modeling module, for performing weight modeling based on the fused feature data set through a hierarchical-incremental hybrid prediction model, and performing weight optimization in combination with a feature importance adaptive adjustment algorithm based on an attention mechanism to obtain a weight prediction result; A generation module is used to generate a feeding plan based on the weight prediction result through a reinforcement learning algorithm, analyze the growth status in combination with a group abnormality warning mechanism, and obtain a target feeding management strategy.
9. An intelligent weight monitoring device for pig farming, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the intelligent weight monitoring device for farmed pigs is running, the processor and the memory communicate via the bus. When the machine-readable instructions are executed by the processor, the steps of the intelligent weight monitoring method for farmed pigs as described in any one of claims 1 to 7 are performed.
10. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by the processor, the intelligent weight monitoring method for farmed pigs as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Multi-source information fusion live pig full-chain intelligent monitoring method and device
CN113507490A
Pig weight estimation method based on image processing
CN116703897A
Construction method of live pig body composition prediction model based on machine vision and machine learning
CN118097364A
Pig breeding intelligent decision management system based on multi-modal information monitoring
CN118735202A
Pig behavior and health method based on deep learning and physiological parameter dynamic monitoring
CN118986303A
Cited By
Sow hip region image processing method and system based on computer vision
CN120452026A
A sow hip area image processing method and system based on computer vision
CN120452026B
Breeding weighing management system based on Internet of Things and AI visual technology
CN120952998A
Beef cattle growth prediction method based on multi-source breeding data mining
CN121683886A
Intelligent pig house management system and method
CN122536508A