A method and system for detecting, tracking and warning of wild animals
By combining adaptive processing of image acquisition and environmental perception with a lightweight AI model at the edge, high-precision detection and tracking of wild animals has been achieved. This solves the problems of low recognition accuracy, high latency, and poor reliability in existing technologies, improves the real-time performance and automation of the system, and reduces operating costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JIANGSU OCEAN UNIV
- Filing Date
- 2026-03-23
- Publication Date
- 2026-07-31
AI Technical Summary
Existing technologies for wildlife monitoring suffer from problems such as a sharp drop in identification accuracy, low value of monitoring data, inability to perform individualized tracking, high latency and insufficient real-time early warning capabilities, over-reliance on networks, and poor reliability.
By employing image acquisition and environmental perception to trigger together, real-time target detection using a lightweight AI model, multi-target tracking and trajectory management, boundary crossing event judgment and early warning generation, and combined with a disconnection resume mechanism, an intelligent monitoring system for the edge is formed.
It achieves high-precision target detection and tracking in complex environments, reduces latency and false alarm rate, improves system reliability and automation, and reduces network dependence and operating costs.
Smart Images

Figure CN122493349A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer vision and Internet of Things technology, specifically relating to a method and system for detecting, tracking and warning of wild animals. Background Technology
[0002] In ecological research and protected area management, continuous and efficient monitoring of wildlife is crucial. Currently, utilizing technological means for automated wildlife monitoring to replace inefficient manual patrols has become the mainstream direction in ecological protection and research. Among these, the existing technologies closest to this invention mainly fall into the following two categories:
[0003] First, edge-device-based rule-triggered monitoring schemes attempt to reduce bandwidth consumption by performing preliminary processing at the edge. For example, a common technique uses passive infrared sensors or simple dynamic pixel change detection as trigger conditions; the device only captures an image or starts recording when movement or a change in the scene is detected. Its drawbacks are: inaccurate triggering and extremely high false alarm rate: infrared sensors cannot distinguish between animals, swaying branches, or changes in light and shadow; simple dynamic detection is easily affected by weather (such as rain and snow) and changes in lighting, leading to frequent triggering by numerous irrelevant events, generating massive amounts of invalid data, and failing to address the power consumption and bandwidth issues. Lack of intelligent recognition capabilities: this scheme can only sense "movement," but cannot identify "what kind of movement." For monitoring personnel, this still requires manual screening of a large number of images or videos, which is inefficient and cannot achieve truly automated early warning. Inability to achieve continuous tracking: single-trigger capture cannot continuously maintain the identity and track the trajectory of moving targets, and cannot provide continuous behavioral data on "a specific individual moving from point A to point B."
[0004] Second: A cloud-based intelligent analysis solution, which is a background technology more closely related to this invention. This solution, based on traditional video surveillance, transmits the video stream entirely to a remote cloud server via a network (such as 4G / WiFi), where the powerful computing resources of the server run an artificial intelligence model for image analysis. Related research can be found in review articles such as "Edge Computing: Vision and Challenges," which describe cloud computing paradigms. While this technical solution achieves intelligence, it still has the following inherent drawbacks: High network bandwidth dependence and high latency: High-definition video streams have extremely high network bandwidth requirements, making transmission difficult and costly in environments with unstable network signals, such as the outdoors. The long data transmission link from acquisition to cloud processing and result return leads to high overall system latency, making it difficult to meet the needs of real-time tracking and immediate early warning. System reliability is constrained by the network: Once the network is interrupted, the entire system is paralyzed, unable to perform any local intelligent analysis and decision-making, lacking autonomy.
[0005] In summary, existing intelligent monitoring solutions suffer from high latency, high cost, and poor reliability due to their architectural design, or high false alarm rates, limited functionality, and low automation due to rudimentary triggering and identification mechanisms. Therefore, there is an urgent need in this field for an intelligent monitoring method and system that can achieve low latency, high accuracy, and continuous target tracking capabilities at resource-constrained edge computing environments. Summary of the Invention
[0006] The purpose of this invention is to design a method and system for detecting, tracking and warning of wild animals, and to solve the problems of sharp drop in identification accuracy, low value of monitoring data, inability to track individuals, high latency and insufficient real-time warning capabilities, as well as over-reliance on networks and poor reliability in continuous and efficient monitoring of wild animals in complex environments.
[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0008] A method for detecting, tracking, and issuing early warnings for wild animals, the method being as follows:
[0009] S1: Image acquisition and environmental perception coordinated triggering: synchronously acquire real-time video streams and environmental sensor data of the monitoring area, and align the timestamps of each frame of image and its corresponding sensor data to form the original data packet;
[0010] S2: Adaptive image preprocessing for environmental awareness: Quality assessment of image frames in the original data packet, and dynamic selection and execution of corresponding image enhancement algorithms based on sensor data and quality assessment results to obtain enhanced images;
[0011] S3: Real-time object detection using a lightweight AI model: A lightweight object detection model is deployed on an edge device with enhanced image input to obtain the object's bounding box and category information;
[0012] S4: Multi-target tracking and trajectory management: Input the detection box and category information into the multi-target tracker, associate motion prediction with data, assign and maintain a unique identification code for each detected target, and output the tracking result containing the identification code;
[0013] S5: Boundary Crossing Event Judgment and Warning Generation: Based on preset rules and tracking results, determine whether a specific event has occurred, and generate an alarm record containing the target identification code, category, and location information when the event occurs;
[0014] S6: Disconnection Resumption and Data Reporting: Alarm records and tracking results are encapsulated as structured data. Based on network status judgment, the system selects to upload the data to the cloud or local cache in real time, and performs disconnection resumption after the network is restored.
[0015] Furthermore, the specific method in step S1 is as follows:
[0016] S11: Image frame capture, captures the video stream of the monitored area in real time through the camera, starts an independent data acquisition thread, and reads image frames in a loop;
[0017] S12: Environmental data acquisition, continuously reading environmental data through temperature and humidity sensors;
[0018] S13: Spatiotemporal alignment and association: Establish an association mapping between each successfully captured image frame and the sensor data corresponding to its timestamp, forming a unified raw data packet, which provides a data foundation for subsequent image enhancement based on environmental context.
[0019] Furthermore, the specific methods in step S2 are as follows:
[0020] S21: Image quality assessment, performs real-time quality assessment on the original image frame, and calculates its key quality indicators such as brightness, contrast, and sharpness.
[0021] S22: Distortion correction. Using the pre-calibrated camera intrinsic parameter matrix and distortion coefficients, the original image is processed by the cv2.undistort function to correct the geometric deformation caused by the lens and output the corrected image.
[0022] S23: Adaptive Enhanced Decision and Execution. Based on environmental sensor data and quality indicators, dynamically execute condition judgment and processing. Judgment condition C1: If the humidity threshold > 80%, the environment is determined to be foggy, and a dehazing algorithm based on dark channel prior is automatically launched. This algorithm calculates the dark channel, estimates atmospheric light value and transmittance, and finally recovers a fog-free image. Judgment condition C2: If the brightness threshold < 50%, the ambient light is determined to be insufficient, and adaptive histogram equalization is automatically performed on the L channel in the LAB color space to improve image details and contrast under low light conditions and output an enhanced image.
[0023] S24: Resolution unification: All processed image frames are uniformly scaled to a standard resolution of 1280×720 to ensure the consistency of the input size for subsequent AI models.
[0024] Furthermore, the real-time target detection of the lightweight AI model in S3 includes model loading and inference, and filters out low-confidence targets below a preset detection threshold.
[0025] Furthermore, the specific methods for multi-target tracking and trajectory management in S4 are as follows:
[0026] S41: Data Association: Using the Hungarian algorithm, calculate the association cost matrix between the predicted tracking trajectory and the actual detection box in the current frame, and solve for the optimal matching relationship;
[0027] S42: Tracking state update. Based on the matching results: For successfully matched detection boxes, update their corresponding tracking trajectories and correct the state of the Kalman filter using the new detection information; for unmatched detection boxes, create new tracking trajectories for them; for unmatched predicted trajectories, mark them as "lost" once; if they are lost more than max_lost times consecutively, terminate the tracking.
[0028] S43: Identification and Output: Assign and maintain a unique identification code ID for each active tracking trajectory, and output the tracking results of the current frame, which includes the ID of each target and its normalized center point coordinates.
[0029] Furthermore, the method for determining and generating warnings for boundary crossing events in S5 is as follows: one or more polygonal regions are preset as electronic fences in the normalized coordinate system of the video image; for each tracked target, it is determined in real time whether its preset representative point is located outside the electronic fence; if so, it is determined that the target has crossed the boundary and the alarm record is generated.
[0030] A system for detecting, tracking, and issuing early warnings for wild animals, used to implement the method, is characterized by comprising edge monitoring devices deployed at the monitoring site and a remote cloud service center; the edge monitoring devices include: an image acquisition unit for real-time capture of video streams of the monitoring area; an environmental sensing unit for real-time acquisition of environmental data; a main control computing unit connected to the image acquisition unit and the environmental sensing unit respectively, for executing the adaptive image preprocessing and quality enhancement steps, lightweight target detection steps, multi-target tracking and trajectory management steps, and intelligent event judgment and early warning steps, and generating structured data; a communication unit connected to the main control computing unit, for uploading the structured data when the network is unobstructed, and for local caching and resuming transmission when the network is interrupted; the cloud service center is used to receive, store, and display the data uploaded by the edge monitoring devices.
[0031] The above technical solution can achieve the following beneficial effects:
[0032] This invention deeply integrates and redesigns several independent technologies, including dynamic image quality assessment, adaptive enhancement of environmental perception, lightweight AI target detection, and multi-target tracking based on deep correlation metrics, on a specific edge computing hardware platform. This forms a closed-loop, data-driven, automated intelligent monitoring system. This integration is not simply a matter of adding functions together; rather, it drives image preprocessing strategies through environmental data feedback and allows tracking results to directly serve intelligent event judgment, resulting in a synergistic effect that improves the overall system's environmental adaptability and automation level.
[0033] To address the limited computing resources of edge devices, instead of directly using the massive YOLOv5s model, the SSD Lite-MobilenetV3 model, which has a smaller computational load and is more suitable for mobile devices, was selected and converted to .tflite format to ensure real-time operation on low-power devices. Under the DeepSORT framework, by optimizing the state vector of the Kalman filter and the correlation cost matrix calculation of the Hungarian algorithm, it can still maintain a high ID switching accuracy in complex scenarios with frequent occlusion by wild animals and similar appearances.
[0034] The architecture, which primarily relies on the cloud for intelligent analysis, has been transformed into a hybrid architecture of "core analysis at the edge + data aggregation in the cloud." Specifically, computationally intensive tasks such as target detection and multi-target tracking are moved from cloud servers to edge computing devices at the front end. Simultaneously, through local data caching queues and network status awareness mechanisms, the system is endowed with the ability to operate autonomously during network outages, significantly improving reliability in harsh network environments in the wild.
[0035] In summary, the improvement of this invention addresses the core pain points of existing technologies in four dimensions—real-time performance, reliability, environmental adaptability, and data value—through a deep integration, edge-first, and environment-adaptive technical approach, thereby achieving a qualitative improvement in the overall performance of the monitoring system. Attached Figure Description
[0036] Figure 1 It's a flowchart.
[0037] Figure 2 This is a schematic diagram of the overall hardware architecture and deployment of the system provided in the embodiment.
[0038] Figure 3 This is a detailed flowchart of the image preprocessing and enhancement module provided in an embodiment of the present invention.
[0039] Figure 4 This is a detailed flowchart of the AI detection and tracking module provided in this embodiment of the invention.
[0040] Figure 5 This is a schematic diagram of the interface layout of the front-end remote monitoring dashboard provided in an embodiment of the present invention. Detailed Implementation
[0041] The invention will be further described below with reference to the accompanying drawings:
[0042] like Figure 1 As shown, a method for detecting, tracking, and issuing early warnings for wild animals is described below:
[0043] S1: Image acquisition and environmental perception coordinated triggering: synchronously acquire real-time video streams and environmental sensor data of the monitoring area, and align the timestamps of each frame of image and its corresponding sensor data to form the original data packet;
[0044] S2: Adaptive image preprocessing for environmental awareness: Quality assessment of image frames in the original data packet, and dynamic selection and execution of corresponding image enhancement algorithms based on sensor data and quality assessment results to obtain enhanced images;
[0045] S3: Real-time object detection using a lightweight AI model: A lightweight object detection model is deployed on an edge device with enhanced image input to obtain the object's bounding box and category information;
[0046] S4: Multi-target tracking and trajectory management: Input the detection box and category information into the multi-target tracker, associate motion prediction with data, assign and maintain a unique identification code for each detected target, and output the tracking result containing the identification code;
[0047] S5: Boundary Crossing Event Judgment and Warning Generation: Based on preset rules and tracking results, determine whether a specific event has occurred, and generate an alarm record containing the target identification code, category, and location information when the event occurs;
[0048] S6: Disconnection Resumption and Data Reporting: Alarm records and tracking results are encapsulated as structured data. Based on network status judgment, the system selects to upload the data to the cloud or local cache in real time, and performs disconnection resumption after the network is restored.
[0049] The specific method in step S1 is as follows:
[0050] S11: Image frame capture, captures the video stream of the monitored area in real time through the camera, starts an independent data acquisition thread, and reads image frames in a loop;
[0051] S12: Environmental data acquisition, continuously reading environmental data through temperature and humidity sensors;
[0052] S13: Spatiotemporal alignment and association: Establish an association mapping between each successfully captured image frame and the sensor data corresponding to its timestamp, forming a unified raw data packet, which provides a data foundation for subsequent image enhancement based on environmental context.
[0053] The specific method in step S2 is as follows:
[0054] S21: Image quality assessment, performs real-time quality assessment on the original image frame, and calculates its key quality indicators such as brightness, contrast, and sharpness.
[0055] S22: Distortion correction. Using the pre-calibrated camera intrinsic parameter matrix and distortion coefficients, the original image is processed by the cv2.undistort function to correct the geometric deformation caused by the lens and output the corrected image.
[0056] S23: Adaptive Enhanced Decision and Execution. Based on environmental sensor data and quality indicators, dynamically execute condition judgment and processing. Judgment condition C1: If the humidity threshold > 80%, the environment is determined to be foggy, and a dehazing algorithm based on dark channel prior is automatically launched. This algorithm calculates the dark channel, estimates atmospheric light value and transmittance, and finally recovers a fog-free image. Judgment condition C2: If the brightness threshold < 50%, the ambient light is determined to be insufficient, and adaptive histogram equalization is automatically performed on the L channel in the LAB color space to improve image details and contrast under low light conditions and output an enhanced image.
[0057] S24: Resolution unification: All processed image frames are uniformly scaled to a standard resolution of 1280×720 to ensure the consistency of the input size for subsequent AI models.
[0058] The real-time target detection of the lightweight AI model in S3 includes model loading and inference, and filters out low-confidence targets below a preset detection threshold.
[0059] The specific methods for multi-target tracking and trajectory management in S4 are as follows:
[0060] S41: Data Association: Using the Hungarian algorithm, calculate the association cost matrix between the predicted tracking trajectory and the actual detection box in the current frame, and solve for the optimal matching relationship;
[0061] S42: Tracking state update. Based on the matching results: For successfully matched detection boxes, update their corresponding tracking trajectories and correct the state of the Kalman filter using the new detection information; for unmatched detection boxes, create new tracking trajectories for them; for unmatched predicted trajectories, mark them as "lost" once; if they are lost more than max_lost times consecutively, terminate the tracking.
[0062] S43: Identification and Output: Assign and maintain a unique identification code ID for each active tracking trajectory, and output the tracking results of the current frame, which includes the ID of each target and its normalized center point coordinates.
[0063] The method for determining and generating warnings for boundary crossing events in S5 is as follows: One or more polygonal regions are preset as electronic fences in the normalized coordinate system of the video frame; for each tracked target, it is determined in real time whether its preset representative point is located outside the electronic fence; if so, it is determined that the target has experienced a boundary crossing event, and the alarm record is generated.
[0064] Example:
[0065] The system hardware platform of this embodiment includes: an edge computing device (using the Fibocom SC171 development kit), an image acquisition device (USB camera), an environmental sensor (temperature and humidity sensor), and a network communication module (4G / WiFi module).
[0066] Figure 2 The figure in the middle shows the physical composition and deployment of the system of the present invention, including three main parts: edge monitoring equipment, communication network and cloud service center, as well as the connection and data flow relationship between them. Figure 3 This is a detailed flowchart of the image preprocessing and enhancement module provided in this embodiment of the invention. This diagram shows in detail the operation sequence and judgment logic of the image preprocessing stage, including key steps such as distortion correction, dehazing based on environmental sensing data, and low-light enhancement. Figure 4 This is a detailed flowchart of the AI detection and tracking module provided in the embodiment. This diagram highlights the core algorithm processes for target detection, cross-frame tracking (correlation of Kalman filter prediction and Hungarian algorithm), and boundary violation event judgment. Figure 5 This is a schematic diagram of the interface layout of the front-end remote monitoring dashboard provided in an embodiment of the present invention. This diagram shows the layout of the web monitoring interface used by the end user, including key UI components such as the main video stream display area, sensor data panel, and event log list.
[0067] The specific operating method is as follows:
[0068] (1) Co-triggered image acquisition and environmental perception and data alignment
[0069] Step S201 (Image Frame Capture): Capture the video stream of the monitored area in real time at a resolution of 640×480 using a USB camera. To reduce system latency, set the video buffer size to 1 (cv2.CAP_PROP_BUFFERSIZE = 1) and start a separate data acquisition thread to read image frames in a loop.
[0070] Step S202 (Environmental Data Acquisition): Continuously read environmental data using temperature and humidity sensors. The sensor data frame format is [0xAA, Humidity, Temperature, 0xBB, Switch Status]. The system obtains accurate humidity percentage (%RH) and temperature value (°C) in real time by parsing the serial port data stream.
[0071] Step S203 (Spatiotemporal Alignment and Association): Establish an association mapping between each successfully captured image frame and the sensor data sensor_data corresponding to its timestamp, forming a unified raw data packet, which provides a data foundation for subsequent image enhancement based on environmental context.
[0072] (2) Adaptive image preprocessing and quality enhancement based on environment perception
[0073] Step S204 (Image Quality Assessment): Perform real-time quality assessment on the original image frame and calculate key quality indicators such as brightness (pixel grayscale mean), contrast (grayscale standard deviation), and sharpness (Laplacian operator variance).
[0074] Step S205 (Distortion Correction): Using the pre-calibrated camera intrinsic matrix CAMERA_MATRIX and distortion coefficients DIST_COEFFS, the original image is distorted using the cv2.undistort function to correct the geometric distortion caused by the lens and output the corrected image.
[0075] Step S206 (Adaptive Enhanced Decision-Making and Execution): This is the core innovative step. The system dynamically performs condition judgments and processing based on environmental sensor data and quality indicators.
[0076] Judgment condition C1: If sensor_data.humidity > 80 (humidity threshold), the environment is determined to be foggy, and a dehazing algorithm based on dark channel prior is automatically initiated. This algorithm calculates the dark channel, estimates atmospheric light value and transmittance, and finally recovers the fog-free image.
[0077] Judgment condition C2: If frame_metrics.brightness < 50 (brightness threshold), then the ambient light is insufficient. Automatic adaptive histogram equalization is performed on the L channel in the LAB color space to improve the image details and contrast under low light conditions and output an enhanced image.
[0078] Step S207 (Resolution Unification): Scale all processed image frames, regardless of the enhancement path, to a standard resolution of 1280×720 to ensure consistent size of subsequent AI model inputs.
[0079] (3) Real-time target detection and result filtering based on lightweight AI model
[0080] Step S208 (Model Loading and Inference): Load and run the optimized lightweight object detection model ssdlite_mobilenet_v3.tflite on the edge device. Input a uniform resolution image into the model, perform forward inference, and obtain the model's raw output, including the bounding box locations (raw boxes), class probabilities (raw scores), and class indices (raw classes) for multiple objects.
[0081] Step S209 (Detection Result Filtering): Based on the preset detection threshold DETECTION_THRESHOLD (default 0.6), filter out low-confidence detection targets with original scores below this threshold. For the retained valid detection results, map their category index to specific animal category names (such as "zebra", "deer") to form a preliminary, reliable target list valid_detections = [ (box, score, class) ... ].
[0082] (4) Multi-target tracking and trajectory management based on DeepSORT
[0083] Step S210 (Tracker Initialization and Update): Initialize the DeepSORT tracker and set the maximum number of lost frames max_lost=3. Input the valid detection boxes detections_bbox (composed of boxes in valid_detections) of the current frame into the tracker.
[0084] Step S211 (Motion Trajectory Prediction): The DeepSORT kernel uses Kalman filtering to predict the expected position of each existing tracking trajectory in the current frame based on the state of each trajectory in the previous frame.
[0085] Step S212 (Data Association): Using the Hungarian algorithm, calculate the association cost matrix (usually based on appearance features and Mahalanobis distance) between the predicted tracking trajectory and the actual detection box in the current frame, and solve for the optimal matching relationship.
[0086] Step S213 (Tracking Status Update): Based on the matching results:
[0087] For a successfully matched detection box, update its corresponding tracking trajectory and use the new detection information to correct the state of the Kalman filter.
[0088] For unmatched detection boxes, create a new tracking trajectory for them.
[0089] For a predicted trajectory that does not match, mark it as "lost" once. If the trajectory is lost more than max_lost times consecutively, the trajectory will be terminated.
[0090] Step S214 (Identification Assignment and Output): Assign and maintain a unique identification code (ID) for each active tracking trajectory. Output the tracking result of the current frame: tracked_objects = {object_id: centroid,...}, which contains the ID of each target and its normalized center point coordinates.
[0091] (5) Intelligent event judgment and early warning generation based on virtual electronic fence
[0092] Step S215 (Electronic Fence Setting): In the normalized coordinate system (range 0 to 1) of the video screen, a polygonal area is preset as a virtual electronic fence, and its vertex coordinates are defined as BOUNDARY_COORDS = np.array([[0.1,0.1], [0.9, 0.1], [0.9, 0.9], [0.1, 0.9]]).
[0093] Step S216 (Boundary Crossing Detection): For each tracked target, calculate the bottom center point of its bounding box in real time: bottom_center = ((box[0] + box[2]) / 2, box[3]). Use the cv2.pointPolygonTest method to determine whether the point is outside the electronic fence polygon. If it is outside, the target is determined to have crossed the boundary.
[0094] Step S217 (Alarm Generation and Recording): Once the boundary crossing condition is triggered, a structured alarm event record is immediately generated. This record includes: target ID, target category, confidence level, precise timestamp, boundary crossing location information, and event type (e.g., "boundary crossing").
[0095] (6) Edge-to-cloud data transmission with disconnection resumption capability
[0096] Step S218 (Structured Data Encapsulation): Encapsulate the detection results, tracking results, sensor data, and alarm events into lightweight JSON-formatted structured data.
[0097] Step S219 (Network Status Judgment and Transmission Decision): The system continuously monitors the network connection status.
[0098] If the network is working properly: Publish structured data to a specified topic (such as edge / detection) in the cloud via the MQTT protocol; at the same time, upload keyframe images with AI analysis results overlaid to the cloud server via the HTTP protocol.
[0099] If the network is interrupted: Store the data packets to be sent into the local first-in-first-out buffer queue and start the timed retry mechanism.
[0100] Step S220 (Resume Disconnection): When the system detects that the network has recovered, it automatically retrieves the cached data packets from the cache_queue and retransmits them to ensure the final integrity of the data under adverse network conditions.
[0101] (7) Remote data aggregation and visual monitoring
[0102] Step S221 (Cloud Data Reception and Storage): The cloud service subscribes to the MQTT topic and listens to the HTTP interface to receive data uploaded by edge devices, parses it, stores it in the time series database, and provides a historical data query interface.
[0103] Step S222 (Web Visualization): A real-time video stream (MJPEG format) and dynamically updated structured data are pushed to the user's browser via a B / S architecture web server. The main area of the user interface displays the real-time video, while the sidebar dynamically updates sensor readings, a list of detected targets, and event logs, enabling remote read-only monitoring.
[0104] Through the above-described complete technical solution, the present invention brings the following significant beneficial effects:
[0105] The system demonstrates significant advantages in adaptability to complex environments by introducing an environment-aware adaptive image enhancement process, enabling it to proactively cope with adverse imaging conditions. Specifically, it automatically defogs when ambient humidity exceeds a threshold and automatically enhances low-light performance when image brightness is insufficient. This allows the subsequent AI model to maintain high-precision detection capabilities even in scenarios where the recognition rate of traditional methods drops sharply, such as rain, fog, and dusk. This effect directly addresses the high false alarm rate caused by environmental interference in the background technology's [edge device rule-triggered monitoring scheme]. This is based on the "image preprocessing and adaptive quality enhancement" module integrated into the technical solution. This module dynamically switches preprocessing strategies by calculating image quality indicators (brightness, contrast, etc.) in real time and coupling them with sensor data.
[0106] In terms of the beneficial effects on monitoring data value and automation, this invention achieves a leap from "target discovery" to "identification and continuous tracking of specific individuals." By integrating the DeepSORT multi-target tracking algorithm, the system can assign a unique ID to each animal target and maintain tracking across frames. In testing, the accuracy rate (IDF1 score) for maintaining the identity of multiple animals within a video sequence reached 92.3%, providing continuous behavioral trajectory data at the individual level for ecological research, completely changing the limitation of traditional solutions that can only provide isolated snapshots. This effect solves the shortcomings of existing solutions in the background technology [inability to continuously maintain the identity and track the motion trajectory of specific targets across frames]. This is based on the "deepSORT-based multi-target tracking and trajectory management" step in the technical solution, which achieves accurate and stable tracking through Kalman filter prediction and Hungarian algorithm correlation.
[0107] The system demonstrates significant benefits in real-time performance and edge intelligence by deploying the complete lightweight AI model (SSDLite-MobilenetV3) and multi-target tracking algorithm locally on the edge device, eliminating network latency associated with remote video data transmission to the cloud. In a standard laboratory testing environment (edge device: Fibocom SC171), the average end-to-end latency from acquiring a single image frame to generating analysis results (including detection, tracking, and event judgment) remains consistently within 250-300 milliseconds, meeting the requirements for real-time early warning in the field. This effect directly addresses the second-level latency issue caused by network transmission in the background technology of [intelligent monitoring solutions based on cloud server analysis]. This data is derived from actual measurements and summations of the processing times of each module within the system.
[0108] The present invention offers significant advantages in system reliability and network robustness by providing edge intelligence and the ability to resume transmission after a network outage. During a network interruption, the system temporarily stores all event records and critical image data using a local cache queue mechanism, while the core monitoring and identification functions continue to operate locally. Once the network is restored, the system automatically attempts to retransmit the cached data, significantly reducing the risk of data loss due to network fluctuations. This effect addresses the deficiency of cloud-based solutions in the prior art, which suffer from complete functional paralysis during network interruptions. This is based on the explicitly designed cache queue and automatic reconnection mechanism within the "data storage and transmission with resume capability" step of the technical solution.
[0109] Regarding the benefits in terms of energy consumption and operating costs, since only structured result data (such as target location, category, ID, and other text information) is processed and uploaded at the edge, rather than the entire high-definition video stream, it is estimated that a single device can reduce cloud data traffic by approximately 95% per month. Simultaneously, cloud servers do not need to deploy large-scale GPU computing resources for real-time video analysis, significantly reducing the total cost of ownership and long-term operating bandwidth costs. This effect is a direct improvement on the high bandwidth dependence and cost issues of cloud solutions in the background technology. The data reduction percentage was calculated by comparing the bandwidth for transmitting raw video streams with the bandwidth for transmitting structured data such as JSON.
[0110] The above descriptions are all preferred embodiments of the present invention. For those skilled in the art, any modifications to the present invention in various equivalent forms without departing from the principle of the present invention shall fall within the protection scope of the appended claims.
Claims
1. A method for detecting, tracking, and issuing early warnings for wild animals, characterized in that: The method is as follows: S1: Image acquisition and environmental perception coordinated triggering: synchronously acquire real-time video streams and environmental sensor data of the monitoring area, and align the timestamps of each frame of image and its corresponding sensor data to form the original data packet; S2: Adaptive image preprocessing for environmental awareness: Quality assessment of image frames in the original data packet, and dynamic selection and execution of corresponding image enhancement algorithms based on sensor data and quality assessment results to obtain enhanced images; S3: Real-time object detection using a lightweight AI model: A lightweight object detection model is deployed on an edge device with enhanced image input to obtain the object's bounding box and category information; S4: Multi-target tracking and trajectory management: Input the detection box and category information into the multi-target tracker, associate motion prediction with data, assign and maintain a unique identification code for each detected target, and output the tracking result containing the identification code; S5: Boundary Crossing Event Judgment and Warning Generation: Based on preset rules and tracking results, determine whether a specific event has occurred, and generate an alarm record containing the target identification code, category, and location information when the event occurs; S6: Disconnection Resumption and Data Reporting: Alarm records and tracking results are encapsulated as structured data. Based on network status judgment, the system selects to upload the data to the cloud or local cache in real time, and performs disconnection resumption after the network is restored.
2. The method for detecting, tracking, and issuing early warnings for wild animals according to claim 1, characterized in that: The specific method in step S1 is as follows: S11: Image frame capture, captures the video stream of the monitored area in real time through the camera, starts an independent data acquisition thread, and reads image frames in a loop; S12: Environmental data acquisition, continuously reading environmental data through temperature and humidity sensors; S13: Spatiotemporal alignment and association: Establish an association mapping between each successfully captured image frame and the sensor data corresponding to its timestamp, forming a unified raw data packet, which provides a data foundation for subsequent image enhancement based on environmental context.
3. The method for detecting, tracking, and issuing early warnings for wild animals according to claim 1, characterized in that: The specific method in step S2 is as follows: S21: Image quality assessment, performs real-time quality assessment on the original image frame, and calculates its key quality indicators such as brightness, contrast, and sharpness. S22: Distortion correction. Using the pre-calibrated camera intrinsic parameter matrix and distortion coefficients, the original image is processed by the cv2.undistort function to correct the geometric deformation caused by the lens and output the corrected image. S23: Adaptive Enhanced Decision and Execution. Based on environmental sensor data and quality indicators, dynamically execute condition judgment and processing. Judgment condition C1: If the humidity threshold > 80%, the environment is determined to be foggy, and a dehazing algorithm based on dark channel prior is automatically launched. This algorithm calculates the dark channel, estimates atmospheric light value and transmittance, and finally recovers a fog-free image. Judgment condition C2: If the brightness threshold < 50%, the ambient light is determined to be insufficient, and adaptive histogram equalization is automatically performed on the L channel in the LAB color space to improve image details and contrast under low light conditions and output an enhanced image. S24: Resolution unification: All processed image frames are uniformly scaled to a standard resolution of 1280×720 to ensure the consistency of the input size for subsequent AI models.
4. The method for detecting, tracking, and issuing early warnings for wild animals according to claim 1, characterized in that: The real-time target detection of the lightweight AI model in S3 includes model loading and inference, and filters out low-confidence targets below a preset detection threshold.
5. The method and system for detecting, tracking, and issuing early warnings for wild animals according to claim 1, characterized in that: The specific methods for multi-target tracking and trajectory management in S4 are as follows: S41: Data Association: Using the Hungarian algorithm, calculate the association cost matrix between the predicted tracking trajectory and the actual detection box in the current frame, and solve for the optimal matching relationship; S42: Tracking state update. Based on the matching results: For successfully matched detection boxes, update their corresponding tracking trajectories and correct the state of the Kalman filter using the new detection information; for unmatched detection boxes, create new tracking trajectories for them; for unmatched predicted trajectories, mark them as "lost" once; if they are lost more than max_lost times consecutively, terminate the tracking. S43: Identification and Output: Assign and maintain a unique identification code ID for each active tracking trajectory, and output the tracking results of the current frame, which includes the ID of each target and its normalized center point coordinates.
6. The method for detecting, tracking, and issuing early warnings for wild animals according to claim 1, characterized in that: The method for determining and generating warnings for boundary crossing events in S5 is as follows: one or more polygonal regions are preset as electronic fences in the normalized coordinate system of the video image; for each tracked target, it is determined in real time whether its preset representative point is located outside the electronic fence. If so, it is determined that the target has crossed the boundary and the alarm record is generated.
7. A system for detecting, tracking, and issuing early warnings for wild animals, used to implement the method according to any one of claims 1 to 6, characterized in that, The system includes edge monitoring devices deployed at the monitoring site and a remote cloud service center. The edge monitoring devices include: an image acquisition unit for real-time video capture of the monitoring area; an environmental sensing unit for real-time environmental data acquisition; a main control computing unit connected to both the image acquisition unit and the environmental sensing unit, for executing adaptive image preprocessing and quality enhancement steps, lightweight target detection steps, multi-target tracking and trajectory management steps, and intelligent event judgment and early warning steps, and generating structured data; a communication unit connected to the main control computing unit, for uploading the structured data when the network is available, and for local caching and resuming transmission when the network is interrupted; and the cloud service center for receiving, storing, and displaying the data uploaded by the edge monitoring devices.