Method and system for analyzing quantity of living livestock based on recorded image

Through deep learning and multi-task learning technology, combined with LSTM and three-dimensional convolutional neural network, it solves the accuracy problem of counting live livestock in complex environments in the existing technology, achieves accurate counting and behavior pattern analysis, and provides a basis for modern pasture management. Provides revolutionary improvements.

CN118552879AInactive Publication Date: 2024-08-27TIANJIN SUIXING TECH CO LTD

Patent Information

Application Number
CN202410965510.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-18
Publication Date
2024-08-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing automatic counting technology has low accuracy in counting live livestock in complex environments. Especially when faced with complex backgrounds, light changes, and behavioral diversity of live livestock, the counting error rate increases significantly.

Method used

Using methods based on deep learning and multi-task learning, by acquiring and preprocessing historical video data, training LSTM network models and three-dimensional convolutional neural network models, extracting feature data and conducting cross-validation, combined with a multi-task learning framework, to achieve the detection of live livestock Precise analysis of quantities and in-depth understanding of behavioral patterns.

Benefits of technology

It significantly improves the accuracy of live livestock counting and the depth of behavioral pattern analysis in complex environments, adapts to various lighting conditions, time periods and environmental backgrounds, reduces counting errors, and improves the efficiency and reliability of pasture management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118552879A
    Figure CN118552879A
Patent Text Reader

Abstract

The invention provides a method and system for analyzing the number of living livestock based on recorded images, and the method comprises the steps: obtaining historical video data which comprises various behaviors of the living livestock and covers different time periods, different illumination conditions and different environment backgrounds; preprocessing the historical video data to obtain a historical video frame sequence, the preprocessing including graying processing, noise reduction processing and background subtraction processing; using the historical video frame sequence to train a preset network model to obtain a target network model, the target network model being used for analyzing the number of living livestock; after the current video data is obtained, the current analysis quantity of the living livestock is determined by using the current video data and the target network model, and the technical effect of accurately analyzing the quantity of the living livestock in real time is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the technical field of image processing, and more particularly to a method and system for analyzing the number of live livestock based on recorded images. Background Art

[0002] In modern animal husbandry management, accurate knowledge of livestock numbers is crucial for resource planning, health management, and economic benefits. Traditional manual counting methods are time-consuming, labor-intensive, and error-prone, especially in large farms or complex and changing natural environments, such as vast grasslands, cloudy weather changes, and nighttime hours. The efficiency and accuracy of manual counting are greatly reduced. In addition, with the expansion of farm size and the improvement of management requirements, it is becoming increasingly important to understand the behavioral patterns of live livestock, such as monitoring their activity patterns, eating habits, and abnormal behaviors, which is of great significance for preventing diseases and optimizing feeding conditions.

[0003] Most existing automatic counting technologies rely on simple image recognition algorithms. These methods often perform poorly when faced with complex backgrounds, light changes, and the diversity of live livestock behaviors. In particular, when live livestock block each other or are in similar ambient color temperatures, the counting error rate increases significantly. Summary of the invention

[0004] The embodiments of the present application provide a method and system for analyzing the number of live livestock based on recorded images, so as to solve the problem of low accuracy in analyzing the number of live livestock based on recorded images in the prior art.

[0005] In a first aspect, an embodiment of the present application provides a method for analyzing the number of live livestock based on recorded images, comprising: obtaining historical video data, wherein the video data contains various behaviors of live livestock, and the video data covers different time periods, different lighting conditions and different environmental backgrounds; preprocessing the historical video data to obtain a historical video frame sequence, wherein the preprocessing includes: grayscale processing, noise reduction processing and background subtraction processing; using the historical video frame sequence, training a preset network model to obtain a target network model, wherein the target network model is used to analyze the number of live livestock; after obtaining the current video data, using the current video data and the target network model to determine the current number of live livestock to be analyzed; wherein, if the preset network model is an LSTM network model, using the historical video frame sequence The method comprises the steps of: extracting features from the historical video frame sequence to obtain a feature data sequence, wherein the feature data includes: the movement direction of the live livestock, the movement speed of the live livestock, the degree of occlusion between the live livestock and the environmental characteristics; inputting the feature data sequence into the LSTM network model for training to obtain the behavior category of the live livestock in each historical video frame, wherein the behavior category includes at least: walking and lying down; determining the corrected live livestock analysis quantity corresponding to the historical video frame sequence based on the behavior category and the first preset live livestock quantity statistical formula; cross-validating and optimizing the LSTM network model based on the historical live livestock analysis quantity and the actual live livestock quantity corresponding to the historical video frame sequence to obtain the target network model.

[0006] Furthermore, if the characteristic data includes: the moving direction and moving speed of the live livestock, the first preset live livestock number statistical formula is: ; in, The number of live livestock analyzed after the first revision, is the initial historical live livestock analysis number corresponding to the historical video frame sequence, is the first The correction factor of the behavior category corresponding to the frame, is the first The probability of the actual behavior category corresponding to the frame, is the first The expected behavior probability corresponding to the frame, is the number of video frames in the historical video frame sequence.

[0007] If the characteristic data includes: the moving direction of the live livestock, the moving speed of the live livestock, the degree of occlusion between the live livestock and the environmental characteristics, then the first preset live livestock number statistical formula is: ; in, The second revised live animal analysis number, , and is the weight parameter, is the first The probability correction factor for the live animal behavior category corresponding to the frame, and is a constant, is the first The probability of the actual behavior category corresponding to the frame is the same as the probability of the first The difference threshold of the expected behavior probability quality inspection corresponding to the frame, is the first The occlusion correction factor corresponding to the frame, , and To occlude the intensity parameter, is the first The occlusion ratio of the frame, is the first The occlusion duration of the frame, is the first Correction factor for environmental factors of the frame, , is the function corresponding to the environmental factors, is the first Frame weather conditions, is the first The light level of the frame, is the first The probability of the actual behavior category corresponding to the frame, is the first The expected behavior probability corresponding to the frame, is the number of video frames in the historical video frame sequence.

[0008] Furthermore, if the preset network model is a network model constructed based on a three-dimensional convolutional neural network and an LSTM network, the preset network model is trained using the historical video frame sequence to obtain a target network model, including; Using a deep learning algorithm, individually identify each live animal in the historical video frame sequence to determine the movement trajectory of each live animal; Constructing a space-time cube for each live livestock, and using the preset network model to extract high-level features of the space-time cube, wherein the high-level features at least include: space-time motion features, time series behavior patterns, relationship features between live livestock, and environmental adaptability features; The preset network model is trained using the movement trajectory of each live animal and the high-level features to determine the corrected live animal analysis quantity corresponding to the historical video frame sequence.

[0009] Further, based on the multi-task learning framework, the high-level features and the preset network model, determining the corrected number of live livestock analyses corresponding to the historical video frame sequence includes: Based on the multi-task learning framework, the high-level features and the preset network model, target data is determined, wherein the target data includes: a behavior pattern of each live animal in each frame and a prediction result of an occlusion degree and an overlap between the live animals in each frame; The corrected live livestock analysis quantity corresponding to the historical video frame sequence is obtained based on the target data and a second preset live livestock quantity statistical formula.

[0010] Furthermore, the second preset formula for calculating the number of live livestock is: ; in, The third revised live animal analysis number, is the dynamic correction factor, Correction factors for interactions between live animals, is the environmental impact factor, , The center point of the time window The distance decay weight, Indicates the time window Behavior trend indicators of frames, is the width of the time window, , Livestock With live animals Whether interaction occurs, For live animals With live animals The distance of quality inspection, For live animals behavior patterns, For live animals behavior patterns, is the interaction effect function.

[0011] In a second aspect, an embodiment of the present application provides a system for analyzing the number of live livestock based on recorded images, comprising: an acquisition unit, for acquiring historical video data, wherein the video data includes various behaviors of live livestock, and the video data covers different time periods, different lighting conditions and different environmental backgrounds; A preprocessing unit, used for preprocessing the historical video data to obtain a historical video frame sequence, wherein the preprocessing includes: grayscale processing, noise reduction processing and background subtraction processing; A training unit, used to train a preset network model using the historical video frame sequence to obtain a target network model, wherein the target network model is used to analyze the number of live livestock; A determination unit, configured to determine the current number of live livestock to be analyzed by using the current video data and the target network model after acquiring the current video data; Wherein, if the preset network model is an LSTM network model, the preset network model is trained using the historical video frame sequence to obtain a target network model, including; Extracting features from the historical video frame sequence to obtain a feature data sequence, wherein the feature data includes: the movement direction of the live livestock, the movement speed of the live livestock, the degree of occlusion between the live livestock, and environmental features; Inputting the feature data sequence into the LSTM network model for training to obtain the behavior category of the live livestock in each historical video frame, wherein the behavior category at least includes: walking and lying; Based on the behavior category and a first preset live livestock quantity statistical formula, determining a revised live livestock analysis quantity corresponding to the historical video frame sequence; Based on the historical live livestock analysis quantity and the actual live livestock quantity corresponding to the historical video frame sequence, the LSTM network model is cross-validated and optimized to obtain the target network model.

[0012] In a third aspect, an embodiment of the present application provides a computing device, including a processing component and a storage component; the storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement the method described in the first aspect above.

[0013] In a fourth aspect, an embodiment of the present application provides a computer storage medium storing a computer program, which, when executed by a computer, implements the method described in the first aspect above.

[0014] The embodiments of the present invention provide a method and system for analyzing the number of live livestock based on deep learning and multi-task learning, which can not only effectively solve the limitations of traditional counting technology in complex environments, but also provide in-depth analysis of the behavior patterns of live livestock, bringing revolutionary improvements to modern pasture management. By integrating comprehensive learning of historical video data, the system can adapt to various lighting conditions, time periods and environmental backgrounds to achieve accurate counting. These or other aspects of the present application will be more concise and easy to understand in the description of the following embodiments.

[0015] These and other aspects of the present application will become more clearly understood in the description of the following embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0017] Figure 1 A flow chart of a method for analyzing the number of live livestock based on recorded images provided in an embodiment of the present application; Figure 2 A flowchart of a system for analyzing the number of live livestock based on recorded images provided in an embodiment of the present application; Figure 3 A schematic diagram of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0018] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0019] Embodiment 1: According to an embodiment of the present invention, an embodiment of a method for analyzing the number of live livestock based on recorded images is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0020] Figure 1 FIG. 4 is a flow chart of a method for analyzing the number of live livestock based on recorded images according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps: Step S102, acquiring historical video data, wherein the video data includes various behaviors of live livestock, and the video data covers different time periods, different lighting conditions and different environmental backgrounds; In the embodiment of the present invention, high-definition video equipment can be used to collect video data at different times of the year to ensure coverage of the four seasons of spring, summer, autumn, and winter, as well as different time points such as morning, evening, and noon. The data includes the behavior of live livestock in various scenes such as grassland, inside and outside the shed, and drinking water areas.

[0021] Step S104, preprocessing the historical video data to obtain a historical video frame sequence, wherein the preprocessing includes: grayscale processing, noise reduction processing and background subtraction processing; In the embodiment of the present invention, the historical video data is grayed out to convert the color video into a grayscale image, thereby reducing the computational complexity and reducing the impact of illumination changes on image analysis. Noise reduction processing can be used to remove noise in the image, such as artifacts caused by swaying grass. A background subtraction algorithm (such as a mixed Gaussian model) is used to identify and remove fixed backgrounds and highlight the contours of live livestock.

[0022] Step S106, using the historical video frame sequence to train a preset network model to obtain a target network model, wherein the target network model is used to analyze the number of live livestock; In an embodiment of the present invention, the preset network model may be an LSTM network model or a network model constructed based on a three-dimensional convolutional neural network and an LSTM network.

[0023] Step S108, after acquiring the current video data, using the current video data and the target network model, determining the current number of live livestock to be analyzed.

[0024] In the embodiment of the present invention, an intelligent counting model that can adapt to various environments and behavioral changes is constructed through full learning of historical data. The preprocessing step ensures the consistency of model training and application, and the multi-task learning framework allows the model to not only count but also understand the behavior of live livestock, which is of great significance for reducing misjudgments in complex scenarios. The dynamic adjustment mechanism in real-time applications ensures that the model can be continuously optimized over time and with environmental changes, improving the practicality and reliability of the system.

[0025] In an embodiment of the present invention, if the preset network model is an LSTM network model, the preset network model is trained using the historical video frame sequence to obtain a target network model, including; Extracting features from the historical video frame sequence to obtain a feature data sequence, wherein the feature data includes: the movement direction of the live livestock, the movement speed of the live livestock, the degree of occlusion between the live livestock, and environmental features; Inputting the feature data sequence into the LSTM network model for training to obtain the behavior category of the live livestock in each historical video frame, wherein the behavior category at least includes: walking and lying; Based on the behavior category and a first preset live livestock quantity statistical formula, determining a revised live livestock analysis quantity corresponding to the historical video frame sequence; Based on the historical live livestock analysis quantity and the actual live livestock quantity corresponding to the historical video frame sequence, the LSTM network model is cross-validated and optimized to obtain the target network model.

[0026] In an embodiment of the present invention, a computer vision library (such as OpenCV, TensorFlow, or PyTorch) may be used to perform video processing.

[0027] Optical flow algorithms (such as the Horn-Schunck method or the Farneback algorithm) are used to calculate the displacement vector of the live animals between adjacent frames, and then the movement direction and speed are obtained.

[0028] The outline of each live livestock is identified through background subtraction and instance segmentation techniques (such as Mask R-CNN), and the proportion of outline overlap is calculated to assess the degree of occlusion.

[0029] Finally, information such as light intensity and color histogram is extracted from the data frame to reflect environmental changes as environmental features.

[0030] By designing an LSTM network, the input layer accepts the feature data sequence obtained from S31, the hidden layer processes the time series features, and the output layer predicts the behavior category. Two basic behavior labels are defined: "walking" and "lying down". More categories can be expanded according to needs in the future. The sequence-to-sequence training method is used to optimize the loss function (such as cross entropy loss) to minimize the difference between the predicted behavior category and the actual label.

[0031] In the embodiment of the present invention, if the characteristic data includes: the moving direction and moving speed of the live livestock, then the first preset live livestock number statistical formula is: ; in, The number of live livestock analyzed after the first revision, is the initial historical live livestock analysis number corresponding to the historical video frame sequence, is the first The correction factor of the behavior category corresponding to the frame, is the first The probability of the actual behavior category corresponding to the frame, is the first The expected behavior probability corresponding to the frame, is the number of video frames in the historical video frame sequence.

[0032] If the characteristic data includes: the moving direction of the live livestock, the moving speed of the live livestock, the degree of occlusion between the live livestock and the environmental characteristics, then the first preset live livestock number statistical formula is: ; in, The second revised live animal analysis number, , and is the weight parameter, is the first The probability correction factor for the live animal behavior category corresponding to the frame, and is a constant, is the first The probability of the actual behavior category corresponding to the frame is the same as the probability of the first The difference threshold of the expected behavior probability quality inspection corresponding to the frame, is the first The occlusion correction factor corresponding to the frame, , and To occlude the intensity parameter, is the first The occlusion ratio of the frame, is the first The occlusion duration of the frame, is the first Correction factor for environmental factors of the frame, , is the function corresponding to the environmental factors, is the first Frame weather conditions, is the first The light level of the frame, is the first The probability of the actual behavior category corresponding to the frame, is the first The expected behavior probability corresponding to the frame, is the number of video frames in the historical video frame sequence.

[0033] In an embodiment of the present invention, if the preset network model is a network model constructed based on a three-dimensional convolutional neural network and an LSTM network, the preset network model is trained using the historical video frame sequence to obtain a target network model, including; Using a deep learning algorithm, individually identify each live animal in the historical video frame sequence to determine the movement trajectory of each live animal; Constructing a space-time cube for each live livestock, and using the preset network model to extract high-level features of the space-time cube, wherein the high-level features at least include: space-time motion features, time series behavior patterns, relationship features between live livestock, and environmental adaptability features; Based on the multi-task learning framework, the high-level features and the preset network model, a revised live livestock analysis quantity corresponding to the historical video frame sequence is determined.

[0034] In an embodiment of the present invention, a composite model based on a 3D convolutional neural network (3D CNN) and an LSTM network is used, which can effectively integrate time series and spatial information to improve counting accuracy and behavior recognition accuracy.

[0035] The preset network model is trained using the movement trajectory of each live animal and the high-level features to determine the corrected number of live animal analyses corresponding to the historical video frame sequence, including: Based on the multi-task learning framework, the high-level features and the preset network model, target data is determined, wherein the target data includes: a behavior pattern of each live animal in each frame and a prediction result of an occlusion degree and an overlap between the live animals in each frame; The corrected live livestock analysis quantity corresponding to the historical video frame sequence is obtained based on the target data and a second preset live livestock quantity statistical formula.

[0036] Specifically, the ReID technology in deep learning is used in combination with 3D CNN to process video sequences, extract the spatiotemporal characteristics of living livestock, and realize continuous recognition and tracking of individual identities.

[0037] A unique visual feature template is established for each live livestock, and the complete movement trajectory of each live livestock from the first identification to the final disappearance is constructed through feature comparison between sequence frames.

[0038] A space-time cube is constructed for each behavior segment of each live livestock in the video sequence, including several consecutive frames, to capture its dynamic behavior patterns in time and space.

[0039] Then we proceed to extract advanced features. The specific advanced features and extraction methods are as follows: Spatiotemporal motion features: 3D CNN is used to analyze the cube and extract the movement direction, speed, acceleration, etc. of the living livestock.

[0040] Time series behavior patterns: The LSTM layer processes the extracted motion feature sequences and identifies behavior patterns such as eating, walking, and lying down.

[0041] Characterization of relationships between live animals: Analyze the relative positions and occlusions of live animals in the cube to reveal group dynamics and social interactions.

[0042] Environmental adaptability characteristics: Combine environmental information such as light and ground cover type to analyze the behavioral adaptability of living livestock in different environments.

[0043] Finally, the individual action trajectory information and high-level features are used as input to train the 3D CNN-LSTM model end-to-end. The goal is to predict the exact behavioral state of each live livestock in the sequence while taking into account its dynamic position in the group.

[0044] Based on the behavior prediction and trajectory analysis of each frame output by the model, the initial count is corrected, and the corrected number of live livestock in each frame is accumulated to obtain the final corrected number of live livestock analysis for the entire historical video sequence.

[0045] The second preset formula for counting the number of live livestock is: ; in, The third revised live animal analysis number, is the dynamic correction factor, Correction factors for interactions between live animals, is the environmental impact factor, , The center point of the time window The distance decay weight, Indicates the time window Behavior trend indicators of frames, is the width of the time window, , Livestock With live animals Whether interaction occurs, For live animals With live animals The distance of quality inspection, For live animals behavior patterns, For live animals behavior patterns, is the interaction effect function.

[0046] Specifically, ; in, , , is the adjustment coefficient, which is adjusted according to the actual situation. is a function that measures the similarity of behavior, for example, if ,but If two live animals behave completely differently , if it is in the middle state, it can be calculated proportionally.

[0047] In the embodiment of the present invention, 3D CNN can effectively capture the spatiotemporal features in the video, especially the motion information, while LSTM is good at processing time series data and capturing the long-term dependencies of behavior. Combining the two, the model can not only accurately identify and track individual live livestock, but also deeply understand the behavioral patterns and environmental adaptability of live livestock groups, thereby providing more accurate counting and behavior analysis in complex and changing pasture environments. Through the comprehensive analysis of individual identification and advanced features, the system can significantly improve the accuracy and adaptability of counting, providing strong technical support for pasture management.

[0048] Embodiment 2: An embodiment of the present invention further provides a system for analyzing the number of live livestock based on recorded images. The system for analyzing the number of live livestock based on recorded images is used to execute the method for analyzing the number of live livestock based on recorded images provided in the above content of the embodiment of the present invention. The following is a detailed introduction to the device provided in the embodiment of the present invention.

[0049] like Figure 2 As shown, Figure 2 The schematic diagram of the system for analyzing the number of live livestock based on recorded images is shown in FIG. 1 , wherein the system comprises: An acquisition unit 10 is used to acquire historical video data, wherein the video data includes various behaviors of live livestock, and the video data covers different time periods, different lighting conditions and different environmental backgrounds; A preprocessing unit 20, configured to preprocess the historical video data to obtain a historical video frame sequence, wherein the preprocessing includes: grayscale processing, noise reduction processing and background subtraction processing; A training unit 30 is used to train a preset network model using the historical video frame sequence to obtain a target network model, wherein the target network model is used to analyze the number of live livestock; The determination unit 40 is used to determine the current number of live livestock analyses by using the current video data and the target network model after acquiring the current video data.

[0050] The embodiment of the present invention provides a live livestock number analysis system based on deep learning and multi-task learning, which can not only effectively solve the limitations of traditional counting technology in complex environments, but also provide in-depth analysis of live livestock behavior patterns, bringing revolutionary improvements to modern pasture management. By integrating comprehensive learning of historical video data, the system can adapt to various lighting conditions, time periods and environmental backgrounds to achieve accurate counting.

[0051] Embodiment three: The embodiment of the present invention further provides a computing device for executing a program of the method described in the first embodiment, such as Figure 3 As shown, the computing device may include a storage component 41 and a processing component 42; The storage component 41 stores one or more computer instructions, wherein the one or more computer instructions are called and executed by the processing component 42 .

[0052] The processing component 42 may include one or more processors to execute computer instructions to complete all or part of the steps in the method of embodiment 1. Of course, the processing component may also be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.

[0053] The storage component 41 is configured to store various types of data to support operations at the terminal. The storage component can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0054] The display component 43 may be an electroluminescent (EL) element, a liquid crystal display or a micro display having a similar structure, or a retinal direct display or a similar laser scanning display.

[0055] Of course, a computing device may also include other components, such as input / output interfaces, communication components, etc.

[0056] The input / output interface provides an interface between the processing component and the peripheral interface module, which may be an output device, an input device, etc.

[0057] The communication component is configured to facilitate, among other things, wired or wireless communications between the computing device and other devices.

[0058] Among them, the computing device can be a physical device or an elastic computing host provided by a cloud computing platform, etc. In this case, the computing device can refer to a cloud server, and the above-mentioned processing components, storage components, etc. can be basic server resources rented or purchased from the cloud computing platform.

[0059] Embodiment 4: The present application also provides a computer storage medium storing a computer program, wherein the computer program can achieve the above-mentioned Figure 1 The method of the illustrated embodiment.

[0060] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0061] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0062] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0063] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. 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 analyzing the number of live livestock based on recorded images, characterized in that: include: Acquire historical video data, wherein the video data includes various behaviors of live livestock, and the video data covers different time periods, different lighting conditions and different environmental backgrounds; Preprocessing the historical video data to obtain a historical video frame sequence, wherein the preprocessing includes: grayscale processing, noise reduction processing and background subtraction processing; Using the historical video frame sequence, training a preset network model to obtain a target network model, wherein the target network model is used to analyze the number of live livestock; After acquiring the current video data, using the current video data and the target network model to determine the current number of live livestock to be analyzed; Wherein, if the preset network model is an LSTM network model, the preset network model is trained using the historical video frame sequence to obtain a target network model, including; Extracting features from the historical video frame sequence to obtain a feature data sequence, wherein the feature data includes: the movement direction of the live livestock, the movement speed of the live livestock, the degree of occlusion between the live livestock, and environmental features; Inputting the feature data sequence into the LSTM network model for training to obtain the behavior category of the live livestock in each historical video frame, wherein the behavior category at least includes: walking and lying; Based on the behavior category and a first preset live livestock quantity statistical formula, determining a revised live livestock analysis quantity corresponding to the historical video frame sequence; Based on the historical live livestock analysis quantity and the actual live livestock quantity corresponding to the historical video frame sequence, the LSTM network model is cross-validated and optimized to obtain the target network model.

2. The method according to claim 1, characterized in that If the characteristic data includes: the moving direction and moving speed of the live livestock, then the first preset live livestock number statistical formula is: ; in, The number of live livestock analyzed after the first revision, is the initial historical live livestock analysis number corresponding to the historical video frame sequence, is the first The correction factor of the behavior category corresponding to the frame, is the first The probability of the actual behavior category corresponding to the frame, is the first The expected behavior probability corresponding to the frame, is the number of video frames in the historical video frame sequence.

3. The method according to claim 1, characterized in that If the characteristic data includes: the moving direction of the live livestock, the moving speed of the live livestock, the degree of occlusion between the live livestock and the environmental characteristics, then the first preset live livestock number statistical formula is: ; in, The second revised live animal analysis number, , and is the weight parameter, is the first The probability correction factor for the live animal behavior category corresponding to the frame, and is a constant, is the first The probability of the actual behavior category corresponding to the frame is the same as the probability of the first The difference threshold of the expected behavior probability quality inspection corresponding to the frame, is the first The occlusion correction factor corresponding to the frame, , and To occlude the intensity parameter, is the first The occlusion ratio of the frame, is the first The occlusion duration of the frame, is the first Correction factor for environmental factors of the frame, , is the function corresponding to the environmental factors, is the first Frame weather conditions, is the first The light level of the frame, is the first The probability of the actual behavior category corresponding to the frame, is the first The expected behavior probability corresponding to the frame, is the number of video frames in the historical video frame sequence.

4. The method according to claim 3, characterized in that If the preset network model is a network model constructed based on a three-dimensional convolutional neural network and an LSTM network, the preset network model is trained using the historical video frame sequence to obtain a target network model, including; Using a deep learning algorithm, individually identify each live animal in the historical video frame sequence to determine the movement trajectory of each live animal; Constructing a space-time cube for each live livestock, and using the preset network model to extract high-level features of the space-time cube, wherein the high-level features at least include: space-time motion features, time series behavior patterns, relationship features between live livestock, and environmental adaptability features; The preset network model is trained using the movement trajectory of each live animal and the high-level features to determine the corrected live animal analysis quantity corresponding to the historical video frame sequence.

5. The method according to claim 4, characterized in that The preset network model is trained using the movement trajectory of each live animal and the high-level features to determine the corrected live animal analysis quantity corresponding to the historical video frame sequence, including: Based on the multi-task learning framework, the high-level features and the preset network model, target data is determined, wherein the target data includes: a behavior pattern of each live animal in each frame and a prediction result of an occlusion degree and an overlap between the live animals in each frame; The corrected live livestock analysis quantity corresponding to the historical video frame sequence is obtained based on the target data and a second preset live livestock quantity statistical formula.

6. The method according to claim 5, characterized in that The second preset formula for counting the number of live livestock is: ; in, The third revised live animal analysis number, is the dynamic correction factor, Correction factors for interactions between live animals, is the environmental impact factor, , The center point of the time window The distance decay weight, Indicates the time window Behavior trend indicators of frames, is the width of the time window, , Livestock With live animals Whether interaction occurs, For live animals With live animals The distance of quality inspection, For live animals behavior patterns, For live animals behavior patterns, is the interaction effect function.

7. A system for analyzing the number of live livestock based on recorded images, characterized in that: include: An acquisition unit, used for acquiring historical video data, wherein the video data includes various behaviors of live livestock, and the video data covers different time periods, different lighting conditions and different environmental backgrounds; A preprocessing unit, used for preprocessing the historical video data to obtain a historical video frame sequence, wherein the preprocessing includes: grayscale processing, noise reduction processing and background subtraction processing; A training unit, used to train a preset network model using the historical video frame sequence to obtain a target network model, wherein the target network model is used to analyze the number of live livestock; A determination unit, configured to determine the current number of live livestock to be analyzed by using the current video data and the target network model after acquiring the current video data; Wherein, if the preset network model is an LSTM network model, the preset network model is trained using the historical video frame sequence to obtain a target network model, including; Extracting features from the historical video frame sequence to obtain a feature data sequence, wherein the feature data includes: the movement direction of the live livestock, the movement speed of the live livestock, the degree of occlusion between the live livestock, and environmental features; Inputting the feature data sequence into the LSTM network model for training to obtain the behavior category of the live livestock in each historical video frame, wherein the behavior category at least includes: walking and lying; Based on the behavior category and a first preset live livestock quantity statistical formula, determining a revised live livestock analysis quantity corresponding to the historical video frame sequence; Based on the historical live livestock analysis quantity and the actual live livestock quantity corresponding to the historical video frame sequence, the LSTM network model is cross-validated and optimized to obtain the target network model.

8. A computing device, characterized in that It comprises a processing component and a storage component; the storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement the method according to any one of claims 1 to 6.

9. A computer storage medium, characterized in that A computer program is stored, and when the computer program is executed by a computer, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Livestock number identification method and device

    CN109801260A

  • Livestock quantity determination method, terminal and computer storage medium

    CN111008561A

  • Livestock real-time checking method

    CN115376157A

  • System and method of counting livestock

    US20230210093A1

Cited By

  • Pork grading evaluation method and device based on image recognition

    CN119229435A

  • A pork grading evaluation method and device based on image recognition

    CN119229435B

  • Livestock health monitoring method and system based on computer vision

    CN121220393A