Method and apparatus for measuring animal backfat and eye muscle thicknesses based on machine learning
Through machine learning-based methods and robotic arm B-ultrasound technology, untouched, fast and accurate measurement of animal backfat and eye muscle thickness is achieved, solving the problems of traditional measurement efficiency and high biosafety risks, and improving measurement efficiency and animal welfare.
Patent Information
- Application Number
- PCT/CN2024/096312
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-11-27
- Filing Date
- 2024-05-30
- Publication Date
- 2025-06-05
AI Technical Summary
The prior art has problems of inefficiency and biosafety risks when measuring animal backfat and eye muscle thickness, and traditional manual measurements cause stress on animals.
Using a machine learning-based method, the animal's back curve is tracked and detected through the tracking and detection model, the acquisition point is identified, and the robotic arm and B-ultrasound probe are used to collect untouched B-ultrasound video images, and the grayscale image frame is extracted for thickness measurement.
Fast, accurate, untouched animal backfat and eye muscle thickness measurements are achieved, reducing human errors and biosafety risks, and improving measurement efficiency and animal welfare.
Smart Images

Figure CN2024096312_05062025_PF_FP_ABST
Abstract
Description
Animal backfat and eye muscle thickness measurement method and device based on machine learning
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on November 27, 2023, with application number 202311597531.9 and application name “Animal back fat and eye muscle thickness measurement method and device based on machine learning”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present invention belongs to the technical field of animal breeding assessment, and in particular relates to a method and device for measuring animal backfat and eye muscle thickness based on machine learning. Background Art
[0003] Machine learning algorithms are gaining prominence in agriculture and livestock management due to their ability to process large datasets and make accurate predictions. Ultrasound is a powerful tool for assessing soft tissue characteristics in living animals. Key advantages of ultrasound technology include its noninvasive nature, rapidity, and reproducibility. This technology, already widely used in the medical field, is now being adapted for livestock management.
[0004] The swine industry currently plays a vital role in meeting global demand for meat products. Effective management of swine production requires the ability to accurately assess pig health, body condition, and meat quality. Two key factors in this assessment are back fat thickness and loincloth thickness. Traditionally, veterinarians have visited pig farms and used handheld devices to measure these indicators. This is stressful for the animals and a significant workload for breeders, posing significant biosecurity risks. Many infectious diseases, such as the highly prevalent African swine fever, are often spread within farms through human contact with pigs. Recent advances in ultrasound, machine learning, and deep learning technologies have made accurate, contactless measurement of back fat and loincloth thickness crucial to effective swine management.
[0005] Summary of the Invention
[0006] To this end, the present invention provides a method and device for measuring animal backfat and eye muscle thickness based on machine learning, which can achieve accurate, contactless measurement of the backfat thickness and eye muscle thickness of breeding objects, especially pigs. This is crucial for the effective management of animal breeding and solves the problems of low efficiency and high safety risks of traditional manual measurement.
[0007] To achieve the above objectives, the present invention provides the following technical solution: a method for measuring the thickness of animal backfat and eye muscle based on machine learning, comprising:
[0008] Tracking and detecting the back curve of the animal object at the specified position using a tracking detection model to determine whether the animal object is in place at the specified position;
[0009] If it is determined that the animal object is already in position at the designated location, identifying the collection points of the back curve of the animal object to obtain the collection points of the back curve of the animal object;
[0010] Positioning the collection points of the back curve of the animal object to obtain positioning coordinate values of the collection points of the back curve of the animal object;
[0011] The positioning coordinate value of the collection point of the back curve of the animal subject is sent to a robotic arm equipped with a B-ultrasound probe. The robotic arm equipped with the B-ultrasound probe tracks the collection point according to the positioning coordinate value, and after dipping the coupling agent from the coupling agent container, the B-ultrasound probe is attached to the collection point of the back curve of the animal subject;
[0012] Controlling a B-ultrasound probe to collect B-ultrasound video images of the collection points of the back curve of the animal object, and generating a B-ultrasound video file of the collection points of the back curve of the animal object;
[0013] A preset number of B-ultrasound image frames are extracted from the B-ultrasound video file, and the obtained preset number of B-ultrasound image frames are converted into grayscale to measure the back fat and eye muscle thickness of the animal object.
[0014] As a preferred solution of the method for measuring animal backfat and eye muscle thickness based on machine learning, the training process of the tracking detection model is:
[0015] Acquire the back image data of the animal object, annotate the back image data and load the YoLov4-tiny model, train, test and evaluate the YoLov4-tiny model using the back image data, and obtain the trained tracking detection model after meeting the preset requirements.
[0016] As a preferred embodiment of the method for measuring the thickness of animal back fat and eye muscle based on machine learning, the formula for identifying the collection points of the back curve of the animal object is: Xc=X0-a, a≥0 Yc=Y0-b, b≥0 Zc=Z0, 0.2≤Z0≤0.9
[0017] Where Xc is the horizontal coordinate of the acquisition point in the 3D camera image, X0 = Length / 2, which is half the length of the identified animal object; Yc is the vertical coordinate of the acquisition point in the 3D camera image, Y0 = Width / 2, which is half the width of the identified animal object; Zc is the height coordinate of the acquisition point in the 3D camera image, Z0 is the distance from the recognition camera to the back of the animal object; a and b are fixed values selected according to the length and width of the animal object.
[0018] As a preferred solution for the method of measuring animal back fat and eye muscle thickness based on machine learning, zero point calibration is performed on the coordinates between a robotic arm equipped with a B-ultrasound probe and a camera for identifying the collection points of the back curve of the animal object.
[0019] As a preferred solution for the method of measuring animal back fat and eye muscle thickness based on machine learning, the B-ultrasound probe performs a B-ultrasound video image acquisition process on the acquisition points of the back curve of the animal object, and controls the B-ultrasound probe to stay for a preset time.
[0020] As a preferred embodiment of the method for measuring the thickness of animal backfat and eye muscles based on machine learning, a preset number of acquired B-ultrasound image frames are converted into a grayscale process, and the clarity of the B-ultrasound image frames is calculated using Laplace transform;
[0021] determining whether the clarity of the B-ultrasound image frame reaches a preset clarity value; if the clarity of the B-ultrasound image frame does not reach the preset clarity value, re-extracting the B-ultrasound image frame from the B-ultrasound video file;
[0022] If the clarity of the B-ultrasound image frames reaches a preset clarity value, counting the B-ultrasound image frames that reach the preset clarity value;
[0023] determining whether the number of the B-ultrasound image frames meeting the preset definition value has reached a preset number, and if the number of the B-ultrasound image frames meeting the preset definition value has reached the preset number, saving the B-ultrasound image frames meeting the preset definition value;
[0024] If the number of the B-ultrasound image frames that meet the preset definition value does not reach the preset number, the corresponding B-ultrasound video file and the B-ultrasound image frames will be discarded.
[0025] As a preferred embodiment of the method for measuring animal back fat and eye muscle thickness based on machine learning, the back fat layer in the B-ultrasound image frame is detected using an edge detection algorithm, and a virtual boundary of the detected back fat area is drawn on the B-ultrasound image frame; the distance from the third layer of the skin to four preset points is calculated, and the back fat measurement result is calculated by the average value of the four distances.
[0026] As a preferred embodiment of the method for measuring animal back fat and eye muscle thickness based on machine learning, the eye muscle thickness in the B-ultrasound image frame is detected using an edge detection algorithm. A line is drawn on the B-ultrasound image frame to represent the end of the eye muscle. The distance between the lines drawn at four preset points in the skin layer is calculated, and the eye muscle thickness measurement result is calculated by the average of the four distances.
[0027] As a preferred method for measuring animal backfat and eye muscle thickness based on machine learning, the formula for measuring backfat and eye muscle thickness μ is:
[0028] Where K represents a constant, Xn+1 and Yn+1 are the detected coordinates of the skin layer, and Xi and Yi are the detected coordinates of the third layer of back fat layer / eye muscle.
[0029] The present invention also provides a device for measuring the thickness of animal backfat and eye muscle based on machine learning, which uses the above-mentioned method for measuring the thickness of animal backfat and eye muscle based on machine learning, comprising:
[0030] a back curve tracking and detection module, configured to track and detect the back curve of an animal object at a specified position using a tracking and detection model, so as to determine whether the animal object is in place at the specified position;
[0031] a back curve collection point identification module, configured to identify the collection points of the back curve of the animal object if it is determined that the animal object is already in position at the designated location, and obtain the collection points of the back curve of the animal object;
[0032] A collection point coordinate conversion module, used for locating the collection point of the back curve of the animal object and obtaining the positioning coordinate value of the collection point of the back curve of the animal object;
[0033] The B-ultrasound probe motion control module is used to send the positioning coordinate value of the collection point of the back curve of the animal subject to the robotic arm equipped with the B-ultrasound probe, so that the robotic arm equipped with the B-ultrasound probe tracks the collection point according to the positioning coordinate value, and after dipping the coupling agent from the coupling agent container, the B-ultrasound probe is attached to the collection point of the back curve of the animal subject;
[0034] A B-ultrasound video acquisition module, used for controlling a B-ultrasound probe to acquire B-ultrasound video images at acquisition points of the back curve of the animal object, and generating a B-ultrasound video file of the acquisition points of the back curve of the animal object;
[0035] The B-ultrasound image processing module is used to extract a preset number of B-ultrasound image frames from the B-ultrasound video file and convert the obtained preset number of B-ultrasound image frames into grayscale to measure the back fat and eye muscle thickness of the animal object.
[0036] The beneficial effects of the present invention are as follows: a tracking detection model is used to track and detect the back curve of an animal object at a specified position to determine whether the animal object is in place at the specified position; if it is determined that the animal object is in place at the specified position, the collection points of the back curve of the animal object are identified to obtain the collection points of the back curve of the animal object; the collection points of the back curve of the animal object are positioned to obtain the positioning coordinate values of the collection points of the back curve of the animal object; the positioning coordinate values of the collection points of the back curve of the animal object are sent to a robotic arm equipped with a B-ultrasound probe, the robotic arm equipped with the B-ultrasound probe tracks the collection points according to the positioning coordinate values, and after dipping the coupling agent from a coupling agent container, the B-ultrasound probe is attached to the collection points of the back curve of the animal object; the B-ultrasound probe is controlled to perform B-ultrasound video image acquisition on the collection points of the back curve of the animal object, and a B-ultrasound video file of the collection points of the back curve of the animal object is generated; a preset number of B-ultrasound image frames are extracted from the B-ultrasound video file, and the obtained preset number of B-ultrasound image frames are converted into grayscale to measure the back fat and eye muscle thickness of the animal object. The present invention utilizes fully automatic ultrasonic measurement to accurately measure the backfat and eye muscle thickness of each animal subject, achieving high accuracy and consistency while reducing human error and variability. It can quickly measure multiple animal subjects in a short period of time, thereby improving the efficiency of animal subject data collection, which is extremely valuable in large-scale farming. Ultrasonic images are captured by a robotic arm, and then the backfat and eye muscle thickness of the pigs are automatically measured based on machine learning. This process is entirely unmanned, causing minimal stress on the animals and contributing to animal welfare. Biosafety risks are also reduced. Data collection is real-time, which is extremely important for timely adjustments to feeding and management strategies, and can optimize the healthy growth of animal subjects. The data is easy to manage, retrieve, and analyze, providing data support for decision-making on the management of farming subjects. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the embodiments or the description of the prior art. Obviously, the drawings described below are merely exemplary, and those skilled in the art can, without inventive effort, derive other implementation drawings based on the provided drawings.
[0038] The structures, proportions, sizes, etc. illustrated in this specification are intended solely to complement the contents disclosed herein and to facilitate understanding and reading by persons skilled in the art. They are not intended to limit the conditions under which the present invention may be implemented and therefore have no substantive technical significance. Any structural modifications, changes in proportions, or adjustments in sizes, without affecting the efficacy and objectives of the present invention, shall remain within the scope of the technical contents disclosed herein.
[0039] FIG1 is a schematic flow chart of a method for measuring animal backfat and eye muscle thickness based on machine learning provided by an embodiment of the present invention;
[0040] FIG2 is a diagram illustrating back curve recognition in a method for measuring back fat and eye muscle thickness of an animal based on machine learning provided by an embodiment of the present invention;
[0041] FIG3 is a diagram illustrating a tracking detection model training process in a method for measuring animal backfat and eye muscle thickness based on machine learning according to an embodiment of the present invention;
[0042] FIG4 is a diagram illustrating the positioning of collection points in the method for measuring animal backfat and eye muscle thickness based on machine learning provided by an embodiment of the present invention;
[0043] FIG5 is a video file processing flow in a method for measuring animal backfat and eye muscle thickness based on machine learning provided by an embodiment of the present invention;
[0044] FIG6 is an image frame processing flow in a method for measuring animal backfat and eye muscle thickness based on machine learning provided by an embodiment of the present invention;
[0045] FIG7 is a diagram showing distances from the third layer of skin to four different points calculated in a method for measuring animal backfat and eye muscle thickness based on machine learning provided by an embodiment of the present invention;
[0046] FIG8 is a diagram showing the identification of the eye muscle and three fat layers and the drawing of a line graph in the method for measuring the thickness of animal backfat and eye muscle based on machine learning provided by an embodiment of the present invention;
[0047] FIG9 is a schematic diagram of the architecture of an apparatus for measuring the thickness of animal backfat and eye muscles based on machine learning according to an embodiment of the present invention. DETAILED DESCRIPTION
[0048] The following describes the implementation of the present invention using specific embodiments. Those skilled in the art will readily understand the other advantages and benefits of the present invention from the disclosure herein. Obviously, the embodiments described are only a portion of the present invention, not all of it. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without inventive effort are intended to fall within the scope of protection of the present invention.
[0049] Example 1
[0050] 1 and 2 , Example 1 of the present invention provides a method for measuring the thickness of animal backfat and eye muscle based on machine learning, comprising the following steps:
[0051] S1. Tracking and detecting the back curve of an animal object at a specified position using a tracking detection model to determine whether the animal object is in place at the specified position;
[0052] S2. If it is determined that the animal object is already in position at the designated location, identifying the collection points of the back curve of the animal object to obtain the collection points of the back curve of the animal object;
[0053] S3. Positioning the collection points of the back curve of the animal object to obtain positioning coordinate values of the collection points of the back curve of the animal object;
[0054] S4. Sending the location coordinates of the collection point on the back curve of the animal subject to a robotic arm equipped with a B-ultrasound probe. The robotic arm equipped with the B-ultrasound probe tracks the collection point according to the location coordinates, and after applying coupling agent from a coupling agent container, places the B-ultrasound probe on the collection point on the back curve of the animal subject.
[0055] S5, controlling the B-ultrasound probe to collect B-ultrasound video images of the collection points of the back curve of the animal object, and generating a B-ultrasound video file of the collection points of the back curve of the animal object;
[0056] S6. Extracting a preset number of B-ultrasound image frames from the B-ultrasound video file, and converting the obtained preset number of B-ultrasound image frames into grayscale to measure the back fat and eye muscle thickness of the animal object.
[0057] Referring to FIG3 , in this embodiment, the training process of the tracking detection model is as follows:
[0058] Acquire the back image data of the animal object, annotate the back image data and load the YoLov4-tiny model, train, test and evaluate the YoLov4-tiny model using the back image data, and obtain the trained tracking detection model after meeting the preset requirements.
[0059] Then, in step S1, the back curve of an animal object, such as a pig, is tracked and detected according to a tracking detection model trained in advance. Successful recognition means that the pig is in place and waiting for detection.
[0060] In this embodiment, in step S2, the formula for identifying the collection points of the back curve of the animal object is: Xc=X0-a, a≥0 Yc=Y0-b, b≥0 Zc=Z0, 0.2≤Z0≤0.9
[0061] Where Xc is the horizontal coordinate of the acquisition point in the 3D camera image, X0 = Length / 2, which is half the length of the identified animal object; Yc is the vertical coordinate of the acquisition point in the 3D camera image, Y0 = Width / 2, which is half the width of the identified animal object; Zc is the height coordinate of the acquisition point in the 3D camera image, Z0 is the distance from the recognition camera to the back of the animal object; a and b are fixed values selected according to the length and width of the animal object.
[0062] Taking a pig as an example, in the visual recognition formula for a 3D camera image, X0 = Length / 2, representing half the pig's length, automatically captured by the 3D camera based on a pre-trained object detection model. Y0 = Width / 2, representing half the pig's width, automatically captured by the 3D camera based on a pre-trained object detection model. Z0 is the distance from the 3D camera to the pig's back, automatically captured by the 3D camera. Z0 ≤ 0.2m indicates the camera is blocked, and Z0 ≥ 0.9m indicates there are no pigs in the area (0.9m is the minimum height for pigs weighing over 80kg). a and b take fixed values based on the pig's length and width.
[0063] Referring to Figure 4 , in this embodiment, in step S3, the collection points of the pig's back curve are located, and the located collection points are converted from visual positioning into coordinate values and transmitted to the robotic arm, thereby obtaining the location coordinate values of the collection points of the pig's back curve. In this case, according to the teaching process of the robotic arm product, the coordinates between the robotic arm equipped with the B-ultrasound probe and the camera that identifies the collection points of the animal's back curve are zero-point calibrated.
[0064] In this embodiment, in step S4, the positioning coordinate value of the collection point of the pig's back curve is sent to a robotic arm equipped with a B-ultrasound probe. The robotic arm equipped with the B-ultrasound probe tracks the collection point according to the positioning coordinate value, and after dipping the coupling agent from the coupling agent container, the B-ultrasound probe is attached to the collection point of the pig's back curve.
[0065] In step S5, the B-ultrasound probe performs a B-ultrasound video image acquisition process on the acquisition points of the pig's back curve, controls the B-ultrasound probe to stay for a preset time of 10 seconds, and automatically generates a B-ultrasound video file of the acquisition points of the pig's back curve, and then the video is transmitted to the microcomputer host.
[0066] 5 and 6 , in this embodiment, in step S6 , the acquired preset number of B-ultrasound image frames are converted into grayscale, and the clarity of the B-ultrasound image frames is calculated using Laplace transform;
[0067] determining whether the clarity of the B-ultrasound image frame reaches a preset clarity value; if the clarity of the B-ultrasound image frame does not reach the preset clarity value, re-extracting the B-ultrasound image frame from the B-ultrasound video file;
[0068] If the clarity of the B-ultrasound image frames reaches a preset clarity value, counting the B-ultrasound image frames that reach the preset clarity value;
[0069] determining whether the number of the B-ultrasound image frames meeting the preset definition value has reached a preset number, and if the number of the B-ultrasound image frames meeting the preset definition value has reached the preset number, saving the B-ultrasound image frames meeting the preset definition value;
[0070] If the number of the B-ultrasound image frames that meet the preset definition value does not reach the preset number, the corresponding B-ultrasound video file and the B-ultrasound image frames will be discarded.
[0071] Five clear images are extracted from each ultrasound video file. If five clear images cannot be extracted, the ultrasound video file will be discarded and not used for backfat and eye lobe thickness measurement. The extracted oblique images are stored in the computer host memory and used to measure backfat and eye lobe thickness.
[0072] Among them, machine learning algorithms such as edge detection and Hough transform are used to automatically identify ribs, muscles, and fat from stored image frames, and then automatically measure the back fat thickness and eye muscle thickness, and store the results in the memory of the microcomputer host.
[0073] Referring to Figure 7, in this embodiment, the back fat layer detection process in the B-ultrasound image frame uses an edge detection algorithm to detect the back fat layer in the B-ultrasound image frame, and a virtual boundary of the detected back fat area is drawn on the B-ultrasound image frame; the distance from the third layer of the skin to four preset points is calculated, and the back fat measurement result is calculated by the average value of the four distances.
[0074] Referring to Figure 8, in this embodiment, the eye muscle thickness in the B-ultrasound image frame is detected using an edge detection algorithm. A line is drawn on the B-ultrasound image frame to represent the end of the eye muscle, and the distance between the lines drawn at four preset points in the skin layer is calculated. The eye muscle thickness measurement result is calculated by the average value of the four distances.
[0075] The formula for measuring backfat and eye muscle thickness μ is:
[0076] Wherein, K represents a constant with a value of 0.5, Xn+1 and Yn+1 are the detected coordinates of the skin layer, and Xi and Yi are the detected coordinates of the third layer of back fat layer / eye muscle.
[0077] In summary, the embodiment of the present invention tracks and detects the back curve of an animal object at a specified position through a tracking detection model to determine whether the animal object is in place at the specified position; if it is determined that the animal object is in place at the specified position, the collection point of the back curve of the animal object is identified to obtain the collection point of the back curve of the animal object; the collection point of the back curve of the animal object is located to obtain the positioning coordinate value of the collection point of the back curve of the animal object; the positioning coordinate value of the collection point of the back curve of the animal object is sent to a robotic arm equipped with a B-ultrasound probe, the robotic arm equipped with the B-ultrasound probe tracks the collection point according to the positioning coordinate value, and after dipping the coupling agent from the coupling agent container, the B-ultrasound probe is attached to the collection point of the back curve of the animal object; the B-ultrasound probe is controlled to perform B-ultrasound video image acquisition on the collection point of the back curve of the animal object, and a B-ultrasound video file of the collection point of the back curve of the animal object is generated; a preset number of B-ultrasound image frames are extracted from the B-ultrasound video file, and the obtained preset number of B-ultrasound image frames are converted into grayscale to measure the back fat and eye muscle thickness of the animal object. The present invention utilizes fully automatic ultrasonic measurement to accurately measure the backfat and eye muscle thickness of each animal subject, achieving high accuracy and consistency while reducing human error and variability. It can quickly measure multiple animal subjects in a short period of time, thereby improving the efficiency of animal subject data collection, which is extremely valuable in large-scale farming. Ultrasonic images are captured by a robotic arm, and then the backfat and eye muscle thickness of the pigs are automatically measured based on machine learning. This process is entirely unmanned, causing minimal stress on the animals and contributing to animal welfare. Biosafety risks are also reduced. Data collection is real-time, which is extremely important for timely adjustments to feeding and management strategies, and can optimize the healthy growth of animal subjects. The data is easy to manage, retrieve, and analyze, providing data support for decision-making on the management of farming subjects.
[0078] In one possible implementation, machine learning algorithms are trained to identify features such as back fat, eye muscles, and muscle boundaries in ultrasound images, facilitating automated measurement. Applying deep learning models, backfat and eye muscle thickness measurements can be used to predict pig growth trends and meat quality. This information is highly valuable for decision-making regarding pig breeding and marketing strategies.
[0079] In one possible embodiment, abnormalities in ultrasound B-scan image frames can be identified, enabling early intervention to address potential issues and ensure healthy pig growth. By continuously measuring and analyzing historical data, machine learning models can provide automated feedback for optimizing feeding and management strategies to meet specific production goals, such as achieving desired fat and muscle levels.
[0080] It should be noted that the method of the embodiments of the present disclosure can be performed by a single device, such as a computer or server. The method of the embodiments of the present disclosure can also be applied in a distributed scenario, where multiple devices cooperate to perform the method. In such a distributed scenario, one of the multiple devices may only perform one or more steps of the method of the embodiments of the present disclosure, and the multiple devices will interact with each other to complete the method.
[0081] It should be noted that the above description is limited to some embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in an order different from that described in the above embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0082] Example 2
[0083] 9 , Example 2 of the present invention provides an apparatus for measuring the thickness of animal backfat and eye muscle based on machine learning, which uses the method for measuring the thickness of animal backfat and eye muscle based on machine learning of Example 1, including:
[0084] The back curve tracking and detection module 1 is used to track and detect the back curve of the animal object at the specified position through the tracking and detection model to determine whether the animal object is in place at the specified position;
[0085] Back curve collection point identification module 2, for identifying the collection points of the back curve of the animal object if it is determined that the animal object is already in position at the designated location, and obtaining the collection points of the back curve of the animal object;
[0086] A collection point coordinate conversion module 3 is used to locate the collection point of the back curve of the animal object and obtain the positioning coordinate value of the collection point of the back curve of the animal object;
[0087] The B-ultrasound probe motion control module 4 is configured to transmit the positioning coordinate values of the collection point of the back curve of the animal subject to the robotic arm equipped with the B-ultrasound probe, so that the robotic arm equipped with the B-ultrasound probe tracks the collection point according to the positioning coordinate values, and after applying coupling agent from the coupling agent container, places the B-ultrasound probe on the collection point of the back curve of the animal subject;
[0088] B-ultrasound video acquisition module 5, used for controlling the B-ultrasound probe to acquire B-ultrasound video images of acquisition points of the back curve of the animal object, and generating a B-ultrasound video file of the acquisition points of the back curve of the animal object;
[0089] The B-ultrasound image processing module 6 is used to extract a preset number of B-ultrasound image frames from the B-ultrasound video file, and convert the obtained preset number of B-ultrasound image frames into grayscale to measure the back fat and eye muscle thickness of the animal object.
[0090] In this embodiment, the training process of the tracking detection model in the back curve tracking detection module 1 is:
[0091] Acquire the back image data of the animal object, annotate the back image data and load the YoLov4-tiny model, train, test and evaluate the YoLov4-tiny model using the back image data, and obtain the trained tracking detection model after meeting the preset requirements.
[0092] In this embodiment, in the back curve collection point recognition module 2, the formula for identifying the collection points of the back curve of the animal object is: Xc=X0-a, a≥0 Yc=Y0-b, b≥0 Zc=Z0, 0.2≤Z0≤0.9
[0093] Where Xc is the horizontal coordinate of the acquisition point in the 3D camera image, X0 = Length / 2, which is half the length of the identified animal object; Yc is the vertical coordinate of the acquisition point in the 3D camera image, Y0 = Width / 2, which is half the width of the identified animal object; Zc is the height coordinate of the acquisition point in the 3D camera image, Z0 is the distance from the recognition camera to the back of the animal object; a and b are fixed values selected according to the length and width of the animal object.
[0094] In this embodiment, the acquisition point coordinate conversion module 3 is further used to perform zero point calibration on the coordinates between the robotic arm equipped with the B-ultrasound probe and the camera for identifying the acquisition points of the back curve of the animal object.
[0095] In this embodiment, in the B-ultrasound video acquisition module 5, the B-ultrasound probe performs a B-ultrasound video image acquisition process on the acquisition points of the back curve of the animal object, and controls the B-ultrasound probe to stay for a preset time.
[0096] In this embodiment, in the B-ultrasound image processing module 6, a preset number of acquired B-ultrasound image frames are converted into grayscale, and the clarity of the B-ultrasound image frames is calculated using Laplace transform;
[0097] determining whether the clarity of the B-ultrasound image frame reaches a preset clarity value; if the clarity of the B-ultrasound image frame does not reach the preset clarity value, re-extracting the B-ultrasound image frame from the B-ultrasound video file;
[0098] If the clarity of the B-ultrasound image frames reaches a preset clarity value, counting the B-ultrasound image frames that reach the preset clarity value;
[0099] determining whether the number of the B-ultrasound image frames meeting the preset definition value has reached a preset number, and if the number of the B-ultrasound image frames meeting the preset definition value has reached the preset number, saving the B-ultrasound image frames meeting the preset definition value;
[0100] If the number of the B-ultrasound image frames that meet the preset definition value does not reach the preset number, the corresponding B-ultrasound video file and the B-ultrasound image frames will be discarded.
[0101] In this embodiment, in the B-ultrasound image processing module 6, the back fat layer in the B-ultrasound image frame is detected using an edge detection algorithm, and a virtual boundary of the detected back fat area is drawn on the B-ultrasound image frame; the distance from the third layer of the skin to four preset points is calculated, and the back fat measurement result is calculated by the average value of the four distances.
[0102] In this embodiment, in the B-ultrasound image processing module 6, the eye muscle thickness in the B-ultrasound image frame is detected using an edge detection algorithm, a line is drawn on the B-ultrasound image frame to represent the end of the eye muscle, and the distance between the lines drawn at the four preset points of the skin layer is calculated. The eye muscle thickness measurement result is calculated by the average value of the four distances.
[0103] In this embodiment, in the B-ultrasound image processing module 6, the formula for measuring the back fat and eye muscle thickness μ is:
[0104] Where K represents a constant, Xn+1 and Yn+1 are the detected coordinates of the skin layer, and Xi and Yi are the detected coordinates of the third layer of back fat layer / eye muscle.
[0105] It should be noted that the information interaction, execution process, etc. between the modules of the above-mentioned device are based on the same concept as the method embodiment in Example 1 of the present application, and the technical effects they bring are the same as those of the method embodiment of the present application. For specific contents, please refer to the description in the method embodiment shown above in the present application, and will not be repeated here.
[0106] Example 3
[0107] Embodiment 3 of the present invention provides a non-transitory computer-readable storage medium, in which the program code of a method for measuring the thickness of animal back fat and eye muscle based on machine learning is stored. The program code includes instructions for executing the method for measuring the thickness of animal back fat and eye muscle based on machine learning of embodiment 1 or any possible implementation thereof.
[0108] Computer-readable storage media can be any available medium that can be accessed by a computer, or a data storage device such as a server or data center that includes one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
[0109] Example 4
[0110] Embodiment 4 of the present invention provides an electronic device, including: a memory and a processor;
[0111] The processor and the memory communicate with each other via a bus; the memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the method for measuring animal back fat and eye muscle thickness based on machine learning in Example 1 or any possible implementation thereof.
[0112] Specifically, the processor can be implemented by hardware or by software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc.; when implemented by software, the processor can be a general-purpose processor, which is implemented by reading software code stored in a memory. The memory can be integrated into the processor or located outside the processor and exist independently.
[0113] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode.
[0114] Obviously, those skilled in the art will appreciate that the various modules or steps of the present invention described above can be implemented using a general-purpose computing device, centralized on a single computing device, or distributed across a network of multiple computing devices. Alternatively, they can be implemented using program code executable by a computing device, which can then be stored in a storage device and executed by the computing device. In some cases, the steps shown or described can be performed in a different order than that shown, or can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0115] Although the present invention has been described in detail above using general descriptions and specific embodiments, it will be apparent to those skilled in the art that modifications and improvements may be made thereto. Therefore, such modifications and improvements, without departing from the spirit of the present invention, are intended to be within the scope of protection claimed herein.
Claims
1. A method for measuring the thickness of animal backfat and eye muscle based on machine learning, characterized in that: include: Tracking and detecting the back curve of the animal object at the specified position by using the tracking and detection model to determine whether the animal object is in place at the specified position; If it is determined that the animal object is already in place at the designated position, identifying the collection points of the back curve of the animal object to obtain the collection points of the back curve of the animal object; Positioning the collection points of the back curve of the animal object to obtain the positioning coordinate values of the collection points of the back curve of the animal object; The positioning coordinate value of the collection point of the back curve of the animal object is sent to a mechanical arm equipped with a B-ultrasound probe, and the mechanical arm equipped with the B-ultrasound probe tracks the collection point according to the positioning coordinate value, and after dipping the coupling agent from the coupling agent container, the B-ultrasound probe is attached to the collection point of the back curve of the animal object; Controlling a B-ultrasound probe to collect B-ultrasound video images of the collection points of the back curve of the animal object, and generating a B-ultrasound video file of the collection points of the back curve of the animal object; A preset number of B-ultrasound image frames are extracted from the B-ultrasound video file, and the obtained preset number of B-ultrasound image frames are converted into grayscale to measure the back fat and eye muscle thickness of the animal object.
2. The method for measuring the thickness of animal backfat and eye muscle based on machine learning according to claim 1, characterized in that: The training process of the tracking detection model is: The back image data of the animal object is obtained, the back image data is annotated and loaded into the YoLov4-tiny model, the YoLov4-tiny model is trained, tested and evaluated through the back image data, and the trained tracking detection model is obtained after meeting the preset requirements.
3. The method for measuring the thickness of animal backfat and eye muscle based on machine learning according to claim 1, characterized in that: The formula for identifying the collection points of the back curve of the animal object is: Xc=X0-a,a≥0 Yc=Y0-b,b≥0 Zc=Z0,0.2≤Z0≤0.9 Where Xc is the horizontal coordinate of the acquisition point in the 3D camera image, X0 = Length / 2, and Yc is the vertical coordinate of the acquisition point in the 3D camera image, Y0=Width / 2, which is half of the width of the identified animal object; Zc is the height coordinate of the acquisition point in the 3D camera image, and Z0 is the distance from the identification camera to the back of the animal object; a and b are fixed values selected according to the body length and width of the animal object.
4. The method for measuring the thickness of animal backfat and eye muscle based on machine learning according to claim 3, characterized in that: The coordinates between the mechanical arm equipped with the B-ultrasound probe and the camera for identifying the acquisition point of the back curve of the animal object are zero-calibrated.
5. The method for measuring the thickness of animal backfat and eye muscle based on machine learning according to claim 1, characterized in that: The B-ultrasound probe performs a B-ultrasound video image acquisition process on the acquisition points of the back curve of the animal object, and controls the B-ultrasound probe to stay for a preset time.
6. The method for measuring the thickness of animal backfat and eye muscle based on machine learning according to claim 5, characterized in that: The acquired preset number of B-ultrasound image frames are converted into grayscale, and the clarity of the B-ultrasound image frames is calculated by Laplace transform; Determining whether the clarity of the B-ultrasound image frame reaches a preset clarity value, and if the clarity of the B-ultrasound image frame does not reach the preset clarity value, re-extracting the B-ultrasound image frame from the B-ultrasound video file; If the clarity of the B-ultrasound image frame reaches a preset clarity value, counting the B-ultrasound image frames that reach the preset clarity value; Determining whether the number of the B-ultrasound image frames meeting the preset definition value reaches the preset number, and if the number of the B-ultrasound image frames meeting the preset definition value reaches the preset number, saving the B-ultrasound image frames meeting the preset definition value; If the number of the B-ultrasound image frames that meet the preset definition value does not reach the preset number, the corresponding B-ultrasound video file and the B-ultrasound image frame will be discarded.
7. The method for measuring the thickness of animal backfat and eye muscle based on machine learning according to claim 6, characterized in that: In the detection process of the back fat layer in the B-ultrasound image frame, an edge detection algorithm is used to detect the back fat layer in the B-ultrasound image frame, and a virtual boundary of the detected back fat area is drawn on the B-ultrasound image frame; the distance from the third layer of the skin to four preset points is calculated, and the back fat measurement result is calculated by the average value of the four distances.
8. The method for measuring the thickness of animal backfat and eye muscle based on machine learning according to claim 7, characterized in that: The eye muscle thickness in the B-ultrasound image frame is detected using an edge detection algorithm. A line is drawn on the B-ultrasound image frame to represent the end of the eye muscle. The distance of the line drawn at four preset points of the skin layer is calculated, and the eye muscle thickness measurement result is calculated by the average value of the four distances.
9. The method for measuring the thickness of animal backfat and eye muscle based on machine learning according to claim 8, characterized in that: The formula for measuring backfat and eye muscle thickness μ is: Wherein, K represents a constant, Xn+1, Yn+1 are the detected coordinates of the skin layer, and Xi and Yi are the detected coordinates of the third layer of back fat layer / eye muscle.
10. A device for measuring the thickness of animal backfat and eye muscles based on machine learning, using the method for measuring the thickness of animal backfat and eye muscles based on machine learning according to any one of claims 1 to 9, characterized in that: include: A back curve tracking and detection module is used to track and detect the back curve of the animal object at the specified position through a tracking and detection model to determine whether the animal object is in place at the specified position; A back curve collection point identification module, used for identifying the collection points of the back curve of the animal object if it is determined that the animal object is already in place at the designated position, so as to obtain the collection points of the back curve of the animal object; A collection point coordinate conversion module, used for locating the collection point of the back curve of the animal object to obtain the positioning coordinate value of the collection point of the back curve of the animal object; The B-ultrasound probe motion control module is used to send the positioning coordinate value of the collection point of the back curve of the animal object to the mechanical arm equipped with the B-ultrasound probe, and the mechanical arm equipped with the B-ultrasound probe tracks the collection point according to the positioning coordinate value, and after dipping the coupling agent from the coupling agent container, the B-ultrasound probe is attached to the collection point of the back curve of the animal object; A B-ultrasound video acquisition module, used for controlling the B-ultrasound probe to acquire B-ultrasound video images of acquisition points of the back curve of the animal object, and generating a B-ultrasound video file of the acquisition points of the back curve of the animal object; A B-ultrasound image processing module is used to extract a preset number of B-ultrasound images from the B-ultrasound video file. Frames, converting a preset number of the acquired B-ultrasound image frames into grayscale to measure the back fat and eye muscle thickness of the animal object.
Citation Information
Patent Citations
Animal center tracking method based on deep learning
CN113470073A
Pig sign information acquisition method and system
CN113947734A
Pig backfat thickness measuring method and system
CN113989353A
Method for detecting intramuscular fat content of pig and related product thereof
CN114663359A
Sow body size, weight and backfat thickness detection method
CN115355948A