A sheep flock density dynamic monitoring method based on multi-camera fusion

By combining social force models and space-time deep learning, the density monitoring errors caused by the rapid movement of sheep flocks and local high-density areas were resolved, achieving dynamic continuity and accuracy in sheep flock density monitoring, and providing real-time density distribution maps and alarm information.

CN121074779BActive Publication Date: 2026-03-24BEIJING CENTURY ELINK ELECTRONICS TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-19
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing multi-camera fusion sheep density monitoring systems cannot stably reflect actual density changes when sheep are moving rapidly or in areas with high density, leading to density estimation errors and image continuity disruptions. This is especially true when sheep are running, gathering, or dispersing, where camera occlusion causes severe interference.

Method used

By collecting dynamic images of sheep flocks through multiple cameras, simulating the interaction forces and target migration trends among individual sheep using a social force model, and combining a space-time joint deep learning model, dynamic density field data is generated. The density window size is adjusted through local high-density behavior analysis, and a real-time dynamic density monitoring report is output.

Benefits of technology

It achieves continuous stability in density estimation and accurate correction of local high-density areas in dynamic scenarios, reduces density monitoring deviations caused by rapid sheep movement and local behavior, and provides real-time, accurate density distribution maps and abnormal alarm information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121074779B_ABST
    Figure CN121074779B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of intelligent livestock monitoring, and discloses a flock density dynamic monitoring method based on multi-camera fusion, comprising the following steps: S1, acquiring a flock dynamic image sequence through a plurality of cameras, modeling the interaction force, expected speed and target migration trend between flock individuals based on a social force model, generating group behavior dynamics characteristic data, and dynamically detecting the in-out flow of sheep in the boundary area of the camera field of view, and outputting density distribution data after boundary compensation; S2, the group behavior dynamics characteristic data generated in S1 is input into a space-time joint deep learning compensation model to obtain the density distribution data of the flock in the camera field of view. Through the group behavior dynamics modeling and space-time joint deep learning compensation technical scheme, the present application achieves the technical effect of continuous and stable density estimation in a dynamic scene, and solves the problem of boundary in-out occlusion and significant density jump caused by the rapid movement of the flock, compared with the scheme of relying on fixed camera image splicing and target detection in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent livestock monitoring technology, specifically a method for dynamic monitoring of sheep flock density based on multi-camera fusion. Background Technology

[0002] In modern ranch management, real-time monitoring of sheep density is a crucial technology for assessing the health of the flock and preventing diseases caused by overcrowding. Current mainstream solutions rely on multi-camera arrays to acquire image data and then estimate density distribution using object detection and region segmentation algorithms.

[0003] For example, Chinese invention application CN112541487B discloses an automatic monitoring method for sheep flocks in pastoral areas based on sub-meter resolution high-resolution satellite remote sensing images. This method relates to fields such as Earth monitoring and ecological environmental protection. It utilizes the spatiotemporal and spectral characteristics of sheep flocks in high-resolution remote sensing images and adopts the following technical process: data selection, geometric correction, image enhancement processing, image segmentation, initial extraction of sheep flock spot distribution, data merging, fine extraction of sheep flock spot distribution, extraction of sheep flock patch distribution, and sheep number calculation. This enables the monitoring of the distribution and number of sheep flocks in the region, effectively grasping the regional sheep inventory and the carrying capacity of the regional ecological environment, and providing decision support for regional ecological environmental protection and optimal resource allocation.

[0004] The shortcomings of the above-mentioned patents:

[0005] In existing sheep density monitoring systems based on multi-camera fusion, fixed cameras are typically used to capture images of the pasture area, and sheep density is estimated through image stitching and target detection algorithms. However, when sheep are in rapid motion, especially in dynamic scenarios such as running, sudden gathering, or dispersal, the cameras are easily obstructed, and sheep frequently enter and exit the edge of the camera's field of view, disrupting image continuity and causing drastic jumps in density estimation, making it impossible to stably reflect the actual density changes.

[0006] Furthermore, in actual pasture management, localized high-density areas often appear within sheep flocks. For example, some sheep may exhibit behaviors such as spinning in place, gathering briefly, or piling up. These non-linear movement patterns can introduce systematic errors into existing density estimation algorithms. Increasing camera coverage or acquisition frequency still fails to effectively identify and adaptively correct for these local anomalies, leading to deviations in density monitoring results.

[0007] To address these issues, this invention proposes a method for dynamic monitoring of sheep flock density based on multi-camera fusion. Summary of the Invention

[0008] To address the shortcomings of existing technologies, this invention provides a method for dynamic monitoring of sheep flock density based on multi-camera fusion, in order to solve the problems mentioned in the background section.

[0009] To achieve the above objectives, the present invention provides the following technical solution: a method for dynamic monitoring of sheep flock density based on multi-camera fusion, comprising:

[0010] S1 collects dynamic image sequences of sheep flocks through multiple cameras, models the interaction forces, expected speed and target migration trend among individual sheep based on the social force model, generates group behavior dynamics characteristic data, and dynamically detects the flow of sheep entering and leaving the boundary area of ​​the camera's field of view, outputting density distribution data after boundary compensation.

[0011] S2 inputs the group behavior dynamics feature data generated in S1, the density distribution data after boundary compensation, and the continuous image frame sequence acquired by multiple cameras into the space-time joint deep learning model. Through spatiotemporal feature fusion, dynamic density field data is generated, and the global density correction result is output.

[0012] S3, based on the dynamic density field data generated by S2, identifies sheep behavior patterns in local high-density areas, extracts the characteristic change trends of rotation, stacking and dwelling behaviors, generates local density correction parameters, and adjusts the size parameters of the spatial-temporal convolution window based on the scale of the local high-density area.

[0013] S4 integrates the global density correction result of S2 with the local density correction parameters of S3 and the adjusted spatial-temporal convolution window size parameters to generate real-time dynamic density monitoring data and output a monitoring report containing density distribution map and density anomaly alarm information.

[0014] Preferably, the group behavior dynamics model in S1 uses a social force model to simulate the force state of individual sheep, and updates the dynamic characteristics of group behavior in real time by combining the target migration trend;

[0015] In S1, the modeling of the sheep's entry and exit flow at the camera's field of view boundary adopts a boundary detection algorithm, and the density jump is compensated according to the sheep's entry and exit change trend between frames.

[0016] Preferably, the spatial-temporal convolutional neural network in S2 introduces physical consistency constraints during training, and optimizes the density correction output of the network through the principles of continuity and conservation.

[0017] Preferably, the local high-density behavior analysis in S3 corrects the local density based on the trend of behavioral feature changes by detecting the sheep's rotation, stacking and dwelling patterns.

[0018] In S3, the size of the spatial-temporal convolution window is dynamically adjusted to achieve adaptive processing of different densities in local regions.

[0019] Preferably, the dynamic density monitoring results in S4 include a real-time generated density field distribution map and congestion alarm information based on abnormal density changes.

[0020] Preferably, the data transfer between S1 and S2 adopts a distributed computing framework to improve the real-time performance of data processing;

[0021] The S3 and S4 merge the global density field and the local density field to generate the final dynamic monitoring report, which is used for decision support by ranch managers.

[0022] Preferably, in step S1, the process of acquiring dynamic image sequences of sheep flocks through multiple cameras and generating boundary-compensated density distribution data further includes the following sub-steps:

[0023] S1.1, Collect a continuous sequence of image frames captured by multiple cameras, and extract the set of coordinates of individual sheep in the flock, P = {p1, p2, ..., p...} i},

[0024] Where, p i =(x i ,y i Let be the two-dimensional coordinates of the i-th sheep;

[0025] Calculate the resultant force of each sheep based on the social force model:

[0026]

[0027] in, The driving force is m, the mass of the sheep is v. desired For the desired speed, v i Current speed;

[0028] For repulsive force, k r d is the repulsion coefficient. ij Let σ be the distance between the i-th sheep and the j-th sheep. r For the scope of effect, ||p i -p j || represents the Euclidean distance between the i-th and j-th sheep in the flock, p i Let p be the two-dimensional coordinates of the i-th sheep. j Let be the two-dimensional coordinates of the j-th sheep;

[0029] For alignment force, k a v is the alignment factor. avg v is the average speed of sheep in the neighborhood.i Current speed;

[0030] Using Newton's kinematic equations: Update the flock's movement state and output dynamic characteristic data D. kinetic ={F i ,v i ,p i};

[0031] S1.2, Define the camera's field of view boundary region as rectangular region B:

[0032] B = [x min ,x max ]×[y min ,y max ] Detect the number of sheep entering or leaving B in each frame. and

[0033] Calculate the density jump variable based on the flow changes between adjacent frames:

[0034]

[0035] Among them, A B The area of ​​the boundary region, For density jump variables;

[0036] like For the current frame density distribution ρ t Provide compensation:

[0037]

[0038] in, To correct the density distribution value, α is the compensation coefficient, β is the attenuation factor, and ρ is the density distribution value. threshold The threshold for determining density jumps.

[0039] S1.3, the dynamic characteristic data D output from S1.1 kinetic Corrected density distribution value of S1.2 The data is fused to generate density distribution data D after boundary compensation. density :

[0040] Input for S2.

[0041] Preferably, in step S2, the group behavior dynamics feature data, the density distribution data after boundary compensation, and the multi-camera image sequence are input into a space-time joint deep learning model to generate a global density correction result, which further includes the following sub-steps:

[0042] S2.1, Input a continuous sequence of image frames captured by multiple cameras. Where k is the number of cameras and t is the timestamp;

[0043] S1 outputs group behavior dynamics characteristic data D kinetic and density distribution data D after boundary compensation density ;

[0044] Spatiotemporal alignment of images from multiple cameras is performed to generate an aligned multi-view image tensor X:

[0045] X∈R T×H×W×C Where T is the time window length, H×W is the image resolution, and C is the number of channels;

[0046] D kinetic The dynamic features in the data are encoded as feature vector F. kinetic ∈R N×d Where N is the number of sheep, d is the feature dimension, and is related to D density Density distribution data in Fusion to generate joint feature tensor

[0047] S2.2, Construct a spatial-temporal convolutional neural network. The network structure includes:

[0048] 3D Convolutional Layers: Extracting Spatiotemporal Features f st :f st =Conv3D(X fusion ;K 3d ), where K 3d It is a three-dimensional convolution kernel;

[0049] Gated loop unit: capturing time-dependent h t :h t =GRU(f st ,h t-1 ), where h t-1 The hidden state at time step t-1;

[0050] Fully connected layer: Output dynamic density correction factor C t :C t =W·h t +b, where W is the weight matrix and b is the bias term;

[0051] If the correction factor C t The absolute value exceeds the threshold C max , for C t Perform truncation:

[0052] C t =sign(C t )·min(|C t |,Cmax );

[0053] S2.3, Define the physical constraint loss function:

[0054] L=λ1L continuity +λ2L conservation ,

[0055] Where L is the total loss function, and λ1 and λ2 are weight coefficients.

[0056] Continuous loss Ensure continuous density variation;

[0057] Conservative loss This represents the total number of sheep counted in S1;

[0058] Optimize network parameters through backpropagation; when L exceeds the convergence threshold L... th When the learning rate η is adaptively adjusted: η = η0·exp(-γ·L), where γ is the decay coefficient and η0 is the initial learning rate;

[0059] Output the optimized global density correction result

[0060] in, This is the result of global density correction. To correct the density distribution value.

[0061] Preferably, in step S3, generating local density correction parameters based on dynamic density field data and adjusting the convolution window size further includes the following sub-steps:

[0062] S3.1, the global density correction result output from input S2. Set density threshold ρ high The detection meets the requirements. The local region set R = {r1, r2, ..., r m};

[0063] For each region r i Extracting the sheep's movement trajectory T i ={p1,p2,...,p k} and the velocity direction change sequence θ i ={θ1,θ2,...,θ k};

[0064] If region r i The average rotational angular velocity ω of the inner sheep i :

[0065] Exceeding the threshold ω th This is determined to be a rotational behavior;

[0066] If region r i Mean distance between sheep

[0067] Less than the stacking threshold d stack This is determined to be a stacking behavior;

[0068] If region r i Average speed of sheep This was determined to be a stay-at-home behavior;

[0069] S3.2, Based on the behavioral patterns identified in S3.1, calculate the correction weights for each region:

[0070] Rotational behavior correction factor c rotate =α r ·ω i / ω th ;

[0071] Stacking behavior correction factor

[0072] Resident behavior correction coefficient

[0073] Comprehensive correction parameter c i =c rotate +c stack +c stay If c i >c max Let c i =c max ;

[0074] Where, ω th d is the rotational angular velocity threshold. stack v is the stacking spacing threshold. stay α is the dwell speed threshold. r α s α st For behavior-adjusted weighting coefficients, c max To correct the upper limit of parameters;

[0075] S3.3, based on local area density values and correction parameter c i Calculate the convolution window adjustment coefficient:

[0076]

[0077] Among them, s base The reference window size is μ, where μ is the scaling factor and s is the scaling factor. min and s max These are the lower and upper limits for the window size;

[0078] If s i >s max , making s i =s max ;

[0079] If s i <s min , making s i =s min ;

[0080] Output the adjusted window size set S = {s1, s2, ..., s} m} and the local correction parameter set C = {c1, c2, ..., c m}

[0081] Preferably, in step S4, fusing the global density correction result with the local correction parameters to generate a monitoring report further includes the following sub-steps:

[0082] S4.1, the global density correction result output from input S2. S3 generates a set of local correction parameters C = {c1, c2, ..., c...} m} and the adjusted set of convolution window sizes S = {s1, s2, ..., s m};

[0083] For each local high-density region r i According to the correction parameter c i Adjust the density value:

[0084]

[0085] like make Where, ρ saturation This represents the density saturation threshold.

[0086] Output the fused global-local density field:

[0087]

[0088] in, This is the result of global density correction. For global density field Local region r i density value, For the local region r i Behavioral pattern analysis and the corrected local density values ​​were performed. This represents the final dynamic density field;

[0089] S4.2, Calculate the anomaly index of each region (x,y) in the density field:

[0090]

[0091] Where, ρ history σ is the historical density mean. history For historical standard deviation, For the final density field The density value at the coordinate point (x, y);

[0092] If A(x,y)>A th The area is marked as abnormal and a congestion alarm signal is generated.

[0093] If continuous T alert The same region within the same frame is marked as abnormal, triggering a continuous alarm, T alert The number of frames triggered for continuous alarm;

[0094] S4.3, the fused density field Density distribution map M rendered as a heatmap t ;

[0095] Integrate alarm signals to generate a structured report:

[0096] Report = {M t ,AlertList,Timestamp}

[0097] The AlertList contains the coordinates of the abnormal area and the alarm level, and the Timestamp is the timestamp.

[0098] Reports are pushed to the ranch management terminal in real time via a distributed message queue.

[0099] This invention provides a method for dynamic monitoring of sheep flock density based on multi-camera fusion. It has the following beneficial effects:

[0100] 1. This invention achieves continuous and stable density estimation in dynamic scenes by using a group behavior dynamics modeling and spatiotemporal joint deep learning compensation technology. Compared with the existing technology that relies on fixed camera image stitching and target detection, this invention solves the shortcomings of boundary occlusion and significant density jumps caused by the rapid movement of sheep.

[0101] 2. This invention achieves the technical effect of accurately correcting nonlinear motion errors in local areas through an adaptive local high-density compensation technology. Compared with the existing technology that only expands the camera coverage or increases the acquisition frequency, this invention solves the problem of local density estimation deviation caused by the behavior of sheep rotating in place, gathering for a short time, or stacking. Attached Figure Description

[0102] Figure 1 This is a flowchart of the present invention. Detailed Implementation

[0103] To enable those skilled in the art to understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort should fall within the scope of protection of the present invention.

[0104] The present invention will now be described in detail with reference to the accompanying drawings:

[0105] Example:

[0106] Please see the appendix Figure 1 This invention provides a method for dynamic monitoring of sheep flock density based on multi-camera fusion, comprising:

[0107] S1 collects dynamic image sequences of sheep flocks through multiple cameras, models the interaction forces, expected speed and target migration trend among individual sheep based on the social force model, generates group behavior dynamics characteristic data, and dynamically detects the flow of sheep entering and leaving the boundary area of ​​the camera's field of view, outputting density distribution data after boundary compensation.

[0108] The group behavior dynamics model in S1 uses a social force model to simulate the force state of individual sheep and updates the dynamic characteristics of group behavior in real time by combining the target migration trend.

[0109] In S1, the modeling of sheep entering and exiting the camera's field of view boundary adopts a boundary detection algorithm, and the density jump is compensated according to the trend of sheep entering and exiting between frames.

[0110] S1.1, Collect a continuous sequence of image frames captured by multiple cameras, and extract the set of coordinates of individual sheep in the flock, P = {p1, p2, ..., p...} i},

[0111] Where, p i =(x i ,y i Let be the two-dimensional coordinates of the i-th sheep;

[0112] Calculate the resultant force of each sheep based on the social force model:

[0113]

[0114] in, The driving force is m, the mass of the sheep is v. desired For the desired speed, v i Current speed;

[0115] For repulsive force, k r d is the repulsion coefficient. ij Let σ be the distance between the i-th sheep and the j-th sheep. r For the scope of effect, ||p i -p j || represents the Euclidean distance between the i-th and j-th sheep in the flock, p i Let p be the two-dimensional coordinates of the i-th sheep. j Let be the two-dimensional coordinates of the j-th sheep;

[0116] For alignment force, k a v is the alignment factor. avg v is the average speed of sheep in the neighborhood. i Current speed;

[0117] Using Newton's kinematic equations: Update the flock's movement state and output dynamic characteristic data D. kinetic ={F i ,v i ,p i};

[0118] S1.2, Define the camera's field of view boundary region as rectangular region B:

[0119] B = [x min ,x max ]×[y min ,y max ] Detect the number of sheep entering or leaving B in each frame. and

[0120] Calculate the density jump variable based on the flow changes between adjacent frames:

[0121]

[0122] Among them, A B The area of ​​the boundary region, For density jump variables;

[0123] like For the current frame density distribution ρ t Provide compensation:

[0124]

[0125] in, To correct the density distribution value, α is the compensation coefficient, β is the attenuation factor, and ρ is the density distribution value. threshold The threshold for determining density jumps.

[0126] S1.3, the dynamic characteristic data D output from S1.1 kinetic Corrected density distribution value of S1.2 The data is fused to generate density distribution data D after boundary compensation. density :

[0127] For input to S2;

[0128] S2 inputs the group behavior dynamics feature data generated in S1, the density distribution data after boundary compensation, and the continuous image frame sequence acquired by multiple cameras into the space-time joint deep learning model. Through spatiotemporal feature fusion, dynamic density field data is generated, and the global density correction result is output.

[0129] The spatial-temporal convolutional neural network in S2 introduces physical consistency constraints during training, and optimizes the density correction output of the network through the principles of continuity and conservation.

[0130] S2.1, Input a continuous sequence of image frames captured by multiple cameras. Where k is the number of cameras and t is the timestamp;

[0131] S1 outputs group behavior dynamics characteristic data D kinetic and density distribution data D after boundary compensation density ;

[0132] Spatiotemporal alignment of images from multiple cameras is performed to generate an aligned multi-view image tensor X:

[0133] X∈R T×H×W×C Where T is the time window length, H×W is the image resolution, and C is the number of channels;

[0134] D kinetic The dynamic features in the data are encoded as feature vector F. kinetic ∈R N×d Where N is the number of sheep, d is the feature dimension, and is related to D density Density distribution data in Fusion to generate joint feature tensor

[0135] S2.2, Construct a spatial-temporal convolutional neural network. The network structure includes:

[0136] 3D Convolutional Layers: Extracting Spatiotemporal Features f st :f st =Conv3D(X fusion ;K 3d ), where K 3d It is a three-dimensional convolution kernel;

[0137] Gated loop unit: capturing time-dependent h t :h t =GRU(f st ,h t-1 ), where h t-1 The hidden state at time step t-1;

[0138] Fully connected layer: Output dynamic density correction factor C t :C t =W·h t +b, where W is the weight matrix and b is the bias term;

[0139] If the correction factor C t The absolute value exceeds the threshold C max , for C t Perform truncation:

[0140] C t =sign(C t )·min(|C t |,C max );

[0141] S2.3, Define the physical constraint loss function:

[0142] L=λ1L continuity +λ2L conservation ,

[0143] Where L is the total loss function, and λ1 and λ2 are weight coefficients.

[0144] Continuous loss Ensure continuous density variation;

[0145] Conservative loss This represents the total number of sheep counted in S1;

[0146] Optimize network parameters through backpropagation; when L exceeds the convergence threshold L... th When the learning rate η is adaptively adjusted: η = η0·exp(-γ·L), where γ is the decay coefficient and η0 is the initial learning rate;

[0147] Output the optimized global density correction result

[0148] in, This is the result of global density correction. To correct the density distribution value;

[0149] S3, based on the dynamic density field data generated by S2, identifies sheep behavior patterns in local high-density areas, extracts the characteristic change trends of rotation, stacking and dwelling behaviors, generates local density correction parameters, and adjusts the size parameters of the spatial-temporal convolution window based on the scale of the local high-density area.

[0150] The local high-density behavior analysis in S3 corrects the local density based on the trend of behavioral feature changes by detecting the sheep's rotation, stacking and dwelling patterns.

[0151] S3 achieves adaptive processing of different density levels in local regions by dynamically adjusting the size of the spatial-temporal convolution window;

[0152] S3.1, the global density correction result output from input S2. Set density threshold ρ high The detection meets the requirements. The local region set R = {r1, r2, ..., r m};

[0153] For each region r i Extracting the sheep's movement trajectory T i ={p1,p2,...,p k} and the velocity direction change sequence θ i ={θ1,θ2,...,θ k};

[0154] If region r i The average rotational angular velocity ω of the inner sheep i :

[0155] Exceeding the threshold ω th This is determined to be a rotational behavior;

[0156] If region r i Mean distance between sheep

[0157] Less than the stacking threshold d stack This is determined to be a stacking behavior;

[0158] If region r i Average speed of sheep This was determined to be a stay-at-home behavior;

[0159] S3.2, Based on the behavioral patterns identified in S3.1, calculate the correction weights for each region:

[0160] Rotational behavior correction factor c rotate =α r ·ω i / ωth ;

[0161] Stacking behavior correction factor

[0162] Resident behavior correction coefficient

[0163] Comprehensive correction parameter c i =c rotate +c stack +c stay If c i >c max Let c i =c max ;

[0164] Where, ω th d is the rotational angular velocity threshold. stack v is the stacking spacing threshold. stay α is the dwell speed threshold. r α s α st For behavior-adjusted weighting coefficients, c max To correct the upper limit of parameters;

[0165] S3.3, based on local area density values and correction parameter c i Calculate the convolution window adjustment coefficient:

[0166]

[0167] Among them, s base The reference window size is μ, where μ is the scaling factor and s is the scaling factor. min and s max These are the lower and upper limits for the window size;

[0168] If s i >s max , making s i =s max ;

[0169] If s i <s min , making s i =s min ;

[0170] Output the adjusted window size set S = {s1, s2, ..., s} m} and the local correction parameter set C = {c1, c2, ..., c m};

[0171] S4 integrates the global density correction result of S2 with the local density correction parameters of S3 and the adjusted spatial-temporal convolution window size parameters to generate real-time dynamic density monitoring data and output a monitoring report containing density distribution map and density anomaly alarm information.

[0172] The dynamic density monitoring results in S4 include real-time generated density field distribution maps and congestion alarm information based on density anomaly changes;

[0173] S4.1, the global density correction result output from input S2. S3 generates a set of local correction parameters C = {c1, c2, ..., c...} m} and the adjusted set of convolution window sizes S = {s1, s2, ..., s m};

[0174] For each local high-density region r i According to the correction parameter c i Adjust the density value:

[0175]

[0176] like make Where, ρ saturation This represents the density saturation threshold.

[0177] Output the fused global-local density field:

[0178]

[0179] in, This is the result of global density correction. For global density field Local region r i density value, For the local region r i Behavioral pattern analysis and the corrected local density values ​​were performed. This represents the final dynamic density field;

[0180] S4.2, Calculate the anomaly index of each region (x,y) in the density field:

[0181]

[0182] Where, ρ history σ is the historical density mean. history For historical standard deviation, For the final density field The density value at the coordinate point (x, y);

[0183] If A(x,y)>Ath The area is marked as abnormal and a congestion alarm signal is generated.

[0184] If continuous T alert The same region within the same frame is marked as abnormal, triggering a continuous alarm, T alert The number of frames triggered for continuous alarm;

[0185] S4.3, the fused density field Density distribution map M rendered as a heatmap t ;

[0186] Integrate alarm signals to generate a structured report:

[0187] Report = {M t ,AlertList,Timestamp}

[0188] The AlertList contains the coordinates of the abnormal area and the alarm level, and the Timestamp is the timestamp.

[0189] Reports are pushed to the ranch management terminal in real time via a distributed message queue.

[0190] This approach quantifies the mechanical interactions (driving force, repulsive force, and alignment force) between individuals in a sheep flock using a social force model, and updates the group's dynamic characteristics in real time using Newton's kinematic equations, effectively simulating the real-world movement patterns of sheep during migration and gathering. Compared to traditional static target detection methods, this scheme significantly improves the continuity of density estimation in dynamic scenes through physically driven dynamic modeling. Simultaneously, the boundary flow detection algorithm, combined with an exponential decay compensation mechanism, eliminates density jump errors caused by frequent sheep entering and leaving the field of view, addressing the pain point of boundary occlusion interference in existing technologies.

[0191] A joint feature tensor is generated using multi-camera spatiotemporal alignment technology. This tensor is then fused with spatiotemporal features via 3D convolutional layers and a GRU network to capture the long-term dependencies in sheep herd motion. A physically consistent constraint loss function is introduced to force the network output to conform to mass conservation and motion continuity in density correction results. Compared to traditional purely data-driven deep learning models, this approach effectively suppresses abnormal corrections caused by data noise through physical prior constraints, thereby improving the reliability of the global density field.

[0192] Based on multi-dimensional behavior detection using rotational angular velocity, stacking spacing, and dwell velocity, local correction parameters are dynamically generated. A convolutional window size adaptive adjustment mechanism enables dynamic optimization of high-density region resolution. Compared to traditional methods with fixed windows, this approach allows the model to flexibly adjust its receptive range according to local density, avoiding feature extraction bias caused by mismatched window sizes.

[0193] A saturation truncation strategy is employed to prevent local corrections, and statistically based intelligent alarms are achieved through anomaly index calculation. Structured reports integrate heatmaps and multi-level alarm signals, with low-latency push notifications via a distributed message queue. Compared to traditional single-density outputs, this solution provides ranch managers with decision-making support that combines spatial detail and temporal continuity through global-local fusion and a continuous alarm triggering mechanism, significantly improving emergency response efficiency.

[0194] Data transfer between S1 and S2 adopts a distributed computing framework to improve the real-time performance of data processing;

[0195] S3 and S4 merge the global density field and the local density field to generate the final dynamic monitoring report, which is used to support the decision-making of ranch managers.

[0196] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for dynamic monitoring of sheep flock density based on multi-camera fusion, characterized in that, include: By collecting dynamic image sequences of sheep flocks through multiple cameras, the interaction forces, expected speeds and target migration trends among individual sheep are modeled based on a social force model, generating group behavior dynamics characteristic data. Furthermore, the flow of sheep entering and leaving the boundary area of ​​the camera's field of view is dynamically detected, and density distribution data after boundary compensation is output. ,Will The generated group behavior dynamics feature data, the density distribution data after boundary compensation, and the continuous image frame sequence captured by multiple cameras are input into the space-time joint deep learning model. Dynamic density field data is generated through spatiotemporal feature fusion, and global density correction results are output. ,based on The generated dynamic density field data identifies sheep behavior patterns in local high-density regions, extracts the characteristic change trends of rotation, stacking and dwelling behaviors, generates local density correction parameters, and adjusts the size parameters of the spatial-temporal convolution window based on the scale of the local high-density region. The In the process of generating local density correction parameters based on dynamic density field data and adjusting the convolution window size, the following sub-steps are further included: ,enter Output global density correction results Set density threshold The detection meets the requirements. Local region set ; For each region Extracting the movement trajectory of sheep and velocity direction change sequence ; If the area Mean rotational angular velocity of the inner sheep : Exceeding the threshold This is determined to be a rotational behavior; If the area Mean distance between sheep : Less than the stacking threshold This is determined to be stacking behavior; If the area Average speed of sheep This was determined to be a stay-at-home behavior; ,according to Identify behavioral patterns and calculate correction weights for each region: Rotational behavior correction factor ; Stacking behavior correction factor ; Resident behavior correction coefficient ; Comprehensive correction parameters ,like ,make ; in, The rotational angular velocity threshold, This is the stacking spacing threshold. The dwell speed threshold, , , Adjust the weighting coefficients for the behavior. To correct the upper limit of parameters; Based on local density values and correction parameters Calculate the convolution window adjustment coefficient: , in, Based on the reference window size, Scaling factor and These are the lower and upper limits for the window size; like ,make ; like ,make ; Output the adjusted window size set and local correction parameter set ; ,Will The global density correction results and The local density correction parameters and the adjusted spatial-temporal convolution window size parameters are fused to generate real-time dynamic density monitoring data, and a monitoring report containing density distribution map and density anomaly alarm information is output.

2. The method for dynamic monitoring of sheep flock density based on multi-camera fusion according to claim 1, characterized in that, The The group behavior dynamics model in the paper uses a social force model to simulate the force state of individual sheep and updates the dynamic characteristics of group behavior in real time by combining the target migration trend. The The modeling of sheep entry and exit flow at the camera's field of view boundary uses a boundary detection algorithm to compensate for density jumps based on the sheep entry and exit trends between frames.

3. The method for dynamic monitoring of sheep flock density based on multi-camera fusion according to claim 1, characterized in that, The In spatial-temporal convolutional neural networks, physical consistency constraints are introduced during training to optimize the density correction output of the network through the principles of continuity and conservation.

4. The method for dynamic monitoring of sheep flock density based on multi-camera fusion according to claim 1, characterized in that, The The local high-density behavior analysis in the study detects the rotation, stacking, and dwelling patterns of sheep, and corrects the local density based on the trend of behavioral characteristics. The By dynamically adjusting the size of the spatial-temporal convolution window, adaptive processing of different density levels in local regions can be achieved.

5. The method for dynamic monitoring of sheep flock density based on multi-camera fusion according to claim 1, characterized in that, The The dynamic density monitoring results include real-time generated density field distribution maps and congestion alarm information based on abnormal density changes.

6. The method for dynamic monitoring of sheep flock density based on multi-camera fusion according to claim 1, characterized in that, The and Data transfer between systems utilizes a distributed computing framework to improve the real-time performance of data processing. The and The system generates a final dynamic monitoring report by fusing global and local density fields, which is used to support the decision-making of ranch managers.

7. The method for dynamic monitoring of sheep flock density based on multi-camera fusion according to claim 1, characterized in that, The The process involves acquiring dynamic image sequences of sheep flocks using multiple cameras and generating boundary-compensated density distribution data, further including the following sub-steps: Collect a continuous sequence of image frames captured by multiple cameras and extract the set of coordinates of individual sheep locations. , in, For the first Two-dimensional coordinates of a sheep; Calculate the resultant force of each sheep based on the social force model: , in, As the driving force, For sheep quality, For the desired speed, Current speed; It is a repulsive force. The repulsion coefficient, For the first Only sheep and the first The distance between the sheep For the scope of application, The first in the flock Only sheep and the first The Euclidean distance between sheep For the first The two-dimensional coordinates of a sheep For the first Two-dimensional coordinates of a sheep; To align the force, Alignment factor, The average speed of sheep in the neighborhood. Current speed; Using Newton's kinematic equations: Update the flock's movement status and output dynamic characteristic data. ; Define the camera's field of view boundary region as a rectangular area. : Detecting entry or exit in each frame number of sheep and ; Calculate the density jump variable based on the flow changes between adjacent frames: , in, The area of ​​the boundary region, For density jump variables; like For the current frame density distribution Provide compensation: , in, To correct the density distribution value, For compensation coefficient, As the attenuation factor, The threshold for determining density jumps; ,Will Output dynamic characteristic data and Corrected density distribution value The data is fused to generate density distribution data after boundary compensation. : , used for Input.

8. A method for dynamic monitoring of sheep flock density based on multi-camera fusion according to claim 1, characterized in that, The In this process, the group behavior dynamics feature data, boundary-compensated density distribution data, and multi-camera image sequences are input into a space-time joint deep learning model to generate global density correction results. This further includes the following sub-steps: Input a sequence of consecutive image frames captured by multiple cameras. ,in, For the number of cameras, For timestamps; Output group behavior dynamics feature data and density distribution data after boundary compensation ; Spatiotemporal alignment of images from multiple cameras is performed to generate aligned multi-view image tensors. : ,in, The time window length, For image resolution, Number of channels; Will The dynamic features in the data are encoded as feature vectors. ,in, For the number of sheep, As the feature dimension, and with Density distribution data in Fusion to generate joint feature tensor ; Construct a spatial-temporal convolutional neural network. The network structure includes: Convolutional layers: extracting spatiotemporal features : ,in, It is a three-dimensional convolution kernel; Gated Loop Unit: Capturing Time Dependencies : ,in, For time step The hidden state; Fully connected layer: Output dynamic density correction coefficient : ,in, This is the weight matrix. For bias terms; If the correction factor The absolute value exceeds the threshold ,right Perform truncation: ; Define the physical constraint loss function: , in, For the total loss function, , These are the weighting coefficients. Continuous loss This ensures continuous density variation; Conservative loss , for The total number of sheep counted in the statistics; Optimize network parameters through backpropagation, when Exceeding the convergence threshold Adaptively adjust the learning rate. : ),in, The attenuation coefficient is... The initial learning rate; Output the optimized global density correction result : , in, This is the result of global density correction. To correct the density distribution value.

9. A method for dynamic monitoring of sheep flock density based on multi-camera fusion according to claim 8, characterized in that, The In the process, the global density correction results are fused with the local correction parameters to generate a monitoring report, which further includes the following sub-steps: ,enter Output global density correction results , The generated set of local correction parameters and the set of adjusted convolution window sizes ; For each local high-density area According to the correction parameters Adjust the density value: , like ,make ,in, This is the density saturation threshold; Output the fused global-local density field: , in, This is the result of global density correction. For global density field Central local area density value, For local areas Behavioral pattern analysis and the corrected local density values. This represents the final dynamic density field; Calculate the density field for each region Abnormality index: , in, The historical density mean For historical standard deviation, For the final density field At coordinate point Density value at; like > The area is marked as abnormal and a congestion alarm signal is generated. If continuous If the same region within a frame is marked as abnormal, a continuous alarm will be triggered. The number of frames triggered for continuous alarm; The fused density field Density distribution map rendered as a heatmap ; Integrate alarm signals to generate structured reports : , in, Includes the coordinates of the abnormal area and the alarm level. For timestamps; Reports are pushed to the ranch management terminal in real time via a distributed message queue.

Citation Information

Patent Citations

  • Automatic Monitoring Method for Sheep Flocks in Pastoral Areas Based on Sub-meter High-Resolution Satellite Remote Sensing Imagery

    CN112541487B

  • Automatic pasturing area sheep flock monitoring method based on sub-meter high-resolution satellite remote sensing images

    CN112541487A

  • Crowd motion simulation method based on mass real crowd motion videos

    CN113536996A