A video target recognition, tracking and abnormal behavior detection method for terrestrial wildlife

Through the combination of video collection and segmented random sampling with DeepSORT and YOLO v7 models, the problem of ineffective monitoring of terrestrial wildlife in the existing technology is solved, fast and accurate video target recognition tracking and abnormal behavior detection are achieved, and detection is improved. Accuracy and speed reduce manual annotation time and ensure protection efficiency.

CN117315531BActive Publication Date: 2024-08-23SHANDONG MENGEN MODERN AGRI DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311215992.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-20
Publication Date
2024-08-23
Estimated Expiration
2043-09-20

AI Technical Summary

Technical Problem

Existing technology cannot effectively monitor and track terrestrial wild animals, manual supervision cannot track 24 hours a day, and manual processing of large amounts of data is limited, making it impossible to detect abnormal behaviors of wild animals in a timely manner, resulting in ineffective protection.

Method used

The video target recognition tracking and abnormal behavior detection method is adopted. Key frames are extracted through video collection and segmented random sampling, and the improved inter-frame difference method is used. DeepSORT and YOLO v7 are combined to establish a multi-target tracking and abnormal behavior detection model. The pseudo-label marking method is used to reduce Manual time annotation enables video-level expression and rapid detection.

Benefits of technology

It achieves fast and accurate tracking and behavior detection of terrestrial wild animals, reduces the impact of scene light changes, improves detection accuracy and speed, reduces manual annotation time, and ensures timely detection and protection of abnormal behaviors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117315531B
    Figure CN117315531B
Patent Text Reader

Abstract

The present invention belongs to the technical field of terrestrial wildlife detection and protection, and in particular, relates to a method for video target recognition, tracking and abnormal behavior detection applied to terrestrial wildlife, including video acquisition and segmented random sampling, establishing a model for multi-target tracking and abnormal behavior detection of terrestrial wildlife based on DeepSORT and YOLO v7, dividing the data set into a training set and a test set, using a pseudo-label marking method to mark the data, and completing the training of the model to achieve video target recognition, tracking and abnormal behavior detection of terrestrial wildlife. During segmented random sampling, an improved inter-frame difference method is used to extract key frames as effective images, which reduces the impact of scene light changes and shadows during the detection process and avoids a large number of repeated samples. The pseudo-label marking method marks the data set, which greatly reduces the time for manual labeling. The present invention combines DeepSORT and YOLO v7 to establish a model, taking into account both detection accuracy and speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of terrestrial wildlife detection and protection, and in particular relates to a video target recognition, tracking and abnormal behavior detection method applied to terrestrial wildlife. Background Art

[0002] Wild animals are an important part of my country's resources. In recent years, my country has taken positive and effective protection measures to restore the ecological construction of nature reserves. The construction of wildlife habitats in recent years has also provided an environmental basis for wildlife. Due to the large range of activities of terrestrial wild animals, it is difficult to detect them artificially. Therefore, the application of algorithms to achieve rapid and accurate tracking and behavior detection and identification of wild animals in nature reserves has far-reaching significance.

[0003] Currently, there are problems such as the inability to effectively monitor wild animals, the inability to track them 24 hours a day through manual supervision, the limited ability to manually process large amounts of data, the inability to detect abnormal behaviors of wild animals in a timely manner, and the inability to achieve effective protection. Summary of the invention

[0004] In response to the technical problems existing in the protection of terrestrial wildlife, the present invention proposes a video target recognition, tracking and abnormal behavior detection method for terrestrial wildlife, which has a reasonable design, a simple method, strong theoretical basis and can realize rapid and accurate tracking and behavior detection of terrestrial wildlife.

[0005] In order to achieve the above object, the technical solution adopted by the present invention is: a video target recognition, tracking and abnormal behavior detection method applied to terrestrial wild animals, comprising the following steps:

[0006] S1. Video acquisition and segmented random sampling. The collected videos of terrestrial wild animals are divided into P segments. M / P frames are collected for each segment. The M frames are stacked in time sequence. The key frames are extracted as effective images using the improved inter-frame difference method. The illumination change coefficient is added and the image is sharpened. The formula is:

[0007]

[0008] Among them, D' k (x,y) is the final image, is the Laplace operator, D k (x, y) is the difference image, and its calculation formula is:

[0009] D k (x,y)=(1-λ)[|f k (x,y)-|f k-1 (x,y)|∩|f k+1 (x,y)-|f k(x,y)|]

[0010] Among them, f(x,y), f k-1 (x,y) and f k+1 (x, y) are the kth, k-1th and k+1th frames respectively, λ is the illumination variation coefficient, and when the difference between the sum of the grayscale values ​​of the pixels between the two frames is greater than the set threshold, it is retained as a valid image;

[0011] S2. Build a model for multi-target tracking and abnormal behavior detection of terrestrial wildlife based on DeepSORT and YOLO v7;

[0012] S3, divide the data set into a training set and a test set, label the data using a pseudo-labeling method, and complete the model training;

[0013] S4. Realize video target recognition, tracking and abnormal behavior detection of terrestrial wild animals.

[0014] Preferably, the step S2 comprises the following steps:

[0015] S21. First, use YOLO v7 to obtain the bounding box of the target;

[0016] S22, then extract and calculate different features for each detected target;

[0017] S23, then performing improved cascade matching;

[0018] S24, finally, data association is performed to assign a unique digital ID to each target;

[0019] Preferably, the S3 step comprises the following steps:

[0020] S31, randomly divide the data set into a training set and a test set;

[0021] S32, classifying wild animals into normal behavior states and abnormal behavior states, first manually marking a small portion of the data to obtain manually marked labels;

[0022] S33, use the labeled data to perform linear training to obtain an ideal model;

[0023] S35, using the obtained ideal model to perform reasoning on unlabeled data to obtain pseudo labels;

[0024] S36, using the threshold to filter out target boxes with lower scores;

[0025] S37, merging the pseudo labels with the manually marked labels and sending them to the model for training again;

[0026] S38. Evaluate the model on the test set until the evaluation index no longer changes. Otherwise, repeat the training on the pseudo-label dataset.

[0027] Preferably, in step S23, the improved cascade matching is to improve the IOU-based matching to an EIOU-based matching.

[0028] Preferably, the data association in step S24 is performed using a motion model and appearance information, and the existing moving target is calculated using Mahalanobis distance, and the motion information in the next frame is predicted through Kalman filtering to perform information association with the new moving target detected in the next frame.

[0029] Preferably, the evaluation index of step S38 is:

[0030]

[0031]

[0032] Among them, FN t is the number of missed detections in the entire video sequence; FP t is the number of false detections in the entire video sequence; IDS t The number of identity changes in the entire video sequence; GT t is the number of real targets in the entire video sequence; d t,i is the IOU between the predicted box and the real box of the tth frame of the video sequence; c t is the number of matches in the tth frame of the video sequence.

[0033] Compared with the prior art, the advantages and positive effects of the present invention are:

[0034] 1. In order to obtain the long-term temporal information of the video, a video-level expression is established, the video frames are randomly sampled in segments, and the key frames are extracted as effective images using the improved inter-frame difference method, which reduces the impact of scene light changes and shadows during the detection process and avoids a large number of repeated samples.

[0035] 2. Use pseudo-label marking method to label the data set, which greatly reduces the time of manual labeling.

[0036] 3. The model for multi-target tracking and abnormal behavior detection of terrestrial wild animals established by the present invention combines DeepSORT and YOLO v7, taking into account both detection accuracy and speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0038] Figure 1 A flowchart of a method for video target recognition, tracking and abnormal behavior detection applied to terrestrial wild animals is provided for this example. DETAILED DESCRIPTION

[0039] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described below in conjunction with the accompanying drawings and embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0040] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways than those described herein. Therefore, the present invention is not limited to the specific embodiments of the following disclosure.

[0041] Examples, such as Figure 1 As shown in the figure, in order to obtain the long-term temporal information of the video and establish the video-level expression, the video frames are randomly sampled in segments. The reason for using random sampling of video segments is that there is a lot of redundant information in the stacked continuous video frames; many methods are based on local reasoning, and lose the correlation between actions that last for seconds or even minutes. In order to reduce the impact of scene light changes and shadows during the detection process, the illumination change coefficient of the overall illumination is added. The Laplace operator is used to detect the edge of the k-th frame image, which is actually to make the edge of the image stand out. Since Laplace is a differential operator with rotation invariance, its application can enhance the grayscale mutation area in the image and weaken the grayscale slow change area. Therefore, the sharpening process can select the Laplace operator to process the original image to generate an image that describes the grayscale mutation, and then superimpose the Laplace image with the original image to generate a sharpened image.

[0042] Therefore, we first perform video acquisition and random sampling, divide the collected videos of terrestrial wild animals into P segments, collect M / P frame images for each segment, stack the M frame images in chronological order, and then use the improved inter-frame difference method to extract key frames as effective images, add the illumination change coefficient and sharpen the image. The formula is:

[0043]

[0044] Among them, D′ k (x,y) is the final image, is the Laplace operator, D k (x, y) is the difference image, and its calculation formula is:

[0045] D k (x,y)=(1-λ)[|f k (x,y)-|f k-1 (x,y)|∩|f k+1 (x,y)-|f k (x,y)|]

[0046] Among them, f(x,y), f k-1 (x,y) and f k+1 (x, y) are the kth, k-1th and k+1th frames respectively, λ is the illumination variation coefficient, and when the difference between the sum of the grayscale values ​​of the pixels between the two frames is greater than the set threshold, it is retained as a valid image;

[0047] Considering that DeepSORT is a commonly used classic tracking algorithm in the DBT mode, the appearance feature is introduced on the basis of SORT (, and the pedestrian re-identification idea borrowed by it can better deal with the problem of short-term occlusion. When performing tracking tasks, SORT and DeepSORT both use Faster R-CNN as the detector. Although the detection accuracy is high, the prediction speed is lacking. The detection speed of the algorithm will seriously affect the tracking speed of the overall task. Different from the target detection algorithm based on region detection, such as R-CNN, Faster R-CNN, etc., the YOLO series target detection algorithm is based on multi-task learning, based on the idea of ​​regression and classification, and directly inputs the entire image for one-step detection to quickly obtain the target category and location information. Therefore, this method replaces the detector of the DeepSORT tracking algorithm from Faster R-CNN to the YOLO v7 detection algorithm, taking into account both detection accuracy and speed, and thus establishes a model for multi-target tracking and abnormal behavior detection of terrestrial wild animals based on DeepSORT and YOLO v7.

[0048] Specifically, first use YOLO v7 to obtain the bounding box of the target, then extract and calculate different features for each detected target, then perform improved cascade matching, and finally perform data association to assign a unique digital ID to each target. Considering that the IOU loss can express the detection effect of the predicted box and the real box, when the predicted box and the real box do not intersect, the IOU loss is always equal to 1, and learning cannot continue. In addition, the IOU loss function cannot determine the positional relationship between the predicted box and the real box. The EIOU loss function calculates the standardized distance between the center point of the predicted box and the real box and the difference between the width and height of the two boxes, so that when the predicted box and the real box do not intersect, the EIOU loss function can still find the descending gradient. Therefore, the improved cascade matching is to improve the IOU-based matching to the EIOU-based matching, and the data association is to use the motion model and appearance information for data association, and use the Mahalanobis distance to calculate the existing moving target, and use the Kalman filter to predict the motion information in the next frame and the new moving target detected in the next frame for information association.

[0049] Considering that pseudo-labels use the information of images learned on some labeled images to infer unlabeled images, after reducing a large number of redundant frames after NMS, a suitable threshold is used to select pseudo-labels, and finally the model is trained using pseudo-labels. In dealing with real-world problems, it is usually necessary to manually label the data set, which requires a lot of manpower and time, and only a small part of the labeled data set can be obtained. This has led to the rapid development of semi-supervised learning technology using labeled and unlabeled samples. Due to the large data set, this paper chooses to use the pseudo-label labeling method in semi-supervised learning to label the terrestrial wildlife data set. Therefore, the data set is divided into a training set and a test set, and the data is labeled using the pseudo-label labeling method, and the model training is completed.

[0050] Specifically, first, the data set is randomly divided into a training set and a test set, and then the wild animals are divided into normal behavior states such as sleeping and walking, and abnormal behavior states such as attacking and biting ears. A small part of the data is first manually labeled to obtain the manually labeled labels, and then linear training is performed on the labeled data to obtain an ideal model. Then the obtained ideal model is used to infer on the unlabeled data to obtain pseudo labels, and then the target boxes with low scores are filtered out using the threshold. Then the pseudo labels are merged with the manually labeled labels and sent to the model for training again. Finally, the model is evaluated on the test set until the evaluation index no longer changes, otherwise, the training is repeated on the pseudo-labeled data set. The evaluation index is:

[0051]

[0052]

[0053] Among them, FN t is the number of missed detections in the entire video sequence; FP t is the number of false detections in the entire video sequence; IDS t The number of identity changes in the entire video sequence; GT t is the number of real targets in the entire video sequence; d t,i is the IOU between the predicted box and the real box of the tth frame of the video sequence; c t is the number of matches in the tth frame of the video sequence.

[0054] Finally, video target recognition, tracking and abnormal behavior detection of terrestrial wild animals are achieved.

[0055] The above description is only a preferred embodiment of the present invention and does not limit the present invention in other forms. Any technician familiar with the profession may use the technical content disclosed above to change or modify it into an equivalent embodiment with equivalent changes and apply it to other fields. However, any simple modification, equivalent change and modification made to the above embodiment based on the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the protection scope of the technical solution of the present invention.

Claims

1. A video target recognition, tracking and abnormal behavior detection method for terrestrial wild animals, characterized in that: The steps include: S1. Video acquisition and segmented random sampling. The collected videos of terrestrial wild animals are divided into P segments. M / P frames are collected for each segment. The M frames are stacked in time sequence. The key frames are extracted as effective images using the improved inter-frame difference method. The illumination change coefficient is added and the image is sharpened. The formula is: Among them, D' k (x,y) is the final image, is the Laplace operator, D k (x,y) is the difference image, The calculation formula is: D k (x,y)=(1-λ)[|f k (x,y) − |f k-1 (x,y)|∩|f k+1 (x,y) − |f k (x,y)|] Among them, f k (x,y),f k-1 (x,y) and f k+1 (x, y) are the kth, k-1th and k+1th frames respectively, λ is the illumination variation coefficient, when the difference between the sum of the grayscale values ​​of the pixels in two frames is greater than the set threshold, it is retained as a valid image and the data set is constructed; S2. Build a model for multi-target tracking and abnormal behavior detection of terrestrial wildlife based on DeepSORT and YOLO v7; S3, divide the data set into a training set and a test set, label the data using a pseudo-labeling method, and complete the model training; S4. Realize video target recognition, tracking and abnormal behavior detection of terrestrial wild animals; The S2 step comprises the following steps: S21. First, use YOLO v7 to obtain the bounding box of the target; S22, then extract and calculate different features for each detected target; S23, then performing improved cascade matching, the improved cascade matching is to improve the IOU-based matching to the EIOU-based matching; S24. Finally, data association is performed. The data association is performed using motion model and appearance information. The Mahalanobis distance is used to calculate the existing motion target, and the motion information in the next frame is predicted through Kalman filtering. The information is associated with the new motion target detected in the next frame, and a unique digital ID is assigned to each target.

2. The method for video target recognition, tracking and abnormal behavior detection of terrestrial wild animals according to claim 1, characterized in that: The S3 step includes the following steps: S31, randomly divide the data set into a training set and a test set; S32, classifying wild animals into normal behavior states and abnormal behavior states, first manually marking a small portion of the data to obtain manually marked labels; S33, use the labeled data to perform linear training to obtain an ideal model; S35, using the obtained ideal model to perform reasoning on unlabeled data to obtain pseudo labels; S36, using the threshold to filter out target boxes with lower scores; S37, merging the pseudo labels with the manually marked labels and sending them to the model for training again; S38. Evaluate the model on the test set until the evaluation index no longer changes. Otherwise, repeat the training on the pseudo-label dataset.

3. The method for video target recognition, tracking and abnormal behavior detection of terrestrial wild animals according to claim 2, characterized in that: The evaluation index of step S38 is: Where: FN t is the number of missed detections in the entire video sequence; FP t is the number of false detections in the entire video sequence; IDS t The number of identity changes in the entire video sequence; GT t is the number of real targets in the entire video sequence; d t,i is the IOU between the predicted box and the real box of the tth frame of the video sequence; c t is the number of matches in the tth frame of the video sequence.