Avian influenza host bird behavior prediction method based on deep reinforcement learning

By combining deep reinforcement learning and an improved YOLOv5 model with dynamic graph neural networks and the Actor-Critic strategy, the non-invasive and adaptive problems of bird behavior recognition in avian influenza monitoring were solved, achieving high-precision group behavior prediction and improved stability.

CN120726693AActive Publication Date: 2025-09-30INST OF GEOGRAPHICAL SCI & NATURAL RESOURCE RES CAS +1

Patent Information

Application Number
CN202510822606.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-19
Publication Date
2025-09-30
Estimated Expiration
2045-06-19

AI Technical Summary

Technical Problem

Existing technologies lack non-invasive, high-precision bird behavior recognition methods in avian influenza monitoring. In particular, it is difficult to achieve group interaction situation modeling and adaptive optimization of the model in complex natural scenarios, resulting in insufficient prediction accuracy and poor adaptability.

Method used

A method based on deep reinforcement learning is adopted to collect video data through multi-angle variable frame rate cameras. The improved YOLOv5 model is combined for target detection. A dynamic graph neural network and Actor-Critic strategy module are constructed to perform local short-term and global multi-step behavior prediction. The adaptability of the model is improved through an online fine-tuning mechanism.

Benefits of technology

It achieves high-precision bird behavior detection and multi-step prediction, improves the ability to identify group behavior, enhances the stability and applicability of the avian influenza monitoring system, and is suitable for long-term deployment in complex natural environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120726693A_ABST
    Figure CN120726693A_ABST
Patent Text Reader

Abstract

The invention discloses an avian influenza host bird behavior prediction method based on deep reinforcement learning, and the method comprises the following steps: S1, deploying a multi-angle and variable-frame-rate camera in a target habitat, and collecting multi-source video data; s2, performing frame insertion, illumination normalization and background denoising processing on the video data; s3, inputting the preprocessed data into an improved YOLOv5 model to obtain a target detection result; s4, constructing a dynamic graph neural network based on bird nodes and space-time edges, and outputting a clustering situation vector; s5, inputting the flight path into a low-layer Actor-Critic strategy network, and generating a local short-term behavior decision; s6, generating a global multi-walk prediction sequence in combination with the clustering situation vector and historical error feedback; and S7, comparing a prediction result with actual observation data, and triggering online fine adjustment according to deviation. According to the invention, non-intrusive and high-precision bird behavior prediction can be realized, and the method is suitable for bird flu monitoring and early warning scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of animal behavior analysis, and in particular to a method for predicting the behavior of avian influenza host birds based on deep reinforcement learning. Background Art

[0002] In the field of avian influenza monitoring and intelligent identification of biological behavior, with the advancement of artificial intelligence, image processing, and wireless sensor technologies, wildlife behavior recognition and prediction based on visual analysis has become a research hotspot. In particular, accurate modeling and prediction of the behavioral patterns of migratory birds, a reservoir of avian influenza, is crucial for early detection of disease transmission risks and optimizing prevention and control strategies. Currently, mainstream bird behavior monitoring technologies can be broadly categorized into two types: individual tracking methods based on sensor tags and group behavior recognition methods based on video imagery.

[0003] Sensor tag-based methods achieve long-term tracking of flight trajectories and physiological states by installing GPS or RFID devices on individual birds. However, they are difficult to deploy on a large scale in natural wild environments due to their high operational invasiveness, high deployment costs, and significant behavioral interference. In contrast, behavioral recognition methods based on video images have greater potential for promotion in practical applications due to their non-invasive advantages and repeatability. Currently, related studies mostly use target detection algorithms to identify individual birds and combine them with traditional trajectory fitting or cluster analysis methods to classify their behavioral states. However, due to interference factors such as background occlusion, dense distribution of small targets, and ambient light fluctuations in complex natural scenes, existing detection algorithms still have obvious shortcomings in terms of accuracy and robustness.

[0004] Furthermore, some studies have attempted to model behavioral sequences using graph neural networks and recurrent neural networks to predict bird behavior over time. However, these approaches generally lack the ability to model group interactions and struggle to adaptively optimize prediction models based on environmental changes. While reinforcement learning methods have demonstrated their feasibility for behavior planning, most approaches focus on optimizing individual behavioral strategies in static environments and have yet to develop an end-to-end collaborative mechanism suitable for dynamic group decision-making and prediction in natural scenarios.

[0005] Existing methods generally lack the ability to jointly model local individual behavior and overall group situation, and lack an effective online model adaptation mechanism. They are unable to fully utilize continuously collected observation data for real-time fine-tuning, resulting in prediction models facing performance degradation and insufficient adaptability during long-term deployment.

[0006] Therefore, how to provide a method for predicting the behavior of avian influenza host birds based on deep reinforcement learning is an urgent problem that needs to be solved by those skilled in the art. Summary of the Invention

[0007] One purpose of the present invention is to propose a method for predicting the behavior of avian influenza host birds based on deep reinforcement learning. The present invention has the capabilities of non-invasive collection, high-precision detection, dynamic group modeling and online adaptive prediction, which effectively improves the accuracy and stability of bird behavior recognition and multi-step behavior prediction.

[0008] The method for predicting the behavior of avian influenza host birds based on deep reinforcement learning according to an embodiment of the present invention includes the following steps:

[0009] S1. Deploy multi-angle, variable frame rate cameras in the target habitat to collect raw video streams and obtain multi-source video data;

[0010] S2, performing time sequence interpolation, ambient light normalization, and background modeling denoising processing on the multi-source video data to obtain preprocessed video data;

[0011] S3, input the preprocessed video data into the improved YOLOv5 model to obtain the target detection results;

[0012] S4. Based on the target detection results, a dynamic graph neural network is constructed with the detected bird individuals as nodes and the spatiotemporal position information and relative speed as edges, and the flocking situation vector is output;

[0013] S5. Input the flight trajectory of individual birds in the target detection results into the low-level Actor-Critic strategy module to generate local short-term behavior decision results;

[0014] S6, feeding the clustering situation vector and historical prediction error feedback into the high-level Actor-Critic strategy module to generate a global multi-step behavior prediction sequence;

[0015] S7. Compare the local short-term behavior decision results and the global multi-step behavior prediction sequence with the actual bird behavior observation data collected in real time, calculate the decision deviation and prediction deviation, and trigger online fine-tuning based on the decision deviation and prediction deviation to update the YOLOv5 detection model and Actor-Critic strategy network parameters.

[0016] Optionally, the S1 specifically includes:

[0017] S11. Using DGNSS and ground reflectance markers to assist positioning, deploy several three-dimensional spatial control points within the target habitat. LiDAR and drone photogrammetry are integrated to obtain environmental point clouds and orthophotos. Target habitats include foraging, breeding, and migratory stopover sites for avian influenza host birds.

[0018] S12. Using the environmental point cloud and orthophotos, calculate the three-dimensional polyhedron of each camera's field of view using a particle swarm optimization algorithm and determine the optimal installation position and pitch angle, where the pitch angle satisfies a field of view coverage greater than 98% and an occlusion probability less than 2%.

[0019] S13. Fix the variable frame rate camera at the optimal installation position and perform internal and external parameter calibration using a combination of stripe structured light and an AprilTag calibration plate to obtain the focal length, principal point coordinates, and radial and tangential distortion coefficients of the variable frame rate camera.

[0020] S14. Equip the variable frame rate camera with an electrically controlled liquid lens, wherein the electrically controlled liquid lens switches the focal length from 100 mm to 200 mm by adjusting the applied voltage, dynamically determines the region of interest based on image block histogram equalization analysis, and caches video frames of the corresponding region at a frequency of 30 fps;

[0021] S15. Use the PTPv2 protocol in combination with the GNSS link for clock synchronization, and embed a drift correction algorithm in the clock synchronization process based on the wireless mesh network to correct the clock deviation in real time;

[0022] S16. Equip each camera with an MPPT-controlled solar cell module and a lithium-ion battery storage module, and automatically adjust the video resolution and frame rate according to a preset power-performance mapping table by monitoring the voltage and output power of the battery module;

[0023] S17. Use a ring buffer structure to store the original video streams of each camera, and fuse the video streams based on the timestamp and the camera view identifier to generate multi-source video data.

[0024] Optionally, the S2 specifically includes:

[0025] S21, accumulating the pixel-level absolute difference of each pair of adjacent frames in the multi-source video data and comparing it with the stillness discrimination threshold, extracting the corresponding frames of the frame pairs whose total pixel difference is less than or equal to the stillness discrimination threshold as key frames, and classifying the corresponding frames of other frame pairs as dynamic frames;

[0026] S22, using an integrated visible light and near-infrared spectral synchronous acquisition device to record ambient spectral distribution data, and linearly mapping and normalizing the pixel brightness in the key frames and dynamic frames based on the spectral distribution data and a pre-calibrated pixel-spectral response lookup table to generate a spectral correction frame set;

[0027] S23, dividing the spectral correction frame set into fixed time windows, for each time window, swapping the first frame and the Nth frame in the storage sequence to balance the time interval difference between the frames, and outputting a reconstructed time series;

[0028] S24. Construct a two-layer background cache canvas, where the first background canvas is updated every N1 frames for long-term static scene modeling, and the second background canvas is updated every N2 frames for short-term dynamic scene capture. The two layers of background canvas are fused using a pixel-level overlay strategy and pixel-by-pixel merge is performed with the reconstructed time series frames to obtain a foreground frame sequence.

[0029] S25, appending a chain metadata tag including a UTC timestamp, a camera number, an ambient light intensity, and an ambient temperature to each frame in the foreground frame sequence;

[0030] S26. Based on the camera number and the frame number, cross-merge the foreground frame sequence in the storage sequence according to the timestamp and the camera view label to generate pre-processed video data.

[0031] Optionally, the S3 specifically includes:

[0032] S31. Input the pre-processed video data frame by frame into the YOLOv5s backbone network CSPDarknet, and perform layer-by-layer convolution processing through the cross-stage local connection structure and residual block stacking to obtain the initial feature map:

[0033]

[0034] in, represents the j-th output feature map of the l-th layer, represents the i-th input feature map of the l-1th layer, represents the convolution kernel weight connecting the i-th input feature map and the j-th output feature map, Represents the corresponding bias term, M j Represents the set of all input feature map indices connected to the j-th output feature map;

[0035] S32. Perform global average pooling and global maximum pooling on the initial feature map to obtain the average pooling feature of the channel dimension With the maximum pooling feature And perform feature normalization on each channel separately;

[0036] S33, respectively, the normalized average pooling features and max pooling features The channel attention weight vector M is obtained by independently transforming the multi-layer perceptron structure with the number of hidden layer neurons being 1 / 4 of the original number of channels, and then adding the transformed results channel by channel and activating them with the Sigmoid function. c (F):

[0037]

[0038] Where σ(·) represents the Sigmoid activation function;

[0039] S34, perform average pooling and maximum pooling on the feature map after channel attention enhancement along the channel dimension to generate a spatial feature matrix and And they are connected in series along the channel direction to form spatial attention fusion features;

[0040] S35, convolution operation is performed on the spatial attention fusion feature through a two-dimensional convolution kernel of size 7×7, the step size of the convolution kernel is 1, and the single-channel spatial attention weight matrix M is output. s (F):

[0041]

[0042] Among them, f 7×7 represents a 2D convolution operation of size 7 × 7, and σ(·) represents the Sigmoid activation function;

[0043] S36, the channel attention weight vector M c (F) Multiply the corresponding feature map channel by channel and add the spatial attention weight matrix M s (F) Multiplying the feature map by pixel position simultaneously achieves dual feature enhancement at the channel level and spatial level;

[0044] S37. Use the path aggregation network to fuse the feature maps of different scales after dual feature enhancement layer by layer to obtain a multi-scale fused feature map. Use the convolutional prediction regression network to predict the bounding box coordinates and category confidence of the multi-scale fused feature map and output the target detection result.

[0045] Optionally, the S4 specifically includes:

[0046] S41, taking the bird individuals detected in the target detection results as nodes, assigning spatial coordinates, detection bounding box size and current frame timestamp to each node;

[0047] S42, determining whether there is a dynamic connection relationship between any two nodes based on a spatial distance threshold and a time interval threshold between nodes, where the spatial distance threshold is defined as the sum of the mean and standard deviation of the distance between individual birds, and the time interval threshold is defined as an integer multiple of the interval between two consecutive video frames;

[0048] S43. For dynamically connected nodes, calculate the magnitude and direction angle of the relative velocity vector between the nodes. The direction angle is represented by the angle between the line connecting two adjacent bird individuals and the horizontal direction, and record the rate of change of the angle.

[0049] S44. Determine the strength and type of an edge based on the spatial distance between nodes and the rate of change of the direction angle of the relative velocity vector. The edge types include approaching, diverging, and parallel. The edge strength is the ratio of the modulus of the relative velocity vector between nodes to the spatial distance.

[0050] S45. Label each edge using a hybrid identifier defined by the edge strength and type, store the label together with the timestamp of the corresponding node, and construct a dynamic graph containing the spatiotemporal state history;

[0051] S46. Calculate the number of nodes, the proportion of edge types, and the variance of the velocity angle between the node and its neighboring nodes in the local neighborhood for each node in the dynamic graph, and aggregate the calculation results into node-level local features.

[0052] S47. Aggregate the node-level local features into a global vector in sequence to obtain a clustering state vector representing the dynamic characteristics of the group.

[0053] Optionally, the S5 specifically includes:

[0054] S51, extract the spatial position coordinates and timestamps of each bird individual in the target detection results in the continuous video frames, and construct the flight trajectory sequence of each bird individual in chronological order. The flight trajectory sequence is expressed in the form of a five-tuple (x t ,y t ,v xt ,v yt ,t), where x t ,y t is the position coordinate, v xt ,v yt is the velocity vector component at the corresponding time point, and t is the timestamp;

[0055] S52, segmenting each flight trajectory sequence according to a time sliding window, with each trajectory segment having a length of a preset number of frames L, and performing first-order difference processing on the velocity vector in each trajectory segment to extract velocity change characteristics;

[0056] S53, the spatial coordinates, speed change characteristics and corresponding time code of each trajectory segment are combined to form a state vector S t , input to the low-level Actor network, and output the current action suggestion vector A t ;

[0057] S54: Construct an immediate reward function R, which is composed of a prediction accuracy reward term R acc , prediction timeliness reward item R time , Ecological Value Reward Item R eco and the continuous correct reward item R cont Linear weighted composition:

[0058] R = αR acc +βR time +γR eco +δR cont ;

[0059] Among them, α, β, γ, δ are weight coefficients;

[0060] S55, the prediction accuracy reward item R acc Defined as:

[0061]

[0062] S56, the prediction timeliness reward item R time Defined as the correct prediction t steps in advance, the value is R time = +2×t, where t≤5, the ecological value reward item R eco Defined as when reproduction or migration behavior is predicted, the value is R eco =+20;

[0063] S57, the continuous correct reward item R cont Defined as the correct prediction for consecutive c steps, the value is R cont =+c 2 ;

[0064] S58, using the experience-first replay mechanism to replay the state vector S t , action proposal vector A t , immediate reward R and next state vector S t+1 They are stored together in the experience replay pool and sorted by sampling priority according to the size of the TD error. The strategy is iteratively updated through the double-delay DDPG algorithm. The Critic network uses the minimum mean square error of the target value of the state-action pair as the loss function. The Actor network updates the parameters by maximizing the expected reward function and outputs the local short-term behavior decision results.

[0065] Optionally, the S6 specifically includes:

[0066] S61. Calculate historical prediction error feedback vector E t , the historical prediction error feedback vector E t is the average value within the sliding window of the difference between the predicted position coordinates and the actual observed position coordinates;

[0067] S62, clustering state vector and historical prediction error feedback vector E t Perform vector splicing to generate the input state vector H of the high-level Actor network t ;

[0068] S63, with the state vector H tAs input, the high-level Actor network outputs the current multi-step predicted action distribution probability vector P(a|H t ), the action distribution probability vector is a probability vector containing the predicted probabilities of the future multi-step action directions and speed amplitudes;

[0069] S64. Define the high-level immediate reward function R H , the high-level immediate reward function R H It is the weighted sum of the prediction accuracy reward and the prediction stability reward;

[0070] S65, use the Actor-Critic algorithm to train the high-level Critic network, minimize the expected loss function corresponding to the action distribution probability vector in the Critic network, and after the high-level Critic network converges, according to the action distribution probability vector P(a|H t ) Select the action sequence output with the highest probability as the global multi-step behavior prediction sequence.

[0071] Optionally, the S7 specifically includes:

[0072] S71. Calculate the position deviation Δ between the local short-term behavior decision result and the actual observation data l ocal;

[0073] S72, calculate the position deviation Δ between the global multi-step behavior prediction sequence and the actual observation data g lobal;

[0074] S73, define the position deviation as the decision deviation E dec =Δ local and prediction error E pred =Δ global , set the decision deviation threshold Th dec and prediction deviation threshold Th pred , when E dec or E pred Automatically trigger online fine-tuning when the corresponding threshold is exceeded;

[0075] S74, based on the triggered deviation, the low-level Actor-Critic network parameters are updated through the deep deterministic policy gradient algorithm, where the loss function L of the Critic network is Q for:

[0076]

[0077] Target value y i The is:

[0078] y i =R i +γQ′(s i+1,μ′(s i+1 |θ μ′ )|θ Q′ );

[0079] Among them, Q(s i ,a i |θ Q ) represents the Critic network's response to state s i With action a i The value estimate of θ Q is the Critic network parameter, R i is the immediate reward, γ is the discount factor, Q′ and μ′ represent the target Critic network and the target Actor network respectively, θ Q′ and θ μ′ Respectively represent the corresponding target network parameters;

[0080] S75. Update the gradient through the Actor network policy to maximize the value estimation function output by the Critic network, where the Actor network policy gradient process is:

[0081]

[0082] Among them, μ(s i |θ μ ) indicates that the Actor network is in state s i The action output under θ μ Actor network parameters;

[0083] S76. Update the YOLOv5 target detection model parameters through the Adam optimization algorithm based on the deviation gradient of the local short-term behavior decision results and the global multi-step behavior prediction sequence.

[0084] The beneficial effects of the present invention are:

[0085] (1) The present invention introduces the DynamicCBAM++ module based on the channel and spatial joint attention mechanism into the YOLOv5 model and dynamically adjusts the attention window parameters according to the statistical characteristics of the environment, thereby achieving high-precision detection of birds in complex backgrounds and small targets, effectively improving the target recall rate and detection stability, and enhancing the applicability of the system in natural environments in the wild.

[0086] (2) The present invention constructs a dynamic graph neural network based on the spatiotemporal position and relative speed of individual birds and uses the local connection structure to calculate the flocking situation vector. It can model and express the dynamic relationship of the collective behavior of bird flocks, significantly improve the accuracy of group behavior perception, and show stronger recognition ability and early warning value in the early stage of potential spread of avian influenza.

[0087] (3) In terms of individual and group behavior prediction, the present invention constructs a two-layer Actor-Critic deep reinforcement learning strategy framework, combines TD3 and SAC algorithms to achieve hierarchical decision-making and joint optimization of local short-term and global multi-step behaviors, effectively solving the problems of insufficient behavior prediction accuracy and poor strategy generalization ability in the existing technology, and breaking through the bottleneck of complex temporal behavior modeling.

[0088] (4) The present invention constructs an online meta-learning adaptive mechanism that includes historical prediction error feedback, and dynamically triggers the fine-tuning process of the YOLOv5 detection model and the Actor-Critic strategy network based on local and global deviations, thereby achieving continuous performance maintenance and dynamic environment adaptability of the model in long-term deployment scenarios, thereby effectively improving the stability and practicality of the avian influenza monitoring system. BRIEF DESCRIPTION OF THE DRAWINGS

[0089] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0090] Figure 1 This is a system flow framework diagram of the avian influenza host bird behavior prediction method based on deep reinforcement learning proposed in this invention. DETAILED DESCRIPTION

[0091] The present invention will now be described in further detail with reference to the accompanying drawings, which are simplified schematic diagrams that illustrate the basic structure of the present invention in a schematic manner.

[0092] refer to Figure 1 ,The avian influenza host bird behavior prediction method based on deep reinforcement learning,including the following steps:

[0093] S1. Deploy multi-angle, variable frame rate cameras in the target habitat to collect raw video streams and obtain multi-source video data;

[0094] S2, performing time sequence interpolation, ambient light normalization, and background modeling denoising processing on the multi-source video data to obtain preprocessed video data;

[0095] S3, input the preprocessed video data into the improved YOLOv5 model to obtain the target detection results;

[0096] S4. Based on the target detection results, a dynamic graph neural network is constructed with the detected bird individuals as nodes and the spatiotemporal position information and relative speed as edges, and the flocking situation vector is output;

[0097] S5. Input the flight trajectory of individual birds in the target detection results into the low-level Actor-Critic strategy module to generate local short-term behavior decision results;

[0098] S6, feeding the clustering situation vector and historical prediction error feedback into the high-level Actor-Critic strategy module to generate a global multi-step behavior prediction sequence;

[0099] S7. Compare the local short-term behavior decision results and the global multi-step behavior prediction sequence with the actual bird behavior observation data collected in real time, calculate the decision deviation and prediction deviation, and trigger online fine-tuning based on the decision deviation and prediction deviation to update the YOLOv5 detection model and Actor-Critic strategy network parameters.

[0100] By introducing an improved YOLOv5 model, the system achieves target detection in multi-source video data of avian influenza host birds. It then uses a dynamic graph neural network based on spatiotemporal position and relative velocity to extract group behavior characteristics. A two-layer actor-critic strategy is then used to hierarchically model and predict individual and group behaviors. Simultaneously, the system performs online fine-tuning based on prediction errors to update detection and strategy network parameters. This technical solution synergistically improves the detection accuracy, temporal modeling capabilities, and model adaptability of bird behavior prediction in complex environments, making it suitable for long-term deployment and dynamic environmental changes in avian influenza risk monitoring scenarios.

[0101] In this embodiment, S1 specifically includes:

[0102] S11. Using DGNSS and ground reflectance markers to assist positioning, deploy several three-dimensional spatial control points within the target habitat. LiDAR and drone photogrammetry are integrated to obtain environmental point clouds and orthophotos. Target habitats include foraging, breeding, and migratory stopover sites for avian influenza host birds.

[0103] S12. Using the environmental point cloud and orthophotos, calculate the three-dimensional polyhedron of each camera's field of view using a particle swarm optimization algorithm and determine the optimal installation position and pitch angle, where the pitch angle satisfies a field of view coverage greater than 98% and an occlusion probability less than 2%.

[0104] S13. Fix the variable frame rate camera at the optimal installation position and perform internal and external parameter calibration using a combination of stripe structured light and an AprilTag calibration plate to obtain the focal length, principal point coordinates, and radial and tangential distortion coefficients of the variable frame rate camera.

[0105] S14. Equip the variable frame rate camera with an electrically controlled liquid lens, wherein the electrically controlled liquid lens switches the focal length from 100 mm to 200 mm by adjusting the applied voltage, dynamically determines the region of interest based on image block histogram equalization analysis, and caches video frames of the corresponding region at a frequency of 30 fps;

[0106] S15. Use the PTPv2 protocol in combination with the GNSS link for clock synchronization, and embed a drift correction algorithm in the clock synchronization process based on the wireless mesh network to correct the clock deviation in real time;

[0107] S16. Equip each camera with an MPPT-controlled solar cell module and a lithium-ion battery storage module, and automatically adjust the video resolution and frame rate according to a preset power-performance mapping table by monitoring the voltage and output power of the battery module;

[0108] S17. Use a ring buffer structure to store the original video streams of each camera, and fuse the video streams based on the timestamp and the camera view identifier to generate multi-source video data.

[0109] By deploying a variable-frame-rate camera system in the target habitat, combining DGNSS positioning, point cloud modeling, and particle swarm optimization for site selection, a high-coverage, low-occlusion camera deployment strategy was achieved. Stripe structured light and AprilTag calibration were used for precise geometric calibration. Furthermore, the use of an electrically controlled liquid lens and a dynamic frame-rate control mechanism, combined with MPPT power supply components and PTPv2 clock synchronization, improved video capture's light adaptability, power supply stability, and time consistency in the wild, enabling highly reliable, multi-source, and high-resolution capture of raw bird behavior video.

[0110] In this embodiment, S2 specifically includes:

[0111] S21, accumulating the pixel-level absolute difference of each pair of adjacent frames in the multi-source video data and comparing it with the stillness discrimination threshold, extracting the corresponding frames of the frame pairs whose total pixel difference is less than or equal to the stillness discrimination threshold as key frames, and classifying the corresponding frames of other frame pairs as dynamic frames;

[0112] S22, using an integrated visible light and near-infrared spectral synchronous acquisition device to record ambient spectral distribution data, and linearly mapping and normalizing the pixel brightness in the key frames and dynamic frames based on the spectral distribution data and a pre-calibrated pixel-spectral response lookup table to generate a spectral correction frame set;

[0113] S23, dividing the spectral correction frame set into fixed time windows, for each time window, swapping the first frame and the Nth frame in the storage sequence to balance the time interval difference between the frames, and outputting a reconstructed time series;

[0114] S24. Construct a two-layer background cache canvas, where the first background canvas is updated every N1 frames for long-term static scene modeling, and the second background canvas is updated every N2 frames for short-term dynamic scene capture. The two layers of background canvas are fused using a pixel-level overlay strategy and pixel-by-pixel merge is performed with the reconstructed time series frames to obtain a foreground frame sequence.

[0115] S25, appending a chain metadata tag including a UTC timestamp, a camera number, an ambient light intensity, and an ambient temperature to each frame in the foreground frame sequence;

[0116] S26. Based on the camera number and the frame number, cross-merge the foreground frame sequence in the storage sequence according to the timestamp and the camera view label to generate pre-processed video data.

[0117] By distinguishing dynamic frames from static frames through pixel-level difference judgment, and combining spectral correction frame sets to improve image brightness consistency, the stability of video data in complex lighting environments is enhanced. At the same time, a two-layer background cache mechanism is constructed to achieve dynamic modeling and fusion of long-term background and short-term scenes, effectively improving the accuracy and continuity of foreground extraction. Combined with time window reconstruction, UTC timestamp tagging and camera number embedding, time alignment and feature unification of multi-source video sequences are achieved.

[0118] In this embodiment, S3 specifically includes:

[0119] S31. Input the pre-processed video data frame by frame into the YOLOv5s backbone network CSPDarknet, and perform layer-by-layer convolution processing through the cross-stage local connection structure and residual block stacking to obtain the initial feature map:

[0120]

[0121] in, represents the j-th output feature map of the l-th layer, represents the i-th input feature map of the l-1th layer, represents the convolution kernel weight connecting the i-th input feature map and the j-th output feature map, Represents the corresponding bias term, M j Represents the set of all input feature map indices connected to the j-th output feature map;

[0122] S32. Perform global average pooling and global maximum pooling on the initial feature map to obtain the average pooling feature of the channel dimension With the maximum pooling feature And perform feature normalization on each channel separately;

[0123] S33, respectively, the normalized average pooling features and max pooling features The channel attention weight vector M is obtained by independently transforming the multi-layer perceptron structure with the number of hidden layer neurons being 1 / 4 of the original number of channels, and then adding the transformed results channel by channel and activating them with the Sigmoid function. c (F):

[0124]

[0125] Where σ(·) represents the Sigmoid activation function;

[0126] S34, perform average pooling and maximum pooling on the feature map after channel attention enhancement along the channel dimension to generate a spatial feature matrix and And they are connected in series along the channel direction to form spatial attention fusion features;

[0127] S35, convolution operation is performed on the spatial attention fusion feature through a two-dimensional convolution kernel of size 7×7, the step size of the convolution kernel is 1, and the single-channel spatial attention weight matrix M is output. s (F):

[0128]

[0129] Among them, f 7×7 represents a 2D convolution operation of size 7 × 7, and σ(·) represents the Sigmoid activation function;

[0130] S36, the channel attention weight vector M c (F) Multiply the corresponding feature map channel by channel and add the spatial attention weight matrix M s (F) Multiplying the feature map by pixel position simultaneously achieves dual feature enhancement at the channel level and spatial level;

[0131] S37. Use the path aggregation network to fuse the feature maps of different scales after dual feature enhancement layer by layer to obtain a multi-scale fused feature map. Use the convolutional prediction regression network to predict the bounding box coordinates and category confidence of the multi-scale fused feature map and output the target detection result.

[0132] By introducing an improved module that integrates channel and spatial attention mechanisms into the YOLOv5 backbone network CSPDarknet, using multi-scale pooling and multi-layer perceptron to calculate channel attention weights, combining 7×7 two-dimensional convolution to generate a spatial attention weight map, and realizing joint enhancement processing of different channels and different spatial regions in the feature map, the network's feature perception ability for individual birds in occlusion, small targets and complex backgrounds is effectively improved, and the detection accuracy and robustness of the model in real environments are enhanced.

[0133] In this embodiment, the S4 specifically includes:

[0134] S41, taking the bird individuals detected in the target detection results as nodes, assigning spatial coordinates, detection bounding box size and current frame timestamp to each node;

[0135] S42, determining whether there is a dynamic connection relationship between any two nodes based on a spatial distance threshold and a time interval threshold between nodes, where the spatial distance threshold is defined as the sum of the mean and standard deviation of the distance between individual birds, and the time interval threshold is defined as an integer multiple of the interval between two consecutive video frames;

[0136] S43. For dynamically connected nodes, calculate the magnitude and direction angle of the relative velocity vector between the nodes. The direction angle is represented by the angle between the line connecting two adjacent bird individuals and the horizontal direction, and record the rate of change of the angle.

[0137] S44. Determine the strength and type of an edge based on the spatial distance between nodes and the rate of change of the direction angle of the relative velocity vector. The edge types include approaching, diverging, and parallel. The edge strength is the ratio of the modulus of the relative velocity vector between nodes to the spatial distance.

[0138] S45. Label each edge using a hybrid identifier defined by the edge strength and type, store the label together with the timestamp of the corresponding node, and construct a dynamic graph containing the spatiotemporal state history;

[0139] S46. Calculate the number of nodes, the proportion of edge types, and the variance of the velocity angle between the node and its neighboring nodes in the local neighborhood for each node in the dynamic graph, and aggregate the calculation results into node-level local features.

[0140] S47. Aggregate the node-level local features into a global vector in sequence to obtain a clustering state vector representing the dynamic characteristics of the group.

[0141] By constructing a dynamic graph structure with individual birds from target detection results as nodes, combining the spatial distance and time interval between nodes to determine dynamic edge relationships, and introducing the angular rate of change and relative velocity modulus to construct edge weights, the method accurately characterizes the neighborhood motion relationships and structural evolution characteristics within the flock. Furthermore, by calculating edge density, edge type ratio, and velocity distribution gradients in local regions, the method extracts multi-level group interaction features, ultimately forming a clustering state vector that represents the global collective motion trend, improving the accuracy of structured modeling and dynamic perception of group behavior.

[0142] In this embodiment, the S5 specifically includes:

[0143] S51, extract the spatial position coordinates and timestamps of each bird individual in the target detection results in the continuous video frames, and construct the flight trajectory sequence of each bird individual in chronological order. The flight trajectory sequence is expressed in the form of a five-tuple (x t ,y t ,v xt ,v yt ,t), where x t ,y t is the position coordinate, v xt ,v yt is the velocity vector component at the corresponding time point, and t is the timestamp;

[0144] S52, segmenting each flight trajectory sequence according to a time sliding window, with each trajectory segment having a length of a preset number of frames L, and performing first-order difference processing on the velocity vector in each trajectory segment to extract velocity change characteristics;

[0145] S53, the spatial coordinates, speed change characteristics and corresponding time code of each trajectory segment are combined to form a state vector S t , input to the low-level Actor network, and output the current action suggestion vector A t ;

[0146] S54: Construct an immediate reward function R, which is composed of a prediction accuracy reward term R acc , prediction timeliness reward item R time , Ecological Value Reward Item R eco and the continuous correct reward item R cont Linear weighted composition:

[0147] R = αR acc +βR time +γR eco +δR cont ;

[0148] Among them, α, β, γ, δ are weight coefficients;

[0149] S55, the prediction accuracy reward item R acc Defined as:

[0150]

[0151] S56, the prediction timeliness reward item R time Defined as the correct prediction t steps in advance, the value is R time = +2×t, where t≤5, the ecological value reward item R eco Defined as when reproduction or migration behavior is predicted, the value is R eco =+20;

[0152] S57, the continuous correct reward item R cont Defined as the correct prediction for consecutive c steps, the value is R cont =+c 2 ;

[0153] S58, using the experience-first replay mechanism to replay the state vector S t , action proposal vector A t , immediate reward R and next state vector S t+1 They are stored together in the experience replay pool and sorted by sampling priority according to the size of the TD error. The strategy is iteratively updated through the double-delay DDPG algorithm. The Critic network uses the minimum mean square error of the target value of the state-action pair as the loss function. The Actor network updates the parameters by maximizing the expected reward function and outputs the local short-term behavior decision results.

[0154] By constructing a low-level actor-critic strategy structure that takes a five-tuple sequence of flight trajectories as input and combining it with a local temporal segmentation and velocity change feature extraction mechanism, a state-action-reward mapping relationship is established. A weighted reward function, encompassing accuracy, timeliness, ecological value, and continuity, refines the evaluation criteria for individual behaviors and enhances the diversity and guidance of training signals. Combining a prioritized experience replay mechanism with TD error sorting sampling improves the training efficiency and stability of the low-level strategy for short-term behavior prediction tasks.

[0155] In this embodiment, S6 specifically includes:

[0156] S61. Calculate historical prediction error feedback vector E t , the historical prediction error feedback vector E t is the average value within the sliding window of the difference between the predicted position coordinates and the actual observed position coordinates;

[0157] S62, clustering state vector and historical prediction error feedback vector E t Perform vector splicing to generate the input state vector H of the high-level Actor network t ;

[0158] S63, with the state vector H t As input, the high-level Actor network outputs the current multi-step predicted action distribution probability vector P(a|H t ), the action distribution probability vector is a probability vector containing the predicted probabilities of the future multi-step action directions and speed amplitudes;

[0159] S64. Define the high-level immediate reward function R H , the high-level immediate reward function R His the weighted sum of the prediction accuracy reward and the prediction stability reward:

[0160] R H =ηR accH +θR stab ;

[0161] Among them, R accH Represents the prediction behavior accuracy reward, R stab is the prediction stability reward, which is defined as the inverse of the fluctuation amplitude of the prediction error within n consecutive steps, and η and θ are weight coefficients;

[0162] S65. Use the Actor-Critic algorithm to train the high-level Critic network and minimize the expected loss function corresponding to the action distribution probability vector in the Critic network:

[0163]

[0164] Among them, Q(H t ,a) is the input state vector H of the Critic network t and the value prediction function of action a;

[0165] S66, after the high-level Critic network converges, according to the action distribution probability vector P(a|H t ) Select the action sequence output with the highest probability as the global multi-step behavior prediction sequence.

[0166] By concatenating the group situation vector with historical prediction error feedback to form a state vector, the state vector is fed into a high-level actor network, which outputs the probability distribution of multi-step behavior actions. An immediate reward function is constructed based on prediction accuracy and stability, and an actor-critic method is introduced to train the high-level policy. This approach enhances the model's ability to dynamically model complex group behaviors, strengthens the policy's sensitivity and constraints to fluctuations in prediction errors, and ultimately achieves high-confidence predictions of future multi-step behavior direction and speed, improving the stability and accuracy of long-term behavior deduction.

[0167] In this embodiment, the S7 specifically includes:

[0168] S71. Calculate the position deviation Δ between the local short-term behavior decision result and the actual observation data local :

[0169]

[0170] Among them, (x li ,y li ) represents the local short-term predicted position of the i-th bird individual, (x reali ,y reali) represents the actual position of the corresponding bird individual, and N is the total number of bird individuals observed at the current moment;

[0171] S72, calculate the position deviation Δ between the global multi-step behavior prediction sequence and the actual observation data global :

[0172]

[0173] Among them, (x gj,t ,y gj,t ) represents the global multi-step predicted position of the j-th bird individual in the next t steps, (x realj,t ,y realj,t ) represents the corresponding actual position, M is the number of bird individuals, and T is the number of predicted steps;

[0174] S73, define the position deviation as the decision deviation E dec =Δ local and prediction error E pred =Δ global , set the decision deviation threshold Th dec and prediction deviation threshold Th pred , when E dec or E pred Automatically trigger online fine-tuning when the corresponding threshold is exceeded;

[0175] S74, based on the triggered deviation, the low-level Actor-Critic network parameters are updated through the deep deterministic policy gradient algorithm, where the loss function L of the Critic network is Q for:

[0176]

[0177] Target value y i The is:

[0178] y i =R i +γQ′(s i+1 ,μ′(s i+1 |θ μ′ )|θ Q′ );

[0179] Among them, Q(s i ,a i |θ Q ) represents the Critic network's response to state s i With action a i The value estimate of θ Q is the Critic network parameter, R iis the immediate reward, γ is the discount factor, Q′ and μ′ represent the target Critic network and the target Actor network respectively, θ Q′ and θ μ′ Respectively represent the corresponding target network parameters;

[0180] S75. Update the gradient through the Actor network policy to maximize the value estimation function output by the Critic network, where the Actor network policy gradient process is:

[0181]

[0182] Among them, μ(s i |θ μ ) indicates that the Actor network is in state s i The action output under θ μ Actor network parameters;

[0183] S76. Update the YOLOv5 target detection model parameters through the Adam optimization algorithm based on the deviation gradient of the local short-term behavior decision results and the global multi-step behavior prediction sequence.

[0184] By defining the position information deviation between local short-term behavior and global multi-step behavior prediction, and introducing a deviation threshold trigger mechanism, automatic fine-tuning of the policy network is achieved. The deep deterministic policy gradient algorithm is combined to update the low-level Actor-Critic network parameters. The YOLOv5 detection model parameters are further adjusted through the gradient descent and Adam optimization methods. The model achieves adaptive error correction in a continuous observation environment, effectively improving the system's ability to maintain prediction accuracy and adapt to dynamic environments during long-term operation.

[0185] Example 1: In order to verify the feasibility of the present invention in implementation, the present invention is applied to a bird ecological monitoring system in a certain prefecture-level region to predict in real time the flight behavior changes and collective dynamic trends of migratory bird groups during migration, so as to assist in the establishment of a local avian influenza risk early warning mechanism.

[0186] During the actual operation, the researchers deployed 12 cameras with automatic zoom and variable frame rate capabilities in the wetland protection area of ​​the migratory bird corridor, and used DGNSS and lidar point cloud for spatial calibration to ensure full coverage and low occlusion of the multi-camera deployment. The video data collected by all cameras are subjected to illumination correction, frame rate reconstruction and double-layer background modeling proposed by the present invention to form high-quality pre-processed video input. The target detection module uses the YOLOv5 network with an integrated dynamic CBAM attention mechanism, which can still achieve an average detection accuracy of 87.2% in scenes with an occlusion rate of more than 30%. The system then extracts group behavior vectors by constructing a dynamic graph neural network, and embeds the flight trajectory into the low-level Actor-Critic module to predict individual behavior. The high-level strategy module is constructed by combining historical errors and situation vectors to complete multi-step predictions.

[0187] During the model training phase, the TD3 and SAC algorithms were used to optimize both the upper and lower layer strategies. Online fine-tuning was performed based on a triggering mechanism based on prediction deviations, and joint parameter updates were performed using the Adam optimizer. On the 14th day after deployment, the system completed over 5,000 bird flock behavior prediction tasks, maintaining an average inference time of 34 milliseconds per frame and a system stability rate of 99.3%. Comparing actual observed and predicted trajectories, the average error in local behavior predictions was within ±0.21 meters, and the average error in global behavior predictions was within ±0.28 meters. The model maintained stable prediction capabilities even under dynamic climate conditions.

[0188] The following table shows the error comparison of some typical samples during the experiment and the change in system recall rate before and after fine-tuning:

[0189] Table 1 Comparison of sample error and recall rate before and after fine-tuning for migratory bird behavior prediction

[0190]

[0191] As can be seen from Table 1, in multiple groups of typical bird behavior samples, the system of the present invention demonstrated high consistency and reliability in both local trajectory prediction and group multi-step behavior trend prediction. The average difference between the trajectory error prediction value and the measured value did not exceed 0.14 meters, with a maximum deviation of 0.18 meters. The group behavior prediction error remained within the range of ±0.10 meters in all samples, indicating that the local Actor-Critic and high-level policy network combined with dynamic graph modeling can effectively capture the interactive characteristics of individual movement trends and the overall mobility of the group. In particular, in sample BSP-031, the difference between the group behavior prediction value and the measured error was only 0.05 meters, indicating that the high-level multi-step behavior distribution prediction network has good stability when facing dense group behavior.

[0192] Regarding model fine-tuning, a joint threshold-based triggering mechanism for local and global prediction deviations during online monitoring allows the system to adaptively initiate small-batch updates without interrupting the main process. For sample groups BSP-001 to BSP-046, the average recall before fine-tuning was 80.98%. After 8 to 10 rounds of online local backpropagation updates triggered by deviations, the average recall increased to 88.24%, a 7.26% improvement. The post-fine-tuning prediction results show a significant decrease in error fluctuations, demonstrating that the fine-tuning mechanism not only improves detection accuracy but also enhances the model's robustness to shifting data distributions.

[0193] Of particular note, on the 19th day of the system's deployment, two consecutive strong winds, reaching a maximum speed of 17.2 meters per second, caused sudden changes in the flock's movement direction and increased local obstruction, temporarily dropping detection accuracy to 78.4%. After identifying three consecutive frames of local behavioral deviation exceeding the threshold, the system automatically entered a high-frequency fine-tuning state, initiating eight rounds of reverse updates and performing gentle parameter replacements based on real-time data. Ultimately, accuracy recovered to 86.5% within approximately two minutes and remained at this level for approximately six hours, demonstrating the system's ability to stabilize and recover under dynamic environmental disturbances.

[0194] To further quantify the system's error correction effect and improved behavior prediction capabilities, experiments compared the performance of the traditional YOLOv5 detection + LSTM behavior prediction method with the YOLOv5-DCAM + Actor-Critic model proposed in this invention on the same dataset. The traditional method achieved an average local error of 3.74 meters and a global error of 6.01 meters in trajectory prediction, while the proposed method achieved an error reduction rate of 21.4% and 18.6%, respectively, of 2.94 meters and 4.89 meters. At the same time, the traditional method experienced a significant increase in false positives in scenarios with an occlusion rate exceeding 20%. However, by introducing a spatial attention enhancement structure and group dynamic structure modeling, the proposed solution kept the average false positive rate within 6.7%, resulting in more stable performance.

[0195] From the above analysis, it can be seen that the present invention not only maintains high-precision prediction capabilities for individual and group behavior under normal climatic conditions, but also demonstrates a good adaptive update mechanism in dynamically changing scenarios. Through continuous error feedback control, joint modeling strategies, and high-frequency fine-tuning processes, the system can effectively cope with typical field monitoring challenges such as long-term deployment, environmental uncertainty, and occlusion interference, and has good prospects for engineering applications. This embodiment fully verifies the comprehensive performance advantages of the present invention in non-invasive behavior perception, deep prediction optimization, and real-time model maintenance.

[0196] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field, within the technical scope disclosed by the present invention, who makes equivalent replacements or changes based on the technical solution and inventive concept of the present invention, should be covered by the scope of protection of the present invention.

Claims

1. A method for predicting the behavior of avian influenza host birds based on deep reinforcement learning, characterized in that: The following steps are involved: S1. Deploy multi-angle, variable frame rate cameras in the target habitat to collect raw video streams and obtain multi-source video data; S2, performing time sequence interpolation, ambient light normalization, and background modeling denoising processing on the multi-source video data to obtain preprocessed video data; S3, input the preprocessed video data into the improved YOLOv5 model to obtain the target detection results; S4. Based on the target detection results, a dynamic graph neural network is constructed with the detected bird individuals as nodes and the spatiotemporal position information and relative speed as edges, and the flocking situation vector is output; S5. Input the flight trajectory of individual birds in the target detection results into the low-level Actor-Critic strategy module to generate local short-term behavior decision results; S6, feeding the clustering situation vector and historical prediction error feedback into the high-level Actor-Critic strategy module to generate a global multi-step behavior prediction sequence; S7. Compare the local short-term behavior decision results and the global multi-step behavior prediction sequence with the actual bird behavior observation data collected in real time, calculate the decision deviation and prediction deviation, and trigger online fine-tuning based on the decision deviation and prediction deviation to update the YOLOv5 detection model and Actor-Critic strategy network parameters.

2. The method for predicting avian influenza host bird behavior based on deep reinforcement learning according to claim 1, characterized in that: Said S1 specifically includes: S11. Using DGNSS and ground reflectance markers to assist positioning, deploy several three-dimensional spatial control points within the target habitat. LiDAR and drone photogrammetry are integrated to obtain environmental point clouds and orthophotos. Target habitats include foraging, breeding, and migratory stopover sites for avian influenza host birds. S12. Using the environmental point cloud and orthophotos, calculate the three-dimensional polyhedron of each camera's field of view using a particle swarm optimization algorithm and determine the optimal installation position and pitch angle, where the pitch angle satisfies a field of view coverage greater than 98% and an occlusion probability less than 2%. S13. Fix the variable frame rate camera at the optimal installation position and perform internal and external parameter calibration using a combination of stripe structured light and an AprilTag calibration plate to obtain the focal length, principal point coordinates, and radial and tangential distortion coefficients of the variable frame rate camera. S14. Equip the variable frame rate camera with an electrically controlled liquid lens, wherein the electrically controlled liquid lens switches the focal length from 100 mm to 200 mm by adjusting the applied voltage, dynamically determines the region of interest based on image block histogram equalization analysis, and caches video frames of the corresponding region at a frequency of 30 fps; S15. Use the PTPv2 protocol in combination with the GNSS link for clock synchronization, and embed a drift correction algorithm in the clock synchronization process based on the wireless mesh network to correct the clock deviation in real time; S16. Equip each camera with an MPPT-controlled solar cell module and a lithium-ion battery storage module, and automatically adjust the video resolution and frame rate according to a preset power-performance mapping table by monitoring the voltage and output power of the battery module; S17. Use a ring buffer structure to store the original video streams of each camera, and fuse the video streams based on the timestamp and the camera view identifier to generate multi-source video data.

3. The method for predicting avian influenza host bird behavior based on deep reinforcement learning according to claim 1, characterized in that: The S2 specifically includes: S21, accumulating the pixel-level absolute difference of each pair of adjacent frames in the multi-source video data and comparing it with the stillness discrimination threshold, extracting the corresponding frames of the frame pairs whose total pixel difference is less than or equal to the stillness discrimination threshold as key frames, and classifying the corresponding frames of other frame pairs as dynamic frames; S22, using an integrated visible light and near-infrared spectral synchronous acquisition device to record ambient spectral distribution data, and linearly mapping and normalizing the pixel brightness in the key frames and dynamic frames based on the spectral distribution data and a pre-calibrated pixel-spectral response lookup table to generate a spectral correction frame set; S23, dividing the spectral correction frame set into fixed time windows, for each time window, swapping the first frame and the Nth frame in the storage sequence to balance the time interval difference between the frames, and outputting a reconstructed time series; S24. Construct a two-layer background cache canvas, where the first background canvas is updated every N1 frames for long-term static scene modeling, and the second background canvas is updated every N2 frames for short-term dynamic scene capture. The two layers of background canvas are fused using a pixel-level overlay strategy and pixel-by-pixel merge is performed with the reconstructed time series frames to obtain a foreground frame sequence. S25, appending a chain metadata tag including a UTC timestamp, a camera number, an ambient light intensity, and an ambient temperature to each frame in the foreground frame sequence; S26. Based on the camera number and the frame number, cross-merge the foreground frame sequence in the storage sequence according to the timestamp and the camera view label to generate pre-processed video data.

4. The method for predicting avian influenza host bird behavior based on deep reinforcement learning according to claim 1, characterized in that: The S3 specifically includes: S31. Input the pre-processed video data frame by frame into the YOLOv5s backbone network CSPDarknet, and perform convolution layer by layer through the cross-stage local connection structure and residual block stacking to obtain the initial feature map: in, represents the j-th output feature map of the l-th layer, represents the i-th input feature map of the l-1th layer, represents the convolution kernel weight connecting the i-th input feature map and the j-th output feature map, Represents the corresponding bias term, M j Represents the set of all input feature map indices connected to the j-th output feature map; S32. Perform global average pooling and global maximum pooling on the initial feature map to obtain the average pooling feature of the channel dimension With the maximum pooling feature And perform feature normalization on each channel separately; S33, respectively, the normalized average pooling features and max pooling features The channel attention weight vector M is obtained by independently transforming the multi-layer perceptron structure with the number of hidden layer neurons being 1 / 4 of the original number of channels, and then adding the transformed results channel by channel and activating them with the Sigmoid function. c (F): Where σ(·) represents the Sigmoid activation function; S34, perform average pooling and maximum pooling on the feature map after channel attention enhancement along the channel dimension to generate a spatial feature matrix and And they are connected in series along the channel direction to form spatial attention fusion features; S35, convolution operation is performed on the spatial attention fusion feature through a two-dimensional convolution kernel of size 7×7, the step size of the convolution kernel is 1, and the single-channel spatial attention weight matrix M is output. s (F): Among them, f 7×7 represents a 2D convolution operation of size 7 × 7, and σ(·) represents the Sigmoid activation function; S36, the channel attention weight vector M c (F) Multiply the corresponding feature map channel by channel and add the spatial attention weight matrix M s (F) Multiplying the feature map by pixel position simultaneously achieves dual feature enhancement at the channel level and spatial level; S37. Use the path aggregation network to fuse the feature maps of different scales after dual feature enhancement layer by layer to obtain a multi-scale fused feature map. Use the convolutional prediction regression network to predict the bounding box coordinates and category confidence of the multi-scale fused feature map and output the target detection result.

5. The method for predicting avian influenza host bird behavior based on deep reinforcement learning according to claim 1, characterized in that: The S4 specifically includes: S41, taking the bird individuals detected in the target detection results as nodes, assigning spatial coordinates, detection bounding box size and current frame timestamp to each node; S42, determining whether there is a dynamic connection relationship between any two nodes based on a spatial distance threshold and a time interval threshold between nodes, where the spatial distance threshold is defined as the sum of the mean and standard deviation of the distance between individual birds, and the time interval threshold is defined as an integer multiple of the interval between two consecutive video frames; S43. For dynamically connected nodes, calculate the magnitude and direction angle of the relative velocity vector between the nodes. The direction angle is represented by the angle between the line connecting two adjacent bird individuals and the horizontal direction, and record the rate of change of the angle. S44. Determine the strength and type of an edge based on the spatial distance between nodes and the rate of change of the direction angle of the relative velocity vector. The edge types include approaching, diverging, and parallel. The edge strength is the ratio of the modulus of the relative velocity vector between nodes to the spatial distance. S45. Label each edge using a hybrid identifier defined by the edge strength and type, store the label together with the timestamp of the corresponding node, and construct a dynamic graph containing the spatiotemporal state history; S46. Calculate the number of nodes, the proportion of edge types, and the variance of the velocity angle between the node and its neighboring nodes in the local neighborhood for each node in the dynamic graph, and aggregate the calculation results into node-level local features. S47. Aggregate the node-level local features into a global vector in sequence to obtain a clustering state vector representing the dynamic characteristics of the group.

6. The method for predicting avian influenza host bird behavior based on deep reinforcement learning according to claim 1, characterized in that: The S5 specifically includes: S51, extract the spatial position coordinates and timestamps of each bird individual in the target detection results in the continuous video frames, and construct the flight trajectory sequence of each bird individual in chronological order. The flight trajectory sequence is expressed in the form of a five-tuple (x t ,y t ,v xt ,v yt ,t), where x t ,y t is the position coordinate, v xt ,v yt is the velocity vector component at the corresponding time point, and t is the timestamp; S52, segmenting each flight trajectory sequence according to a time sliding window, with each trajectory segment having a length of a preset number of frames L, and performing first-order difference processing on the velocity vector in each trajectory segment to extract velocity change characteristics; S53, the spatial coordinates, speed change characteristics and corresponding time code of each trajectory segment are combined to form a state vector S t , input to the low-level Actor network, and output the current action suggestion vector A t ; S54: Construct an immediate reward function R, which is composed of a prediction accuracy reward term R acc , prediction timeliness reward item R time 、Ecological value reward item R eco and the continuous correct reward item R cont Linear weighted composition: R=αR acc +βR time +γR eco +δR cont ; Among them, α, β, γ, δ are weight coefficients; S55, the prediction accuracy reward item R acc Defined as: S56, the prediction timeliness reward item R time Defined as the correct prediction t steps in advance, the value is R time = +2×t, where t≤5, the ecological value reward item R eco Defined as when reproduction or migration behavior is predicted, the value is R eco =+20; S57, the continuous correct reward item R cont Defined as the correct prediction for consecutive c steps, the value is R cont =+c 2 ; S58, using the experience-first replay mechanism to replay the state vector S t , action proposal vector A t , immediate reward R and next state vector S t+1 They are stored together in the experience replay pool and sorted by sampling priority according to the size of the TD error. The strategy is iteratively updated through the double-delay DDPG algorithm. The Critic network uses the minimum mean square error of the target value of the state-action pair as the loss function. The Actor network updates the parameters by maximizing the expected reward function and outputs the local short-term behavior decision results.

7. The method for predicting avian influenza host bird behavior based on deep reinforcement learning according to claim 1, characterized in that: The S6 specifically includes: S61. Calculate historical prediction error feedback vector E t , the historical prediction error feedback vector E t is the average value within the sliding window of the difference between the predicted position coordinates and the actual observed position coordinates; S62, clustering state vector and historical prediction error feedback vector E t Perform vector splicing to generate the input state vector H of the high-level Actor network t ; S63, with the state vector H t As input, the high-level Actor network outputs the current multi-step predicted action distribution probability vector P(a|H t ), the action distribution probability vector is a probability vector containing the predicted probabilities of the future multi-step action directions and speed amplitudes; S64. Define the high-level immediate reward function R H , the high-level immediate reward function R H It is the weighted sum of the prediction accuracy reward and the prediction stability reward; S65, use the Actor-Critic algorithm to train the high-level Critic network, minimize the expected loss function corresponding to the action distribution probability vector in the Critic network, and after the high-level Critic network converges, according to the action distribution probability vector P(a|H t ) Select the action sequence output with the highest probability as the global multi-step behavior prediction sequence.

8. The method for predicting avian influenza host bird behavior based on deep reinforcement learning according to claim 1, characterized in that: The S7 specifically includes: S71. Calculate the position deviation Δ between the local short-term behavior decision result and the actual observation data l ocal; S72, calculate the position deviation Δ between the global multi-step behavior prediction sequence and the actual observation data g lobal; S73, define the position deviation as the decision deviation E dec =Δ local and prediction error E pred =Δ global , set the decision deviation threshold Th dec and prediction deviation threshold Th pred , when E dec or E pred Automatically trigger online fine-tuning when the corresponding threshold is exceeded; S74, based on the triggered deviation, the low-level Actor-Critic network parameters are updated through the deep deterministic policy gradient algorithm, where the loss function L of the Critic network is Q for: Target value y i The is: y i =R i +γQ ′ (s i+1 ,m ′ (s i+1 |θ μ′ )|θ Q′ ); Among them, Q(s i ,a i |θ Q ) represents the Critic network's response to state s i With action a i The value estimate of θ Q is the Critic network parameter, R i is the immediate reward, γ is the discount factor, Q′ and μ′ represent the target Critic network and the target Actor network respectively, θ Q′ and θ μ′ Respectively represent the corresponding target network parameters; S75. Update the gradient through the Actor network policy to maximize the value estimation function output by the Critic network, where the Actor network policy gradient process is: Among them, μ(s i |θ μ ) indicates that the Actor network is in state s i The action output under θ μ Actor network parameters; S76. Update the YOLOv5 target detection model parameters through the Adam optimization algorithm based on the deviation gradient of the local short-term behavior decision results and the global multi-step behavior prediction sequence.

Citation Information

Patent Citations

  • Power transmission line bird detection method and system based on digital twinning, medium and equipment

    CN117351521A

  • Natural environment bird monitoring method based on multi-modal fusion deep learning and computer device

    CN119027775A

  • Scene-adaptive bird disease directional management and control method and platform

    CN119294869A

  • Design and development of ultrasonic bird repellent system for agricultural applications.

    IN202221045856A

Cited By

  • Bird impact risk real-time early warning method and system based on video stream analysis

    CN121330885A

  • DGNN-based laser radar airport bird flock detection and early warning method and system

    CN121522660A