Livestock sorting method, livestock sorting system, and related apparatus

Livestock information is obtained through image processing and analysis technology, and livestock sorting is automatically solved, which has solved the quality problems caused by sorting based on weight in the existing technology, and has achieved efficient, accurate sorting and health management of livestock.

WO2024260122A1PCT designated stage expired Publication Date: 2024-12-26PAN YUANZHI

Patent Information

Application Number
PCT/CN2024/091699
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-06-19
Filing Date
2024-05-08
Publication Date
2024-12-26

AI Technical Summary

Technical Problem

The existing livestock sorting system only sorts based on the weight of the livestock, and cannot comprehensively consider the age, gender, development status and health of the livestock, resulting in poor sorting quality.

Method used

Information about livestock, including breeds, health status, weight, etc. is obtained through image processing and analysis technology. Based on this information, the gate control and driving components are used to guide livestock into the corresponding sorting area.

Benefits of technology

The automated and intelligent sorting of livestock has been realized, the sorting efficiency and quality have been improved, the labor costs and zoonotic risks have been reduced, and the correct sorting and handling of livestock have been ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024091699_26122024_PF_FP_ABST
    Figure CN2024091699_26122024_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are a livestock sorting method, a livestock sorting system, and a related apparatus. The method comprises: when target livestock enters a detection area, acquiring a livestock image of the target livestock; acquiring livestock information of the target livestock according to the livestock image; on the basis of the livestock information, acquiring sorting information corresponding to the target livestock; and sorting the target livestock to a sorting area corresponding to the sorting information. The present application can solve the problem of livestock sorting quality being relatively poor due to the fact that sorting is only performed according to the weight of livestock, and the influence of factors such as the age, gender, development conditions and health conditions of the livestock on the livestock cannot be comprehensively considered.
Need to check novelty before this filing date? Find Prior Art

Description

Livestock sorting method, livestock sorting system and related devices

[0001] This application claims priority to Chinese Patent Application No. 202310732516.4 filed on June 19, 2023, which is incorporated by reference in its entirety. Technical Field

[0002] The present application relates to the field of livestock sorting technology, for example, to a livestock sorting method, a livestock sorting system and related devices. Background Art

[0003] With the development of society, animal husbandry has shifted from individual farming to large-scale, intensive, automated, and intelligent farming. The livestock sorting system is an automated system used to classify and sort livestock (such as cattle, pigs, sheep, etc.), aiming to improve livestock sorting efficiency and reduce manual operations. However, the relevant livestock sorting system is only a single control system based on electromechanical technology and / or pneumatic technology, which controls and manages livestock sorting and zoning based on the weight of the livestock, a single indicator. Since the livestock are sorted only based on their weight, it is impossible to comprehensively consider the impact of factors such as the age, gender, developmental status, and health status of the livestock on the livestock, resulting in poor livestock sorting quality.

[0004] Based on this, the present application provides a livestock sorting method, a livestock sorting system and related devices to improve related technologies.

[0005] Summary of the Invention

[0006] The purpose of this application is to provide a livestock sorting method, a livestock sorting system and related devices, which can solve the problem of poor livestock sorting quality when sorting livestock only according to their weight.

[0007] The purpose of this application is achieved by the following technical solutions:

[0008] In a first aspect, the present application provides a livestock sorting method, the method comprising:

[0009] When the target livestock enters the detection area, acquiring a livestock image of the target livestock;

[0010] acquiring livestock information of the target livestock according to the livestock image;

[0011] Based on the livestock information, obtaining sorting information corresponding to the target livestock;

[0012] The target livestock are sorted into a sorting area corresponding to the sorting information.

[0013] This technical solution has the following beneficial effects: it detects whether a target livestock has entered a designated detection area. Once the target livestock has been detected, an image of the target livestock is captured. By processing and analyzing the captured image, livestock information, such as breed, characteristics, and health status, can be extracted. Based on the target livestock's livestock information, sorting information corresponding to the target livestock is obtained. Different livestock information may result in different sorting information corresponding to the target livestock. Based on the acquired sorting information, the target livestock is sorted to a sorting area corresponding to the sorting information, for example, by opening a gate to the sorting area and guiding the target livestock into the sorting area. First, this achieves automated and intelligent sorting of target livestock without manual intervention, improving work efficiency, reducing labor costs, lowering the risk of zoonotic diseases, and mitigating the risk of human error. Second, by acquiring livestock images of the target livestock to obtain livestock information and sorting the target livestock based on this information, it helps ensure that the target livestock is sorted correctly. Third, the target livestock are sorted according to their livestock information. The livestock information not only includes the weight information of the target livestock, but can solve the problem of poor livestock sorting quality caused by sorting only according to the weight of the livestock, failing to comprehensively consider the impact of factors such as the age, gender, development status, and health status of the livestock.

[0014] In summary, through image processing, information analysis and automated sorting, accurate sorting of target livestock is achieved, thereby improving sorting efficiency and reducing sorting errors.

[0015] In one embodiment, obtaining livestock information of the target livestock based on the livestock image includes:

[0016] The livestock image is processed to identify and obtain health status information of the target livestock.

[0017] This technical solution offers the following advantages: by performing image processing on captured livestock images, such as through image enhancement, edge detection, and feature extraction, features and information related to the livestock's health status can be extracted from the images. Based on the processed livestock images, algorithms such as machine learning and computer vision can be used to identify the health status of target livestock. For example, by analyzing features such as the livestock's posture, facial expression, skin color, skin surface condition, eye condition, and secretion status, the target livestock's health status, such as whether it is ill or in estrus, can be determined. Based on this health information, corresponding sorting information can be obtained for the target livestock. For example, livestock with illnesses can be sorted to specific areas for further processing, or livestock in estrus can be sorted to areas related to reproduction. Based on this sorting information, the target livestock's intended sorting area is determined, implemented through predefined rules and logic, ensuring that the target livestock is correctly sorted and processed. First, by processing and analyzing livestock images, accurate identification of the target livestock's health status information facilitates early detection of sick or problematic livestock, enabling appropriate treatment measures to be taken. Second, based on the target livestock's health status information, a customized sorting plan is provided for each animal, helping to ensure that the livestock is sorted to the appropriate sorting area for appropriate processing, improving sorting efficiency and quality. Third, by using image processing and analysis technology, data-based decision support is provided, helping to reduce the interference of subjective judgment and provide more objective and accurate sorting decisions and farm management decisions. Fourth, by automatically obtaining the target livestock's health status information and corresponding sorting information, an automated and intelligent livestock sorting process is achieved, which can improve production efficiency, reduce labor costs, reduce the incidence of zoonotic diseases, and ensure that livestock are properly handled and sorted.

[0018] In one embodiment, the method further comprises:

[0019] Obtaining real-time weight information of the target livestock;

[0020] Based on the livestock image, obtaining a livestock identification of the target livestock;

[0021] Obtaining historical weight information of the target livestock according to the livestock identification;

[0022] acquiring development status information of the target livestock based on the real-time weight information and the historical weight information;

[0023] The step of obtaining sorting information corresponding to the target livestock according to the livestock information includes:

[0024] Based on the health status information and the development status information, sorting information corresponding to the target livestock is determined.

[0025] This technical solution offers the following benefits: Using a livestock weighing component, the target livestock's weight information is acquired in real time, providing accurate data on the target livestock's current weight status. By processing and analyzing the target livestock's image, the target livestock's livestock identification, such as its number and name, is identified and extracted. By querying a database or information system, the target livestock's historical weight information is retrieved based on its livestock identification. This historical weight information records the target livestock's past weight information. By comparing the target livestock's real-time weight with its historical weight data, the target livestock's weight growth trend and rate are calculated, thereby determining its developmental status. For example, this can determine whether the target livestock is developing normally, growing too fast, or growing too slowly. Combining the target livestock's health and developmental status information can determine the specific area or processing flow to which the target livestock should be sorted. First, by acquiring the target livestock's real-time and historical weight information to obtain the target livestock's developmental status information, a more comprehensive analysis and assessment is conducted, facilitating the development of more accurate and personalized sorting plans that best meet the needs and requirements of the target livestock. Second, based on the target livestock's real-time and historical weight information, more refined sorting and classification are achieved, helping to rationally divide livestock according to their weight and developmental status, thereby improving the accuracy and effectiveness of feeding management. Third, based on the target livestock's developmental status information, a feeding environment (sorting area) suitable for their growth and developmental needs is selected, helping to provide favorable feeding conditions and promote healthy growth and productive production. Fourth, based on the same livestock image, both the target livestock's health status information and livestock identification, and thus the target livestock's developmental status information, can be determined. This enables the reuse of livestock images, reduces the overall image processing data volume, and improves sorting efficiency.

[0026] In one embodiment, the acquiring the development status information of the target livestock based on the real-time weight information and the historical weight information includes:

[0027] Get the preset weight correspondence;

[0028] Based on the real-time weight information, the historical weight information and the weight correspondence, the development status information of the target livestock is obtained.

[0029] This technical solution has the beneficial effects of obtaining a preset weight correspondence and establishing a set of weight correspondences for converting livestock weight into specific developmental status information, such as establishing a model or mathematical model that relates weight ranges to growth stages. Real-time weight information of target livestock is obtained using weighing equipment or sensors. Simultaneously, historical weight information of the target livestock is obtained by querying a database or information system. Using the preset weight correspondences, the real-time and historical weight information are compared and matched with developmental status information. Developmental status information of the target livestock, such as growth stage and degree of development, is determined through calculation, comparison, or interpolation. First, using the preset weight correspondences, the developmental status of the target livestock is accurately assessed. Weight is an important indicator of livestock growth and development. By linking weight with developmental status, the growth stage and developmental level of the target livestock can be more accurately determined. Second, by obtaining developmental status information of the target livestock, personalized management and adjustments can be implemented for livestock at different developmental stages to meet the needs of livestock at different developmental stages.

[0030] In one embodiment, obtaining the livestock identification of the target livestock based on the livestock image includes:

[0031] detecting whether livestock features of the target livestock in the livestock image meet preset image conditions; the livestock features include one or more of facial features, neck features, ear features, shoulder features, back features, chest features, waist features, hip features, thigh features, leg features, tail features, and arm features of the target livestock; the facial features include facial features; and the preset image conditions include at least one of feature clarity and feature completeness;

[0032] If not, inputting the livestock image into a preset image completion model to obtain a completed image corresponding to the livestock image;

[0033] Based on the completed image, the livestock identification of the target livestock is obtained.

[0034] The beneficial effect of this technical solution is that it analyzes the livestock features of a target livestock in a livestock image and detects whether the clarity and / or completeness of the livestock features meet preset image conditions, such as the clarity (e.g., image resolution, contrast, etc.) and the completeness of the facial features, neck features, ear features, shoulder features, back features, chest features, waist features, hip features, thigh features, leg features, tail features, or arm features. Facial features include facial features. If the livestock features do not meet the preset image conditions, the livestock image is input into a preset image completion model. Based on the existing image information and partial features of the livestock features, an image reconstruction or completion operation is performed to generate a completed image of the livestock features of the target livestock. Based on the obtained completed image, the livestock's identification information, such as identification information such as number and name, is determined through image processing and recognition techniques. The identification information is used to confirm the identity of the target livestock. First, by capturing livestock images oriented in the direction of target livestock travel and applying preset image conditions and image completion models, the accuracy of livestock identification is improved. Even when livestock features are incomplete or lack clarity, a complete image with recognizable features can still be generated, thereby improving the acquisition rate and accuracy of livestock identification. Second, by utilizing image processing and pattern recognition technologies, automated and intelligent recognition and processing of livestock images is achieved, improving processing efficiency, reducing manual intervention, and minimizing the impact of human factors on livestock identification acquisition. Third, by using livestock images as the source of livestock identification, data consistency and convenience are achieved. Livestock identification can be directly linked to livestock information, such as health status and weight, providing more possibilities for subsequent data analysis, management, and decision-making.

[0035] In one embodiment, obtaining the real-time weight information of the target livestock includes:

[0036] acquiring a weight pressure signal of the target livestock in real time;

[0037] The weight pressure signal is filtered to obtain real-time weight information of the target livestock.

[0038] The beneficial effects of this technical solution are as follows: The livestock weighing assembly monitors the weight pressure signal exerted by the target livestock on the livestock weighing assembly in real time. The weight pressure signal is proportional to the livestock's weight and can be used to calculate the livestock's real-time weight. After obtaining the weight pressure signal, it is filtered, such as with a Kalman filter. This filtering process eliminates noise and interference in the measurement, thereby obtaining more stable and accurate real-time weight information. First, because the erratic movement of the target livestock entering the detection area can interfere with the acquisition of the weight pressure signal, real-time acquisition of the weight pressure signal and application of filtering methods (such as a Kalman filter) provide more accurate real-time weight information. Filtering reduces the impact of noise and interference, thereby improving the accuracy and stability of weight estimation. Second, by acquiring the target livestock's weight pressure signal in real time and converting it into real-time weight information, it helps to timely understand the livestock's weight changes and make decisions such as health assessment, feeding adjustments, and disease prevention. Third, the acquisition and filtering of real-time weight information are automated processes, enabling automatic data collection and processing, reducing the need for manual intervention and operation, and improving work efficiency and data consistency.

[0039] In a second aspect, the present application provides an electronic device, comprising a memory and at least one processor, wherein the memory stores a computer program, and when the at least one processor executes the computer program, the following steps are implemented:

[0040] When the target livestock enters the detection area, acquiring a livestock image of the target livestock;

[0041] acquiring livestock information of the target livestock according to the livestock image;

[0042] Based on the livestock information, obtaining sorting information corresponding to the target livestock;

[0043] The target livestock are sorted into a sorting area corresponding to the sorting information.

[0044] In one embodiment, when executing the computer program, the at least one processor obtains the livestock information of the target livestock based on the livestock image in the following manner:

[0045] The livestock image is processed to identify and obtain health status information of the target livestock.

[0046] In one embodiment, when executing the computer program, the at least one processor further implements the following steps:

[0047] Obtaining real-time weight information of the target livestock;

[0048] Based on the livestock image, obtaining a livestock identification of the target livestock;

[0049] Obtaining historical weight information of the target livestock according to the livestock identification;

[0050] acquiring development status information of the target livestock based on the real-time weight information and the historical weight information;

[0051] When executing the computer program, the at least one processor obtains the sorting information corresponding to the target livestock according to the livestock information in the following manner:

[0052] Based on the health status information and the development status information, sorting information corresponding to the target livestock is determined.

[0053] In one embodiment, when executing the computer program, the at least one processor obtains the development status information of the target livestock based on the real-time weight information and the historical weight information in the following manner:

[0054] Get the preset weight correspondence;

[0055] Based on the real-time weight information, the historical weight information and the weight correspondence, the development status information of the target livestock is obtained.

[0056] In one embodiment, when executing the computer program, the at least one processor obtains the livestock identification of the target livestock based on the livestock image in the following manner:

[0057] detecting whether livestock features of the target livestock in the livestock image meet preset image conditions; the livestock features include one or more of facial features, neck features, ear features, shoulder features, back features, chest features, waist features, hip features, thigh features, leg features, tail features, and arm features of the target livestock; the facial features include facial features; and the preset image conditions include at least one of feature clarity and feature completeness;

[0058] If not, inputting the livestock image into a preset image completion model to obtain a completed image corresponding to the livestock image;

[0059] Based on the completed image, the livestock identification of the target livestock is obtained.

[0060] In one embodiment, when executing the computer program, the at least one processor obtains the real-time weight information of the target livestock in the following manner:

[0061] acquiring a weight pressure signal of the target livestock in real time;

[0062] The weight pressure signal is filtered to obtain real-time weight information of the target livestock.

[0063] In a third aspect, the present application provides a livestock sorting system, comprising:

[0064] a detection module, the detection module being used to detect livestock information of target livestock;

[0065] A sorting module, the sorting module is used to sort the target livestock;

[0066] An electronic device comprises a memory and a processor, wherein the memory stores a computer program, and the processor is configured to implement the steps of any one of the above methods when executing the computer program.

[0067] In one embodiment, the detection module includes an image acquisition component and a livestock weighing component;

[0068] The image acquisition component is used to obtain an image of the target livestock when the target livestock enters the detection area;

[0069] The livestock weighing component is used to obtain the weight pressure signal of the target livestock in real time.

[0070] In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by at least one processor, it implements the steps of any of the above methods or implements the functions of any of the above electronic devices.

[0071] In a fifth aspect, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by at least one processor, it implements the steps of any of the above methods or implements the functions of any of the above electronic devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] The present application is further described below with reference to the accompanying drawings and implementation methods.

[0073] FIG1 shows a structural block diagram of a livestock sorting system provided in an embodiment of the present application.

[0074] FIG2 shows a schematic flow chart of a livestock sorting method provided in an embodiment of the present application.

[0075] FIG3 shows a schematic diagram of a process for determining sorting information provided by an embodiment of the present application.

[0076] FIG4 shows a schematic diagram of a loss curve provided in an embodiment of the present application.

[0077] FIG5 shows a schematic diagram of an accuracy curve provided in an embodiment of the present application.

[0078] FIG6 shows a schematic diagram of a process of image completion provided in an embodiment of the present application.

[0079] FIG7 shows a schematic diagram of image comparison of an image completion result provided in an embodiment of the present application.

[0080] FIG8 shows a schematic diagram of a process for obtaining real-time weight information provided in an embodiment of the present application.

[0081] FIG9 shows a schematic flow chart of a Kalman filter process provided in an embodiment of the present application.

[0082] FIG10 shows a structural block diagram of an electronic device provided in an embodiment of the present application.

[0083] FIG11 shows a schematic structural diagram of a program product provided in an embodiment of the present application. DETAILED DESCRIPTION

[0084] The technical solutions in this application will be described below in conjunction with the accompanying drawings and specific implementation methods of this application. It should be noted that, under the premise of no conflict, the various implementation methods or technical features described below can be arbitrarily combined to form a new implementation method.

[0085] In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can represent: a, b, c, a and b, a and c, b and c, a and b and c, where a, b and c can be single or multiple. It is worth noting that "at least one" can also be interpreted as "one or more items".

[0086] It should also be noted that in the examples of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any implementation or design described as "exemplary" or "for example" in the examples of this application should not be interpreted as being preferred or advantageous over other implementations or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0087] The following is a brief description of the technical field and related terms of the embodiments of the present application.

[0088] Livestock refers to animals raised by humans for food, agricultural labor, transportation, and fur. They are typically used to provide meat, dairy products, eggs, leather, and other animal products. Livestock includes cattle, sheep, pigs, horses, mules, donkeys, chickens, ducks, and geese. In agriculture and animal husbandry, livestock is often considered a vital resource, providing food and other necessities for humans.

[0089] Livestock sorting systems are used for automatic or semi-automatic livestock classification and sorting. Using detection equipment, they detect, identify, and analyze livestock, grouping them according to predetermined standards and requirements. Their benefits include improved efficiency, reduced labor costs, lowered error rates, and more accurate livestock management. Livestock sorting systems are widely used in industries such as animal husbandry and slaughter, providing efficient, accurate, and reliable livestock classification and sorting solutions.

[0090] ResNet-50 is a convolutional neural network model and a variant of the ResNet (Residual Network) family. ResNet is a deep learning model architecture proposed by Microsoft Research, designed to address the degradation problem during deep neural network training. ResNet-50 specifically refers to a ResNet model with 50 convolutional layers and fully connected layers. Its main structure consists of multiple residual blocks, each of which contains multiple convolutional layers and batch normalization layers, using rectified linear units (ReLU) as the activation function. ResNet-50 was trained on the ImageNet dataset and achieved excellent performance in computer vision tasks such as image classification, object detection, and image segmentation. Its deeper network structure can extract higher-level image features, making it widely used in many vision tasks.

[0091] The ImageNet dataset is a benchmark dataset for image recognition and computer vision tasks. The ImageNet database contains millions of high-resolution images covering images from various fields and categories. These images are organized into a hierarchical label structure, and each image is assigned a category label.

[0092] The logistic model, also known as the logistic regression model, is a statistical model used for classification problems. It is a generalized linear model and is often used to predict the probability of binary or multi-class classification. The output of the logistic model is a probability value, which indicates the probability that a sample belongs to a certain category.

[0093] (System Example)

[0094] The livestock sorting system provided by this application is introduced in detail below.

[0095] Refer to Figure 1, which shows a structural block diagram of a livestock sorting system provided by an embodiment of the present application.

[0096] An embodiment of the present application provides a livestock sorting system, the system comprising:

[0097] A detection module 20, wherein the detection module 20 is used to detect livestock information of target livestock;

[0098] A sorting module 30, the sorting module 30 is used to sort the target livestock;

[0099] Electronic device 10.

[0100] The embodiment of the present application does not limit the type of target livestock, which may be, for example, cattle, sheep, pigs, horses, mules, donkeys, chickens, ducks, geese, etc.

[0101] In one implementation, the livestock information includes at least one of livestock breed, livestock age, livestock gender, livestock weight, livestock health status, livestock appearance characteristics, and livestock identification.

[0102] Among them, livestock breed refers to the breed of the target livestock, such as cattle (beef cattle, dairy cows), sheep (goats, sheep), pigs (piglets, boars, sows, pregnant pigs, sick pigs), etc. Livestock age refers to the age range or specific age of the target livestock, such as young livestock, adult livestock, elderly livestock, etc. Livestock sex refers to the sex of the target livestock, such as male and female. Livestock weight refers to the weight information of the target livestock, and livestock health status refers to the health status of the target livestock, including physical condition, illness or injury. Livestock appearance characteristics refer to the appearance characteristics of the target livestock, such as carcass outline, markings, coat color, lesions, eye mucus, horn shape, etc. Livestock identification refers to the identification information of the target livestock, such as number, name, etc.

[0103] In one implementation, the detection module 20 includes an image acquisition component and a livestock weighing component;

[0104] The image acquisition component is used to obtain an image of the target livestock when the target livestock enters the detection area;

[0105] The livestock weighing component is used to obtain the weight pressure signal of the target livestock in real time.

[0106] The image acquisition component may be a camera, a scanner, or other device with a camera function (such as a mobile phone or tablet). The camera may include, for example, an optical camera, an infrared camera, and / or a dedicated infrared thermal imaging camera. The image acquisition component is not limited here.

[0107] The livestock weighing assembly includes a weighing platform and a load cell. The load cell can be a pressure sensor, piezoelectric sensor, or vibration sensor. The type of load cell is not limited here. Pressure sensors include piezoresistive sensors, capacitive sensors, and piezoelectric sensors. The type of pressure sensor is not limited here.

[0108] In some embodiments, the image acquisition component further includes a fill light unit, which is used to enhance the illumination of the detection area. The fill light unit can be an LED lamp or an incandescent lamp, and the fill light unit is not limited here.

[0109] In one implementation, a detection zone refers to a specific area used for livestock detection. It is a designated space into which target livestock are guided for necessary detection, observation, and data collection.

[0110] As an example, the detection zone is a section of a corridor where target livestock are guided and ensured to enter the detection zone using structures such as railings, guides, or fences. Once the target livestock enters the detection zone, the fences or gates are closed to create a confined area, confining the target livestock within a controllable range for detection. A livestock weighing assembly is installed within this detection zone and located on the ground. The target livestock is driven onto the weighing platform of the livestock weighing assembly for weight measurement and recording.

[0111] In one implementation, the sorting module 30 includes a gate control component and a driving component;

[0112] The gate control component is used to control the gates of each sorting area;

[0113] The driving component is used to drive the target livestock to move.

[0114] The gate control component controls the gates based on sorting information. Based on the sorting information of the target livestock, it controls the opening and closing of the corresponding gates to guide the target livestock into the sorting area corresponding to their sorting information. Gate control components can be implemented electrically, electronically, pneumatically, or mechanically. Depending on the design requirements, gate control components can be automated, using sensors and actuators to monitor and control gate status in real time, or semi-automated, requiring manual operator control based on sorting information.

[0115] The driving assembly is used to drive the target livestock. It guides and drives the target livestock in a specific direction, directing them to the desired location for sorting, weighing, or other operations. For example, it may include components such as a driving rod, a driving stick, a sound guidance device, an electric door, a pneumatic door, a railing, a manipulator, etc. The driving assembly drives the livestock, ensuring they follow the desired path or process.

[0116] For example, if the sorting information for a target animal indicates that the target animal should be sorted to sorting area C, the gate control component opens the gate of sorting area C, and the driving component emits a stimulating sound behind the target animal, forcing the target animal to move along the passage toward the gate of sorting area C. After the target animal enters sorting area C, the gate control component closes the gate of sorting area C, completing the sorting of the target animal.

[0117] In one implementation, the detection module 20 further includes an entry detection component;

[0118] The entrance detection component is used to detect whether the target livestock enters the detection area.

[0119] The entrance detection component may be detected by an infrared sensor or a camera, and the entrance detection component is not limited here.

[0120] When the entrance detection component uses infrared sensors for detection, by setting the infrared sensors on both sides of the entrance of the detection area, when the target livestock enters the detection area, the target livestock blocks the single beam of infrared light emitted by the infrared sensor, thereby determining that there is an obstacle at the entrance. When the livestock weighing component obtains the weight pressure signal and the infrared sensor does not detect any obstruction, it indicates that the target livestock has entered the detection area.

[0121] When the entrance detection component uses a camera for detection, the camera faces the entrance of the detection area and obtains the video stream to analyze and determine whether the target livestock has entered the detection area.

[0122] In an embodiment of the present application, the electronic device may be configured to implement the steps of a livestock sorting method. The livestock sorting method will be described below first, followed by a description of the electronic device.

[0123] (Method Example)

[0124] Referring to FIG. 2 , FIG. 2 shows a schematic flow chart of a livestock sorting method provided in an embodiment of the present application.

[0125] The present application provides a livestock sorting method, comprising:

[0126] Step S101: when a target livestock enters a detection area, obtaining a livestock image of the target livestock;

[0127] Step S102: acquiring livestock information of the target livestock according to the livestock image;

[0128] Step S103: Based on the livestock information, obtaining sorting information corresponding to the target livestock;

[0129] Step S104: sorting the target livestock to a sorting area corresponding to the sorting information.

[0130] In one implementation, the livestock image may be a full-body image, a side image, a facial image, etc. of the target livestock, and the livestock image is not limited here.

[0131] In one implementation, sorting areas are pre-planned based on different sorting attributes. These attributes include at least one of the target livestock's gender, age, weight, health, and developmental status. Sorting areas can be separated by fences or electronic fencing, or they can be separated into separate rooms. The implementation of the sorting areas is not limited herein.

[0132] As an example, when a target livestock enters a detection area, an image capture device (e.g., a camera) is used to capture an image of the target livestock. The livestock image can be a full-body image, a side view, or other appropriate perspective to capture the livestock's appearance and identification information. Using image processing and computer vision techniques, the captured livestock image is analyzed and processed to extract livestock information about the target livestock. For example, if the target livestock is determined to be a pig and a Large White pig, the target livestock is accordingly sorted to sorting area A. The sorting information then includes information that the target livestock is sorted to sorting area A. The target livestock is thus sorted based on the sorting information.

[0133] Thus, the system detects whether a target livestock has entered a designated detection area. Once the target livestock has been detected, an image of the target livestock is captured. By processing and analyzing the captured image, livestock information, such as breed, characteristics, and health status, can be extracted. Based on the target livestock's livestock information, sorting information corresponding to the target livestock is obtained. Different livestock information may result in different sorting information corresponding to the target livestock. Based on the acquired sorting information, the target livestock is sorted to a sorting area corresponding to the sorting information, for example, by opening a gate to the sorting area and guiding the target livestock into the sorting area. First, this enables automated sorting of target livestock without manual intervention, improving work efficiency, reducing labor costs, lowering the risk of zoonotic diseases, and mitigating the risk of human error. Second, by acquiring livestock images of the target livestock to obtain livestock information and sorting the target livestock based on this information, it helps ensure that the target livestock is sorted correctly. Third, the target livestock are sorted according to their livestock information. The livestock information not only includes the weight information of the target livestock, but can solve the problem that the livestock sorting quality is poor because the livestock is sorted only according to their weight and cannot be comprehensively considered due to factors such as the age, gender, and health status of the livestock.

[0134] In summary, through image processing, information analysis and automated sorting, accurate sorting of target livestock is achieved, which has the effects of improving sorting efficiency and reducing sorting errors.

[0135] In some embodiments, when the target livestock enters the detection area, acquiring the livestock image of the target livestock includes:

[0136] acquiring a plurality of candidate images of the target livestock;

[0137] Based on the preset image evaluation conditions, scoring the quality of each candidate image to obtain a quality score corresponding to each candidate image;

[0138] Based on the quality score corresponding to each candidate image, one candidate image is selected from the multiple candidate images as the livestock image.

[0139] In one implementation, the preset image evaluation conditions may include clarity requirements, integrity requirements, or contrast requirements, etc., and the preset image evaluation conditions are not limited here.

[0140] As an example, multiple candidate images of the target livestock are captured from different angles or fields of view. The candidate images may include images from different perspectives such as the side, front, and back. An image quality assessment algorithm is used to assign a quality score to each candidate image, taking into account indicators such as clarity, contrast, brightness, and noise level of the candidate image to evaluate the image quality. Based on the output of the quality scoring algorithm, a corresponding quality score is obtained for each candidate image. The quality score can be a numerical value that reflects the quality level of the image, and generally, the higher the score, the better the quality. Based on the quality score corresponding to each candidate image, one of the higher quality images can be selected as the final livestock image. The basis for selection can be the highest score, a score that meets certain threshold requirements, or the best livestock image is determined according to a pre-set scoring rule.

[0141] Thus, when the target livestock enters the detection area, multiple alternative images are collected. The alternative images can be taken from different angles and under different lighting conditions, or they can be taken from the same angle for a continuous period of time. The method of acquiring the alternative images is not limited here. For each alternative image, a score is given using the preset image quality assessment conditions. Factors such as image clarity, noise level, contrast, etc. are taken into consideration to obtain a quality score for each alternative image. Based on the quality score of each alternative image, one alternative image is selected from the multiple alternative images as the final livestock image. The selection criteria can be determined according to the application requirements, such as selecting the alternative image with the highest score or the alternative image that meets certain threshold requirements. By scoring the quality of the alternative images, high-quality images can be screened out for subsequent processing and analysis, which helps to improve image clarity, reduce noise, etc., and provide more accurate information.

[0142] In some embodiments, obtaining livestock information of the target livestock based on the livestock image includes:

[0143] The livestock image is processed to identify and obtain health status information of the target livestock.

[0144] In one implementation, based on the manifestation of livestock diseases, target livestock lines in livestock images are identified to obtain health status information of the target livestock.

[0145] For example, consider the target livestock, such as pigs. Pig diseases often manifest themselves in abnormalities in the eyes, ears, nose, and skin. By identifying these abnormalities in the livestock image, the system can determine whether the target livestock is sick. Sick pigs can then be sorted to a separate sorting area, allowing management to provide follow-up treatment. This also prevents disease transmission between pigs.

[0146] Thus, the captured livestock images are processed using techniques such as image enhancement, edge detection, and feature extraction to extract features and information related to the livestock's health status. Based on the processed livestock images, algorithms such as machine learning and computer vision can be used to identify the target livestock's health status. For example, by analyzing features such as the livestock's body shape, skin color, and eye condition, their health status, such as whether they are ill or in estrus, can be determined. Based on this health information, the target livestock's corresponding sorting information can be obtained. For example, livestock with illnesses can be sorted to a specific area for further processing, or livestock in estrus can be sorted to a breeding-related area. Based on this sorting information, the sorting area to which the target livestock should be sorted is determined, implemented using predefined rules and logic to ensure that the target livestock is correctly sorted and processed. First, accurately identifying the target livestock's health status through livestock image processing and analysis facilitates early detection of sick or problematic livestock, allowing appropriate treatment measures to be taken. Second, based on the target livestock's health status information, a customized sorting plan is provided for each animal, helping to ensure that the livestock is sorted to the appropriate sorting area for appropriate processing, improving sorting efficiency and quality. Third, by using image processing and analysis technology, data-based decision support is provided, helping to reduce the interference of subjective judgment and provide more objective and accurate sorting decisions. Fourth, by automatically obtaining the target livestock's health status information and corresponding sorting information, an automated livestock sorting process is achieved, which can improve production efficiency, reduce labor costs, reduce the incidence of zoonotic diseases, and ensure that livestock are properly handled and sorted.

[0147] In some embodiments, performing image processing on the livestock image to identify and obtain health status information of the target livestock includes:

[0148] The livestock image is input into a preset status detection model to obtain health status information of the target livestock.

[0149] The state detection model training process includes:

[0150] Acquire a training set, the training set comprising a plurality of training data, each of the training data comprising a sample livestock image and labeled data of health status information corresponding to the sample livestock image;

[0151] For each training data in the training set, perform the following processing:

[0152] Inputting the sample livestock images in the training data into a preset deep learning model to obtain predicted data of health status information corresponding to the sample livestock images;

[0153] updating the model parameters of the deep learning model based on the predicted data and the labeled data of the health status information corresponding to the sample livestock images;

[0154] Detect whether the preset training end condition is met; if so, use the trained deep learning model as the state detection model; if not, continue training the deep learning model using the next training data.

[0155] Therefore, by designing, establishing an appropriate number of neuron computing nodes and a multi-layer operation hierarchy, and selecting appropriate input and output layers, a preset deep learning model can be obtained. Through the learning and tuning of the deep learning model, a functional relationship from input to output is established. Although the functional relationship between input and output cannot be found 100%, the actual correlation relationship can be approached as much as possible. The state detection model trained in this way can obtain corresponding health status information based on livestock images. It has a wide range of applications, and the calculation results are highly accurate, reliable, and transferable.

[0156] In some embodiments of the present application, the present application can train a state detection model.

[0157] In other embodiments of the present application, the present application may adopt a pre-trained state detection model.

[0158] In one implementation, the preset deep learning model can be a convolutional neural network model or a recurrent neural network model. The implementation method of the preset deep learning model is not limited here.

[0159] This application does not limit the training process of the state detection model. For example, it can adopt the above-mentioned supervised learning training method, or can adopt the semi-supervised learning training method, or can adopt the unsupervised learning training method.

[0160] This application does not limit the preset training end conditions. For example, it can be that the number of training times reaches a preset number (the preset number is, for example, 1 time, 3 times, 10 times, 100 times, 1000 times, 10,000 times, etc.), or it can be that all the training data in the training set complete one or more trainings, or it can be that the total loss value obtained from this training is not greater than the preset loss value.

[0161] In some embodiments, the health status information further includes a disease type; and the method further includes:

[0162] When the health status information indicates that the target livestock is ill, generating notification information based on the disease type and livestock information;

[0163] The notification information is sent to the user device to prompt that the target livestock is sick.

[0164] This embodiment does not limit the disease type, which may be, for example, scabies, ear scabies, ringworm, skin tumor, external parasite infection, etc.

[0165] In the embodiments of the present application, the user device is not limited and can be, for example, a mobile phone, tablet computer, laptop computer, desktop computer, smart wearable device or other intelligent terminal device, or a user device can be a workstation, controller or console. The method of sending the reminder information can be, for example, SMS push, email push, in-app push, phone notification, etc.

[0166] As an example, a notification message is sent to administrator A01 via SMS push. The text content of the notification message is "Hello, administrator A01. Pig C51 is suspected of having Swine Erysipelas and has been sorted to sorting area D. Please handle it as soon as possible. Thank you!"

[0167] Referring to FIG. 3 , FIG. 3 shows a schematic diagram of a process for determining sorting information provided by an embodiment of the present application.

[0168] In some embodiments, the method further comprises:

[0169] Step S201: obtaining real-time weight information of the target livestock;

[0170] Step S202: acquiring a livestock identification of the target livestock based on the livestock image;

[0171] Step S203: acquiring historical weight information of the target livestock according to the livestock identification;

[0172] Step S204: acquiring the development status information of the target livestock based on the real-time weight information and the historical weight information;

[0173] The step of obtaining sorting information corresponding to the target livestock according to the livestock information includes:

[0174] Step S205: Determine sorting information corresponding to the target livestock based on the health status information and the development status information.

[0175] The real-time weight information of the target livestock refers to the weight information of the target livestock obtained by the livestock weighing component in real time in the detection area. The historical weight information of the target livestock refers to the weight information recorded during the breeding process of the target livestock, including the weight of the target livestock at different time points.

[0176] In one implementation, the developmental status information may include low developmental level, medium low developmental level, normal developmental level, high developmental level; it may also include poor developmental level, good developmental level, and excellent developmental level; the developmental status information is not limited here.

[0177] As an example, a livestock weighing component obtains a live pig's real-time weight, which is 150 kg. Using image recognition technologies, such as computer vision and image processing algorithms, the live pig's image is analyzed and its livestock identifier, such as its number or name, is determined. Assume that the livestock identifier PZ123 is successfully captured from the livestock image. Using livestock identifier PZ123, the historical weight information for the live pig is retrieved from a record or database. This historical weight information may include the pig's weight records at different time points. Assume that over the past few months, the pig's historical weight records are as follows: 3 months ago: 100 kg, 2 months ago: 120 kg, 1 month ago: 140 kg. Based on the real-time and historical weight information, calculations determine that the pig's developmental status is poor. Given that the pig's health status is normal, the pig is sorted to sorting area A so that its feed can be adjusted to optimize its developmental status. If the health status information of the live pig is sick, the live pig will be sorted to sorting area B so that the management personnel can deal with its disease.

[0178] Thus, using the livestock weighing component, real-time weight information of target livestock is acquired, providing accurate data on the target livestock's current weight status. By processing and analyzing the target livestock's image, the target livestock's livestock identification, such as its number and name, is identified and extracted. By querying a database or information system, the target livestock's historical weight information is retrieved based on its livestock identification. This historical weight information records the target livestock's past weight information. By comparing the target livestock's real-time weight with its historical weight data, the target livestock's weight growth trend and rate are calculated, thereby determining its developmental status. For example, this can determine whether the target livestock is developing normally, growing too fast, or growing too slowly. Combining the target livestock's health and developmental status information can determine the specific area or processing flow to which the target livestock should be sorted. First, by acquiring the target livestock's real-time and historical weight information to obtain developmental status information, a more comprehensive analysis and assessment is conducted, facilitating the developmental status of the target livestock, which helps develop more accurate and personalized sorting plans to best meet the needs and requirements of the target livestock. Second, based on the target livestock's real-time and historical weight information, more refined sorting and classification are achieved, helping to rationally divide livestock according to their weight and developmental status, thereby improving the accuracy and effectiveness of feeding management. Third, based on the target livestock's developmental status information, a feeding environment (sorting area) suitable for their growth and developmental needs is selected, helping to provide favorable feeding conditions and promote healthy growth and productive production. Fourth, based on the same livestock image, both the target livestock's health status information and livestock identification, and thus the target livestock's developmental status information, can be determined. This enables the reuse of livestock images, reduces the overall image processing data volume, and improves sorting efficiency.

[0179] In some embodiments, obtaining the development status information of the target livestock based on the real-time weight information and the historical weight information includes:

[0180] Get the preset weight correspondence;

[0181] Based on the real-time weight information, the historical weight information and the weight correspondence, the development status information of the target livestock is obtained.

[0182] The weight correspondence refers to the correspondence between the real-time weight information, the historical weight information and the developmental status information of the target livestock, which can be determined, for example, by a formula, a matrix or a model. The weight correspondence is not limited here.

[0183] As an example, a growth curve of a target livestock is drawn based on real-time weight information and historical weight information, and a nonlinear fitting is performed on the growth curve using a logistic model, which can be expressed as follows:

[0184] W=A / (1+e (a-rt) )

[0185] Where W is the body weight at day t (kg), A is the limit body weight parameter (kg), a is the constant scale, r is the growth rate parameter, and e is a constant.

[0186] The coefficient of determination R 2 Indicates the degree of curve fitting, which can be expressed by the following formula:

[0187] Where y represents the actual observed value, represents the model prediction value, represents the mean of the observations.

[0188] Coefficient of determination R 2 The closer it is to 1, the better the model fit is, and it can better explain the variability of the dependent variable; the closer it is to 0, the worse the model fit is, and it cannot well explain the variability of the dependent variable.

[0189] After determining the relevant parameters of the Logistic model through experimental calculation, the development status information of the target livestock can be determined based on the real-time weight information and historical weight information.

[0190] Thus, a preset weight correspondence is obtained and a set of weight correspondences is established to convert the livestock's weight into specific developmental status information. For example, a model or mathematical model is established to correlate weight ranges with growth stages. Real-time weight information of the target livestock is obtained using weighing equipment or sensors. Simultaneously, historical weight information of the target livestock is obtained by querying a database or information system. Using the preset weight correspondences, the real-time and historical weight information is compared and matched with the developmental status information. Developmental status information of the target livestock, such as growth stage and degree of development, is determined through calculation, comparison, or interpolation. First, by using the preset weight correspondences, the developmental status of the target livestock is accurately assessed. Weight is an important indicator of livestock growth and development. By linking weight with developmental status, the growth stage and developmental level of the target livestock can be more accurately determined. Second, by obtaining the developmental status information of the target livestock, personalized management and adjustments can be implemented for livestock at different developmental stages to meet the needs of livestock at different developmental stages.

[0191] In some embodiments, livestock identifiers refer to identifiers used to identify and track individual livestock, and are used for livestock identification, tracing, and management. For example, these identifiers can be identified using ear tags, body tags, or livestock feature identification.

[0192] Specifically, obtaining the livestock identification of the target livestock based on the livestock image includes:

[0193] The livestock features of the target livestock are obtained by identifying the livestock image; the livestock features include one or more of facial features, neck features, ear features, shoulder features, back features, chest features, waist features, hip features, thigh features, leg features, tail features, and arm features of the target livestock; wherein the facial features include facial features;

[0194] Based on the livestock characteristics, a livestock identification of the target livestock is determined.

[0195] Facial features refer to the morphology, structure, and characteristics of a livestock's face. These include eye, nose, ear, and texture features, though these are not specifically defined here. Neck features refer to the morphology, structure, and characteristics of a livestock's neck, including neck length, thickness, and curvature. These are not specifically defined here. Ear features refer to the morphology, structure, and characteristics of a livestock's ears, including size, shape, and whether they stand upright or droop. These are not specifically defined here. Shoulder features refer to the morphology, structure, and characteristics of a livestock's shoulder, including shoulder width, slope, and shoulder blade angle. These are not specifically defined here. Back features refer to the morphology, structure, and characteristics of a livestock's back, including the straightness or curvature of the topline and the height of the spine. These are not specifically defined here. Chest features refer to the morphology, structure, and characteristics of a livestock's chest, including chest depth, chest width, and the shape of the ribcage. These are not specifically defined here. Waist characteristics refer to the shape, structure and characteristics of the livestock's waist, including waist length, waist width, and the tightness of the waist and abdomen. Waist characteristics are not limited here. Hip characteristics refer to the shape, structure and characteristics of the livestock's buttocks, including hip width, hip height, and the degree of development of the buttocks muscles. Hip characteristics are not limited here. Thigh characteristics refer to the shape, structure and characteristics of the livestock's thigh (thigh), including the length of the femur and the degree of development of the femoral muscles. Thigh characteristics are not limited here. Leg characteristics refer to the shape, structure and characteristics of the livestock's hind legs and calves. Tail characteristics refer to the shape, thickness and curvature of the livestock's tail. Arm characteristics refer to the shape, structure and characteristics of the livestock's arm (upper arm of the forelimb), including arm length, arm thickness, and the degree of development of the arm muscles. Arm characteristics are not limited here.

[0196] In one implementation, the livestock identification may be a combination of text, numbers, and symbols, such as pig A01, Huahua, dairy cow C51, sheep 105, Z10245, etc., and the livestock identification is not limited here.

[0197] In some embodiments, obtaining the livestock identification of the target livestock based on the livestock image includes:

[0198] The livestock image is input into a preset livestock identification model to obtain the livestock identification of the target livestock.

[0199] The livestock identification model can be trained based on a convolutional neural network model or a recurrent neural network model, and the implementation method of the livestock identification model is not limited herein. The convolutional neural network model can be a ResNet-50 model.

[0200] As an example, a ResNet-50 model was pre-trained on the ImageNet dataset and then used to identify live pigs. The convolutional layers of the ResNet-50 model, pre-trained on the ImageNet dataset, were frozen, and the parameters of the fully connected layers were retrained to obtain the network's accuracy. The captured images were categorized, saved, filtered, and trimmed, with 6,000 images used as the training set, 2,000 as the validation set, and 2,000 as the test set. During testing, the images from the test dataset were fed into the trained livestock recognition model for livestock identification. Successfully identified images were then stored in the corresponding dataset. Experimental results showed that the highest accuracy was achieved with the 25 convolutional layers before freezing. Due to the rapid growth and development of pigs, increasing the necessary sorting frequency can ensure identification accuracy. Furthermore, training was performed using 50 epochs (full passes), 750 iterations, a batch size of 8, a learning rate of 0.005, and the ReLU activation function. The loss curve of the training results is shown in Figure 4, and the accuracy curve is shown in Figure 5. In Figure 4, the horizontal axis represents the number of iterations, and the vertical axis represents the loss value. "Loss" is a metric used during neural network training to measure the error between the model's predicted output and the actual label for each training batch or epoch, indicating how well the model fits the training data. "Val_loss" (validation loss) refers to the loss calculated during model training using the validation dataset. The validation dataset is a separate, independent dataset used to evaluate the model's performance on unseen data. In Figure 5, the horizontal axis represents the number of iterations, and the vertical axis represents the accuracy. "Accuracy" (accuracy) indicates the proportion of samples for which the model's predicted output exactly matches the actual label during training or validation. It is a measure of classification model performance. "Val_acc" (validation accuracy) refers to the accuracy calculated on the validation dataset. Similar to "Val_loss", validation accuracy is used to evaluate the model's performance on unseen data to determine its generalization ability.

[0201] Referring to FIG. 6 , FIG. 6 shows a schematic diagram of a process of image completion provided in an embodiment of the present application.

[0202] In some embodiments, the livestock image is an image obtained by capturing the target livestock's moving direction when the target livestock enters the detection area;

[0203] The step of obtaining the livestock identification of the target livestock based on the livestock image includes:

[0204] Step S301: detecting whether the livestock features of the target livestock in the livestock image meet preset image conditions;

[0205] Step S302: If not, inputting the livestock image into a preset image completion model to obtain a completed image corresponding to the livestock image;

[0206] Step S303: Based on the completed image, obtain the livestock identification of the target livestock.

[0207] The livestock features include one or more of the target livestock's facial features, neck features, ear features, shoulder features, back features, chest features, waist features, hip features, thigh features, leg features, tail features, and arm features; the facial features include facial features; and the preset image conditions include at least one of feature clarity and feature completeness.

[0208] In some embodiments, the image acquisition component is set in the direction of travel of the target livestock and facing the target livestock, so that the facial features of the target livestock in the livestock image are more complete, thereby determining the livestock identification of the target livestock based on the facial features.

[0209] In one implementation, the image completion model can be a convolutional neural network model or a recurrent neural network model. The implementation method of the preset image completion model is not limited here.

[0210] In some embodiments, the image completion model uses a generative adversarial network (WGAN) image completion method, adding a mask to the input sample livestock image and combining contextual and perceptual losses. The contextual loss ensures that the resulting completed image corresponding to the livestock image is as identical as possible to the sample livestock image, while the perceptual loss ensures the image's authenticity, thereby generating the completed and restored image. The mask marks the area on the input sample livestock image that needs to be completed. This area can be manually set or automatically detected by other algorithms and represents the portion that needs to be repaired or filled. Contextual loss is a loss function that measures the similarity between the generated image and the input image in the completed area. By minimizing the contextual loss, the generated image completion model can minimize the consistency of the completed image with the original image in the completed area, preserving the overall structure and details of the original image. Perceptual loss is a loss function based on perceptual quality that measures the difference between the generated image and the real image. It measures the image's authenticity by calculating the difference in high-level feature representations between the generated and real images. Perceptual loss can help the model generate realistic images that are visually closer to real images.

[0211] As an example, FIG7 is a schematic diagram of image comparison of an image completion result. An occlusion map is obtained by occluding the original image, and the image completion model performs image completion on the occlusion map to obtain a completed image.

[0212] In practical applications, livestock images are input into the image completion model to complete the occluded livestock features of the target livestock in the livestock images.

[0213] Thus, the livestock features of the target livestock in the livestock image are analyzed to determine whether the clarity and / or completeness of the livestock features meet preset image conditions, such as the clarity (e.g., image resolution, contrast, etc.) and the completeness of the facial features, neck features, ear features, shoulder features, back features, chest features, waist features, hip features, thigh features, leg features, tail features, or arm features. Facial features include facial features. If the livestock features do not meet the preset image conditions, the livestock image is input into a preset image completion model. Based on the existing image information and partial features of the livestock features, an image reconstruction or completion operation is performed to generate a completed image of the livestock features of the target livestock. Based on the obtained completed image, the livestock's identification information, such as identification information such as number and name, is determined through image processing and recognition techniques. This identification information is used to confirm the identity of the target livestock. First, by capturing livestock images oriented in the direction of target livestock travel and applying preset image conditions and image completion models, the accuracy of livestock identification is improved. Even when livestock features are incomplete or lack clarity, a complete image with recognizable features can still be generated, thereby improving the acquisition rate and accuracy of livestock identification. Second, by utilizing image processing and pattern recognition technologies, automated and intelligent recognition and processing of livestock images is achieved, improving processing efficiency, reducing manual intervention, and minimizing the impact of human factors on livestock identification acquisition. Third, by using livestock images as the source of livestock identification, data consistency and convenience are achieved. Livestock identification can be directly linked to livestock information, such as health status and weight, providing more possibilities for subsequent data analysis, management, and decision-making.

[0214] Refer to FIG8 , which shows a schematic diagram of a process for obtaining real-time weight information provided by an embodiment of the present application.

[0215] In some embodiments, the irregular movements of the target livestock may interfere with weight collection, and thus it is necessary to filter the weight pressure signal to more accurately determine the real-time weight information of the target livestock.

[0216] Specifically, obtaining the real-time weight information of the target livestock includes:

[0217] Step S401: acquiring the weight pressure signal of the target livestock in real time;

[0218] Step S402: filtering the weight pressure signal to obtain real-time weight information of the target livestock.

[0219] In one implementation, a livestock weighing assembly is used to obtain a weight pressure signal of a target livestock. The livestock weighing assembly may use a voltage-type weighing sensor, which is connected to a weighing platform of the livestock weighing assembly. When the target livestock arrives on the weighing platform, the weight pressure signal is obtained in real time through the voltage-type weighing sensor.

[0220] In some embodiments, a Kalman filter algorithm is used to filter the weight pressure signal. The Kalman filter equation can be expressed by the following formulas (1) to (5). Formula (1) is a state prediction equation. The state at the kth moment is estimated by the state at the k-1 moment, as shown in the following formula:

[0221] X k =AX k-1 +BU k-1 (1)

[0222] Where, X k represents the state at time k; A represents the state transfer matrix; B represents the input control matrix; U represents the external action.

[0223] Formula (2) represents the error matrix prediction, using the covariance P at time k-1 k-1 Recursively, we get the covariance estimate P at the kth moment k , as shown below:

[0224] P k =Ap k-1 A T +Q (2)

[0225] Where, P k represents the covariance estimate at time k; A represents the state transfer matrix; Q represents the predicted noise covariance matrix.

[0226] Formula (3) represents the Kalman gain calculation, as shown below:

[0227] K k =P k H T (HP k H T +R) -1 (3)

[0228] Where K k is the Kalman gain; H is the observation matrix; R is the measurement noise covariance matrix.

[0229] Formula (4) represents the state correction, as shown below:

[0230] X k =X k +K k (Z k -HX k ) (4)

[0231] Where K k is the Kalman gain; H is the observation matrix; Z k is the observed value at time k.

[0232] Formula (5) represents the covariance matrix update, as shown below:

[0233] P k =(IK k H)P k (5)

[0234] Where K k is the Kalman gain; I represents the identity matrix; H is the observation matrix; P k represents the covariance estimate at time k.

[0235] Referring to the flowchart of Kalman filtering shown in FIG9 , an experimental analysis is performed to determine the prediction noise covariance matrix and the measurement noise covariance matrix, thereby completing the construction of the Kalman filter equation.

[0236] Thus, the livestock weighing assembly monitors the weight pressure signal exerted by the target livestock on the weighing assembly in real time. The weight pressure signal is proportional to the livestock's weight and can be used to calculate the livestock's real-time weight. After obtaining the weight pressure signal, it is filtered, such as with a Kalman filter. This filtering process eliminates noise and interference in the measurement, thereby obtaining more stable and accurate real-time weight information. First, because the erratic movement of the target livestock entering the detection area can interfere with the acquisition of the weight pressure signal, real-time acquisition of the weight pressure signal and application of filtering methods (such as a Kalman filter) provide more accurate real-time weight information. Filtering can reduce the impact of noise and interference, thereby improving the accuracy and stability of weight estimation. Second, by acquiring the target livestock's weight pressure signal in real time and converting it into real-time weight information, it helps to timely understand the livestock's weight changes and make decisions such as health assessment, feeding adjustments, and disease prevention. Third, the acquisition and filtering of real-time weight information are automated processes, enabling automatic data collection and processing, reducing the need for manual intervention and operation, and improving work efficiency and data consistency.

[0237] In a specific application scenario, an embodiment of the present application provides a livestock sorting method, the method comprising:

[0238] When the target livestock enters the detection area, an image of the target livestock is acquired; the image of the target livestock is an image acquired by capturing the direction in which the target livestock is traveling when the target livestock enters the detection area;

[0239] performing image processing on the livestock image to identify and obtain health status information of the target livestock;

[0240] Obtaining real-time weight information of the target livestock;

[0241] Detecting whether livestock features of the target livestock in the livestock image meet preset image conditions; the livestock features include one or more of facial features, neck features, ear features, shoulder features, back features, chest features, waist features, hip features, thigh features, leg features, tail features, and arm features of the target livestock; the facial features include facial features; and the preset image conditions include at least one of feature clarity and facial features and feature completeness;

[0242] If not, inputting the livestock image into a preset image completion model to obtain a completed image corresponding to the livestock image;

[0243] acquiring a livestock identification of the target livestock based on the completed image;

[0244] Obtaining historical weight information of the target livestock according to the livestock identification;

[0245] Get the preset weight correspondence;

[0246] acquiring the development status information of the target livestock based on the real-time weight information, the historical weight information and the weight correspondence;

[0247] determining sorting information corresponding to the target livestock based on the health status information and the development status information;

[0248] The target livestock are sorted into a sorting area corresponding to the sorting information.

[0249] In practical applications, using a pig as the target livestock as an example, the system detects whether the pig has entered a detection area. When a pig enters the detection area, an image of the pig is captured using an image acquisition component facing the pig's direction of travel. This image is then processed to identify the pig's health status. If the pig's facial skin shows abnormalities, this may indicate a disease. Image analysis and detection are performed to determine if the pig is ill, corresponding to the health status information being ill. The target pig's real-time weight information is captured using a livestock weighing component. The pig's weight pressure signal is monitored and recorded in real time, and then processed to obtain the real-time weight information. The pig's facial and ear features in the livestock image are then tested to see if they meet preset image conditions, including requirements for clarity and completeness. If the facial features in the detected livestock image are incomplete, the livestock image is input into a preset image completion model to complete the facial features in the livestock image, thereby obtaining a completed facial image of the target pig. Based on the completed image, the livestock identification of the live pig, such as the code of the live pig, is obtained. According to the code of the live pig, the historical weight information of the target live pig is obtained. The historical weight records related to the code of the live pig are obtained by retrieving records or querying the database. A pre-set weight correspondence relationship, such as a matrix, model or mathematical formula, is obtained. Based on the real-time weight information, historical weight information and weight correspondence relationship, the developmental status information of the target live pig is obtained. If the developmental status information of the live pig obtained by calculation indicates that the development level of the live pig is normal, then the sorting information corresponding to the target live pig is determined based on the health status information and the developmental status information. Since the health status of the live pig is sick and the developmental status is normal, it is determined based on this information that the live pig should be sorted to sorting area C. Sorting area C is an area where management personnel need to be notified to carry out subsequent processing of the livestock in the sorting area. According to the sorting information, the gate control component opens the gate of the sorting area C, and uses the driving component to create sound or light to drive the live pig into the sorting area C. After the live pig enters the sorting area C, the gate of the sorting area C is closed, thereby completing the sorting of the live pig.

[0250] (Electronic equipment)

[0251] The embodiment of the present application also provides an electronic device, the specific embodiment of which is consistent with the embodiment described in the above method embodiment and the technical effects achieved, and some contents will not be repeated here.

[0252] The electronic device includes a memory and at least one processor, wherein the memory stores a computer program, and when the at least one processor executes the computer program, the following steps are implemented:

[0253] When the target livestock enters the detection area, acquiring a livestock image of the target livestock;

[0254] acquiring livestock information of the target livestock according to the livestock image;

[0255] Based on the livestock information, obtaining sorting information corresponding to the target livestock;

[0256] The target livestock are sorted into a sorting area corresponding to the sorting information.

[0257] In one embodiment, when executing the computer program, the at least one processor obtains the livestock information of the target livestock based on the livestock image in the following manner:

[0258] The livestock image is processed to identify and obtain health status information of the target livestock.

[0259] In one embodiment, when executing the computer program, the at least one processor further implements the following steps:

[0260] Obtaining real-time weight information of the target livestock;

[0261] Based on the livestock image, obtaining a livestock identification of the target livestock;

[0262] Obtaining historical weight information of the target livestock according to the livestock identification;

[0263] acquiring development status information of the target livestock based on the real-time weight information and the historical weight information;

[0264] When executing the computer program, the at least one processor obtains the sorting information corresponding to the target livestock according to the livestock information in the following manner:

[0265] Based on the health status information and the development status information, sorting information corresponding to the target livestock is determined.

[0266] In one embodiment, when executing the computer program, the at least one processor obtains the development status information of the target livestock based on the real-time weight information and the historical weight information in the following manner:

[0267] Get the preset weight correspondence;

[0268] Based on the real-time weight information, the historical weight information and the weight correspondence, the development status information of the target livestock is obtained.

[0269] In one embodiment, when executing the computer program, the at least one processor obtains the livestock identification of the target livestock based on the livestock image in the following manner:

[0270] detecting whether livestock features of the target livestock in the livestock image meet preset image conditions; the livestock features include one or more of facial features, neck features, ear features, shoulder features, back features, chest features, waist features, hip features, thigh features, leg features, tail features, and arm features of the target livestock; the facial features include facial features; and the preset image conditions include at least one of feature clarity and feature completeness;

[0271] If not, inputting the livestock image into a preset image completion model to obtain a completed image corresponding to the livestock image;

[0272] Based on the completed image, the livestock identification of the target livestock is obtained.

[0273] In one embodiment, when executing the computer program, the at least one processor obtains the real-time weight information of the target livestock in the following manner:

[0274] acquiring a weight pressure signal of the target livestock in real time;

[0275] The weight pressure signal is filtered to obtain real-time weight information of the target livestock.

[0276] Referring to FIG. 10 , FIG. 10 is a structural block diagram of an electronic device 10 provided in an embodiment of the present application.

[0277] The electronic device 10 may include, for example, at least one memory 11 , at least one processor 12 , and a bus 13 connecting different platform systems.

[0278] The memory 11 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 111 and / or a cache memory 112 , and may further include a read-only memory (ROM) 113 .

[0279] The memory 11 also stores a computer program, which can be executed by the processor 12 so that the processor 12 implements the steps of any of the above methods.

[0280] The memory 11 may also include a utility 114 having at least one program module 115, such program module 115 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include an implementation of a network environment.

[0281] Accordingly, the processor 12 may execute the aforementioned computer program and the utility 114 .

[0282] The processor 12 may be implemented as one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs), or other electronic components.

[0283] The bus 13 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures.

[0284] The electronic device 10 may also communicate with one or more external devices, such as a keyboard, a pointing device, a Bluetooth device, or the like, as well as one or more devices capable of interacting with the electronic device 10, and / or any device that enables the electronic device 10 to communicate with one or more other computing devices (e.g., a router, a modem, etc.). Such communication may be performed via an input / output interface 14. Furthermore, the electronic device 10 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 15. The network adapter 15 may communicate with other modules of the electronic device 10 via the bus 13. It should be understood that, although not shown in the figures, other hardware and / or software modules may be used in conjunction with the electronic device 10 in actual applications, including but not limited to microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms.

[0285] (Computer-readable storage medium)

[0286] The embodiment of the present application also provides a computer-readable storage medium, the specific embodiment of which is consistent with the embodiment described in the above method embodiment and the technical effects achieved, and some contents will not be repeated here.

[0287] The computer-readable storage medium stores a computer program, and when the computer program is executed by at least one processor, the computer program implements the steps of any of the above methods or implements the functions of any of the above electronic devices.

[0288] Computer readable medium can be a computer readable signal medium or a computer readable storage medium. In an embodiment of the present application, a computer readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it. Computer readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0289] A computer-readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable storage medium may also be any computer-readable medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, or any suitable combination thereof. The program code used to perform the operations of this application may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, as well as conventional procedural programming languages ​​such as C or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a standalone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. Where a remote computing device is involved, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN), a wide area network (WAN), or a public network (the Internet), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0290] (Computer Program Product)

[0291] The embodiments of the present application also provide a computer program product, the specific embodiments of which are consistent with the embodiments described in the above method embodiments and the technical effects achieved, and some contents will not be repeated here.

[0292] The present application provides a computer program product, which includes a computer program. When the computer program is executed by at least one processor, it implements the steps of any of the above methods or the functions of any of the above electronic devices.

[0293] See Figure 11, which is a structural diagram of a computer program product provided in an embodiment of the present application.

[0294] The computer program product is used to implement the steps of any of the above methods or to implement the functions of any of the above electronic devices. The computer program product can be a portable compact disc read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the computer program product of the present application is not limited thereto, and the computer program product can be any combination of one or more computer-readable media.

Claims

1. A livestock sorting method, comprising: When the target livestock enters the detection area, acquiring a livestock image of the target livestock; acquiring livestock information of the target livestock according to the livestock image; Based on the livestock information, obtaining sorting information corresponding to the target livestock; The target livestock is sorted into a sorting area corresponding to the sorting information.

2. The livestock sorting method according to claim 1, wherein: The livestock information includes health status information, and acquiring the livestock information of the target livestock according to the livestock image includes: The livestock image is processed to identify and obtain health status information of the target livestock.

3. The livestock sorting method according to claim 2, wherein: The livestock sorting method further comprises: Obtaining real-time weight information of the target livestock; Based on the livestock image, obtaining a livestock identification of the target livestock; According to the livestock identification, obtaining historical weight information of the target livestock; Based on the real-time weight information and the historical weight information, acquiring the development status information of the target livestock; The step of obtaining sorting information corresponding to the target livestock according to the livestock information includes: Based on the health status information and the development status information, sorting information corresponding to the target livestock is determined.

4. The livestock sorting method according to claim 3, wherein: The step of acquiring the development status information of the target livestock based on the real-time weight information and the historical weight information includes: Obtain the preset weight correspondence; Based on the real-time weight information, the historical weight information and the weight correspondence, the development status information of the target livestock is acquired.

5. The livestock sorting method according to claim 3, wherein: The step of obtaining the livestock identification of the target livestock based on the livestock image includes: Detecting whether the livestock features of the target livestock in the livestock image meet preset image conditions; the livestock features include one or more of facial features, neck features, ear features, shoulder features, back features, chest features, waist features, buttocks features, thigh features, leg features, tail features and arm features of the target livestock; the facial features include facial features; the preset image conditions include at least one of feature clarity and feature completeness; If not, inputting the livestock image into a preset image completion model to obtain a completed image corresponding to the livestock image; Based on the completed image, the livestock identification of the target livestock is obtained.

6. The livestock sorting method according to claim 3, wherein: The step of obtaining the real-time weight information of the target livestock comprises: Acquiring a weight pressure signal of the target livestock in real time; The weight pressure signal is filtered to obtain the real-time weight information of the target livestock.

7. An electronic device, comprising a memory and at least one processor, wherein the memory stores a computer program, and when the at least one processor executes the computer program, the following steps are implemented: When the target livestock enters the detection area, acquiring a livestock image of the target livestock; acquiring livestock information of the target livestock according to the livestock image; Based on the livestock information, obtaining sorting information corresponding to the target livestock; The target livestock is sorted into a sorting area corresponding to the sorting information.

8. A livestock sorting system, comprising: A detection module, the detection module is used to detect livestock information of target livestock; A sorting module, the sorting module is used to sort the target livestock; An electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to implement the steps of the method according to any one of claims 1 to 6 when executing the computer program.

9. The livestock sorting system according to claim 8, wherein: The detection module includes an image acquisition component and a livestock weighing component; The image acquisition component is used to obtain an image of the target livestock when the target livestock enters the detection area; The livestock weighing component is used to obtain the weight pressure signal of the target livestock in real time.

10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by at least one processor, implements the steps of the method according to any one of claims 1 to 6 or implements the functions of the electronic device according to claim 7.

11. A computer program product, comprising a computer program, wherein when the computer program is executed by at least one processor, the computer program implements the steps of the method according to any one of claims 1 to 6 or implements the functions of the electronic device according to claim 7.

Citation Information

Patent Citations

  • Livestock state detection method, computer program, storage medium and electronic equipment

    CN108052964A

  • Target state detection method and device, medium and electronic equipment

    CN112150506A

  • Poultry seedling sorting system based on convolutional neural network

    CN113231341A

  • Weight measurement method and device, electronic equipment and living livestock measurement system

    CN114973332A

  • Method for estimating weight of pig and related equipment

    CN115294185A

Cited By

  • Intelligent sorting method and system based on machine learning

    CN120563919A

  • Live pig breeding whole-process intelligent management system

    CN121744070A

  • A whole-process intelligent management system for pig breeding

    CN121744070B