A method and system for livestock pose recognition based on sparse millimeter-wave radar point clouds

By employing unit conversion, coarse filtering, density clustering, and posture feature extraction from sparse millimeter-wave radar point clouds, the shortcomings of wearable sensors and machine vision solutions are addressed, enabling non-contact, all-weather livestock posture recognition and improving the accuracy and stability of posture recognition.

CN122135408BActive Publication Date: 2026-07-03QINGDAO UNIV OF SCI & TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
QINGDAO UNIV OF SCI & TECH
Filing Date
2026-05-06
Publication Date
2026-07-03

Smart Images

  • Figure CN122135408B_ABST
    Figure CN122135408B_ABST
Patent Text Reader

Abstract

This application discloses a method and system for livestock posture recognition based on sparse millimeter-wave radar point clouds, relating to the field of livestock posture recognition technology, and solving the problems of low accuracy and poor stability in posture recognition caused by current radar point clouds. The method includes: acquiring raw point cloud data collected by sparse millimeter-wave radar, performing unit conversion and coordinate transformation to obtain a structured point cloud; performing coarse filtering based on a preset region of interest spatial boundary to obtain a first point cloud; sorting by amplitude in descending order, retaining the top preset number of points with the highest amplitude to obtain a second point cloud; performing density clustering based on a preset neighborhood radius and minimum number of points to obtain one or more point cloud clusters; selecting target point cloud clusters based on the number of points and amplitude of point cloud clusters; extracting posture features from the target point cloud clusters; performing temporal statistics on the posture features of continuous time frames to obtain smoothed statistical features; and outputting the livestock posture category based on the smoothed statistical features and a preset posture discrimination threshold.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of livestock posture recognition technology, and in particular to a livestock posture recognition method and system based on sparse millimeter-wave radar point clouds. Background Technology

[0002] With the trend of livestock farming developing towards large-scale and intelligent operations, livestock posture recognition has become a core link in refined breeding management, and is of great significance for health early warning and gestation management.

[0003] In existing posture recognition solutions, wearable sensors are prone to causing stress in livestock, and the high costs of equipment maintenance and charging limit their large-scale deployment. Machine vision solutions are greatly affected by environmental factors such as lighting, dust, and occlusion, lack robustness, and cannot meet the needs of all-weather monitoring. Under these circumstances, millimeter-wave radar, with its inherent advantages of being non-contact, anti-interference, and protecting privacy, has become the preferred sensing solution for livestock monitoring.

[0004] However, the point clouds output by such radars have inherent defects such as sparseness, low resolution, and poor signal-to-noise ratio. Existing general radar point cloud processing frameworks are designed for high-density lidar. When directly applied to such sparse point clouds, target extraction is prone to over-segmentation or under-segmentation, making it impossible to stably obtain individual livestock point cloud clusters. In addition, it will also cause attitude feature extraction to be affected by outliers, with drastic fluctuations in height and area feature values. Furthermore, the lack of coordinate system calibration can easily lead to the invalidation of the physical meaning of area features. At the same time, it does not make full use of unique information such as radar amplitude and radial velocity, ultimately resulting in low attitude recognition accuracy and poor stability. Summary of the Invention

[0005] To address the technical problems existing in the background art, embodiments of this application provide a method and system for livestock attitude recognition based on sparse millimeter-wave radar point clouds. The method includes: acquiring raw point cloud data collected by sparse millimeter-wave radar; performing unit conversion and coordinate transformation on the raw point cloud data to obtain a structured point cloud; each point in the structured point cloud has distance, azimuth, and elevation information in a spherical coordinate system and three-dimensional spatial coordinates in a Cartesian coordinate system; performing coarse filtering on the structured point cloud according to a preset region of interest spatial boundary to obtain a first point cloud; and performing livestock attitude recognition based on each point in the first point cloud... The amplitude of each point is used to sort each point in the first point cloud in descending order, retaining the top preset number of points with the highest amplitude to obtain the second point cloud. A density clustering algorithm is then applied to the second point cloud based on a preset neighborhood radius and a minimum number of points to obtain one or more point cloud clusters. Multiple point cloud clusters are compared based on the number of points in each cluster and the sum of their amplitudes to select a target point cloud cluster. Attitude features are extracted from the target point cloud cluster. Temporal statistics are performed on the attitude features across consecutive time frames to obtain smoothed statistical features. Based on the smoothed statistical features and a preset attitude discrimination threshold, the attitude category of the livestock is output.

[0006] In one example, raw point cloud data acquired by a sparse millimeter-wave radar is obtained. Unit conversion and coordinate transformation are performed on the raw point cloud data to obtain a structured point cloud. Specifically, this includes: acquiring raw point cloud data output by the millimeter-wave radar; each point in each frame of the raw point cloud data includes at least raw values ​​for distance, radial velocity, azimuth, elevation, and amplitude; converting the raw values ​​of each point in the raw point cloud data into physical quantities according to a preset unit conversion relationship; performing coordinate transformation on the physical quantities using a spherical to Cartesian coordinate conversion formula, calculating the three-dimensional spatial coordinates of each point, and combining the three-dimensional spatial coordinates of each point into a structured point cloud.

[0007] In one example, the structured point cloud is coarsely filtered according to a preset region of interest spatial boundary to obtain a first point cloud. Specifically, this includes: presetting the region of interest spatial boundary based on the radar installation location's height above the ground and the spatial range of the livestock pen; for each point in each frame of the structured point cloud, determining whether the corresponding distance, azimuth, and elevation angles in the spherical coordinate system all fall within the region of interest spatial boundary; if so, retaining the point; if not, discarding the point; and using all retained points as the first point cloud.

[0008] In one example, based on a preset neighborhood radius and a minimum number of points, a density clustering algorithm is performed on the second point cloud to obtain one or more point cloud clusters. Specifically, this includes: using the DBSCAN density clustering algorithm, calculating the number of other points contained in the neighborhood of each point in the second point cloud; if the number of points contained in the neighborhood of a point is greater than or equal to the preset minimum number of points, the point is marked as a core point; using each core point as a seed, point cloud clusters are generated by expanding through density reachability relationships; core points that are connected to each other within a preset neighborhood radius and boundary points within the neighborhoods of interconnected core points are grouped into the same cluster; points that cannot be covered by the preset neighborhood radius of any core point are marked as noise points and discarded, so as to output one or more point cloud clusters.

[0009] In one example, multiple point cloud clusters are compared based on their number of points and the sum of their amplitudes to select a target point cloud cluster. Specifically, this involves: calculating the number of points in each cluster and comparing the number of points; if there is a single point cloud cluster with the highest number of points, this cluster is directly identified as the target cluster; if there are at least two point cloud clusters with the same number of points, both being the highest-numbered clusters, the sum of the amplitudes of each point cloud cluster within these two clusters is calculated; the sum of amplitudes is the sum of the amplitude values ​​of all points within the cluster; the sum of the amplitudes of these two clusters is compared, and the cluster with the largest sum is selected as the target cluster; if multiple clusters with the largest sum of amplitudes still exist, these clusters are merged to form the target cluster.

[0010] In one example, extracting attitude features from the target point cloud cluster specifically includes: obtaining the three-dimensional spatial coordinates of all points in the target point cloud cluster; extracting the height coordinates of all points in the target point cloud cluster, sorting the height coordinates, and calculating a preset first proportional quantile and a preset second proportional quantile of the height coordinates; the second proportional quantile being greater than the first proportional quantile; using the difference between the second proportional quantile and the first proportional quantile as the vertical thickness feature; calculating the centroid coordinates of the target point cloud cluster, drawing a circle with the centroid as the center and a preset radius on a horizontal plane, and collecting all point clouds falling within the circle; calculating the projected area of ​​all point clouds on the horizontal plane using a convex hull algorithm as the footprint feature; using the ratio of the footprint feature to the vertical thickness feature as the composite morphological feature; and combining the vertical thickness feature, footprint feature, and composite morphological feature into the attitude feature of the target point cloud cluster.

[0011] In one example, temporal statistics are performed on the pose features of consecutive time frames to obtain smoothed statistical features. Specifically, this includes: dividing the consecutive time frames into several time slices according to a preset time window length; obtaining the vertical thickness feature, floor area feature, and composite morphology feature extracted from each frame within the time slice; taking the median of the vertical thickness feature, floor area feature, and composite morphology feature of all frames within the time slice to obtain smoothed vertical thickness feature, smoothed floor area feature, and smoothed composite morphology feature; and outputting the smoothed vertical thickness feature, smoothed floor area feature, and smoothed composite morphology feature as smoothed statistical features.

[0012] In one example, based on the smoothed statistical features and a preset posture discrimination threshold, the posture category of the livestock is output. Specifically, this includes: comparing the smoothed vertical thickness feature with a preset first posture discrimination threshold and a preset second posture discrimination threshold; the first posture discrimination threshold is greater than the second posture discrimination threshold; if the smoothed vertical thickness feature is greater than the first posture discrimination threshold, a standing posture is output; if the smoothed vertical thickness feature is less than the second posture discrimination threshold, a lying posture is output; if the smoothed vertical thickness feature is less than the first posture discrimination threshold and greater than the second posture discrimination threshold, the smoothed composite morphological feature is compared with a preset third posture discrimination threshold; if the smoothed composite morphological feature is greater than the third posture discrimination threshold, a lying posture is output; otherwise, a standing posture is output.

[0013] In one example, the method further includes: after the step of performing temporal statistics on the posture features of consecutive time frames to obtain smooth statistical features, and before the step of outputting the posture category of livestock based on the smooth statistical features and a preset posture discrimination threshold, performing a transition state gating step; the transition state gating step specifically includes: obtaining the radial velocity of each point in the target point cloud cluster; calculating the average value of the absolute values ​​of the radial velocities of all points in the target point cloud cluster; comparing the average value with a preset velocity threshold; if the average value is greater than the velocity threshold, determining that the current time slice is in a standing-lying transition state, temporarily not outputting the posture category, and marking it as a transition state; if the average value is less than the velocity threshold, continuing to perform the step of outputting the posture category of livestock based on the smooth statistical features and the preset posture discrimination threshold.

[0014] On the other hand, this application provides a livestock posture recognition system based on sparse millimeter-wave radar point clouds, characterized by comprising: a radar data interface for acquiring raw point cloud data collected by millimeter-wave radar; a data preprocessing module connected to the radar data interface for performing unit conversion and coordinate transformation on the raw point cloud data, converting each point from spherical coordinates to a three-dimensional spatial point in Cartesian coordinates, obtaining a structured point cloud in each frame containing the three-dimensional spatial coordinates, radial velocity, and amplitude of each point; and a target extraction module connected to the data preprocessing module for coarsely filtering the structured point cloud according to a preset region of interest spatial boundary to obtain a first point cloud, sorting the points in the first point cloud in descending order according to amplitude and retaining the first preset number of points with the highest amplitude to obtain a second point cloud, and performing DBSC on the second point cloud according to a preset neighborhood radius and minimum number of points. The AN density clustering algorithm obtains one or more point cloud clusters, and selects target point cloud clusters representing individual livestock from the one or more point cloud clusters based on a joint criterion of the number of points in the point cloud clusters and the sum of the amplitudes of the point cloud clusters. A feature extraction module, connected to the target extraction module, is used to extract posture features from the target point cloud clusters. A time series analysis module, connected to the feature extraction module, is used to divide continuous time frames into time slices, take the median of the posture features in each time slice to obtain smooth statistical features, and calculate the average value of the absolute radial velocity of all points in the target point cloud clusters in the time slice. The average value is compared with a preset velocity threshold to determine whether the current time slice is a transitional state. A posture output module, connected to the time series analysis module, is used to output the posture category of livestock in a non-transitional state based on the smooth statistical features and a preset posture discrimination threshold.

[0015] On the other hand, embodiments of this application provide a non-volatile computer storage medium for livestock posture recognition based on sparse millimeter-wave radar point clouds, which stores computer-executable instructions that can execute any of the above-mentioned livestock posture recognition methods based on sparse millimeter-wave radar point clouds.

[0016] The above-described technical solutions adopted in the embodiments of this application can achieve the following beneficial effects:

[0017] First, this invention uses millimeter-wave radar as the core sensor, achieving completely non-contact long-range detection and fundamentally eliminating animal stress responses caused by wearing devices, as is common in wearable device solutions. Second, the active detection characteristic of radar makes it completely unaffected by changes in lighting, darkness at night, dust, rain, fog, and other harsh farming environments, overcoming the fundamental shortcomings of machine vision solutions, such as poor environmental adaptability and insufficient robustness. Addressing the inherent problems of sparse and low-resolution point clouds in millimeter-wave radar, this invention employs a cascaded strategy of amplitude filtering, density clustering, and a joint "point count-amplitude" criterion to achieve stable extraction of target point clouds, solving the over-segmentation and under-segmentation problems easily encountered by general clustering algorithms. Simultaneously, by using vertical thickness features based on height quantiles and area features based on the central neighborhood, it effectively resists outlier interference and feature distortion caused by uncalibrated coordinate systems, ensuring stable and reliable attitude features. Furthermore, this invention introduces a transition state gating mechanism based on radial velocity to accurately filter state transitions during the animal's standing and lying-down transition periods, ensuring the continuity and accuracy of the output results. The entire method provides a practical, reliable, and economical non-contact attitude monitoring solution for the field of smart aquaculture. Attached Figure Description

[0018] To more clearly illustrate the technical solution of this application, some embodiments of this application will be described in detail below with reference to the accompanying drawings, in which:

[0019] Figure 1 A flowchart illustrating a livestock posture recognition method based on sparse millimeter-wave radar point clouds provided in this application embodiment;

[0020] Figure 2 This is a schematic diagram illustrating the implementation of a livestock posture recognition system based on sparse millimeter-wave radar point clouds, as provided in an embodiment of this application. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0022] Some embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0023] Figure 1This is a flowchart illustrating a livestock pose recognition method based on sparse millimeter-wave radar point clouds, provided as an embodiment of this application. This method can be applied to various business domains. Certain input parameters or intermediate results in this process can be manually adjusted to help improve accuracy.

[0024] The analysis method involved in the embodiments of this application can be implemented by a terminal device or a server, and this application does not impose any special limitations on it. For ease of understanding and description, the following embodiments are all described in detail using a server as an example.

[0025] Based on this Figure 1 The process may include the following steps:

[0026] S101: Acquire the raw point cloud data collected by sparse millimeter-wave radar, and perform unit conversion and coordinate transformation on the raw point cloud data to obtain a structured point cloud.

[0027] In some embodiments of this application, raw point cloud data collected by a 24GHz millimeter-wave radar is first acquired via a radar data interface. This radar is fixedly installed approximately 160cm above the ground, diagonally above the pigpen, to detect the pigpen area from a top-down perspective. The raw point cloud data is stored in timestamp-based blocks in the form of a text log, with each frame containing several point cloud records, and each point including at least the original distance value. Radial velocity original value azimuth original value Original values ​​of pitch angle and the original value of amplitude Five fields.

[0028] After obtaining the raw data, the original values ​​of each field are converted into physical quantities according to the preset unit conversion relationship: distance The unit is meters; radial velocity The unit is meters per second; azimuth. The unit is degrees; pitch angle Unit: degrees; Amplitude , dimensionless.

[0029] After completing the unit conversion, the physical quantity is transformed using the conversion formula from spherical coordinates to Cartesian coordinates to calculate the three-dimensional spatial coordinates of each point. The specific conversion formula is as follows: , , .

[0030] The converted point cloud is stored in frames, with each frame containing a number of points, and each point containing... Five attributes are used to obtain a structured point cloud for each frame, containing the three-dimensional spatial coordinates, radial velocity, and amplitude of each point. This provides a standardized data foundation for subsequent processing.

[0031] S102: Based on the preset spatial boundary of the region of interest, the structured point cloud is coarsely filtered to obtain the first point cloud.

[0032] In some embodiments of this application, this step presets the spatial boundaries of the region of interest based on the radar installation location's height above the ground and the actual spatial range of the livestock pen, specifically including the distance range. Azimuth range and pitch angle range .

[0033] For each point in each frame of the structured point cloud, determine whether its 3D spatial coordinates (distance, azimuth, and pitch) all fall within the spatial boundary of the region of interest. If a point's distance, azimuth, and pitch all satisfy the spatial boundary conditions, then the point is retained; otherwise, it is discarded. This step can quickly remove point clouds that are clearly not part of the animal's body surface, such as walls, ground, and fences, and use all retained points as the first point cloud, thereby reducing the amount of data for subsequent processing and improving algorithm efficiency.

[0034] S103: Based on the amplitude of each point in the first point cloud, sort each point in the first point cloud in descending order to retain the first preset number of points with the highest amplitude, thus obtaining the second point cloud.

[0035] In some embodiments of this application, considering that the 24GHz millimeter-wave radar point cloud is sparse and contains a large amount of weak clutter, while the reflection from the surface of livestock usually produces strong echoes, the amplitude value (amp) of each point in the first point cloud is acquired, and all points in the first point cloud are sorted in descending order of amplitude value. Based on the radar frame rate and the maximum number of points per frame, a preset quantity K=320 is set, and the top K points (the 320 points with the highest amplitude) are selected from the sorted point cloud as retained points. This strategy can effectively suppress low-amplitude environmental clutter while ensuring that the main reflection points of the livestock are completely preserved. The point cloud formed by these retained points is used as the second point cloud, laying the foundation for stable target extraction.

[0036] S104: Based on the preset neighborhood radius and minimum number of points, perform a density clustering algorithm on the second point cloud to obtain one or more point cloud clusters.

[0037] In some embodiments of this application, the DBSCAN density clustering algorithm is used to process the second point cloud. The neighborhood radius is set based on the livestock size and point cloud distribution density. and minimum points .

[0038] The algorithm calculates the value of each point in the second point cloud. The number of other points contained in the neighborhood, if a certain point The number of points contained in the neighborhood is greater than or equal to the preset minimum number of points. If so, then mark that point as the core point.

[0039] Subsequently, using each core point as a seed, point cloud clusters are generated through density reachability relationships. Core points that are connected to each other within a preset neighborhood radius ε, as well as boundary points within the neighborhoods of interconnected core points, are grouped into the same cluster. Points that cannot be covered by the preset neighborhood radius of any core point are marked as noise points and discarded. Finally, one or more point cloud clusters are output, achieving spatial segmentation of the point cloud.

[0040] S105: Based on the number of points in the point cloud cluster and the sum of the amplitudes of the point cloud clusters, compare multiple point cloud clusters to select the target point cloud cluster.

[0041] In some embodiments of this application, this step employs a combined criterion of "point count priority, amplitude and auxiliary" to accurately identify the target point cloud cluster representing individual livestock from multiple point cloud clusters.

[0042] Specifically, firstly, the number of points in each point cloud cluster is calculated, and the number of points in each cluster is compared. If there is a unique point cloud cluster with the most points, it is directly identified as the target point cloud cluster. If there are at least two point cloud clusters with the same number of points, both of which have the most points, the amplitude sum of each point cloud cluster in the at least two point cloud clusters with the most points is calculated. This amplitude sum is the sum of the amplitude values ​​of all points in the point cloud cluster. Then, the amplitude sum of the at least two point cloud clusters with the most points is compared, and the point cloud cluster with the largest amplitude sum is selected as the target point cloud cluster. If there are still multiple point cloud clusters with the largest amplitude sum, these multiple point cloud clusters with the largest amplitude sum are merged and used as the target point cloud cluster.

[0043] This principle can effectively address point cloud fragmentation caused by occlusion or uneven reflection, ensuring a stable "grasp" of the target and obtaining a pure livestock point cloud cluster.

[0044] S106: Extract attitude features from the target point cloud cluster.

[0045] In some embodiments of this application, geometric features that can stably reflect the posture of livestock are extracted from the target point cloud cluster. The posture features include at least vertical thickness features, area features, and composite morphological features.

[0046] First, obtain the three-dimensional spatial coordinates of all points in the target point cloud cluster, extract the height coordinates z of all points, sort the height coordinates, and calculate their 10th percentiles. and 90th percentile The difference between the 90th percentile and the 10th percentile is taken as the vertical thickness feature, i.e. This quantile method can effectively eliminate extreme value interference caused by ground reflection points or back outliers, making the thickness feature stably reflect the true vertical occupancy of the body.

[0047] Subsequently, the centroid coordinates of the target point cloud cluster are calculated. A circle with the centroid as the center and a preset radius R = 1.0m is drawn on the horizontal XY plane. All point clouds falling within the circle are collected. The projected area of ​​the point cloud on the horizontal plane is calculated using the convex hull algorithm, which serves as the area feature. This central neighborhood area estimation strategy avoids drastic fluctuations in area caused by uneven distribution of strong echo points, ensuring that the area characteristics stably reflect the horizontal space occupied by livestock.

[0048] Finally, the ratio of the floor area feature to the vertical thickness feature is used as the composite morphological feature. This ratio amplifies the morphological differences between standing and lying down, providing stronger discrimination capabilities. The vertical thickness feature, floor area feature, and composite morphological feature are combined to form the attitude feature of the target point cloud cluster.

[0049] S107: Perform temporal statistics on the attitude features of consecutive time frames to obtain smooth statistical features.

[0050] In some embodiments of this application, considering that single-frame point clouds may have jitter or random noise, the attitude features of consecutive time frames are temporally smoothed.

[0051] The continuous time frame is divided into several time slices according to a preset time window length, with the length of each time slice set according to actual application requirements (e.g., 10 seconds). The vertical thickness feature, floor area feature, and composite morphology feature extracted from each frame within the time slice are obtained. The median of the vertical thickness feature, floor area feature, and composite morphology feature of all frames within the time slice is then taken to obtain the smoothed vertical thickness feature. Smoothed floor area characteristics and smoothed composite morphological features .

[0052] Using the median for statistical smoothing can effectively resist outlier interference and filter out the influence of abnormal frames. The smoothed vertical thickness feature, smoothed floor area feature, and smoothed composite morphological feature are output as smoothed statistical features.

[0053] S108: Output the animal's posture category based on the smoothed statistical features and the preset posture discrimination threshold.

[0054] In some embodiments of this application, attitude determination is performed based on smoothed statistical features. The smoothed vertical thickness feature is compared with a preset first attitude determination threshold T1 and a preset second attitude determination threshold T2, wherein the first attitude determination threshold T1 is greater than the second attitude determination threshold T2. In this embodiment, T1 = 0.52m and T2 = 0.48m.

[0055] If the smoothed vertical thickness feature If the vertical thickness feature is greater than the first pose discrimination threshold T1, then output the standing pose; if the smoothed vertical thickness feature is greater than the first pose discrimination threshold T1, then output the standing pose. If the value is less than the second pose discrimination threshold T2, then the lying posture is output; if the smoothed vertical thickness feature is less than T2, then the lying posture is output. The value lies between the second attitude discrimination threshold T2 and the first attitude discrimination threshold T1, i.e. Then the smoothed composite morphological features Compared with the preset third pose discrimination threshold In comparison, in this embodiment .

[0056] If the smoothed composite morphological features Greater than the third pose discrimination threshold If the animal is in a lying position, the output will be a reclining posture; otherwise, the output will be a standing posture. This threshold rule allows for accurate differentiation between the animal's standing and reclining postures.

[0057] It should also be noted that, after step S107 and before step S108, the method further includes a transition state gating step. Specifically, the radial velocity of each point in the target point cloud cluster is obtained. Calculate the average of the absolute values ​​of the radial velocities of all points in the target point cloud cluster. The average value With the preset speed threshold Compare them. If the average value is... greater than the speed threshold If the current time slice is in a transitional state between standing and lying down, the posture category will not be output for the time being, and it will be marked as a transitional state.

[0058] If the average Less than or equal to the speed threshold If the animal does not respond to the given condition, the attitude determination in step S108 will continue. This gating mechanism effectively filters out frequent misjudgments and state jumps during the animal's standing and lying down movements, ensuring the continuity and reliability of the final output.

[0059] It should be noted that, although the embodiments in this application are based on... Figure 1Steps S101 to S108 will be described sequentially, but this does not mean that steps S101 and S108 must be performed in a strict order. The reason this embodiment follows this order is... Figure 1 The order in which steps S101 to S108 are described is provided to facilitate understanding of the technical solutions of the embodiments of this application by those skilled in the art. In other words, in the embodiments of this application, the order of steps S101 to S108 can be appropriately adjusted according to actual needs.

[0060] pass Figure 1 The livestock posture recognition method and system based on sparse millimeter-wave radar point clouds proposed in this invention have achieved several significant advantages over existing technologies. First, by using millimeter-wave radar as the core sensor, this invention achieves completely non-contact long-range detection, fundamentally eliminating animal stress responses caused by wearable devices. Second, the active detection characteristic of radar makes it completely unaffected by changes in lighting, darkness at night, dust, rain, fog, and other harsh farming environments, overcoming the fundamental defects of poor environmental adaptability and insufficient robustness in machine vision solutions. Addressing the inherent problems of sparse and low-resolution millimeter-wave radar point clouds, this invention achieves stable extraction of target point clouds through a cascaded strategy of amplitude filtering, density clustering, and a joint "point count-amplitude" criterion, solving the over-segmentation and under-segmentation problems easily generated by general clustering algorithms. Simultaneously, by employing vertical thickness features based on height quantiles and area features based on the central neighborhood, it effectively resists outlier interference and feature distortion caused by uncalibrated coordinate systems, making posture features stable and reliable. Furthermore, this invention introduces a transition state gating mechanism based on radial velocity, which accurately filters out state jumps during the transition period of livestock getting up and lying down, ensuring the continuity and accuracy of the output results.

[0061] Figure 2 A schematic diagram illustrating the implementation of a livestock posture recognition system based on sparse millimeter-wave radar point clouds, provided in this application embodiment, includes:

[0062] A radar data interface is used to acquire raw point cloud data collected by millimeter-wave radar. A data preprocessing module, connected to the radar data interface, performs unit conversion and coordinate transformation on the raw point cloud data, converting each point from spherical coordinates to a three-dimensional point in Cartesian coordinates, resulting in a structured point cloud in each frame containing the three-dimensional spatial coordinates, radial velocity, and amplitude of each point. A target extraction module, connected to the data preprocessing module, performs coarse filtering on the structured point cloud according to a preset region of interest spatial boundary to obtain a first point cloud. It then sorts the points in the first point cloud in descending order according to amplitude and retains the top preset number of points with the highest amplitude to obtain a second point cloud. Finally, it performs DBSCAN density clustering on the second point cloud according to a preset neighborhood radius and minimum number of points to obtain one or more point cloud clusters. The system uses a joint criterion of the number of points in a point cloud cluster and the sum of the amplitudes of the point cloud clusters to select target point cloud clusters representing individual livestock from one or more point cloud clusters; a feature extraction module, connected to the target extraction module, is used to extract posture features from the target point cloud clusters; a time series analysis module, connected to the feature extraction module, is used to divide continuous time frames into time slices, take the median of the posture features in each time slice to obtain smoothed statistical features, and calculate the average value of the absolute radial velocity of all points in the target point cloud cluster in the time slice, and compare the average value with a preset velocity threshold to determine whether the current time slice is a transitional state; a posture output module, connected to the time series analysis module, is used to output the posture category of livestock in a non-transitional state based on the smoothed statistical features and a preset posture discrimination threshold.

[0063] Some embodiments of this application provide a non-volatile computer storage medium for livestock posture recognition based on sparse millimeter-wave radar point clouds, which stores computer-executable instructions capable of executing any of the above-mentioned livestock posture recognition methods based on sparse millimeter-wave radar point clouds.

[0064] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and medium embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the description of the method embodiments.

[0065] The devices and media provided in this application are one-to-one with the methods. Therefore, the devices and media also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.

[0066] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0067] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0068] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0069] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0070] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0071] Memory may include non-persistent storage in computer-readable media, random access memory (RAM), and non-volatile memory such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0072] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0073] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0074] The above are merely embodiments of this application and are not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the technical principles of this application should fall within the protection scope of this application.

Claims

1. A method for livestock posture recognition based on sparse millimeter-wave radar point clouds, characterized in that, The method includes: The raw point cloud data collected by sparse millimeter-wave radar is acquired, and the raw point cloud data is subjected to unit conversion and coordinate transformation to obtain a structured point cloud; specifically, each point is converted from spherical coordinates to a three-dimensional spatial point in Cartesian coordinate system to obtain a structured point cloud in each frame containing the three-dimensional spatial coordinates, radial velocity and amplitude of each point. Based on the preset spatial boundary of the region of interest, the structured point cloud is coarsely filtered to obtain the first point cloud; Based on the amplitude of each point in the first point cloud, sort each point in the first point cloud in descending order, and retain the first preset number of points with the highest amplitude to obtain the second point cloud; Based on the preset neighborhood radius and minimum number of points, a density clustering algorithm is performed on the second point cloud to obtain one or more point cloud clusters; Based on the number of points in a point cloud cluster and the sum of the amplitudes of the point cloud clusters, multiple point cloud clusters are compared to select the target point cloud cluster. The step of comparing multiple point cloud clusters based on the number of points in the cluster and the sum of the amplitudes of the clusters to select the target point cloud cluster specifically includes: Calculate the number of points in each point cloud cluster and compare the number of points in each cluster; If there exists a point cloud cluster with the most points, the point cloud cluster with the most points will be directly identified as the target point cloud cluster. If there are at least two point cloud clusters with the same number of points, and both of them have the maximum number of points, calculate the sum of the amplitudes of each point cloud cluster in the at least two point cloud clusters with the maximum number of points; the sum of the amplitudes is the sum of the amplitude values ​​of all points in the point cloud cluster; Compare the amplitude and size of the at least two point cloud clusters with the most points, and select the point cloud cluster with the largest amplitude and size as the target point cloud cluster; If multiple point cloud clusters with the largest amplitude still exist, the multiple point cloud clusters with the largest amplitude are merged into the target point cloud cluster. Attitude features are extracted from the target point cloud cluster; the attitude features include at least vertical thickness features, area features, and composite morphology features; the vertical thickness features are obtained by calculating the difference in quantiles of the height values ​​of all points in the target point cloud cluster. Specifically, the difference in quantiles of the height value distribution is: obtaining the three-dimensional spatial coordinates of all points in the target point cloud cluster; Extract the height coordinates of all points in the target point cloud cluster, sort the height coordinates, and calculate a preset first proportional quantile and a preset second proportional quantile of the height coordinates; the second proportional quantile should be greater than the first proportional quantile. The difference between the second proportional quantile and the first proportional quantile is used as the vertical thickness feature; The footprint feature is obtained by selecting a neighborhood of a preset radius on the horizontal plane with the centroid of the target point cloud cluster as the reference, collecting the point cloud falling into the neighborhood of the preset radius, and calculating the projected area of ​​the point cloud on the horizontal plane; the composite morphology feature is obtained by the ratio of the footprint feature to the vertical thickness feature. Temporal statistics are performed on the pose features of consecutive time frames to obtain smooth statistical features; Based on the smoothed statistical features and the preset posture discrimination threshold, the posture category of the livestock is output; After the step of performing temporal statistics on the posture features of consecutive time frames to obtain smooth statistical features, and before the step of outputting the posture category of livestock based on the smooth statistical features and a preset posture discrimination threshold, a transition state gating step is performed. The transition state gating step specifically includes: Obtain the radial velocity of each point in the target point cloud cluster; Calculate the average of the absolute values ​​of the radial velocities of all points in the target point cloud cluster; The average value is compared with a preset speed threshold. If the average value is greater than the velocity threshold, the current time slice is determined to be in a transitional state between standing and lying down. The attitude category is not output for the time being, and it is marked as a transitional state. If the average value is less than the speed threshold, continue with the step of outputting the livestock's posture category based on the smoothed statistical features and the preset posture discrimination threshold.

2. The method according to claim 1, characterized in that, The process of acquiring raw point cloud data from sparse millimeter-wave radar and performing unit conversion and coordinate transformation on the raw point cloud data to obtain a structured point cloud specifically includes: Acquire raw point cloud data output by millimeter-wave radar; each point in each frame of the raw point cloud data includes at least the raw range value, the raw radial velocity value, the raw azimuth angle value, the raw elevation angle value, and the raw amplitude value; Based on the preset unit conversion relationship, the original value of each point in the original point cloud data is converted into a physical quantity; The physical quantity is transformed using the conversion formula from spherical coordinates to Cartesian coordinates. The three-dimensional spatial coordinates of each point are calculated, and the three-dimensional spatial coordinates of each point are combined into a structured point cloud.

3. The method according to claim 1, characterized in that, The step of coarsely filtering the structured point cloud according to the preset spatial boundary of the region of interest to obtain the first point cloud specifically includes: Based on the radar installation location's height above the ground and the spatial range of the livestock pen, the spatial boundaries of the region of interest are preset; For each point in each frame of the structured point cloud, determine whether the corresponding distance, azimuth, and pitch angle in the spherical coordinate system all fall within the spatial boundary of the region of interest; If so, retain that point; If not, remove that point; All retained points are used as the first point cloud.

4. The method according to claim 1, characterized in that, The step of performing a density clustering algorithm on the second point cloud based on a preset neighborhood radius and minimum number of points to obtain one or more point cloud clusters specifically includes: Using the DBSCAN density clustering algorithm, the number of other points contained in the neighborhood of each point in the second point cloud is calculated. If the number of points in the neighborhood of a point is greater than or equal to the preset minimum number of points, the point is marked as a core point. Using each core point as a seed, point cloud clusters are generated by expanding through density reachability relationships; Core points that are connected to each other within a preset neighborhood radius, as well as boundary points within the neighborhood of interconnected core points, will be grouped into the same cluster. Points that cannot be covered by a preset neighborhood radius of any core point are marked as noise points and discarded to output one or more point cloud clusters.

5. The method according to claim 1, characterized in that, The extraction of pose features from the target point cloud cluster specifically includes: Calculate the centroid coordinates of the target point cloud cluster, draw a circle on a horizontal plane with the centroid as the center and a preset radius, and collect all point clouds that fall within the circle; The projected area of ​​all point clouds on the horizontal plane is calculated using the convex hull algorithm and used as the feature of the land area. The ratio of the floor area feature to the vertical thickness feature is used as the composite morphological feature; The vertical thickness feature, area feature, and composite morphology feature are combined to form the attitude feature of the target point cloud cluster.

6. The method according to claim 1, characterized in that, The step of performing temporal statistics on the pose features of consecutive time frames to obtain smooth statistical features specifically includes: The continuous time frame is divided into several time slices according to the preset time window length; Obtain the vertical thickness features, floor area features, and composite morphology features extracted from each frame within the time slice; The median of the vertical thickness feature, floor area feature, and composite morphology feature of all frames within the time slice is taken to obtain the smoothed vertical thickness feature, smoothed floor area feature, and smoothed composite morphology feature. The smoothed vertical thickness feature, smoothed floor area feature, and smoothed composite morphology feature are output as smoothed statistical features.

7. The method according to claim 6, characterized in that, The step of outputting the livestock's posture category based on the smoothed statistical features and a preset posture discrimination threshold specifically includes: The smoothed vertical thickness feature is compared with a preset first attitude discrimination threshold and a preset second attitude discrimination threshold, respectively; the first attitude discrimination threshold is greater than the second attitude discrimination threshold; If the smoothed vertical thickness feature is greater than the first pose discrimination threshold, output the standing pose. If the smoothed vertical thickness feature is less than the second pose discrimination threshold, output the lying posture; If the smoothed vertical thickness feature is less than the first attitude discrimination threshold and greater than the second attitude discrimination threshold, the smoothed composite morphological feature is compared with the preset third attitude discrimination threshold. If the smoothed composite morphological features are greater than the third pose discrimination threshold, output the lying posture; otherwise, output the standing posture.

8. A livestock posture recognition system based on sparse millimeter-wave radar point clouds, which uses a livestock posture recognition method based on sparse millimeter-wave radar point clouds as described in any one of claims 1-7, characterized in that, include: Radar data interface, used to acquire raw point cloud data collected by millimeter-wave radar; The data preprocessing module is connected to the radar data interface and is used to perform unit conversion and coordinate transformation on the raw point cloud data, converting each point from spherical coordinates to a three-dimensional spatial point in the Cartesian coordinate system, so as to obtain a structured point cloud in each frame containing the three-dimensional spatial coordinates, radial velocity and amplitude of each point. The target extraction module, connected to the data preprocessing module, is used to coarsely filter the structured point cloud according to the preset spatial boundary of the region of interest to obtain a first point cloud, sort the points in the first point cloud in descending order according to the amplitude and retain the first preset number of points with the highest amplitude to obtain a second point cloud, perform DBSCAN density clustering algorithm on the second point cloud according to the preset neighborhood radius and minimum number of points to obtain one or more point cloud clusters, and filter the target point cloud clusters representing individual livestock from the one or more point cloud clusters according to the joint criterion of the number of points in the point cloud cluster and the sum of the amplitudes of the point cloud clusters. A feature extraction module, connected to the target extraction module, is used to extract pose features from the target point cloud cluster; The time series analysis module, connected to the feature extraction module, is used to divide continuous time frames into time slices, take the median of the attitude features in each time slice to obtain smooth statistical features, and calculate the average value of the absolute radial velocity of all points in the target point cloud cluster in the time slice. The average value is compared with a preset velocity threshold to determine whether the current time slice is a transition state. The posture output module, connected to the time series analysis module, is used to output the posture category of livestock in a non-transitional state based on the smooth statistical features and a preset posture discrimination threshold.