Polygonal multi-ROI animal identification method based on TensorRT
By using TensorRT accelerated reasoning and multi-ROI division technology in the animal recognition system, combining YOLOv8 and DeepSORT algorithms for real-time target tracking and cross-region re-identification, and using the OpenPose framework for skeleton key point detection, it solves the problem of existing systems in complex environments and Shortcomings in cross-regional tracking enable efficient, real-time animal identification and behavior monitoring.
Patent Information
- Application Number
- CN202411899260.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-01-24
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing animal identification systems have problems such as slow inference speed, wasted computing resources, inability to track across regions and inability to understand animal posture and behavior in complex, high-density environments and cross-region tracking.
Adopt a polygonal multi -Roi animal recognition method based on Tensorrt, noise reduction processing and polygon ROI through the video signal, and using the YOLOV8 target detection model and DeepSort algorithm to track the real -time target tracking and cross -camera re -recognition. Detection, realize animal fine -grained behavior monitoring and health assessment.
It achieves rapid response to changes in animal behavior and fine-grained classification in complex environments, and can track and classify the status and characteristics of each individual in real time, ensuring millisecond-level rapid feedback and improving monitoring coverage and management efficiency.
Smart Images

Figure CN119360130A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to a polygonal multi-ROI animal recognition method based on TensorRT. Background Art
[0002] As the level of intelligence in animal husbandry continues to deepen, animal identification technology has gradually become one of the key tools in animal husbandry management; using these technologies, behavior monitoring and disease warning of animals in farms can be achieved through video surveillance. The origin of animal identification systems can be traced back to the development of computer vision and pattern recognition technology, especially in the late 20th century. The initial animal identification systems were mostly based on traditional machine learning algorithms, such as support vector machines (SVM) and decision trees, and manually designed features to classify and identify objects. With the rise of deep learning technology, deep convolutional neural networks (CNNs) have gradually become the mainstream method in target detection and classification tasks. Since then, deep learning technology has begun to be applied to more complex animal identification tasks, especially in wildlife monitoring and animal husbandry management. Most of the current animal identification systems rely on general target detection algorithms, such as YOLO (You Only Look Once) and SSD (Single Shot Multibox Detector). These algorithms can process large amounts of video data in real time and efficiently identify and track multiple targets, becoming the core of animal identification technology.
[0003] However, these algorithms perform well when dealing with target recognition scenarios in simple environments. However, they still face many challenges in complex, high-density environments and more complex tasks. The main shortcomings of traditional target detection algorithms include: 1. Traditional target detection algorithms require complex calculations and feature extraction during the processing process, resulting in slow reasoning speed and inability to meet real-time requirements. 2. Most traditional detection algorithms can only perform target recognition on the entire screen and cannot effectively focus and screen specific areas, resulting in a waste of computing resources and a decrease in detection accuracy. 3. Traditional target detection algorithms can only recognize within a single camera and cannot handle cross-region tracking of animals under different cameras, resulting in discontinuous monitoring. 4. Traditional target detection algorithms mainly focus on the overall outline of animals or large-scale classification, and cannot understand the posture and behavior of animals. Summary of the invention
[0004] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a polygonal multi-ROI animal recognition method based on TensorRT to solve the shortcomings of the prior art.
[0005] The object of the present invention is achieved by the following technical solution: a polygonal multi-ROI animal recognition method based on TensorRT, the method comprising: Step 1: Perform noise reduction processing on the real-time acquired video signal, and use high-pass filtering and adaptive histogram equalization technology to enhance the contrast and clarity of the image; Step 2: Set multiple polygonal ROIs based on the processed image to cover different monitoring areas; Step 3: Use the target detection model to detect the target in each polygonal ROI, identify the polygonal outline of the animal, and output the relevant position and feature information; Step 4: Use the DeepSORT algorithm to track the detected animals in real time, update their positions and features in the scene, and combine cross-camera re-identification technology to match the features of the same individual between different cameras to achieve continuous tracking across regions; Step 5: Use the OpenPose framework loaded with the improved detection framework to detect skeleton key points of each target for posture estimation and behavior analysis, so as to achieve fine-grained behavior monitoring and health status assessment of animals.
[0006] The step five specifically includes: feature extraction step, key point confidence map generation step, limb vector field generation step, multi-stage convolution iterative optimization step, key point matching and allocation step, skeleton assembly and posture output step.
[0007] The feature extraction step comprises: The OpenPose framework uses a deep convolutional neural network to extract the features of the target image detected by the target detection model. At this stage, the low-level convolutional layers extract basic features, and the high-level convolutional layers extract complex structural features. These features are used to generate key points and connection relationships of the posture.
[0008] The step of generating a key point confidence map comprises: For each joint position in the image, a confidence map is iteratively generated through the multi-stage convolutional network module in the multi-stage posture estimation model. The multi-stage posture estimation model gradually locates the exact position of each key point. The confidence map is a two-dimensional matrix of the same size as the input image. Each value in the matrix represents the probability that the point position belongs to a certain key point. The high-value area represents the possible position of the key point. The generated confidence map forms a heat map effect on the image. The darker the color, the more likely it is the position of the key point.
[0009] The step of generating a limb vector field comprises: A set of two-dimensional vector fields PAFs are generated to represent the direction and connection strength between different key point pairs. Each pair of key points generates a vector field to describe the spatial relationship between them, that is, to determine which key points may belong to the same target to prevent misconnection of targets.
[0010] The multi-stage convolution iterative optimization step includes: The key point confidence map generated in the key point confidence map generation step and the PAFs generated in the limb vector field generation step are optimized through multiple convolution stages, where the input of each stage is the output of the previous stage, gradually optimizing the position and orientation connections of the key points.
[0011] The key point matching and allocation steps include: On PAFs, the best path between two key points is found by calculating the direction and strength of the vector field; Calculate the path score from one key point to another key point. The higher the score, the more likely it is that the two key points belong to the same animal. After matching is completed, the key points belonging to the same animal are assembled into a complete posture skeleton.
[0012] The skeleton assembly and posture output steps include: After allocating the key points of all targets, these key points are connected to a complete skeleton structure, which contains the specific coordinate positions of the key points. The final output posture includes the coordinates of each key point to form a complete posture structure.
[0013] The step 4 specifically includes: Use a deep convolutional neural network to extract deep features from the detected animal target area and generate a high-dimensional feature vector. Each animal target is represented as a 256-dimensional feature vector. The extracted feature vectors are normalized using L2 normalization discharge, so that the length of each feature vector is 1, thereby ensuring that the feature directionality is independent of the size and only considering the similarity of its direction. The feature vectors are reduced in dimension using principal component analysis; Using cosine similarity as a similarity metric, the target is matched by calculating the cosine similarity between the feature vector of the animal under the current camera and the feature vector of the identified animals in other cameras to determine whether their directions are similar, and thus whether they are the same target; Use a cross-camera re-identification model to determine the features of the same individual under different cameras, and then determine whether it is the same animal under different camera perspectives and conditions; Use Kalman filtering to predict the location of the target, associate the matched target with its identity, and achieve continuous tracking across cameras; When an animal target is identified under multiple cameras, the features of these cameras are fused using the weighted average method to generate a more stable and comprehensive feature description. At the same time, the position information under different cameras is geometrically corrected to ensure the accuracy and consistency of the tracking results.
[0014] The target detection model includes a YOLOv8 target detection model, and improvements to the YOLOv8 target detection model include: The loss function of the YOLOv8 target detection model is replaced with the Focal Loss loss function. The YOLOv8 target detection model is loaded into the TensorRT inference engine. TensorRT is used to prune the YOLOv8 target detection model and delete redundant weights and unimportant layers to reduce the computational complexity of the model. Quantize the YOLOv8 target detection model from floating point precision to half-precision floating point or integer precision to reduce the memory usage and computational resource requirements of the YOLOv8 target detection model while maintaining a reasonable level of inference accuracy; TensorRT uses layer fusion technology to merge multiple computing layers in the YOLOv8 target detection model into one computing layer to reduce the delay of internal access and data transmission, and accelerate the reasoning process; Using TensorRT's inference pipeline technology, the inference process is divided into multiple stages, supporting multi-threaded parallel processing of different inference tasks. TensorRT generates inference engine files, further reducing loading time and enabling efficient inference of the YOLOv8 target detection model at runtime.
[0015] The present invention has the following advantages: 1. Combined with TensorRT to accelerate reasoning, the YOLOv8 model is first used to perform preliminary target detection and identify animals in each ROI area. Then, TRT is used to optimize the reasoning speed, and hierarchical fusion technology is used to merge multiple detection layers to reduce memory access time and processing delay. At the same time, half-precision floating point compression model weights are used to reduce memory usage, so that it can quickly respond to changes in animal behavior and fine-grained classification requirements. Even in large-scale farms, the status and characteristics of each individual can be tracked and classified in real time to ensure millisecond-level rapid feedback; 2. It can monitor and classify individual animals in multiple areas in the same scene at the same time. Even if multiple animal populations are mixed, the accuracy and stability of the classification results can be guaranteed.
[0016] 3. It realizes fine-grained classification and identification of different animal individuals in a farm environment. When multiple cameras are switched, the tracking continuity is still maintained, ensuring that livestock can be accurately identified no matter which camera range they are in, thereby greatly improving the monitoring coverage and management efficiency.
[0017] 4. Behavior analysis and posture detection can be achieved through skeleton changes, including the judgment of healthy behavior and abnormal behavior. This combination of technologies enables the present invention to maintain high-precision classification and behavior detection in complex environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the detailed description of the embodiments of the present application provided below in conjunction with the drawings is not intended to limit the scope of protection of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application. The present invention is further described below in conjunction with the drawings.
[0020] like Figure 1 As shown, the present invention specifically relates to a polygonal ROI animal recognition method based on TensorRT. In the practice of aquaculture, real-time monitoring and accurate identification of the state and behavior of animals are crucial, especially for large-scale farms. The present invention introduces cross-camera recognition and skeleton key point pose estimation technology, combined with TensorRT to achieve real-time fine-grained classification of multiple ROIs, providing an innovative technical solution for modern aquaculture; specifically including the following contents.
[0021] Video signal input: obtain real-time video signals through the camera and transmit them to the image processing module for further processing; Image preprocessing: Perform noise reduction on video signals, use high-pass filtering and adaptive histogram equalization technology to enhance the contrast and clarity of the image to ensure the accuracy of subsequent detection; Polygonal ROI division: Based on the pre-processed image, multiple polygonal regions of interest (ROIs) are defined to cover different monitoring areas. By dividing the ROIs, unnecessary background interference can be reduced and computing resources can be optimized. Target detection: Use the YOLOv8 target detection model to detect targets within each polygonal ROI, identify the polygonal outline of the animal, and output relevant position and feature information. The YOLOv8 target detection model introduces focal loss to improve the detection capability of small targets; Cross-camera target tracking: Use the DeepSORT algorithm to track detected animals in real time and update their positions and features in the scene. Combined with cross-camera re-identification (Re-ID) technology, the system matches the features of the same individual between different cameras to achieve continuous tracking across regions, ensuring that animals can still be accurately identified when crossing different areas; Key point detection: The OpenPose framework (YL_OpenPose) with the improved detection framework loaded performs skeleton key point detection on each target. The system identifies and locates the key points of the animal, such as the head, limbs, tail, etc., to form a skeleton structure. This key point information is used for posture estimation and behavior analysis to achieve fine-grained behavior monitoring and health status assessment of the animal; Loop: Determine whether a loop is needed. If so, return to the step of video signal input. If not, end.
[0022] Furthermore, cross-camera target tracking specifically includes the following: A1. Feature extraction: First, deep features are extracted from the detected animal target area, and a deep convolutional neural network (ResNet-50) is used to extract information such as color, texture, shape, etc. to generate a high-dimensional feature vector. After this process, each animal target is represented as a 256-dimensional feature vector, which contains unique information about the target, allowing them to be matched from different perspectives. These features can not only help identify targets within the same camera, but also provide a basis for target matching across cameras.
[0023] A2. Feature normalization and encoding: In order to ensure the stability and comparability of features under different cameras, the extracted feature vectors are normalized using the L2 normalization method so that the length of each feature vector is 1, thereby ensuring that the directionality of the feature vector is independent of its size and only considering the similarity of its direction. Subsequently, in order to further optimize the features and reduce the complexity of subsequent calculations, principal component analysis (PCA) is used to reduce the dimension of the feature vector. The PCA method can compress the feature space, retain the most recognizable feature information, and reduce the computational burden. After these two steps, the feature vector of each animal target will become more stable and efficient, suitable for matching and identification across cameras.
[0024] A3. Feature matching and similarity measurement: In cross-camera recognition, cosine similarity is used as a similarity measurement method. The target is matched by calculating the cosine similarity between the feature vector of the animal under the current camera and the feature vector of the identified animals in other cameras. It can be determined whether their directions are similar, thereby evaluating whether they are the same target.
[0025] A4. Application of Re-ID model: In order to further improve the accuracy of cross-camera matching, a cross-camera Re-ID model is used to determine the features of the same individual under different cameras. The Triplet Loss method is used to train the cross-camera Re-ID model. Triplet Loss optimizes the network by comparing three samples: one is a positive sample of the target (i.e., images of the same animal under different cameras), and the other two are negative samples (i.e., images of different animals). In this way, the model learns how to compress the feature vectors of different viewpoints of the same animal into a similar feature space, while separating the features of different animals. Through this deep learning method, the Re-ID model can determine whether it is the same animal under different camera viewpoints and conditions, and significantly improve the robustness of cross-camera matching. The trained Re-ID model will serve as an important tool for subsequent cross-view matching, helping the system to accurately identify in complex environments.
[0026] A5. Cross-camera tracking association: Use Kalman filter to predict the position of the target, associate the matched target with its identity, and achieve continuous tracking across cameras. This process includes associating the position and time of the target in different cameras to ensure the consistency of the recognition results, especially when the animal enters the field of view of one camera and enters another camera, it can be accurately associated with the same identity.
[0027] A6. Feature fusion and position correction: When an animal target is identified under multiple cameras, the features of these cameras are fused using the weighted average method to generate a more stable and comprehensive feature description. At the same time, the position information under different cameras is geometrically corrected to ensure the accuracy and consistency of the tracking results. Specifically, by combining the internal and external parameters of the camera, geometric transformation and spatial mapping are used to ensure the consistency of the position information of the same target under different cameras. Through this comprehensive processing, stable and accurate cross-camera target tracking can be achieved in a multi-camera system.
[0028] Furthermore, key point detection specifically includes the following contents: B1. Feature extraction: The OpenPose framework uses a deep convolutional neural network (ResNet-50) to extract the features of the target image at the target detection model detection location. At this stage, the target image input to the target detection model will undergo feature extraction. The image is input from the input end of the target detection model, first passes through the low-level convolutional layer, and then passes through the high-level convolutional layer to obtain the extracted features. The convolutional layer close to the input layer is the low-level convolutional layer. Because the receptive field of the low-level convolutional layer is small, it can capture local details in the image, but cannot see the context of a larger range, so the low-level convolutional layer mainly completes the extraction of basic features; for example, edge features: detect areas in the image where the brightness or color changes dramatically through the convolution kernel, and identify the edge contour of the object; texture features: extract texture information of the image by identifying repeated patterns in a small area, such as roughness, stripes or grids; corner points and simple shapes: detect simple geometric structures in objects (such as lines, points, and crosses).
[0029] The convolution layer close to the output layer is a high-level convolution layer. After multiple layers of convolution and pooling, the high-level convolution layer has a larger receptive field and can focus on the spatial relationship of the entire object, not just the local details. The high-level convolution layer will integrate and combine the basic features extracted from the low-level convolution layer to form high-level complex features; for example, combined features: the high-level convolution layer combines the basic features such as edges and textures extracted from the low-level layers. For example, simple edges can be combined into triangles, circles, or more complex contours; structural features: components of complex objects, such as the overall shape, head, and limbs of animals; semantic features: the category, action, or other high-level information of objects. The deep convolutional neural network for feature extraction produces high-dimensional feature maps, which contain key spatial and semantic information, which helps in the subsequent prediction of key point positions.
[0030] B2. Generate key point confidence map: For each joint position in the image (such as head, shoulder, elbow, knee, etc.), the confidence map is iteratively generated through the multi-stage convolutional network module (Stage-wise CNNs) in the multi-stage posture estimation model. The multi-stage posture estimation model gradually locates the exact position of each key point. The confidence map is a two-dimensional matrix of the same size as the input image. Each value in the matrix represents the probability that the point position belongs to a certain key point. The high-value area indicates the possible position of the key point. The generated confidence map forms a heat map effect on the image. The darker the color, the more likely it is the position of the key point.
[0031] B3. Generate Part Affinity Fields (PAFs): Generate a set of two-dimensional vector fields PAFs to represent the direction and connection strength between different key point pairs (for example, the connection between the left front leg shoulder and elbow, and the right hind leg knee and ankle). Each pair of key points generates a vector field to describe the spatial relationship between them, that is, to determine which key points may belong to the same target to prevent misconnection of targets. Generation and confidence of PAFs Figure 1 In this way, a more accurate connection direction is generated through multiple convolution superpositions.
[0032] B4. Multi-stage convolution iterative optimization: The key point confidence map generated in the key point confidence map generation step and the PAFs generated in the limb vector field generation step are optimized through multiple convolution stages. The input of each stage is the output of the previous stage (including the confidence map and vector field), gradually optimizing the position and direction connection of the key points.
[0033] The advantage of the multi-stage design is that the confidence map and vector field can be gradually corrected to improve the accuracy of the multi-stage pose estimation model and ensure the accurate positioning and connection of key points. For example, if the key point detection in a certain stage is inaccurate, the subsequent stages will adjust it according to the information of other regions, and finally obtain a more stable output.
[0034] B5. Keypoint matching and assignment: On PAFs, the best path between two keypoints is found by calculating the direction and strength of the vector field; Calculate the path score from one key point to another key point. The higher the score, the more likely it is that the two key points belong to the same animal. After matching, the key points belonging to the same animal are grouped into a complete posture skeleton to avoid misconnections across individuals.
[0035] B6. Skeleton assembly and posture output: After allocating the key points of all targets, these key points are connected to complete skeleton structures. The skeleton structure contains the specific coordinate positions of the key points. The final output posture includes the (x, y) coordinates of each key point to form a complete posture structure.
[0036] Furthermore, the present invention improves the YOLOv8 target detection model by: The loss function of the YOLOv8 target detection model is replaced with the Focal Loss loss function. The YOLOv8 target detection model is loaded into the TensorRT inference engine. TensorRT is used to prune the YOLOv8 target detection model and delete redundant weights and unimportant layers, thereby reducing the computational complexity of the model, making the inference process more lightweight and improving the inference speed. Quantize the YOLOv8 target detection model from floating point precision (FP32) to half-precision floating point (FP16) or integer precision (INT8) to reduce the memory footprint and computational resource requirements of the YOLOv8 target detection model while maintaining a reasonable level of inference accuracy; TensorRT uses layer fusion technology to merge multiple computing layers in the YOLOv8 target detection model into one computing layer to reduce the delay of internal access and data transmission, and accelerate the reasoning process; Using TensorRT's inference pipeline technology, the inference process is divided into multiple stages, supporting multi-threaded parallel processing of different inference tasks. TensorRT generates inference engine files, further reducing loading time and enabling efficient inference of the YOLOv8 target detection model at runtime.
[0037] The above is only a preferred embodiment of the present invention. It should be understood that the present invention is not limited to the form disclosed herein, and should not be regarded as excluding other embodiments, but can be used for various other combinations, modifications and improvements, and can be modified within the scope of the concept described herein through the above teachings or the technology or knowledge of the relevant field. The changes and modifications made by those skilled in the art do not deviate from the spirit and scope of the present invention, and should be within the scope of protection of the claims attached to the present invention.
Claims
1. A polygonal multi-ROI animal recognition method based on TensorRT, characterized by: The method comprises: Step 1: Perform noise reduction processing on the real-time acquired video signal, and use high-pass filtering and adaptive histogram equalization technology to enhance the contrast and clarity of the image; Step 2: Set multiple polygonal ROIs based on the processed image to cover different monitoring areas; Step 3: Use the target detection model to detect the target in each polygonal ROI, identify the polygonal outline of the animal, and output the relevant position and feature information; Step 4: Use the DeepSORT algorithm to track the detected animals in real time, update their positions and features in the scene, and combine cross-camera re-identification technology to match the features of the same individual between different cameras to achieve continuous tracking across regions; Step 5: Use the OpenPose framework loaded with the improved detection framework to detect skeleton key points of each target for posture estimation and behavior analysis, so as to achieve fine-grained behavior monitoring and health status assessment of animals.
2. The polygonal multi-ROI animal recognition method based on TensorRT according to claim 1, characterized in that: The step five specifically includes: feature extraction step, key point confidence map generation step, limb vector field generation step, multi-stage convolution iterative optimization step, key point matching and allocation step, skeleton assembly and posture output step.
3. The polygonal multi-ROI animal recognition method based on TensorRT according to claim 2, characterized in that: The feature extraction step comprises: The OpenPose framework uses a deep convolutional neural network to extract the features of the target image detected by the target detection model. At this stage, the low-level convolutional layers extract basic features, and the high-level convolutional layers extract complex structural features. These features are used to generate key points and connection relationships of the posture.
4. The polygonal multi-ROI animal recognition method based on TensorRT according to claim 2, characterized in that: The step of generating a key point confidence map comprises: For each joint position in the image, a confidence map is iteratively generated through the multi-stage convolutional network module in the multi-stage posture estimation model. The multi-stage posture estimation model gradually locates the exact position of each key point. The confidence map is a two-dimensional matrix of the same size as the input image. Each value in the matrix represents the probability that the point position belongs to a certain key point. The high-value area represents the possible position of the key point. The generated confidence map forms a heat map effect on the image. The darker the color, the greater the possibility of the key point position.
5. The polygonal multi-ROI animal recognition method based on TensorRT according to claim 2, characterized in that: The step of generating a limb vector field comprises: A set of two-dimensional vector fields PAFs are generated to represent the direction and connection strength between different key point pairs. Each pair of key points generates a vector field to describe the spatial relationship between them, that is, to determine which key points belong to the same target to prevent misconnection of targets.
6. The polygonal multi-ROI animal recognition method based on TensorRT according to claim 2, characterized in that: The multi-stage convolution iterative optimization step includes: The key point confidence map generated in the key point confidence map generation step and the PAFs generated in the limb vector field generation step are optimized through multiple convolution stages, where the input of each stage is the output of the previous stage, gradually optimizing the position and orientation connections of the key points.
7. The polygonal multi-ROI animal recognition method based on TensorRT according to claim 2, characterized in that: The key point matching and allocation steps include: On PAFs, the best path between two key points is found by calculating the direction and strength of the vector field; Calculate the path score from one key point to another key point. The higher the score, the more likely it is that the two key points belong to the same animal. After matching is completed, the key points belonging to the same animal are assembled into a complete posture skeleton.
8. The polygonal multi-ROI animal recognition method based on TensorRT according to claim 2, characterized in that: The skeleton assembly and posture output steps include: After allocating the key points of all targets, these key points are connected to a complete skeleton structure, which contains the specific coordinate positions of the key points. The final output posture includes the coordinates of each key point to form a complete posture structure.
9. The polygonal multi-ROI animal recognition method based on TensorRT according to claim 1, characterized in that: The step 4 specifically includes: Use a deep convolutional neural network to extract deep features from the detected animal target area and generate a high-dimensional feature vector. Each animal target is represented as a 256-dimensional feature vector. The extracted feature vectors are normalized using L2 normalization discharge, so that the length of each feature vector is 1, thereby ensuring that the feature directionality is independent of the size and only considering the similarity of its direction. The feature vectors are reduced in dimension using principal component analysis; Using cosine similarity as a similarity metric, the target is matched by calculating the cosine similarity between the feature vector of the animal under the current camera and the feature vector of the identified animals in other cameras to determine whether their directions are similar, and thus whether they are the same target; Use a cross-camera re-identification model to determine the features of the same individual under different cameras, and then determine whether it is the same animal under different camera perspectives and conditions; Use Kalman filtering to predict the location of the target, associate the matched target with its identity, and achieve continuous tracking across cameras; When an animal target is identified under multiple cameras, the features of these cameras are fused using the weighted average method to generate a more stable and comprehensive feature description. At the same time, the position information under different cameras is geometrically corrected to ensure the accuracy and consistency of the tracking results.
10. A polygonal multi-ROI animal recognition method based on TensorRT according to any one of claims 1 to 9, characterized in that: The target detection model includes a YOLOv8 target detection model, and improvements to the YOLOv8 target detection model include: The loss function of the YOLOv8 target detection model is replaced with the Focal Loss loss function. The YOLOv8 target detection model is loaded into the TensorRT inference engine. TensorRT is used to prune the YOLOv8 target detection model and delete redundant weights and unimportant layers to reduce the computational complexity of the model. Quantize the YOLOv8 target detection model from floating point precision to half-precision floating point or integer precision to reduce the memory usage and computational resource requirements of the YOLOv8 target detection model while maintaining a reasonable level of inference accuracy; TensorRT uses layer fusion technology to merge multiple computing layers in the YOLOv8 target detection model into one computing layer to reduce the delay of internal access and data transmission, and accelerate the reasoning process; Using TensorRT's inference pipeline technology, the inference process is divided into multiple stages, supporting multi-threaded parallel processing of different inference tasks. TensorRT generates inference engine files, further reducing loading time and enabling efficient inference of the YOLOv8 target detection model at runtime.
Citation Information
Cited By
Multi-species pet mixed identity recognition method and device and storage medium
CN121170852A