Detection method and system based on animal posture action recognition and analysis
By improving the YOLO detection model and introducing the CBAM attention mechanism, combining monitoring video and sensing data, automatic identification and monitoring of the identity and status of experimental animals is achieved, and the problem of insufficient real-time and data integrity in the prior art is solved.
Patent Information
- Application Number
- CN202411572744.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-02-25
AI Technical Summary
The prior art cannot automatically identify and monitor the identity, body temperature and survival status of experimental animals, resulting in low real-time and insufficient data integrity, which requires manual observation.
The detection method based on animal posture and motion recognition and analysis is adopted. By obtaining temperature data, humidity data, monitoring videos and animal body temperature data, the CBAM attention mechanism is introduced to improve the YOLO detection model, identify animal identities, and record animal action trajectories in real time to match the display environment, animal and action data.
Automatic identification and status monitoring of experimental animals is realized, real-time and data integrity are improved, and the need for manual observation is reduced.
Smart Images

Figure CN119516606A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of state monitoring, and in particular to a detection method and system based on animal posture and motion recognition and analysis. Background Art
[0002] During the experiment, it is very necessary to detect the status of animals in real time and analyze the experimental environment in real time. The stability and quality of experimental animals and the experimental environment directly affect the safety of the experimental box and the accuracy of the experimental results.
[0003] At present, the detection method that can monitor the status of mice in toxicity tests online cannot automatically identify the identity of the mice, nor can it automatically identify the body temperature corresponding to the identity. The key point is that it cannot automatically identify the survival and physical status (normal, abnormal) of the mice, and most of them require manual observation. Summary of the invention
[0004] In view of this, in order to solve the technical problems that most of the existing monitoring and analysis methods are manual inspections, which leads to low real-time performance and insufficient data integrity, the present invention proposes a detection method based on animal posture and motion recognition and analysis, the method comprising the following steps:
[0005] Obtain temperature data, humidity data, surveillance video, and animal body temperature data;
[0006] Introduced CBAM attention mechanism to improve the YOLO detection model;
[0007] Identify the identity of the animal based on the improved YOLO detection model and obtain animal data;
[0008] Classify the target animal's movements based on the surveillance video and record the animal's movement trajectory in real time to obtain movement data;
[0009] The environmental data, the animal data and the action data are matched and displayed in association.
[0010] In some embodiments, it also includes:
[0011] The temperature data, the humidity data and the animal body temperature data are compared with preset thresholds to filter out unreasonable data.
[0012] In some embodiments, the step of identifying the identity of the animal based on the improved YOLO detection model to obtain the animal data specifically includes:
[0013] Extract features from the input image based on a parallel feature extraction network to obtain a feature map;
[0014] Processing the feature map based on the CBAM attention mechanism to generate a channel attention feature map and a spatial attention feature map;
[0015] Performing weighted fusion on the channel attention feature map and the spatial attention feature map to obtain a weighted fusion feature map;
[0016] The weighted fusion feature map is judged based on the detection head to obtain animal data.
[0017] In some embodiments, the step of recording the animal's motion trajectory in real time to obtain motion data specifically includes:
[0018] Taking the monitoring video as input, the 3D coordinate sequence of the key points of the target animal in each frame image of the monitoring video is obtained; the action classification is performed based on the 3D coordinate sequence of the key points; and the action of each frame image is associated with time to obtain action data.
[0019] In some embodiments, the step of matching and displaying the environment data, the animal data, and the action data specifically includes:
[0020] Based on the same target, the animal data and the action data are matched to obtain first matching data; based on time, the environment data and the first matching data are associated to obtain final display data; and the final display data is uploaded.
[0021] The present invention also proposes a detection system, the system comprising:
[0022] Online detection module, used to display environmental data, animal data and motion data;
[0023] Report management module, used for report editing, report generation and report export;
[0024] The device management module is used to handle device access, device query and device deletion.
[0025] Based on the above scheme, the present invention provides a detection method and system based on animal posture and motion recognition and analysis, which combines natural learning language algorithm with Internet of Things sensing technology to achieve 24-hour detection of experimental scenes and experimental animals, helping relevant experimental personnel to observe and collect evidence on the mice in the experiment anytime and anywhere. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 It is a flow chart of the steps of a detection method based on animal posture and action recognition and analysis of the present invention;
[0027] Figure 2It is a specific implementation framework diagram of the detection system of the present invention;
[0028] Figure 3 It is a structural block diagram of a detection system based on animal posture and action recognition and analysis of the present invention. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0030] It should be noted that, for the convenience of description, only the parts related to the relevant invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other.
[0031] It should be understood that the "system", "device", "unit" and / or "module" used in this application is a method for distinguishing different components, elements, parts, portions or assemblies at different levels. However, if other words can achieve the same purpose, the word can be replaced by other expressions.
[0032] As shown in this application and claims, unless the context clearly indicates an exception, the words "a", "an", "a kind" and / or "the" do not refer to the singular, but also include the plural. Generally speaking, the terms "include" and "comprise" only indicate the inclusion of clearly identified steps and elements, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements. The elements defined by the sentence "includes a..." do not exclude the existence of other identical elements in the process, method, commodity or device that includes the elements.
[0033] In the description of the embodiments of the present application, "plurality" means two or more than two. The following terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features.
[0034] In addition, flow charts are used in the present application to illustrate the operations performed by the system according to the embodiments of the present application. It should be understood that the preceding or following operations are not necessarily performed accurately in order. On the contrary, the various steps may be processed in reverse order or simultaneously. At the same time, other operations may also be added to these processes, or a certain step or several steps of operations may be removed from these processes.
[0035] Reference Figure 1 , is a flow chart of an optional example of a detection method based on animal posture and action recognition and analysis proposed by the present invention, which can be applied to computer devices. The detection method proposed in this embodiment may include but is not limited to the following steps:
[0036] Step S0: Build a detection system based on SpringBoot architecture and Pytorch framework;
[0037] Among them, Spring Boot is a framework that simplifies Spring development. It is used to supervise the development of spring applications, with conventions over configurations, and to create an independent, product-level application by simplifying the complexities. Pytorch is the python version of torch, an open source neural network framework developed by Facebook, specifically for GPU-accelerated deep neural network (DNN) programming.
[0038] Step S1, obtaining environmental data;
[0039] Step S2: introduce the CBAM attention mechanism, identify the identity of the animal based on the improved YOLO detection model, and obtain animal data;
[0040] YOLO scales the input image to a predefined size and divides it into S×S grids. When the center of the object to be detected falls into a certain grid, the grid is responsible for predicting B bounding boxes. If there are C types of objects to be detected, the vector size of each bounding box output is (C+5), where 5 represents a five-tuple of the form T=(x,y,w,h,S), where (x,y) is the horizontal and vertical coordinates of the center of the object, (w,h) is the width and height of the object, and S represents the confidence score of the predicted box, which is calculated as
[0041] S = P(Ci) × P(O) × I;
[0042] When there is an object in the predicted box, P(O) = 1, otherwise P(O) = 0; I represents the intersection-over-union ratio of the predicted box and the true box; P(Ci) represents the probability that the object belongs to the i-th object in the C category when the object exists. After obtaining the confidence score of each box, a threshold is set, and the non-maximum suppression algorithm (NMS) is used to process it. The scores less than the threshold are set to 0, and the confidence score S is obtained. The prediction box with a higher score is the detection box.
[0043] Step S3, recording the animal's movement trajectory in real time to obtain movement data;
[0044] Step S4: Match and display the environmental data, the animal data and the action data.
[0045] In some feasible embodiments, the step S1 specifically includes:
[0046] S1.1. Obtain temperature data and humidity data based on temperature and humidity sensors;
[0047] S1.2, obtaining surveillance video based on surveillance cameras;
[0048] S1.3, obtain animal body temperature data based on thermal imaging detector;
[0049] S1.4. Filter the temperature data, the humidity data and the animal body temperature data according to preset threshold screening rules.
[0050] For example, set the ambient temperature threshold to 0°C and delete the temperature data below the ambient temperature. Monitor the temperature data below the normal animal body temperature to see if the experimental animals have died.
[0051] In some feasible embodiments, the step S2 specifically includes:
[0052] S2.1, extract features from the input image based on the feature extraction network to obtain a feature map;
[0053] In this step, two parallel feature extraction networks, such as Darknet53, are constructed; based on the parallel feature extraction networks, features of different scales are extracted from the input image to obtain a visible light multi-scale feature map and an infrared light multi-scale feature map.
[0054] S2.2, processing the feature map based on the CBAM attention mechanism including a channel attention unit and a spatial attention unit to generate a channel attention feature map and a spatial attention feature map;
[0055] S2.3, performing multi-scale weighted fusion on the channel attention feature map and the spatial attention feature map to obtain a weighted fusion feature map of the corresponding scale;
[0056] Among them, in order to further improve the calculation speed of the algorithm, the number of channels can be appropriately reduced.
[0057] S2.4. Determine the weighted fusion feature map based on the detection head to obtain animal data.
[0058] This recognition process also includes steps such as model training, parameter adjustment and testing, but this process is not much different from the existing technology, so it will not be explained in detail.
[0059] In some feasible embodiments, the step S3 specifically includes:
[0060] S3.1, taking the surveillance video as input, obtaining a 3D coordinate sequence of key points of the target animal in each frame of the surveillance video;
[0061] S3.2, performing action classification based on the 3D coordinate sequence of the key points;
[0062] S3.3. Based on time, the action of each frame image is associated to obtain action data.
[0063] In some feasible embodiments, the step S4 specifically includes:
[0064] S4.1. First, connect the actions of the same target in series. Based on the same target (identity number), match the animal data and the action data to obtain the first matching data;
[0065] S4.2, combining the corresponding environment data. Based on time, the environment data and the first matching data are associated to obtain final display data;
[0066] S4.3. Upload the final display data and provide visual operation, so that the user can grasp the temperature and humidity in the monitoring box in real time.
[0067] Based on the above scheme, refer to Figure 2 The data processing in the detection system of the present invention includes monitoring the temperature and humidity of the detection box, generating a report to display data, monitoring the body temperature of the mice (if there is a number, the corresponding number is monitored), and monitoring the activity status data of the mice. An algorithm for identifying the physical state of the mice based on the mouse activity posture, an algorithm for identifying different mouse identities based on color + markers, a video stream processing method, etc. are applied.
[0068] like Figure 3 As shown, a detection system based on animal posture and motion recognition and analysis includes:
[0069] Online detection module, used to display environmental data, animal data and motion data;
[0070] Report management module, used for report editing, report generation and report export;
[0071] The device management module is used to handle device access, device query and device deletion.
[0072] The contents of the above method embodiments are all applicable to the present system embodiments. The functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0073] A detection device based on animal posture and motion recognition and analysis:
[0074] at least one processor;
[0075] at least one memory for storing at least one program;
[0076] When the at least one program is executed by the at least one processor, the at least one processor implements the above-mentioned detection method based on animal posture and action recognition and analysis.
[0077] The contents of the above method embodiments are all applicable to the present device embodiments. The functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0078] A storage medium stores processor-executable instructions, which are used to implement the above-mentioned detection method based on animal posture and action recognition and analysis when executed by the processor.
[0079] The contents of the above method embodiments are all applicable to the present storage medium embodiments. The functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0080] The above is a specific description of the preferred implementation of the present invention, but the invention is not limited to the embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.
Claims
1. A detection method based on animal posture and action recognition and analysis, characterized in that: The following steps are involved: Obtain environmental data; The CBAM attention mechanism is introduced to identify the identity of animals based on the improved YOLO detection model to obtain animal data; Record the animal's movement trajectory in real time to obtain movement data; The environmental data, the animal data and the action data are matched and displayed.
2. The detection method based on animal posture and action recognition and analysis according to claim 1, characterized in that: Also included: Build a detection system based on SpringBoot architecture and Pytorch framework.
3. The detection method based on animal posture and action recognition and analysis according to claim 1, characterized in that: The step of obtaining environmental data specifically includes: Obtain temperature data, humidity data and surveillance video; Obtain animal body temperature data; The temperature data, the humidity data and the animal body temperature data are screened according to preset threshold screening rules.
4. The detection method based on animal posture and action recognition and analysis according to claim 1, characterized in that: The step of introducing the CBAM attention mechanism, identifying the identity of the animal based on the improved YOLO detection model, and obtaining the animal data specifically includes: Extract features from the input image based on the feature extraction network to obtain a feature map; Processing the feature map based on the CBAM attention mechanism to generate a channel attention feature map and a spatial attention feature map; Performing weighted fusion on the channel attention feature map and the spatial attention feature map to obtain a weighted fusion feature map; The weighted fusion feature map is judged based on the detection head to obtain animal data.
5. A detection method based on animal posture and action recognition and analysis according to claim 4, characterized in that: The step of extracting features from the input image based on the feature extraction network to obtain a feature map specifically includes: Build a parallel feature extraction network; Based on the parallel feature extraction network, features of different scales are extracted from the input image to obtain visible light multi-scale feature maps and infrared light multi-scale feature maps.
6. The detection method based on animal posture and action recognition and analysis according to claim 1, characterized in that: The step of recording the animal's motion trajectory in real time to obtain motion data specifically includes: Taking the surveillance video as input, obtaining a 3D coordinate sequence of key points of the target animal in each frame of the surveillance video; Performing action classification based on the 3D coordinate sequence of the key points; Based on time, the actions of each frame of the image are associated to obtain action data.
7. The detection method based on animal posture and action recognition and analysis according to claim 1, characterized in that: The step of matching and displaying the environmental data, the animal data and the action data specifically includes: Based on the same target, the animal data and the action data are matched to obtain first matching data; Based on time, the environment data and the first matching data are associated to obtain final display data; The final display data is uploaded.
8. The detection method based on animal posture and action recognition and analysis according to claim 2, characterized in that: The detection system comprises: Online detection module, used to display environmental data, animal data and motion data; Report management module, used for report editing, report generation and report export; The device management module is used to handle device access, device query and device deletion.
9. A detection device based on animal posture and action recognition and analysis, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements a detection method based on animal posture and action recognition and analysis as described in any one of claims 1 to 7.