Intelligent monitoring method, system and device for body weight of pigs in breeding and storage medium

By using multi-angle stereo image acquisition and data fusion technology, combined with deep learning and reinforcement learning algorithms, the problems of insufficient data fusion and low prediction accuracy in pig weight monitoring have been solved, enabling accurate weight prediction and intelligent feeding management at different growth stages.

CN119919242BActive Publication Date: 2025-11-04AGRI MACHINERY INST CHINESE TROPICAL ACAD OF SCI +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510392359.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-31
Publication Date
2025-11-04
Estimated Expiration
2045-03-31

AI Technical Summary

Technical Problem

Existing methods for monitoring the weight of farmed pigs suffer from insufficient data integration, low prediction accuracy, lack of targeted analysis for different growth stages, and failure to effectively link with feeding management, making it difficult to adjust feeding strategies in a timely manner based on monitoring results.

Method used

A multi-angle stereo image acquisition network was used to acquire raw image datasets containing top, side, and 45-degree angle views. Image enhancement and noise reduction were performed by combining an adaptive histogram equalization algorithm and an improved Gaussian filter. Feature extraction was performed using a contour-skeleton dual feature extraction algorithm. Deep learning behavior pattern recognition and multi-source data fusion were performed with IoT sensor data. Weight modeling was performed using a hierarchical-incremental hybrid prediction model. Feeding plans were generated by combining attention mechanisms and reinforcement learning algorithms.

Benefits of technology

It significantly improves the accuracy and efficiency of weight prediction, achieves seamless integration of monitoring results and feeding management, and forms an intelligent and precise breeding solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119919242B_ABST
    Figure CN119919242B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of image processing, and discloses a weight intelligent monitoring method, system and device for breeding pigs and a storage medium. The method comprises the following steps: obtaining an original data set through multi-angle image acquisition; performing image processing by using adaptive histogram equalization and Gaussian filtering; acquiring a body shape parameter by using contour-skeleton feature extraction and curvature analysis; performing multi-source fusion processing in combination with Internet of Things data; performing weight modeling based on a hierarchical-incremental prediction model and an attention mechanism; and generating a feeding scheme through reinforcement learning. The application solves the technical problems of insufficient data fusion and low prediction accuracy in the existing weight monitoring method for breeding pigs.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of image processing, and particularly relates to a body weight intelligent monitoring method, system and device for breeding pigs and a storage medium. BACKGROUND

[0002] At present, various measurement methods have been developed in the field of breeding pig weight monitoring. Traditional weight monitoring methods mainly rely on manual weighing, which requires pigs to be driven into a weighing cage for measurement. This method not only consumes time and effort, but also easily causes stress reactions in pigs, affecting their growth and development. With the development of computer vision technology, weight estimation methods based on image processing have emerged, which collect image information of pigs and extract body shape feature parameters for weight prediction. At the same time, the application of Internet of Things technology in the breeding field is increasingly widespread, and various types of sensors are used to collect behavior data and environmental parameters of pigs, providing more data support for weight monitoring.

[0003] However, the existing weight monitoring methods still have some obvious deficiencies. First, single image features or behavior data cannot accurately reflect the actual weight of pigs, and the prediction accuracy is limited. Second, existing methods generally lack targeted analysis for different growth stages and fail to fully consider the differences in growth and development rules. Third, in the data processing process, the ability to identify and handle abnormal data is insufficient, and it is easily affected by environmental factors and equipment failures. In addition, existing methods often treat weight monitoring as an independent link and fail to form effective linkage with feeding management, making it difficult to adjust feeding strategies in a timely manner based on monitoring results. SUMMARY

[0004] The present application provides a body weight intelligent monitoring method, system and device for breeding pigs and a storage medium, which solves the technical problems of insufficient data fusion and low prediction accuracy in existing breeding pig weight monitoring methods. By establishing a multi-dimensional data fusion mechanism, image feature data and Internet of Things sensor data are deeply fused, and the dynamic weight adjustment of 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 an intelligent body weight monitoring method for breeding pigs, comprising: image acquisition and processing of the breeding pigs through a multi-angle stereoscopic image acquisition network to obtain an original image dataset containing top view, side view and 45-degree view; image enhancement and noise reduction processing of the original image dataset through an adaptive histogram equalization algorithm and an improved Gaussian filter, target segmentation processing combined with a background separation algorithm based on region growing to obtain normalized image data; feature extraction of the normalized image data through a contour-skeleton dual feature extraction algorithm, skeleton framework construction combined with key point positioning based on curvature analysis to obtain feature vector data containing body size parameters; multi-source data fusion processing of the feature vector data and behavior data collected by Internet of Things sensors through a deep learning behavior pattern recognition algorithm, abnormal correction through a spatiotemporal correlation data cleaning algorithm to obtain a fusion feature dataset; body weight modeling through a hierarchical-incremental hybrid prediction model based on the fusion feature dataset, weight optimization combined with a feature importance adaptive adjustment algorithm based on an attention mechanism to obtain a body weight prediction result; target feeding management strategy generation through a reinforcement learning algorithm based on the body weight prediction result, growth state analysis combined with a group abnormal early warning mechanism to obtain the target feeding management strategy.

[0006] In a second aspect, the present application provides an intelligent body weight monitoring system for breeding pigs, comprising:

[0007] An acquisition module for image acquisition and processing of the breeding pigs through a multi-angle stereoscopic image acquisition network to obtain an original image dataset containing top view, side view and 45-degree view;

[0008] A noise reduction module for image enhancement and noise reduction processing of the original image dataset through an adaptive histogram equalization algorithm and an improved Gaussian filter, target segmentation processing combined with a background separation algorithm based on region growing to obtain normalized image data;

[0009] An extraction module for feature extraction of the normalized image data through a contour-skeleton dual feature extraction algorithm, skeleton framework construction combined with key point positioning based on curvature analysis to obtain feature vector data containing body size parameters;

[0010] A fusion module for multi-source data fusion processing of the feature vector data and behavior data collected by Internet of Things sensors through a deep learning behavior pattern recognition algorithm, abnormal correction through a spatiotemporal correlation data cleaning algorithm to obtain a fusion feature dataset;

[0011] The modeling module is configured for weight modeling based on the fusion feature dataset by a hierarchical-incremental hybrid prediction model, and weight optimization is performed by combining a feature importance adaptive adjustment algorithm based on an attention mechanism to obtain a weight prediction result.

[0012] The generation module is configured for feeding scheme generation by a reinforcement learning algorithm according to the weight prediction result, and growth state analysis is performed by combining a group abnormality early warning mechanism to obtain a target feeding management strategy.

[0013] The third aspect of the present application provides a weight intelligent monitoring device for breeding pigs, the memory stores machine readable instructions executable by the processor, when the weight intelligent monitoring device for breeding pigs is running, the processor communicates with the memory through the bus, and the machine readable instructions are executed by the processor to perform the steps of the weight intelligent monitoring method for breeding pigs described above.

[0014] The fourth aspect of the present application provides a computer readable storage medium, the computer readable storage medium stores instructions, when it runs on the computer, makes the computer execute the weight intelligent monitoring method for breeding pigs described above.

[0015] In the technical scheme provided by the present application, the multi-angle stereoscopic image acquisition network is used to obtain the original image dataset containing the top view, the side view and the 45-degree view, which effectively avoids the information loss caused by a single view, improves the integrity and reliability of data acquisition, and the adaptive histogram equalization algorithm and the improved Gaussian filter are used for image enhancement and noise reduction processing, and the region growing based background separation algorithm is used for target segmentation processing, which can effectively improve the image quality and accurately separate the target area, laying a foundation for subsequent feature extraction, and the contour-skeleton double feature extraction algorithm is used for feature extraction, and the key point positioning based on curvature analysis is used for skeleton frame construction, realizing accurate extraction and quantitative expression of the body shape characteristics of the breeding pigs, and through multi-source data fusion processing of the feature vector data and the behavior data collected by the Internet of Things sensor and abnormal correction by the spatio-temporal correlation data cleaning algorithm, the accuracy and reliability of the data are significantly improved, the hierarchical-incremental hybrid prediction model is used for weight modeling, and the weight optimization is performed by combining the feature importance adaptive adjustment algorithm based on the attention mechanism, which not only improves the accuracy of the prediction model, but also realizes targeted modeling for different growth stages, finally the reinforcement learning algorithm is used for feeding scheme generation, and the growth state analysis is performed by combining the group abnormality early warning mechanism, realizing effective connection of the monitoring result and the feeding management, forming a complete intelligent breeding solution, which not only significantly improves the accuracy and efficiency of weight monitoring, but also realizes intelligent and precise feeding management. BRIEF DESCRIPTION OF DRAWINGS

[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiment description will be briefly introduced as follows. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor based on these drawings.

[0017] Figure 1 An embodiment schematic diagram of the body weight intelligent monitoring method for breeding pigs in the embodiments of the present application;

[0018] Figure 2 An embodiment schematic diagram of the body weight intelligent monitoring system for breeding pigs in the embodiments of the present application;

[0019] Figure 3 A structural schematic diagram of the body weight intelligent monitoring device for breeding pigs in the embodiments of the present application. DETAILED DESCRIPTION

[0020] The embodiments of the present application provide a body weight intelligent monitoring method, system, device and storage medium for breeding pigs. The terms "first", "second", "third", "fourth" and the like (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily mean a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the term "comprising" or "having" and any variation thereof is intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily limit to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0021] For ease of understanding, the specific process of the embodiments of the present application will be described below. Please refer to Figure 1 An embodiment of the body weight intelligent monitoring method for breeding pigs in the embodiments of the present application includes:

[0022] Step S101, image acquisition and processing of the breeding pigs are performed by a multi-angle stereoscopic image acquisition network to obtain an original image data set containing a top view, a side view and a 45-degree view;

[0023] Step S102, image enhancement and noise reduction processing are performed on the original image data set by 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;

[0024] Step S103, feature extraction is performed on the standardized image data via a contour-skeleton dual feature extraction algorithm, a key point positioning based on curvature analysis is combined to construct a skeleton framework, and feature vector data containing body shape parameters are obtained;

[0025] Step S104, the feature vector data and the behavior data collected by the Internet of Things sensor are processed through a deep learning behavior pattern recognition algorithm for multi-source data fusion, and an abnormality correction is performed via a time-space correlation data cleaning algorithm, and a fusion feature data set is obtained;

[0026] Step S105, based on the fusion feature data set, a weight optimization is performed through a hierarchical-incremental hybrid prediction model for body weight modeling, and a feature importance self-adaptive adjustment algorithm based on an attention mechanism is combined to obtain a body weight prediction result;

[0027] Step S106, according to the body weight prediction result, a feeding scheme is generated via a reinforcement learning algorithm, and a growth state analysis is performed in combination with a group abnormality early warning mechanism to obtain a target feeding management strategy.

[0028] It can be understood that the execution subject of the present application can be a body weight intelligent monitoring system for breeding pigs, and can also be a terminal or a server, and the specific implementation is not limited herein. The server is taken as an example for description in the embodiments of the present application.

[0029] Specifically, the pigs are image collected and processed by a multi-angle stereoscopic image collection network. The network is arranged with multiple high-definition cameras in the breeding farm for synchronous shooting. To ensure image quality, the system is equipped with an infrared sensor that automatically switches to infrared imaging mode when light is insufficient. During image collection, when a pig is detected to enter a designated area, a depth sensor obtains accurate distance information between the pig and the camera, which is used for image correction. In addition, the camera uses adaptive focusing technology to automatically adjust the focal length and exposure parameters according to the intensity of the ambient light, synchronously collects top view, side view and 45-degree view, and forms an original image data set. When processing the obtained original image data set, first, an adaptive histogram equalization algorithm is used to enhance the image. The algorithm reassigns the gray values of the original image by calculating the histogram of the image gray distribution, so that the contrast of the image is improved. Subsequently, an improved Gaussian filter is used for noise reduction processing, which effectively removes noise while preserving the edge details of the image. In the target segmentation stage, a background separation algorithm based on region growing is used to accurately extract the target pig from the background. The algorithm first selects a seed point in the target area, and then gradually expands the region according to the similarity of pixel gray values to obtain the complete target contour, forming standardized image data.

[0030] According to the normalized image data, a 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 center axis information of the target through skeletonization processing. On this basis, combined with the key point positioning technology based on curvature analysis, the ear root, shoulder peak, hip and other feature points are accurately positioned. By calculating the distance and angle relationship between these feature points, the skeletal framework model of the pig is constructed, and the body length, body height, body width and other body shape parameters are obtained to form the feature vector data. When the feature vector data is fused with the behavior data collected by the Internet of Things sensor, first, the feeding, drinking, exercise and other behaviors are identified and classified through the deep learning behavior pattern recognition algorithm. The algorithm identifies the characteristics of different behavior patterns by analyzing the time sequence characteristics of the sensor data. Then, through the data cleaning algorithm based on space-time correlation, the abnormal value detection and correction of the data are performed. The algorithm identifies and corrects abnormal data points by analyzing the time continuity and spatial correlation of the data, ensuring the accuracy and reliability of the data, and generates the fused feature data set.

[0031] Based on the fused feature data set, a hierarchical-incremental hybrid prediction model is used for body weight modeling. The model first divides the data according to the growth stage, and establishes sub-models for different stages. Through the feature importance self-adaptive adjustment algorithm based on attention mechanism, the weights of each feature are dynamically adjusted. The algorithm optimizes the feature weights by calculating the correlation and importance score between features, and continuously absorbs new data samples by using the incremental learning strategy, continuously optimizing the prediction performance to obtain the body weight prediction result. According to the body weight prediction result, a reinforcement learning algorithm is used to generate a feeding plan. The algorithm analyzes the growth curve, nutritional requirements and other factors to develop individualized feeding strategies. At the same time, combined with the group abnormal early warning mechanism, the dispersion degree of the group growth curve is analyzed to timely discover abnormal individuals. For example, in a breeding batch, when it is found that the growth rate of a pig is significantly lower than the average level of the group, the system analyzes its feeding amount, activity amount and other behavior data, and combines the change trend of body shape characteristics to judge the abnormal reason. If it is found that the feeding amount is insufficient, the system will adjust the feed formula and feeding strategy accordingly; if it is found that the activity amount is abnormal, it will pay special attention to its health condition. In this way, a scientific and reasonable target feeding management strategy is formed.

[0032] For example, when a batch of newborn piglets enters the fattening stage in a certain farm, 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 Internet of Things sensors record the feeding, drinking and activity data of each pig. The system fuses and analyzes these data to monitor the growth status of each pig in real time. When the system detects that the feeding amount of a certain pig suddenly decreases and the activity amount increases, combined with image analysis, it is found that the weight growth rate is lower than expected, and an early warning is immediately given. The system analyzes that this abnormality is related to the recent temperature change, and adjusts the feeding environment parameters and optimizes the feed formula, successfully helping the pig to restore normal growth status. This precise monitoring and management method significantly improves the breeding efficiency, and embodies the practical value of the present scheme.

[0033] In the embodiments of the present application, the multi-angle stereo image acquisition network is used to obtain the original image data set containing the top view, side view and 45-degree view, which effectively avoids the information loss caused by single view, improves the integrity and reliability of data acquisition, and through the adaptive histogram equalization algorithm and the improved Gaussian filter for image enhancement and noise reduction processing, combined with the background separation algorithm based on region growing for target segmentation processing, the image quality can be effectively improved and the target area can be accurately separated, which lays a foundation for subsequent feature extraction. At the same time, the contour-skeleton double feature extraction algorithm is used for feature extraction, combined with the key point positioning based on curvature analysis for skeleton frame construction, the accurate extraction and quantitative expression of the body shape characteristics of the breeding pigs are realized. Through multi-source data fusion processing of the feature vector data and the behavior data collected by the Internet of Things sensors, and via the time and space related data cleaning algorithm for anomaly correction, the accuracy and reliability of the data are significantly improved. Based on the hierarchical-incremental hybrid prediction model for weight modeling, combined with the feature importance adaptive adjustment algorithm based on attention mechanism for weight optimization, not only the accuracy of the prediction model is improved, but also the targeted modeling for different growth stages is realized. Finally, through the reinforcement learning algorithm for feeding scheme generation, combined with the group anomaly early warning mechanism for growth status analysis, the effective connection of the monitoring result and the feeding management is realized, forming a complete intelligent breeding solution, which not only significantly improves the accuracy and efficiency of weight monitoring, but also realizes the intelligentization and precision of feeding management.

[0034] In a specific embodiment, the process of step S101 can specifically include the following steps:

[0035] (1) Obtain the light intensity value and distance data by environmental parameter measurement, and perform three-dimensional spatial positioning on the breeding area to obtain scene basic data;

[0036] (2) Calculate the acquisition parameters according to the scene basic data, dynamically adjust the device parameters, and obtain the optimized acquisition settings;

[0037] (3) Input the optimized acquisition settings into the image acquisition system and perform multi-angle scanning on the target area to obtain original scan data;

[0038] (4) Perform time synchronization processing on the original scan data, combine spatial position information for coordinate correction, and obtain spatio-temporal registration data;

[0039] (5) Perform perspective classification processing according to the spatio-temporal registration data, project and convert different perspective data, and obtain a multi-perspective sequence;

[0040] (6) Integrate the multi-perspective sequence according to the time sequence relationship, and obtain an original image data set containing top view, side view and 45-degree angle view through data merging.

[0041] Specifically, the environmental information of the breeding farm is obtained through environmental parameter measurement. The ambient light sensor captures the light intensity value of the breeding area, records the light change at different times, and 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 of the point cloud data obtained by the depth sensor, complete three-dimensional scene information is formed, and each spatial point contains position coordinates and environmental parameter information, thereby obtaining scene basic data. When calculating the acquisition parameters according to the scene basic data, first analyze the time distribution characteristics of the light intensity data, calculate the average light level and fluctuation range of different regions. For the area with insufficient light, the infrared light compensation module automatically adjusts the light compensation intensity; for the area with excessive light, the exposure parameters of the camera are adjusted for compensation. At the same time, according to the depth data, the distance between the camera and the target is calculated, and the focal length parameter is dynamically adjusted to ensure image clarity. These adjusted parameter combinations form the optimized acquisition settings.

[0042] After the optimized acquisition settings are input into the image acquisition system, the farming area is scanned from multiple angles. Multiple cameras work together to capture images 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, ensuring that clear images are obtained under different lighting conditions and shooting angles. The image data obtained through scanning contains information such as shooting time, spatial position, and acquisition parameters, forming the original scan data. When performing time synchronization processing on the original scan data, first extract the timestamp information of each image and arrange the images from different cameras in chronological order. Due to the slight differences in the acquisition times of multiple cameras, time alignment processing is required. Through interpolation algorithms, images at non-synchronized times are processed to ensure that all images from different angles correspond to the same time point. At the same time, combined with spatial position information, the images are converted and corrected in the coordinate system to eliminate distortions caused by differences in camera installation position and angle, obtaining spatiotemporally registered data.

[0043] When classifying the viewing angles based on the spatiotemporally registered data, first divide the image data into top view, side view, and 45-degree angle view classes according to the installation position and shooting angle of the cameras. Figure 3 For images of each viewing angle class, perform geometric correction through projection transformation algorithms to unify images taken from different viewing angles to a standard viewing angle. In this process, depth information is used to assist in calculating the projection transformation parameters, ensuring the accuracy of the geometric relationship of the transformed images and forming a standardized multi-view sequence. When integrating the multi-view sequence according to the time sequence, first establish a time index to combine images of different viewing angles at the same time. For each image group at a time point, perform quality assessment and select the best image quality as the representative image of that viewing angle. Finally, combine the selected top view, side view, and 45-degree angle view to form a complete original image dataset. In the process of monitoring the weight 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 capture the pig, producing a series of original images. After time synchronization processing, the top view, side view, and 45-degree angle view completely correspond to the same time. Through projection transformation, images taken from different angles are converted to a standard viewing angle, generating a complete set of multi-view image data.

[0044] In a specific embodiment, the process of performing step S102 can specifically include the following steps:

[0045] (1) Perform gray value statistical analysis on the original image dataset to construct a gray distribution histogram and obtain gray distribution feature data;

[0046] (2) Calculate the image brightness threshold range according to the gray scale distribution characteristic data, and perform interval mapping on the pixel value to obtain brightness equalization data;

[0047] (3) Perform weight calculation on the brightness equalization data according to the pixel neighborhood relationship, and perform weighted average processing on the image noise to obtain noise reduction processing data;

[0048] (4) Perform edge region detection on the noise reduction processing data to determine the target region growth seed point, and obtain segmentation initial data;

[0049] (5) Perform region expansion on the segmentation initial data according to the pixel similarity, and perform dynamic update on the target boundary to obtain target contour data;

[0050] (6) Perform background and foreground separation on the target contour data, and perform edge smoothing processing to obtain normalized image data.

[0051] Specifically, the gray value of these images is statistically analyzed. The gray value statistical analysis is to convert the color image into a gray scale image, calculate the number of pixels at each gray level, and construct a gray scale distribution histogram. In the gray scale conversion process, the weighted average method is used to convert the values of the RGB three channels into a single gray value, record the frequency of the occurrence of each gray level pixel, and form the gray scale distribution characteristic data. According to the gray scale distribution characteristic data, the brightness threshold range of the image is calculated. By analyzing the distribution characteristics of the gray scale histogram, the maximum gray value, the minimum gray value and the peak position of the image are determined, and the brightness mapping relationship is established. For the region with uneven brightness distribution, the original gray value is mapped to the new gray range by using the piecewise linear mapping method, 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 the details, forming brightness equalization data.

[0052] When performing noise reduction processing on the brightness equalization data, the neighborhood relationship of the pixels is first defined. For each pixel point, 8 neighborhood pixels around it are selected, the gray scale difference between the center pixel and the neighborhood pixels is calculated, and the weight value is allocated according to the difference degree. The weight value decreases with the increase of the gray scale difference, ensuring that the pixels with similar gray values have greater influence. By performing weighted average on the neighborhood pixels, a new pixel value is obtained, which effectively suppresses random noise and preserves the edge features of the image, forming noise reduction processing data. The edge region detection is performed on the data after noise reduction processing, which mainly identifies the significant change region in the image. By calculating the gradient information of the image, including the gray scale change rate in the horizontal and vertical directions, the position and intensity of the edge are determined. On the basis of edge detection, the regions with stable gray scale change and representative are selected as seed points, which will be used as the starting position of subsequent region growth, so as to obtain segmentation initial data.

[0053] The key step of the region growing algorithm is to expand the initial data segmentation according to the pixel similarity. Starting from the selected seed point, the gray value of the adjacent pixel is checked. When the gray difference between the adjacent pixel and the current region is less than the preset threshold, the adjacent pixel is merged into the current region. With the continuous expansion of the region, the target boundary is gradually formed. In the expansion process, the statistical characteristics of the region are dynamically updated, including the average gray value and the standard deviation, 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 the region growing process, making the boundary smoother and more continuous. The pixels in the target region are marked as foreground by the filling algorithm, and the remaining regions are marked as background, completing the foreground-background separation and obtaining the normalized image data.

[0054] For example, when monitoring the weight of pigs in a farm, after obtaining a set of original images containing top view, side view and 45-degree view, first, the gray value conversion is performed. By analyzing the gray distribution of each view image, it is found that due to uneven lighting, the abdominal region of the pig in the side view is dark, while the back region is bright. After brightness equalization processing, the brightness distribution of the image is more reasonable, and the detail information of the abdominal region is enhanced. In the noise reduction process, the scattering noise caused by the pig house environment is mainly processed, and the clarity of the pig contour is effectively preserved through neighborhood weighted average. When edge detection is performed, seed points are selected at the boundary between the pig and the ground, and the complete contour of the pig is accurately extracted by gradually expanding the region growth. Finally, the contour is smoothed to obtain a clear and accurate pig image segmentation result, providing a reliable image basis for subsequent feature extraction and weight estimation.

[0055] In a specific embodiment, the process of performing step S103 can specifically include the following steps:

[0056] (1) Extracting boundary points from the normalized image data, calculating the gradient change value between adjacent points, and obtaining a target contour point set;

[0057] (2) Interpolating and connecting the target contour point set according to the spatial distribution to smooth the contour curve and obtain continuous contour data;

[0058] (3) Calculating the distance transformation of the continuous contour data to determine the center line position of the target region and obtain an initial skeleton point set;

[0059] (4) Judging the branches of the initial skeleton point set according to the topological structure, pruning and merging the branch nodes, and obtaining main skeleton data;

[0060] (5) Calculate the local curvature based on the main skeleton data, extract the features of the curvature extreme points, and obtain the key feature point data;

[0061] (6) Map the key feature point data to spatial location, and mark the location of the ear root point, acromion point, and buttock point to obtain the marked location data;

[0062] (7) Measure the distance between the marked locations and calculate the Euclidean distance between adjacent feature points to obtain the body length parameter data;

[0063] (8) Project the body length parameter data and the main skeleton data vertically to calculate the body height value and obtain the body height parameter data;

[0064] (9) Perform a horizontal scan on the continuous contour data at the labeled position data, calculate the target width value, and obtain the body width parameter data;

[0065] (10) Combine and organize the body length parameter data, body height parameter data and body width parameter data to generate feature vector data containing body shape parameters.

[0066] Specifically, the Sobel operator is used to calculate the image gradient. Gradient values ​​for each pixel are obtained through convolution operations in the horizontal and vertical directions. During boundary point extraction, a gradient threshold of 1.5 times the average image gradient is set. Pixels with gradient values ​​higher than this threshold are marked as candidate boundary points. The gradient changes between adjacent candidate boundary points are calculated to generate a target contour point set, accurately describing the physical contour of the farmed pig. After obtaining the target contour point set, cubic spline interpolation is used to connect the discrete contour points to obtain a continuous and smooth contour curve. During interpolation, the density of interpolation nodes is adaptively adjusted based on the spatial distribution characteristics of the contour points, ensuring denser interpolation points in areas of greater curvature, thus more accurately describing the detailed features of the farmed pig's body shape. The interpolated contour curve is then processed using a Gaussian smoothing algorithm to eliminate local fluctuations introduced by interpolation, resulting in continuous and smooth contour data.

[0067] When calculating distance transformation for continuous contour data, the Euclidean distance transformation algorithm is used to calculate the distance from each pixel within the contour to the nearest boundary point. By finding the local maximum point in the distance transformation map, the centerline position of the target region is determined, thus obtaining the initial point set of the skeleton, laying the foundation for subsequent skeletal framework construction. After obtaining the initial point set of the skeleton, branch judgment and pruning and merging are performed based on topological structure analysis. The mathematical model is expressed as follows:

[0068] ;

[0069] in, This represents the connection strength between branch points p and q. is a branch direction weight coefficient, is a node is a distance value, is an attenuation coefficient, is a path length, n is a number of associated nodes.

[0070] When performing local curvature calculation on the main skeleton data, the following formula is used:

[0071] ;

[0072] wherein, is a curvature value, X(t) and Y(t) are parameter equations of the skeleton curve, , is a first derivative, X''(t), Y''(t) are second derivatives, is a smoothing factor.

[0073] When performing body height calculation, the following projection model is established:

[0074] ;

[0075] wherein, is a body height estimation value, is a skeleton curve equation, is a distance weight function, is a projection angle, a and b are integral interval boundaries.

[0076] After obtaining the key feature point data, spatial position mapping is performed to accurately position the locations of the ear root point, shoulder peak point and hip point. During the positioning process, a feature point positioning rule library is established in combination with anatomical features and image features, and the target point position is determined by matching the feature template with the highest similarity. Euclidean distance calculation is performed on the labeled position points to obtain body length parameter data, and the body length data is subjected to vertical projection operation with the main skeleton data to obtain body height parameters. When calculating the body width through horizontal scanning, the labeled position points are taken as the reference to perform scanning in a direction perpendicular to the main skeleton, and the target width value is determined through boundary detection. Finally, the body length, body height, body width and other parameters are subjected to normalization processing and combination and arrangement to form feature vector data.

[0077] For example, about 2000 discrete contour points are obtained through boundary point extraction, and a continuous contour curve is formed through interpolation smoothing processing. The initial skeleton point set generated through distance transformation calculation contains about 200 nodes, and after branch pruning, 85 key nodes on the main skeleton are retained. Three groups of feature points, i.e., the ear root point, shoulder peak point and hip point, are accurately positioned through curvature analysis, and body length parameters are calculated. Body height data is obtained through vertical projection calculation, and body width parameters are measured through horizontal scanning. The parameters are arranged according to the standard format to generate feature vectors.

[0078] In a specific embodiment, the process of performing step S104 can specifically include the following steps:

[0079] (1) Time sequence labeling is performed on the feature vector data, and the body shape parameters at different time points are arranged in time sequence to obtain time sequence feature data;

[0080] (2) A time window is established according to the time sequence feature data, and data continuity test is performed in the window to obtain sequence integrity data;

[0081] (3) The sequence integrity data is time-aligned with the behavior data collected by the Internet of Things sensor, the data collection time node is determined, and aligned time sequence data is obtained;

[0082] (4) The aligned time sequence data is divided into behavior types, multi-dimensional feature combination is performed through feed intake, water intake and activity intensity, and behavior feature data is obtained;

[0083] (5) The behavior feature data is segmented according to the spatio-temporal correlation, and the mutation points in the data segment are identified to obtain abnormal marker data;

[0084] (6) Statistical analysis is performed on the abnormal marker data, the mean and standard deviation in the data segment are calculated, and statistical feature data is obtained;

[0085] (7) A threshold interval is established according to the statistical feature data, data points exceeding the threshold are corrected, and smoothed processing data is obtained;

[0086] (8) Correlation analysis is performed on the smoothed processing data and the behavior feature data, a correlation matrix between features is established, and correlation data is obtained;

[0087] (9) Feature combination is performed on the correlation data, high correlation features are merged, and reduced dimension feature data is obtained;

[0088] (10) The reduced dimension feature data is integrated with the time sequence feature data, and is reorganized according to the time dimension to obtain a fusion feature data set.

[0089] Specifically, a timestamp is added to each body size parameter. The timestamp includes the year, month, day, hour, minute, and second, accurate to the second level, ensuring the time sequence of the data. The body size parameters with timestamps are arranged in chronological order to form an 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 data collection frequency, usually set to 24 hours, and the data within the window is continuously tested. Continuity testing includes data integrity checking and time interval consistency checking. Data integrity checking is used to identify data missing points, and time interval consistency checking is used to ensure the stability of the sampling interval, generating sequence integrity data.

[0090] Sequence integrity data needs to be time-aligned with behavior data collected by Internet of Things sensors. Internet of Things sensors include feed intake sensors, water intake sensors, and activity intensity sensors. In the time alignment process, the timestamp is used as a reference to match data from different sources according to the collection time node, ensuring the time consistency of the data and forming aligned time series data. When dividing the aligned time series data into behavior types, first analyze the feed intake data, including single feed intake and daily feed frequency. Water intake data records single water intake and water intake interval. Activity intensity data is recorded by motion sensors to record motion amplitude and duration. These behavior indicators are combined into multi-dimensional feature groups to build behavior feature data, which fully reflects the behavior state of the breeding pigs.

[0091] When segmenting behavior feature data according to spatiotemporal correlation, the continuity of behavior and spatial location relationship need to be considered. The data is segmented by sliding window algorithm, and the window size is dynamically adjusted according to the duration of the behavior. Within each data segment, the Z-score method is used to identify value mutation points, and the mutation points are labeled to generate abnormal marker data. Statistical analysis is performed on the labeled abnormal data to calculate the mean, standard deviation, skewness, kurtosis and other statistical characteristics of each data segment. These statistical indicators reflect the distribution characteristics and variation law of the data, forming statistical characteristic data. Based on the statistical characteristic data, a reasonable threshold interval for the data is established using the 3σ criterion. For data points outside the threshold interval, the moving average method is used for correction to obtain smoothed data.

[0092] In the correlation analysis of the smoothed data and the behavior feature data, the Pearson correlation coefficient is used to calculate the correlation between the features. The correlation coefficients are organized into a matrix form, and each element in the matrix represents the correlation strength between two features, forming the correlation data. When performing feature combination on the correlation data, features with correlation coefficients higher than a threshold value are merged. The merging process uses principal component analysis method to retain the main feature information, reduce the data dimension, and generate the reduced dimension feature data. Finally, the reduced dimension feature data and the time series feature data are reorganized according to the time dimension. The reorganization process maintains the time sequence of the data while integrating multi-dimensional feature information, forming the fusion feature data set. The fusion data set contains both time series features and reduced dimension behavior features, providing complete data support for subsequent weight prediction.

[0093] For example, first, the body length, body height, body width, and other body shape parameters of the pig are obtained, and accurate time stamps are added to the data. A 24-hour time window is used for data continuity test, and missing data caused by equipment maintenance is completed by linear interpolation method. The complete body shape data is aligned with the behavior data collected at the same period, including the pig's feed intake data (recording the time and amount of each feeding), water intake data (recording the water drinking time and water intake), and activity intensity data (recording the motion state and intensity value). The behavior data is combined into multi-dimensional features to construct the behavior feature vector. The data is segmented by sliding, and abnormal feeding records caused by feeding equipment failure are identified and marked as abnormal points. The statistical features of the data segment are calculated, and a reasonable threshold interval is established to 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 combined and reduced in dimension. All features are reorganized according to the time dimension to form a complete feature data set.

[0094] In a specific embodiment, the process of performing step S105 can specifically include the following steps:

[0095] (1) The fusion feature data set is divided into growth stages, and the data is processed in layers according to the time span to obtain layered feature data;

[0096] (2) The statistical distribution characteristics of each layer of data are calculated according to the layered feature data, and the data is normalized to obtain standardized hierarchical data;

[0097] (3) The standardized hierarchical data is mapped according to the input dimension, the correlation strength between the features is quantitatively calculated, and the feature weight data is obtained;

[0098] (4) The attention score of the feature weight data is calculated, and the weight is dynamically adjusted through the feature importance score to obtain the attention distribution data;

[0099] (5) Weighted combination of attention distribution data and standardized hierarchical data, re-distribution of feature contribution, and obtain weighted feature data;

[0100] (6) Establishing a prediction parameter matrix according to the weighted feature data, and performing reverse transmission on the historical prediction error to obtain error correction data;

[0101] (7) Incremental updating of error correction data, feature extraction and integration of new data samples, and obtaining updated feature data;

[0102] (8) Prediction calculation on the updated feature data to generate weight value estimation results, and obtain a prediction value sequence;

[0103] (9) Comparing and verifying the prediction value sequence with the measured weight data, calculating the prediction error range, and obtaining error statistical data;

[0104] (10) Confidence evaluation of error statistical data, determination of prediction value through confidence interval analysis, and obtaining weight prediction results.

[0105] Specifically, when the fusion feature data set is divided into growth stages, the growth period is divided into five stages according to the physiological characteristics of pigs, i.e. piglet period (0-30 days), nursery period (31-70 days), early growth period (71-110 days), middle growth period (111-150 days) and fattening period (more than 151 days). According to the time span of different growth stages, the data is processed in layers to form layered feature data, each layer containing body shape parameters, behavior characteristics and environmental factor data of the stage. The layered feature data is calculated for statistical distribution characteristics, including mean, standard deviation, skewness and kurtosis of each layer of data. The feature data of each layer is normalized, and the maximum and minimum value 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.

[0106] When the standardized hierarchical data is mapped to features, a feature space mapping matrix is constructed to calculate the correlation strength between features. The correlation strength is quantified by mutual information and Pearson correlation coefficient to generate feature weight data. The attention score calculation of feature weight data uses the following formula:

[0107]

[0108] wherein, is the attention score between features r and c, is the attention weight coefficient, and are the vector representations of features r and c, is the Gaussian kernel parameter,​where n is the feature dimension.

[0109] The standardized hierarchical data is combined by weighting according to the attention distribution data, the contribution of the features is redistributed, and weighted feature data is obtained. After establishing the prediction parameter matrix, the historical prediction error is back-propagated, the gradient descent method is used to optimize the model parameters, and error correction data is generated. Feature extraction and integration are performed on the new data samples to realize incremental updating, and updated feature data is obtained.

[0110] When predicting the updated feature data, the following prediction model is used:

[0111] ;

[0112] wherein, is the weight prediction value 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.

[0113] The prediction value sequence is compared with the measured weight data to verify and calculate the prediction error range, and error statistical data is generated. The error statistical data is evaluated for credibility, the prediction value is determined through confidence interval analysis, and the weight prediction result is obtained.

[0114] For example, by collecting the growth data of the pig from birth to 150 days for analysis. First, the data is stratified according to the growth stage, such as in the middle growth stage (111-150 days), the collected data includes daily feed intake, water intake, activity intensity and other behavioral characteristics, as well as body length, body height, body width and other body shape parameters. The original data is 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 shape parameters, and there is a significant correlation between environmental temperature and feeding behavior. Based on these correlation relationships, the attention mechanism is used to dynamically adjust the feature weights, focusing on the feature indicators that are strongly related to weight gain. When predicting the weight, the model not only considers the current feature data, but also integrates the historical growth trend, and continuously optimizes the prediction accuracy through error back propagation. When new feed intake data or body shape measurement data is input, the model can quickly update the parameters to adapt to the dynamic changes of growth and development, and output the weight prediction result.

[0115] In a specific embodiment, the process of performing step S106 can specifically include the following steps:

[0116] (1) Time series analysis is performed on the body weight prediction results to calculate the growth rate trend, and growth trend data is obtained;

[0117] (2) Growth cycle segmentation points are established according to the growth trend data, and nutritional demand calculations are performed for different growth stages to obtain nutritional demand data;

[0118] (3) Deviation calculations are performed on the nutritional demand data and standard growth curves to quantitatively evaluate the growth state, and state evaluation data is obtained;

[0119] (4) Group distribution statistics are performed on the state evaluation data, and individual growth difference coefficients are calculated to obtain group difference data;

[0120] (5) Group difference data is classified according to threshold ranges to identify and mark abnormal individuals, and abnormal marking data is obtained;

[0121] (6) Nutritional supplementation schemes are designed according to the abnormal marking data, and nutritional ratios are dynamically adjusted to obtain nutritional ratio data;

[0122] (7) Nutritional ratio data is converted into feed formula parameters, and feeding strategies are quantitatively planned to obtain feeding plan data;

[0123] (8) Time node arrangements are performed on the feeding plan data to generate specific feeding operation guidelines, and feeding operation data is obtained;

[0124] (9) Feeding operation data is associated and integrated with abnormal marking data to establish a feedback tracking mechanism, and supervision tracking data is obtained;

[0125] (10) Comprehensive analysis and processing are performed on the supervision tracking data to form a feeding management scheme, and target feeding management strategies are obtained.

[0126] Specifically, first, the body weight growth rate between adjacent time points is calculated, and the growth rate trend is obtained through difference method. The growth rate calculation considers the time interval factor, and uses the body weight growth amount per unit time as the evaluation index to form the 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 specific nutritional demand characteristics, and the demand amounts of protein, energy, minerals and other nutrients are calculated based on the growth stage and body weight prediction results to generate nutritional demand data. Nutritional demand calculation is based on the nutritional standards in the standard feeding manual, and dynamically adjusted combined with actual growth conditions.

[0127] The calculated nutritional requirement data is compared with the standard growth curve to calculate the deviation value between the actual growth curve and the standard curve. The deviation calculation includes two dimensions of absolute deviation and relative deviation, and the growth state is quantitatively evaluated by setting a scoring standard to form state evaluation data. The evaluation indexes include growth rate, body weight standard rate and development uniformity, etc. The state evaluation data generated is statistically analyzed for population distribution to calculate the growth difference coefficient between individuals in the population. The difference coefficient is calculated by the coefficient of variation method, which reflects the dispersion degree of the growth and development of individuals in the population. The population difference data obtained by statistical analysis can directly reflect the overall growth status of the breeding population.

[0128] The population difference data is divided into levels according to the preset threshold range, and 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 considers multiple indexes such as growth rate, feed intake and behavior characteristics. Based on the abnormal marking data, a targeted nutrition supplement scheme is formulated, and different nutrition intervention measures are adopted for abnormal individuals of different levels. The dynamic adjustment of nutrition ratio follows the principle of nutritional balance, and the ratio relationship of various nutrients is optimized to form nutrition ratio data. The key indicators in the ratio adjustment process are the ratio of energy to protein and amino acid balance.

[0129] The nutrition ratio data is converted into specific feed formula parameters, including the ratio and addition amount of various raw materials. In the formula design process, the nutritional value, price factor and availability of raw materials are considered, and the optimal ratio scheme is determined by linear programming method to generate feeding plan data. The feeding plan clearly specifies specific parameters such as daily feeding amount, feeding frequency and feeding time. The feeding plan data is arranged at time nodes to develop detailed feeding operation procedures. The operation guidance includes daily feeding schedule, feed blending method and matters needing attention to form feeding operation data. The development of operation procedures fully considers the physiological characteristics and behavioral habits of breeding pigs.

[0130] The feeding operation data is associated and integrated with the abnormal marking data to establish a complete supervision and tracking system. The tracking mechanism includes regular measurement of body weight, recording of feeding conditions and observation of behavior performance, etc. to form supervision and tracking data. Through the tracking data, problems occurring in the feeding process can be found and solved in a timely manner. Finally, the supervision and tracking data are comprehensively analyzed to form a complete feeding management scheme. The management scheme includes feeding targets, operation procedures and emergency plans, etc., and the target feeding management strategy is formed through continuous optimization.

[0131] For example, after obtaining weight prediction results, time series analysis revealed that some individuals experienced slow growth during the mid-growth stage. Data analysis showed that these individuals had lower than normal daily feed intake and relatively less activity. Close monitoring of these individuals with abnormal growth revealed that their feeding behavior was mainly concentrated in the early morning and evening, while normal individuals showed a more even feeding pattern. Based on this finding, the feeding program for the abnormal individuals was adjusted, increasing the feed supply during the morning and evening periods, and adding appropriate palatability enhancers to the feed. Through continuous monitoring, the feed intake of the abnormal individuals gradually returned to normal levels, and their growth rate significantly improved. Throughout the adjustment process, the breeders strictly adhered to the established operating procedures, regularly recorded individual feed intake and weight changes, and adjusted the feeding program in a timely manner based on the monitoring results, achieving balanced growth for the entire breeding population.

[0132] The above describes the intelligent weight monitoring method for farmed pigs in the embodiments of this application. The following describes the intelligent weight monitoring system for farmed pigs in the embodiments of this application. Please refer to [link / reference]. Figure 2 One embodiment of the intelligent weight monitoring system for farmed pigs in this application includes:

[0133] The acquisition module is used to acquire and process images of farmed pigs through a multi-angle stereo image acquisition network to obtain a raw image dataset containing top view, side view and 45-degree angle view;

[0134] The noise reduction module is used to perform image enhancement and noise reduction processing based on the original image dataset using an adaptive histogram equalization algorithm and an improved Gaussian filter, and to perform target segmentation processing by combining a background separation algorithm based on region growing, so as to obtain normalized image data.

[0135] The extraction module is used to extract features from the standardized image data using a contour-skeleton dual feature extraction algorithm, and to construct a skeletal framework by combining key point localization based on curvature analysis, thereby obtaining feature vector data containing body shape parameters.

[0136] The fusion module is used to perform multi-source data fusion processing on the feature vector data and the behavioral data collected by IoT sensors through a deep learning behavior pattern recognition algorithm, and to perform anomaly correction through a spatiotemporal correlation data cleaning algorithm to obtain a fused feature dataset.

[0137] The modeling module is used to model weight based on the fused feature dataset using a hierarchical-incremental hybrid prediction model, and to optimize weight by combining an attention-based feature importance adaptive adjustment algorithm to obtain weight prediction results.

[0138] The generating module is configured to generate a feeding scheme via a reinforcement learning algorithm according to the body weight prediction result, analyze a growth state by combining a group abnormality early warning mechanism, and obtain a target feeding management strategy.

[0139] Through the cooperation of the above-mentioned components, the original image dataset containing the top view, side view and 45-degree view is obtained through the multi-angle stereo image acquisition network, effectively avoiding the information loss caused by a single view, improving the integrity and reliability of data acquisition, and through the adaptive histogram equalization algorithm and the improved Gaussian filter for image enhancement and noise reduction processing, combined with the region growing-based background separation algorithm for target segmentation processing, the image quality can be effectively improved and the target area can be accurately separated, laying a foundation for subsequent feature extraction, and the contour-skeleton dual feature extraction algorithm is used for feature extraction, combined with the key point positioning based on curvature analysis for skeleton framework construction, realizing the accurate extraction and quantitative expression of the body shape characteristics of the breeding pigs, through the multi-source data fusion processing of the feature vector data and the behavior data collected by the Internet of Things sensor, and via the time and space related data cleaning algorithm for abnormal correction, the accuracy and reliability of the data are significantly improved, the body weight is modeled based on the hierarchical-incremental hybrid prediction model, combined with the feature importance adaptive adjustment algorithm based on the attention mechanism for weight optimization, not only improving the accuracy of the prediction model, but also realizing the targeted modeling of different growth stages, finally the feeding scheme is generated through the reinforcement learning algorithm, combined with the group abnormality early warning mechanism for growth state analysis, realizing the effective connection of the monitoring result and the feeding management, forming a complete intelligent breeding solution, not only significantly improving the accuracy and efficiency of the body weight monitoring, but also realizing the intelligentization and precision of the feeding management.

[0140] Based on the same technical concept, the embodiment of the present application also provides a body weight intelligent monitoring device for breeding pigs. Referring to Figure 3 As shown in the structure schematic diagram of the body weight intelligent monitoring device 300 for breeding pigs provided by the embodiment of the present application, it includes a processor 301, a memory 302, and a bus 303. The memory 302 is used to store execution instructions, including an internal memory 3021 and an external memory 3022; the internal memory 3021 is also called an internal memory, used to temporarily store operation data in the processor 301 and exchange data with the external memory 3022 such as a hard disk, the processor 301 exchanges data with the external memory 3022 through the internal memory 3021, and the processor 301 and the memory 302 communicate through the bus 303 when the body weight intelligent monitoring device 300 for breeding pigs is running.

[0141] The application further provides a computer readable storage medium, which can be a nonvolatile computer readable storage medium or a volatile computer readable storage medium, and instructions are stored in the computer readable storage medium, and when the instructions are run on a computer, the computer is caused to perform the steps of the method for intelligently monitoring the weight of a pig in breeding.

[0142] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the system, the system and the unit described above can refer to the corresponding processes in the foregoing method embodiments, and will not be described here.

[0143] The integrated unit, if implemented in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, includes a plurality of instructions for causing a pig weight intelligent monitoring device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program code storage media.

[0144] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for intelligent weight monitoring of farmed pigs, characterized in that, The intelligent weight monitoring method for farmed pigs includes: Images of farmed pigs were acquired and processed using a multi-angle stereo image acquisition network to obtain a raw image dataset containing top view, side view, and 45-degree angle view. Based on the original image dataset, image enhancement and noise reduction are performed using an adaptive histogram equalization algorithm and an improved Gaussian filter, and target segmentation is performed using a background separation algorithm based on region growing, resulting in normalized image data. Based on the standardized image data, features are extracted using a contour-skeleton dual feature extraction algorithm. The skeleton framework is then constructed by combining key point localization based on curvature analysis, resulting in feature vector data containing body shape parameters. The feature vector data and the behavioral data collected by IoT sensors are fused together using a deep learning behavior pattern recognition algorithm. Anomalies are then corrected using a spatiotemporal correlation data cleaning algorithm to obtain the fused feature dataset. Based on the fused feature dataset, weight modeling is performed using a hierarchical-incremental hybrid prediction model, combined with a feature importance adaptive adjustment algorithm based on an attention mechanism for weight optimization, to obtain weight prediction results. This includes: dividing the fused feature dataset into growth stages, performing hierarchical processing according to time span to obtain hierarchical feature data; calculating the statistical distribution characteristics of each layer of data based on the hierarchical feature data, and normalizing the data to obtain standardized hierarchical data; performing feature mapping on the standardized hierarchical data according to the input dimension, quantifying the correlation strength between features to obtain feature weight data; and calculating attention scores on the feature weight data, dynamically adjusting the weights based on the feature importance score to obtain attention... The process involves: 1) Weighted combination of the attention distribution data and the standardized hierarchical data; 2) Redistributing the feature contributions to obtain weighted feature data; 3) Establishing a prediction parameter matrix based on the weighted feature data; 4) Backpropagating historical prediction errors to obtain error correction data; 5) Incrementally updating the error correction data; 6) Extracting and integrating features from newly added data samples to obtain updated feature data; 7) Performing prediction calculations on the updated feature data to generate a weight estimation result, resulting in a predicted value sequence; 8) Comparing and verifying the predicted value sequence with measured weight data; 9) Calculating the prediction error range to obtain error statistics; 10) Evaluating the credibility of the error statistics; 11) Determining the predicted value through confidence interval analysis to obtain the weight prediction result. Based on the predicted weight, a feeding plan is generated using a reinforcement learning algorithm, and growth status is analyzed by combining a population anomaly early warning mechanism to obtain the target feeding and management strategy.

2. The intelligent weight monitoring method for farmed pigs according to claim 1, characterized in that, The process involves acquiring and processing images of farmed pigs using a multi-angle stereoscopic image acquisition network to obtain a raw image dataset containing top-view, side-view, and 45-degree angle views, including: By measuring environmental parameters to obtain light intensity values ​​and distance data, the aquaculture area is located in three-dimensional space to obtain basic scene data. Based on the basic data of the scenario, the acquisition parameters are calculated, and the device parameters are dynamically adjusted to obtain the optimized acquisition settings; The optimized acquisition settings are input into the image acquisition system to perform multi-angle scanning of the target area and obtain the original scan data. The original scan data is time-synchronized and then combined with spatial location information for coordinate correction to obtain spatiotemporal registration data. Based on the spatiotemporal registration data, perspective classification processing is performed, and projection transformation is carried out on the data from different perspectives to obtain a multi-perspective sequence. The multi-view sequences are integrated according to their temporal relationship, and the original image dataset containing top view, side view and 45-degree angle view is obtained by data merging.

3. The intelligent weight monitoring method for farmed pigs according to claim 1, characterized in that, The process involves image enhancement and noise reduction using an adaptive histogram equalization algorithm and an improved Gaussian filter based on the original image dataset, followed by target segmentation using a region-growing-based background separation algorithm, to obtain standardized image data, including: Perform grayscale value statistical analysis on the original image dataset, construct a grayscale distribution histogram, and obtain grayscale distribution feature data; The image brightness threshold range is calculated based on the grayscale distribution feature data, and the pixel values ​​are mapped to the interval to obtain brightness equalization data. The brightness equalization data is weighted according to the pixel neighborhood relationship, and the image noise is weighted and averaged to obtain the noise reduction data. Edge region detection is performed on the noise-reduced data to determine the seed points for the target region, thus obtaining the initial segmentation data; The initial segmentation data is expanded into regions based on pixel similarity, and the target boundary is dynamically updated to obtain target contour data. The target contour data is separated into background and foreground, and then subjected to edge smoothing to obtain normalized image data.

4. The intelligent weight monitoring method for farmed pigs according to claim 1, characterized in that, The standardized image data is used to extract features via a contour-skeleton dual feature extraction algorithm, and a skeletal framework is constructed by combining keypoint localization based on curvature analysis, resulting in feature vector data containing body shape parameters, including: Boundary points are extracted from the normalized image data, and the gradient change values ​​between adjacent points are calculated to obtain the target contour point set; The target contour point set is interpolated and connected according to its spatial distribution, and the contour curve is smoothed to obtain continuous contour data. Distance transformation calculations are performed on the continuous contour data to determine the centerline position of the target region and obtain the initial point set of the skeleton; The initial set of points in the skeleton is branched according to the topological structure, and the branch nodes are pruned and merged to obtain the main skeleton data. Based on the main skeleton data, local curvature is calculated, and feature extraction is performed on the curvature extreme points to obtain key feature point data; The key feature point data is spatially mapped, and the ear root point, acromion point, and buttock point are located and labeled to obtain labeled position data. Distance measurements are performed on the labeled location data, and the Euclidean distance between adjacent feature points is calculated to obtain body length parameter data; The body length parameter data is vertically projected onto the main skeleton data to calculate the body height value, thus obtaining the body height parameter data. The continuous contour data is scanned laterally at the marked position data to calculate the target width value and obtain the body width parameter data. The body length parameter data, body height parameter data, and body width parameter data are combined and organized to generate feature vector data containing body shape parameters.

5. The intelligent weight monitoring method for farmed pigs according to claim 1, characterized in that, The process involves fusing the feature vector data with behavioral data collected by IoT sensors using a deep learning behavior pattern recognition algorithm, followed by anomaly correction via a spatiotemporal correlation data cleaning algorithm, to obtain a fused feature dataset, including: The feature vector data is time-series labeled, and the body shape parameters at different time points are arranged in chronological order to obtain time-series feature data; A time window is established based on the time series characteristic data, and data continuity is checked within the window to obtain sequence integrity data; The sequence integrity data is time-aligned with the behavioral data collected by IoT sensors to determine the data collection time nodes and obtain aligned time sequence data. The aligned time-series data is classified into behavioral types, and behavioral feature data is obtained by combining multi-dimensional features such as food intake, water intake, and activity intensity. The behavioral feature data is segmented according to spatiotemporal correlation, and the mutation points within the data segments are identified to obtain anomaly marker data; Statistical analysis is performed on the anomaly-marked data to calculate the mean and standard deviation within the data segment, thereby obtaining statistical characteristic data; A threshold range is established based on the statistical feature data, and data points exceeding the threshold are corrected to obtain smoothed data. The smoothed data and the behavioral feature data are correlated and analyzed to establish a correlation matrix between features, thereby obtaining correlation data. The correlation data is combined by feature merging, and highly correlated features are merged to obtain dimensionality-reduced feature data. The dimensionality-reduced feature data is integrated with the time-series feature data and reorganized according to the time dimension to obtain a fused feature dataset.

6. The intelligent weight monitoring method for farmed pigs according to claim 1, characterized in that, Based on the predicted body weight, a feeding plan is generated using a reinforcement learning algorithm, and growth status is analyzed using a population anomaly early warning mechanism to obtain the target feeding and management strategy, including: Time series analysis was performed on the predicted weight to calculate the growth rate trend and obtain growth trend data. Based on the growth trend data, growth cycle segmentation points are established, and nutritional requirements are calculated for different growth stages to obtain nutritional requirement data. The deviation between the nutritional requirement data and the standard growth curve is calculated to quantitatively assess the growth status and obtain status assessment data. The population distribution statistics of the state assessment data are performed, and the individual growth difference coefficient is calculated to obtain the population difference data; The group difference data is classified according to a threshold range, and abnormal individuals are marked and identified to obtain abnormal marked data; Based on the abnormal marker data, a nutritional supplementation plan is designed, and the nutritional ratio is dynamically adjusted to obtain nutritional ratio data; The nutritional ratio data is converted into feed formulation parameters, and the feeding strategy is quantitatively planned to obtain feeding plan data. The feeding plan data is scheduled according to time nodes to generate specific feeding operation guidelines, thus obtaining feeding operation data; The feeding operation data and the abnormal marker data are correlated and integrated to establish a feedback tracking mechanism and obtain regulatory tracking data; The monitoring and tracking data are comprehensively analyzed and processed to form a feeding and management plan, resulting in the target feeding and management strategy.

7. A weight intelligent monitoring system for farmed pigs, used to implement the weight intelligent monitoring method for farmed pigs as described in any one of claims 1-6, characterized in that, The intelligent weight monitoring system for farmed pigs includes: The acquisition module is used to acquire and process images of farmed pigs through a multi-angle stereo image acquisition network to obtain a raw image dataset containing top view, side view and 45-degree angle view; The noise reduction module is used to perform image enhancement and noise reduction processing based on the original image dataset using an adaptive histogram equalization algorithm and an improved Gaussian filter, and to perform target segmentation processing by combining a background separation algorithm based on region growing, so as to obtain normalized image data. The extraction module is used to extract features from the standardized image data using a contour-skeleton dual feature extraction algorithm, and to construct a skeletal framework by combining key point localization based on curvature analysis, thereby obtaining feature vector data containing body shape parameters. The fusion module is used to perform multi-source data fusion processing on the feature vector data and the behavioral data collected by IoT sensors through a deep learning behavior pattern recognition algorithm, and to perform anomaly correction through a spatiotemporal correlation data cleaning algorithm to obtain a fused feature dataset. The modeling module is used to model weight based on the fused feature dataset using a hierarchical-incremental hybrid prediction model, and to optimize weights using an attention-based adaptive feature importance adjustment algorithm to obtain weight prediction results. The module includes: dividing the fused feature dataset into growth stages and performing hierarchical processing according to time span to obtain hierarchical feature data; calculating the statistical distribution characteristics of each layer of data based on the hierarchical feature data, and normalizing the data to obtain standardized hierarchical data; performing feature mapping on the standardized hierarchical data according to the input dimension, and quantifying the correlation strength between features to obtain feature weight data; calculating attention scores on the feature weight data, and dynamically adjusting the weights based on the feature importance scores to obtain... The process involves: obtaining attention distribution data; weighting the attention distribution data with the standardized hierarchical data to redistribute feature contributions, resulting in weighted feature data; establishing a prediction parameter matrix based on the weighted feature data and backpropagating historical prediction errors to obtain error correction data; incrementally updating the error correction data and extracting and integrating features from newly added data samples to obtain updated feature data; performing prediction calculations on the updated feature data to generate weight estimation results, resulting in a predicted value sequence; comparing and verifying the predicted value sequence with measured weight data, calculating the prediction error range, and obtaining error statistics; assessing the credibility of the error statistics and determining the predicted value through confidence interval analysis to obtain the weight prediction result. The generation module is used to generate a feeding plan based on the weight prediction results through a reinforcement learning algorithm, and to analyze the growth status by combining a population anomaly early warning mechanism to obtain the target feeding management strategy.

8. A smart weight monitoring device for farmed pigs, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the intelligent weight monitoring device for pig farming is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the intelligent weight monitoring method for pig farming as described in any one of claims 1 to 6 are performed.

9. A computer-readable storage medium storing instructions thereon, characterized in that, When the instructions are executed by the processor, they implement the intelligent weight monitoring method for farmed pigs as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Multi-source information fusion live pig full-chain intelligent monitoring method and device

    CN113507490A

  • Pig behavior and health method based on deep learning and physiological parameter dynamic monitoring

    CN118986303A