A mouse behavior detection method and system based on three-dimensional tracking

Through three-dimensional tracking technology, the behavior and body shape of mice are detected, which solves the problem that existing technology cannot realize 24-hour three-dimensional behavior detection, realizes highly accurate and efficient mouse behavior analysis, and is suitable for the physical condition of mouse experiments. detection.

CN118172796BActive Publication Date: 2024-09-27HUAZHONG AGRI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410266131.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-08
Publication Date
2024-09-27
Estimated Expiration
2044-03-08

AI Technical Summary

Technical Problem

Existing technology cannot detect the three-dimensional behavior of mice 24 hours a day, and lacks a system that can measure the volume and weight of mice, resulting in high requirements for observers' attention, qualitative analysis results and poor repeatability.

Method used

A mouse behavior detection method based on three-dimensional tracking is used to collect RGB images and depth images, perform preprocessing to obtain three-dimensional point cloud images, locate and track the mice, extract feature points, and calculate the body shape data and behavior of the mice, including volume, tail length and back width, and analyze behavior.

Benefits of technology

It achieves fast and accurate three-dimensional mouse behavior detection, can measure mouse volume and weight simultaneously, has high accuracy and efficiency, is suitable for physical condition detection of mouse-related experiments, and reduces storage costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118172796B
    Figure CN118172796B
Patent Text Reader

Abstract

The present invention discloses a mouse behavior detection method and system based on three-dimensional tracking, the method comprising the following steps: collecting several images of mice in a feeding box, the images comprising: RGB images and depth images, pre-processing the RGB images and the depth images to obtain a three-dimensional point cloud image; positioning and tracking the mice in the RGB images to obtain the position information of a single mouse; based on the position information, cutting out a small point cloud image of a single mouse from the three-dimensional point cloud image, and extracting feature points of the segmented parts based on the small point cloud image; judging the body shape data and behavior of the mouse based on the feature points. The present invention realizes the detection of the physical condition of mice, and provides strong technical support for mouse-related experiments such as medical experiments. At the same time, the system adopts an intelligent storage form to selectively store data and reduce storage costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of machine vision detection and animal behavior, and specifically relates to a mouse behavior detection method and system based on three-dimensional tracking. Background Art

[0002] Animal behavior is a discipline that studies the interaction between animals and the environment and other organisms. This discipline has a long history and its research objects are very wide, including the communication behavior, emotional expression, social behavior, learning behavior, reproductive behavior, etc. of various animals. A single animal experiment lasts for a long time (may be up to tens of minutes or even hours), and most experiments need to be repeated. For early animal behavior experiments, it was mainly completed by human observation, and the only measuring tools were stopwatches and rulers. This requires a high level of attention from the observer, and the work is relatively boring; the analysis results obtained are qualitative, and there are shortcomings such as strong subjectivity and poor experimental repeatability. With the development of deep learning, the mouse behavior analysis system based on two-dimensional video has gradually improved, but these behaviors are limited to two dimensions and lack vertical behaviors, such as jumping and standing up. At the same time, it is also impossible to measure volume, etc. At present, there is a lack of a system on the market that can detect three-dimensional mouse behavior 24 hours a day. Summary of the invention

[0003] The present invention aims to solve the deficiencies of the prior art and proposes a mouse behavior detection method and system based on three-dimensional tracking, which can quickly and accurately extract mice in the environment and calculate their volume and estimate their weight through the volume.

[0004] To achieve the above object, the present invention provides the following solutions:

[0005] A mouse behavior detection method based on three-dimensional tracking comprises the following steps:

[0006] Collecting several images of mice in a feeding box, the images including: RGB images and depth images, and preprocessing the RGB images and the depth images to obtain a three-dimensional point cloud image;

[0007] Positioning and tracking the mice in the RGB image to obtain position information of a single mouse;

[0008] Based on the position information, a small point cloud image of a single mouse is cut out from the three-dimensional point cloud image, and feature points of the segmented part are extracted based on the small point cloud image;

[0009] The body shape data and behavior of the mouse are determined based on the feature points.

[0010] Preferably, the pretreatment method comprises:

[0011] Synthesize the RGB image and the depth image to obtain an original three-dimensional point cloud;

[0012] Removing surroundings and unreal points from the three-dimensional point cloud to obtain a processed three-dimensional point cloud;

[0013] The processed three-dimensional point cloud is registered and coordinate corrected to obtain the three-dimensional point cloud image.

[0014] Preferably, the positioning and tracking method includes:

[0015] Performing frame extraction processing on the RGB image to obtain a frame extracted image;

[0016] The Yolov7 model is used to detect the extracted image to obtain a detection frame, and the three-dimensional bounding box is subjected to Kalman filtering to obtain a prediction frame;

[0017] The detection box is matched with the prediction box by EIOU and associated with an ID, and the detection box after the associated ID is output to obtain the position information.

[0018] Preferably, the feature point extraction method includes:

[0019] Segment the mouse parts based on the small point cloud image into head, back, tail and caudal parts;

[0020] The center of the head, back and tail is extracted by taking the centroid to obtain the center of the head, the center of the back and the center of the tail;

[0021] PCL BoundaryEstimation is used to extract the neck, nose, waist, two endpoints of the tail, the point with the greatest curvature of the tail, and two points on the edges of both sides of the body.

[0022] Preferably, the body shape data includes: mouse volume, mouse tail length and mouse back width;

[0023] The volume calculation method includes: calculating the minimum convex hull of the small point cloud image based on the open3d library, and calculating the volume of the minimum convex hull to obtain the volume of the mouse;

[0024] The method for calculating the mouse tail length comprises: taking one end point of the mouse tail as a starting point, calculating the distance between the starting point and the nearest bone point, and then taking the bone point as a starting point for the next iteration until the other end point, and accumulating the distances to obtain the mouse tail length;

[0025] The width of the mouse back is the distance between two points on the edges of both sides of the body;

[0026] The behavior identification method includes: acquiring relative position information of the feature points, and analyzing the behavior of the mouse based on the relative position information.

[0027] The present invention also provides a mouse behavior detection system based on three-dimensional tracking, wherein the detection system applies any of the above detection methods and comprises: an image acquisition module, a positioning and tracking module, a feature extraction module and a calculation and judgment module;

[0028] The image acquisition module is used to collect a number of images of mice in the feeding box, the images include: RGB images and depth images, and the RGB images and the depth images are preprocessed to obtain a three-dimensional point cloud image;

[0029] The positioning and tracking module is used to position and track the mice in the RGB image to obtain the position information of a single mouse;

[0030] The feature extraction module cuts out a small point cloud image of a single mouse from the three-dimensional point cloud image based on the position information, and extracts feature points of the segmented part based on the small point cloud image;

[0031] The calculation and judgment module judges the body shape data and behavior of the mouse based on the feature points.

[0032] Preferably, the image acquisition module includes: an acquisition unit, a synthesis unit, a processing unit and a correction unit;

[0033] The acquisition unit includes a plurality of depth cameras, and the acquisition unit is used to acquire the image;

[0034] The synthesis unit is used to synthesize the RGB image and the depth image to obtain an original three-dimensional point cloud;

[0035] The processing unit is used to remove the surrounding environment and unreal points in the three-dimensional point cloud to obtain a processed three-dimensional point cloud;

[0036] The correction unit is used to perform registration and coordinate correction on the processed three-dimensional point cloud to obtain the three-dimensional point cloud image.

[0037] Preferably, the positioning and tracking module comprises: a frame extraction processing unit, a detection unit and a positioning unit;

[0038] The frame extraction processing unit is used to perform frame extraction processing on the RGB image to obtain a frame extracted image;

[0039] The detection unit detects the extracted image using the Yolov7 model to obtain a detection frame, and performs Kalman filtering on the three-dimensional bounding frame to obtain a prediction frame;

[0040] The positioning unit is used to perform EIOU matching on the detection box and the prediction box and associate an ID, and output the detection box after associating the ID to obtain the position information.

[0041] Preferably, the feature extraction module includes: a segmentation unit, a center extraction unit and a boundary extraction unit;

[0042] The segmentation unit performs mouse part segmentation based on the small point cloud image, into the head, back, tail and tail;

[0043] The center extraction unit extracts the center of the head, back and tail by taking the centroid to obtain the center of the head, the center of the back and the center of the tail;

[0044] The boundary extraction unit uses the PCL BoundaryEstimation boundary extraction method to extract the neck, nose, waist, two end points of the tail, the point with the greatest bending degree of the tail, and two points on the edges of both sides of the body.

[0045] Preferably, the body shape data includes: mouse volume, mouse tail length and mouse back width;

[0046] The calculation and judgment module includes: a volume calculation unit, a tail length calculation unit, a width calculation unit and a behavior judgment unit;

[0047] The volume calculation unit calculates the minimum convex hull of the small point cloud image based on the open3d library, and calculates the volume of the minimum convex hull to obtain the volume of the mouse;

[0048] The tail length calculation unit takes one end point of the mouse tail as a starting point, calculates the distance between the starting point and the nearest bone point, and then takes the bone point as a starting point for the next iteration until the other end point, and accumulates the distances to obtain the mouse tail length;

[0049] The width calculation unit is used to calculate the distance between two points on the edges of both sides of the body to obtain the back width of the mouse;

[0050] The behavior identification unit is used to obtain the relative position information of the feature points and analyze the behavior of the mouse based on the relative position information.

[0051] Compared with the prior art, the present invention has the following beneficial effects:

[0052] (1) The present invention simultaneously realizes the acquisition of complete three-dimensional mouse point cloud, mouse volume measurement and weight estimation, mouse tail length extraction, mouse width acquisition, three-dimensional tracking of multiple mice and three-dimensional behavior detection of mice, and has the characteristics of high accuracy, time saving and labor saving;

[0053] (2) The present invention can detect the physical condition of mice and provide powerful technical support for mouse-related experiments such as medical experiments. At the same time, the system adopts intelligent storage to selectively store data and reduce storage costs. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0055] Figure 1 A schematic diagram of a method flow chart of an embodiment of the present invention;

[0056] Figure 2 A schematic diagram of a point cloud data processing process according to an embodiment of the present invention;

[0057] Figure 3 A schematic diagram of a small point cloud image of a mouse according to an embodiment of the present invention;

[0058] Figure 4 Schematic diagram of the system structure of an embodiment of the present invention. DETAILED DESCRIPTION

[0059] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0060] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0061] Embodiment 1

[0062] In this embodiment, if Figure 1 As shown, a mouse behavior detection method based on three-dimensional tracking comprises the following steps:

[0063] S1. Collect several images of mice in a feeding box, including RGB images and depth images, and pre-process the RGB images and depth images to obtain a three-dimensional point cloud image.

[0064] The preprocessing method includes: synthesizing the RGB image and the depth image to obtain the original three-dimensional point cloud; removing the surrounding environment and unreal points in the three-dimensional point cloud to obtain a processed three-dimensional point cloud; aligning and correcting the coordinates of the processed three-dimensional point cloud to obtain a three-dimensional point cloud image.

[0065] In this embodiment, in order to achieve better imaging effects and reduce subsequent errors, two depth cameras are used for data acquisition. First, the depth camera is used to collect RGB images and aligned depth images, and the RGB images and depth images are synthesized to obtain the original 3D point cloud. At this time, the original 3D point cloud has surroundings and unreal points, which will increase the difficulty of data processing. Therefore, the point cloud clipping method is used to remove the surroundings, and the statistical filtering method is used to remove unreal points.

[0066] Because the positions of the two cameras are fixed, only one alignment is needed to obtain the rotation matrix for subsequent point cloud alignment. Cloudcompare software is used to select 5 feature points to align the two initial point clouds reconstructed by the two cameras to obtain the rotation matrix. The subsequent point cloud alignment is completed through the obtained rotation matrix.

[0067] The synthesized point cloud establishes a spatial coordinate system with the camera as the origin. Because the camera is tilted, for the convenience of subsequent processing, the point cloud needs to be straightened, that is, the z-axis is perpendicular to the ground. The RANSAC algorithm is used to extract the ground to obtain the plane equation, extract the plane normal vector, calculate the rotation matrix of the plane normal vector rotated to (0, 0, 1), and rotate the point cloud around the origin through the rotation matrix to rotate the ground to be parallel to the xoy plane. The specific operation process is to extract the ground before placing it in the breeding box to complete the coordinate correction to obtain the rotation matrix, and finally straighten the point cloud through the obtained rotation matrix to obtain the final three-dimensional point cloud image.

[0068] S2. Position and track the mice in the RGB image to obtain the position information of a single mouse.

[0069] The positioning and tracking method includes: performing frame extraction processing on the RGB image to obtain a frame-extracted image; using the Yolov7 model to detect the frame-extracted image to obtain a detection frame, performing Kalman filtering on the three-dimensional bounding box to obtain a prediction frame; performing EIOU matching on the detection frame and the prediction frame and associating an ID, and outputting the detection frame associated with the ID to obtain position information.

[0070] In this embodiment, Yolov7 is first used to perform frame extraction processing on the RGB image. Since frame extraction during tracking will lead to poor tracking effect, when the distance between mice is relatively far, the mice will not have ID jumps at this time, and a total of 15 frames are extracted into 10 frames. The reason why too many frames cannot be extracted is that when the number of frames is too small, it will cause errors in behavior judgment. When the mice are close, no frame extraction processing is performed. When the mice are in a sleeping state, that is, when the mice remain inactive for a long time, a total of 15 frames are extracted into 5 frames.

[0071] like Figure 2 As shown in the figure, the mouse RGB image is recognized by Yolov7, and the average depth information of the recognition box area is extracted. The three-dimensional bounding box information (x, y, z, l, w, h) is input into the three-dimensional Kalman filter to predict the position of the next frame. The prediction box of the Kalman filter and the detection box of Yolo are matched by EIOU using the Hungarian algorithm to associate the ID. Because Yolo has a high recognition accuracy, the detection box of Yolo is used as the position information. At the same time, a restriction condition is added to limit the maximum number of IDs to the number of mice in the feeding box. When the match is wrong, the Mahalanobis distance is used to match the missing ID. When a mouse is completely blocked above a mouse, the depth value of the mouse below will be distorted, which may cause the ID to be exchanged with the mouse above during matching. Therefore, when the Mahalanobis distance is matched, the mouse with a high z coordinate is matched first. When the number of mice detected by Yolov7 is less than the number of mice in the feeding box, the mouse position predicted by the Kalman filter is regarded as the position of the missing mouse in the current frame.

[0072] S3. Based on the position information, a small point cloud image of a single mouse is cut out from the three-dimensional point cloud image, and feature points of the segmented part are extracted based on the small point cloud image.

[0073] The feature point extraction method includes: segmenting the mouse parts based on the small point cloud image into the head, back, tail and tail; extracting the center of the head, back and tail by taking the centroid method to obtain the center of the head, the center of the back and the center of the tail; using the PCL BoundaryEstimation boundary extraction method to extract the neck, nose, waist, two end points of the tail, the point with the greatest degree of curvature of the tail and two points on the edges of both sides of the body.

[0074] like Figure 3 As shown, in this embodiment, according to the results of three-dimensional tracking, the point cloud at the detection box position is cropped to obtain a small point cloud. At this time, there is only one complete mouse in the small point cloud. The complete mouse is segmented based on the Point Transformer network to obtain a small point cloud image. The accuracy and average accuracy of Point Transformer for the segmentation of the complete mouse are 95.57% and 91.02% respectively.

[0075] The segmented mouse point cloud image was input into the Point Transformer network for part segmentation, and the mouse was divided into four parts: head, back, tail, and tail. In the multi-mouse experiment, the tail part was not considered. The Point Transformer model achieved an accuracy and average miou of 92.55% and 87.94% in part segmentation, respectively.

[0076] The mouse feature point extraction method provided in this embodiment is to extract the center of the head, the center of the back, the center of the tail, the neck (the center of the junction of the head and the back), the nose (the point of the head farthest from the neck), the waist (the center of the junction of the back and the tail), the two end points of the tail and the point with the greatest curvature, and two points on the edges of both sides of the body. The center of the segmented head, tail and back is extracted by taking the centroid; the boundary of the back and the whole mouse is extracted by PCL BoundaryEstimation boundary extraction, and the boundary line on the back boundary but not on the whole boundary is extracted. The clustering method is used to cluster them into two categories, and the centroid is extracted respectively. The point close to the head is the center of the neck, and the other point is the center of the waist; the boundary line on the back boundary and on the whole boundary is extracted, and the clustering method is used as two categories, and the point closest to the center of the tail is taken as the edge point on both sides of the mouse body; the point closest to the tail point cloud is extracted as the starting point of the tail, and the deep optimization method is adopted, that is, starting from the starting point, the kdtree is used to search all points within the radius, and the points except the farthest point are marked. The next iteration is carried out with the current farthest point as the starting point, and the last unmarked point is taken as the other endpoint. The Laplace algorithm is used to extract the tail skeleton points, and the PCA algorithm is used to calculate the curvature to extract the point with the largest curvature.

[0077] S4. Determine the body shape data and behavior of mice based on feature points.

[0078] The body shape data includes: mouse volume, mouse tail length and mouse back width. The volume calculation method includes: calculating the minimum convex hull of the small point cloud image based on the open3d library, and calculating the volume of the minimum convex hull to obtain the mouse volume; the mouse tail length calculation method includes: taking one end point of the mouse tail as the starting point, calculating the distance between the starting point and its nearest bone point, and then taking the bone point as the starting point for the next iteration until the other end point, and accumulating the distance to obtain the mouse tail length; the mouse back width is the distance between two points on the edges of the body on both sides.

[0079] The behavior discrimination method includes: obtaining relative position information of feature points, and analyzing the behavior of the mouse based on the relative position information.

[0080] In this embodiment, the determination method is to analyze the behavior of the mouse based on the relative position information of the feature points of the mouse body. First, the relative position information of the feature points is obtained: the length of the line connecting the center of the head and the center of the back is l 1 , the length of the line connecting the back center and the tail center is l 2 , the angle between the two lines is a. The z coordinate of the head, back and tail of a mouse when crawling normally is z 1 、z 2 、z 3 , the length of the line connecting the center of the head and the center of the back is d 1 , the length of the line connecting the back center and the tail center is d 2 The speed of the mouse is the speed of the mouse center of mass divided by the xoy plane speed v 1 and the velocity v along the z-axis 2 .

[0081] The single instantaneous behaviors to be identified include:

[0082] (1) Normal static state: the z coordinates of the head, dorsal and tail centers are close, a>160 degrees, and the speed is close to 0;

[0083] (2) Standing: The difference between the z coordinates of the head and tail centers is greater than 20 mm, and the distance between the coordinates (x, y) of the head and tail centers is less than 20 mm;

[0084] (3) Squatting: The difference between the z coordinates of the center of the head and tail is greater than 10 mm, and the distance between the coordinates (x, y) of the center of the head and tail is greater than 20 mm;

[0085] (4) Head lift: the z coordinates of the back and tail are close, and the z coordinate of the head is 2 mm greater than the z coordinate of the back;

[0086] (5) Stretch: l 1 +l 2 >d 1 +d 2 +20mm;

[0087] (6) Abbreviation: l 1 +l 2 <d 1 +d 2 +20mm;

[0088] (7) curl up: l 1 +l 2 <d 1 +d 2 +20mm and a<90 degrees;

[0089] (8) Tail bending angle: the angle between the two end points and the line connecting the point with the maximum curvature;

[0090] Identify single continuous behavior:

[0091] (1) Eating: In the food area, the head is raised for more than 2 seconds;

[0092] (2) Drinking water: In the drinking area, the head is raised for more than 2 seconds;

[0093] (3) Sleeping: staying still for more than 30 seconds;

[0094] (4) Exploration: walking in the middle area of ​​the enclosure, where the distance from the inner wall is greater than 5 cm;

[0095] (5) Sniffing: The center of the back and tail is basically motionless, and the angle between the line connecting the center of the neck and the center of the head and the line connecting the center of the back and the tail changes continuously within 1 second and exceeds 45 degrees;

[0096] (6) Tail swing: The bending angle of the tail changes continuously;

[0097] (7) Running: Mouse xoy plane speed v 1 >10cm / s;

[0098] (8) Climbing: The head, back and tail coordinates are higher than z 1 +20mm, z 2 +20mm, z 3 +20mm;

[0099] (9) Circle: continuous a<90 degrees mouse xoy plane speed v 1 >5cm / s for more than 2s;

[0100] (10) Jumping in place: The mouse's speed along the z-axis v 2 >5cm / s and the body is in a standing position;

[0101] Identify multiple social behaviors:

[0102] (1) Chase: The distance between the two mice shortens and the head of one mouse is closer to the tail of the other mouse than to its head;

[0103] (2) Close proximity: the distance between the two mice shortens and the head of one is closer to the other head than the tail;

[0104] (3) Close: The side frames of the two mice overlap;

[0105] (4) Head to head: the distance between the centers of the heads of two mice was less than 3 cm;

[0106] (5) Head to tail: The distance between the center of the head and the center of the tail of two mice is less than 3 cm;

[0107] (6) Tail to tail: the distance between the centers of the tails of two mice was less than 3 cm;

[0108] (7) one on top of the other: the overlap of the detection frames of the two mice was greater than 30% and the average depth of the detection frames differed by 2 cm;

[0109] (8) Fighting: Two mice are close to each other and move quickly.

[0110] Embodiment 2

[0111] In this embodiment, if Figure 4 As shown, a mouse behavior detection system based on three-dimensional tracking includes: an image acquisition module, a positioning tracking module, a feature extraction module and a calculation and judgment module.

[0112] The image acquisition module is used to collect several images of mice in the feeding box, including RGB images and depth images. The RGB images and depth images are preprocessed to obtain three-dimensional point cloud images.

[0113] The image acquisition module includes: an acquisition unit, a synthesis unit, a processing unit and a correction unit. The acquisition unit includes several depth cameras. The acquisition unit is used to acquire images; the synthesis unit is used to synthesize RGB images and depth images to obtain the original three-dimensional point cloud; the processing unit is used to remove the surrounding environment and unreal points in the three-dimensional point cloud to obtain the processed three-dimensional point cloud; the correction unit is used to align and correct the coordinates of the processed three-dimensional point cloud to obtain a three-dimensional point cloud image.

[0114] The positioning and tracking module is used to locate and track mice in RGB images to obtain the position information of a single mouse.

[0115] The positioning and tracking module includes: a frame extraction processing unit, a detection unit and a positioning unit. The frame extraction processing unit is used to perform frame extraction processing on the RGB image to obtain the frame extracted image; the detection unit uses the Yolov7 model to detect the frame extracted image to obtain the detection frame, and performs Kalman filtering on the three-dimensional bounding box to obtain the prediction frame; the positioning unit is used to perform EIOU matching between the detection frame and the prediction frame and associate the ID, and output the detection frame after the ID is associated to obtain the location information.

[0116] The feature extraction module cuts out a small point cloud image of a single mouse from the three-dimensional point cloud image based on the position information, and extracts feature points of the segmented parts based on the small point cloud image.

[0117] The feature extraction module includes: segmentation unit, center extraction unit and boundary extraction unit. The segmentation unit performs mouse part segmentation based on the small point cloud image, which is divided into head, back, tail and tail; the center extraction unit uses the centroid method to extract the center of the head, back and tail, and obtains the center of the head, back and tail; the boundary extraction unit uses the PCL BoundaryEstimation boundary extraction method to extract the neck, nose, waist, two end points of the tail, the point with the largest degree of tail curvature and two points on the edges of the two sides of the body.

[0118] The calculation and judgment module judges the body data and behavior of the mouse based on the feature points. The body data includes: mouse volume, mouse tail length and mouse back width.

[0119] The calculation and judgment module includes: volume calculation unit, tail length calculation unit, width calculation unit and behavior discrimination unit. The volume calculation unit calculates the minimum convex hull of the small point cloud image based on the open3d library, and calculates the volume of the minimum convex hull to obtain the volume of the mouse; the tail length calculation unit takes one end point of the mouse tail as the starting point, calculates the distance between the starting point and its nearest bone point, and then takes the bone point as the starting point for the next iteration until the other end point, and accumulates the distance to obtain the tail length of the mouse; the width calculation unit is used to calculate the distance between two points on the edges of both sides of the body to obtain the width of the mouse back; the behavior discrimination unit is used to obtain the relative position information of the feature points, and analyze the behavior of the mouse based on the relative position information.

[0120] The above embodiments are only descriptions of the preferred embodiments of the present invention, and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.

Claims

1. A mouse behavior detection method based on three-dimensional tracking, characterized in that: The following steps are involved: Collecting several images of mice in a feeding box, the images including: RGB images and depth images, and preprocessing the RGB images and the depth images to obtain a three-dimensional point cloud image; Positioning and tracking the mice in the RGB image to obtain position information of a single mouse; Based on the position information, a small point cloud image of a single mouse is cut out from the three-dimensional point cloud image, and feature points of the segmented part are extracted based on the small point cloud image; Determining the body shape data and behavior of the mouse based on the characteristic points; The feature point extraction method comprises: Segment the mouse parts based on the small point cloud image into head, back, tail and caudal parts; The center of the head, back and tail is extracted by taking the centroid to obtain the center of the head, the center of the back and the center of the tail; PCL BoundaryEstimation is used to extract the neck feature points, nose feature points, waist feature points, two end points of the tail, the point with the greatest curvature of the tail, and two points on the edges of both sides of the body. The PCL BoundaryEstimation boundary extraction method is used to extract the boundary of the back and the boundary of the whole mouse. The boundary line on the back boundary but not on the overall boundary is extracted, and clustered into two categories by clustering. The center of mass is extracted respectively. The point close to the head is the center of the neck, and the other point is the center of the waist. The boundary line on the back boundary and on the overall boundary is extracted by clustering into two categories. The point closest to the center of the tail is taken as the edge point on both sides of the mouse body. The point closest to the tail point cloud is extracted as the starting point of the tail. The deep optimization method is adopted, that is, starting from the starting point, kdtree is used to search all points within the radius, and the remaining points except the farthest point are marked. The next iteration is carried out with the current farthest point as the starting point, and the last unmarked point is taken as the other endpoint. The Laplace algorithm is used to extract the skeleton points of the tail, and the PCA algorithm is used to calculate the curvature to extract the point with the largest curvature. The body shape data include: mouse volume, mouse tail length and mouse back width; The volume calculation method includes: calculating the minimum convex hull of the small point cloud image based on the open3d library, and calculating the volume of the minimum convex hull to obtain the volume of the mouse; The method for calculating the mouse tail length comprises: taking one end point of the mouse tail as a starting point, calculating the distance between the starting point and the nearest bone point, and then taking the bone point as a starting point for the next iteration until the other end point, and accumulating the distances to obtain the mouse tail length; The width of the mouse back is the distance between two points on the edges of both sides of the body; The behavior identification method includes: acquiring relative position information of the feature points, and analyzing the behavior of the mouse based on the relative position information.

2. A mouse behavior detection method based on three-dimensional tracking according to claim 1, characterized in that: The pretreatment method comprises: Synthesize the RGB image and the depth image to obtain an original three-dimensional point cloud; Removing surroundings and unreal points from the three-dimensional point cloud to obtain a processed three-dimensional point cloud; The processed three-dimensional point cloud is registered and coordinate corrected to obtain the three-dimensional point cloud image.

3. A mouse behavior detection method based on three-dimensional tracking according to claim 1, characterized in that: The positioning tracking method comprises: Performing frame extraction processing on the RGB image to obtain a frame extracted image; The Yolov7 model is used to detect the extracted frame image to obtain a detection frame, and the average depth information of the recognition frame area is extracted, and the three-dimensional bounding frame is subjected to Kalman filtering to obtain a prediction frame; The detection box is matched with the prediction box by EIOU and associated with an ID, and the detection box after the associated ID is output to obtain the position information.

4. A mouse behavior detection system based on three-dimensional tracking, the detection system applying the detection method according to any one of claims 1 to 3, characterized in that: include: Image acquisition module, positioning and tracking module, feature extraction module and calculation and judgment module; The image acquisition module is used to collect a number of images of mice in the feeding box, wherein the images include: RGB images and depth images, and the RGB images and the depth images are preprocessed to obtain a three-dimensional point cloud image; The positioning and tracking module is used to position and track the mice in the RGB image to obtain the position information of a single mouse; The feature extraction module cuts out a small point cloud image of a single mouse from the three-dimensional point cloud image based on the position information, and extracts feature points of the segmented part based on the small point cloud image; The calculation and judgment module judges the body shape data and behavior of the mouse based on the characteristic points; The feature extraction module includes: a segmentation unit, a center extraction unit and a boundary extraction unit; The segmentation unit performs mouse part segmentation based on the small point cloud image, into the head, back, tail and tail; The center extraction unit extracts the center of the head, back and tail by taking the centroid to obtain the center of the head, the center of the back and the center of the tail; The boundary extraction unit uses the PCL BoundaryEstimation boundary extraction method to extract the neck, nose, waist, two end points of the tail, the point with the greatest bending degree of the tail, and two points on the edges of both sides of the body; The PCL BoundaryEstimation boundary extraction method is used to extract the boundary of the back and the boundary of the whole mouse. The boundary line on the back boundary but not on the overall boundary is extracted, and clustered into two categories by clustering. The center of mass is extracted respectively. The point close to the head is the center of the neck, and the other point is the center of the waist. The boundary line on the back boundary and on the overall boundary is extracted by clustering into two categories. The point closest to the center of the tail is taken as the edge point on both sides of the mouse body. The point closest to the tail point cloud is extracted as the starting point of the tail. The deep optimization method is adopted, that is, starting from the starting point, kdtree is used to search all points within the radius, and the remaining points except the farthest point are marked. The next iteration is carried out with the current farthest point as the starting point, and the last unmarked point is taken as the other endpoint. The Laplace algorithm is used to extract the skeleton points of the tail, and the PCA algorithm is used to calculate the curvature to extract the point with the largest curvature. The body shape data include: mouse volume, mouse tail length and mouse back width; The calculation and judgment module includes: a volume calculation unit, a tail length calculation unit, a width calculation unit and a behavior judgment unit; The volume calculation unit calculates the minimum convex hull of the small point cloud image based on the open3d library, and calculates the volume of the minimum convex hull to obtain the volume of the mouse; The tail length calculation unit takes one end point of the mouse tail as a starting point, calculates the distance between the starting point and the nearest bone point, and then takes the bone point as a starting point for the next iteration until the other end point, and accumulates the distances to obtain the mouse tail length; The width calculation unit is used to calculate the distance between two points on the edges of both sides of the body to obtain the back width of the mouse; The behavior identification unit is used to obtain the relative position information of the feature points and analyze the behavior of the mouse based on the relative position information.

5. A mouse behavior detection system based on three-dimensional tracking according to claim 4, characterized in that: The image acquisition module includes: an acquisition unit, a synthesis unit, a processing unit and a correction unit; The acquisition unit includes a plurality of depth cameras, and the acquisition unit is used to acquire the image; The synthesis unit is used to synthesize the RGB image and the depth image to obtain an original three-dimensional point cloud; The processing unit is used to remove the surrounding environment and unreal points in the three-dimensional point cloud to obtain a processed three-dimensional point cloud; The correction unit is used to perform registration and coordinate correction on the processed three-dimensional point cloud to obtain the three-dimensional point cloud image.

6. A mouse behavior detection system based on three-dimensional tracking according to claim 4, characterized in that: The positioning and tracking module includes: a frame extraction processing unit, a detection unit and a positioning unit; The frame extraction processing unit is used to perform frame extraction processing on the RGB image to obtain a frame extracted image; The detection unit detects the extracted frame image using the Yolov7 model to obtain a detection frame, extracts average depth information of the recognition frame area, performs Kalman filtering on the three-dimensional bounding frame, and obtains a prediction frame; The positioning unit is used to perform EIOU matching on the detection box and the prediction box and associate an ID, and output the detection box after associating the ID to obtain the position information.