Animal feature point recognition method, its circling behavior measurement method and system and application

Through computer vision technology, the characteristic points of animals are identified and the circle behavior is automated, which solves the problems of manual counting errors and environmental interference, and improves the accuracy and reliability of experimental results.

CN113901957BActive Publication Date: 2024-11-19CHENGDU TME SOFTWARE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111374161.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-19
Publication Date
2024-11-19
Estimated Expiration
2041-11-19

AI Technical Summary

Technical Problem

There are artificial counting errors, stain interference and light changes in existing animal circle behavior experiments, which affect the authenticity and reliability of the experimental results.

Method used

Computer vision technology is used to identify the moving feature points and fixed feature points of animals, and the circle behavior is determined through quantitative changes in the feature vector, and automated statistics are realized to avoid artificial errors and environmental interference.

Benefits of technology

In the absence of animal marking, real-time and accurate statistics of circle behaviors have improved the effectiveness and robustness of experimental results and reduced artificial interference and environmental impact.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113901957B_ABST
    Figure CN113901957B_ABST
Patent Text Reader

Abstract

The present invention discloses an animal feature point recognition method, a circling behavior measurement method and system and application thereof, wherein the measurement method comprises: identifying the motion feature points related to the animal's motion state and the fixed feature points related to the animal's body structure from the obtained continuous frame images and / or processed images of the test animal, and further obtaining the quantitative changes of the feature vectors composed of the motion feature points and the fixed feature points in the continuous frame images, and determining the animal's circling behavior measurement parameters according to the quantitative changes. The present invention can obtain the circling behavior measurement results efficiently, accurately, automatically and in real time without marking the animal itself.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of animal behavior recognition based on computer vision. Background Art

[0002] Animal circling experiments can be used to analyze circling behavior caused by unilateral brain damage in rodents. Most existing circling or rotation behavior experiments use the following methods: manual counting and analysis by human eye observation; using methods of local staining of animals and setting special marks on the animal's body, capturing these specially treated body parts through computer vision technology, and then calculating the number of animal circling based on image records. Among the above methods, manual counting is prone to subjective errors caused by fatigue of counting personnel during long-term experiments, and local staining methods are prone to interference of dyes and markers on experimental animals, as well as cumulative angle errors caused by misidentification of dyes and markers, which affect the authenticity and reliability of the experimental results. Summary of the invention

[0003] The purpose of the present invention is to propose an animal feature point recognition method, a circling behavior measurement method and system, wherein the feature points are mainly feature points that can be used for circling behavior measurement, including motion feature points such as the animal's center of gravity, and fixed feature points such as its facial feature points, more specifically, its nose tip point. The present invention can obtain real-time and accurate circling behavior statistics without marking the animal itself, and can improve the statistical fault tolerance in the presence of obvious environmental interference factors such as occlusion, light changes, etc. that cause inaccurate image key points. The present invention can also realize the automation of the animal experiment process, avoid human errors and interference with experimental animals, and increase the validity and robustness of the experimental results.

[0004] The present invention first provides the following technical solution:

[0005] A method for measuring animal circling behavior, comprising:

[0006] S1 obtains the continuous frame image data of the test animal, that is, its original image;

[0007] S2: in each frame of the original image and / or the processed image thereof, identifying a first feature point of the subject animal;

[0008] S3: in each frame of the original image and / or the processed image thereof, identifying a second feature point of the subject animal;

[0009] S4: obtaining a quantitative change of a feature vector composed of the first feature point and the second feature point in different frames of the original image and / or the processed image thereof, and determining a measurement parameter of the animal circling behavior according to the quantitative change;

[0010] The first feature point is a motion feature point related to the animal's motion state, and the second feature point is a fixed feature point related to the animal's body structure.

[0011] In the above scheme, the fixed feature point is not limited to a point whose relative position or absolute position in all images is fixed, but only refers to the point being a feature point that actually exists on the animal body.

[0012] Preferably, in order to enhance recognition accuracy, the processed image is used in steps S2-S4, as shown in the specific implementation.

[0013] According to some preferred embodiments of the present invention, the feature vector is a line vector formed by connecting the first feature point and the second feature point.

[0014] Further preferably, the quantitative change is a deflection angle of the connecting line vector.

[0015] According to some preferred embodiments of the present invention, the processed image is a target image containing a test animal and / or an enhanced image thereof after enhancement processing and / or any target extracted image obtained by extracting the two through a minimum bounding box.

[0016] According to some preferred embodiments of the present invention, the first characteristic point is the center of gravity.

[0017] According to some preferred embodiments of the present invention, the second feature point is a facial feature point, and more preferably, the facial feature point is a nose tip point.

[0018] According to some preferred embodiments of the present invention, the target image is a foreground image of the original image obtained by background subtraction and binarization.

[0019] According to some preferred embodiments of the present invention, the background subtraction method comprises one or more of the following methods:

[0020] A moving target background subtraction method, comprising: modeling background pixels according to the color features of pixels in the original image of the continuous frames; based on the obtained background pixel model, calculating the maximum likelihood estimate of the current pixel as a background pixel by using the Bayesian formula to obtain its probability distribution map; performing thresholding processing on the probability distribution map to obtain segmented foreground pixels and background pixels;

[0021] The background subtraction method based on the background image includes: obtaining a background image without animals; performing a difference process between the original image and the background image without animals to obtain a difference image; performing an image enhancement process on the difference image to obtain a processed foreground image;

[0022] The background subtraction method based on grayscale pixel classification includes: grayscale the original image; binary classification of the pixel values ​​of the obtained grayscale image, and calculating the number of pixels in each category, wherein the pixel points of the category with a small number are determined as foreground pixel points, and the pixel points of the category with a large number are determined as background pixel points;

[0023] The background subtraction method based on color picking includes: picking color from the center point of the animal's body; establishing a pure color HSV image of the color picking point as a color background image; converting the original image into an HSV format, searching for pixels with colors similar to the color picking point according to a set similarity threshold, and forming foreground pixels from the similar pixels.

[0024] According to some preferred embodiments of the present invention, in the moving target background subtraction method, the color feature is the RGB color quantization value of the pixel point.

[0025] According to some preferred embodiments of the present invention, the thresholding process further includes morphological processing of the probability distribution map.

[0026] According to some preferred embodiments of the present invention, the identification of the nose tip point includes:

[0027] Inputting the original image and / or its processed image into a nose tip point recognition model to obtain a single-channel thermal map corresponding to the nose tip point;

[0028] Find the maximum pixel value of the heat map and its corresponding coordinate value, and convert the coordinate value to the input image according to the transformation relationship between the heat map and the input image to obtain the coordinates of the nose tip point in the input image;

[0029] Among them, the nose tip point recognition model is constructed based on a neural network with an encoding-decoding structure, which can generate a normalized Gaussian distribution map as the heat map label of the input image according to the label of the input image, and the corresponding Gaussian kernel center of gravity is the coordinate of the nose tip point.

[0030] According to some preferred embodiments of the present invention, the measurement parameters include the number of turns and / or the direction of turns, and the acquisition process includes:

[0031] Obtaining relative deflection angles of the feature vectors in each adjacent frame image according to different rotation directions, wherein the different rotation directions include clockwise or counterclockwise rotation;

[0032] Accumulating the relative deflection angles of adjacent frame images in different rotation directions respectively;

[0033] When the accumulated angle reaches the turning angle statistical threshold, the number of turns in this direction is increased by one, and the accumulated value is reset to 0, and the accumulation calculation is restarted until all frames are calculated;

[0034] The turning angle statistical threshold is an angle value greater than or equal to 310° and less than or equal to 350°.

[0035] The present invention further provides a method for identifying animal feature points, wherein the feature point is a nose tip point, and the identification includes: inputting an input image into a nose tip point recognition model to obtain a single-channel thermal map corresponding to the nose tip point;

[0036] Find the maximum pixel value of the heat map and its corresponding coordinate value, and convert the coordinate value to the input image according to the transformation relationship between the heat map and the input image to obtain the coordinates of the nose tip point in the input image;

[0037] Among them, the input image is a foreground image containing the subject animal and / or its enhanced image after enhancement processing and / or any extracted image obtained by extracting the minimum bounding box of the two; the nose tip point recognition model is constructed based on the neural network of the above encoding-decoding structure.

[0038] The present invention further provides an animal circling behavior measurement system, which includes the following storage module: the module stores models and / or programs and / or required data required to implement the above-mentioned measurement method and / or identification method.

[0039] The present invention further provides a specific application method of the above-mentioned determination method and / or identification method and / or determination system, such as applying it to determine the circling behavior of unilateral Parkinson's disease model mice.

[0040] The measurement method and / or system of the present invention measures and counts the number and direction of animal circles based on computer vision technology and deep learning technology, without the need for manual counting, saving labor costs and avoiding human subjective errors. At the same time, it does not require dyeing or adding labels to the animal's body surface, avoiding interference caused by the external environment and simplifying the experimental operation.

[0041] The measuring method and / or system of the present invention can use the same technology for animals of different sizes, and no additional configuration is required according to the size of the animal; in addition, for some animals with special movement patterns that are difficult to identify individually, such as unilateral Parkinson's model mice that tend to use their forelimbs as fulcrums and connect their heads and tails to constantly turn to the left in circles during movement, after the front and back backgrounds are segmented, they tend to present a C-shape or a circle, rather than an ellipse or rectangle with obvious differences in the major and minor axes, which has a negative impact on the direct calculation of the orientation through the second-order moment, making it difficult to obtain accurate statistical results. The present invention further proposes a method for identifying fixed feature points such as the tip of the nose through a neural network, which is not affected by the negative impact of its movement pattern; in addition, the measuring method and / or system of the present invention can be configured with different background subtraction methods according to actual application requirements, reduce the influence of the color of the experimental animals, avoid interference from light and shadow changes, camera imaging quality and equipment color, and have a good effect when an ordinary USB camera is used instead of an industrial camera. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 The figure is a flow chart of a specific statistical method for animal circling behavior in the present invention.

[0043] Figure 2 The figure is a flowchart of a specific moving target background subtraction method in the present invention.

[0044] Figure 3 A heat map output by a specific recognition model in the present invention.

[0045] Figure 4 Schematic diagram of the image processing process in Example 1. DETAILED DESCRIPTION

[0046] The technical solution of the present invention is described clearly and completely below in conjunction with the embodiments and drawings. 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 those skilled in the art without creative work are within the scope of protection of the present invention.

[0047] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific position, be constructed and operated in a specific position, and therefore cannot be understood as limiting the present invention; the terms "first", "second", and "third" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance. In addition, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0048] According to the technical solution of the present invention, a specific method for measuring animal circling behavior includes:

[0049] S0 obtains the continuous image data of the test animal, i.e., its original image;

[0050] S1 preprocesses the original image to obtain a target extracted image containing the test animal;

[0051] S2 identifies the center of gravity of the subject animal in the resulting target extraction image;

[0052] S3 identifies facial feature points of the test animal in the obtained target extraction image;

[0053] S4: obtaining the deflection angle change of the feature vector composed of the center of gravity and the facial feature points in different frames of the original image and / or the target extracted image thereof, and determining the measurement parameters of the animal's circling behavior, such as the number of circling times and the circling direction, according to the deflection angle change.

[0054] Among them, more specifically,

[0055] The identification of the center of gravity may include:

[0056] Obtaining a foreground image containing the test animal of the original image, namely the target extraction image, which can be more specifically achieved by using a background subtraction method or the like;

[0057] The center of gravity of the foreground image is obtained as the center of gravity of the test animal.

[0058] The facial feature point is preferably the nose tip point, and its identification may include:

[0059] Obtaining a foreground image containing the test animal of the original image, namely the target extraction image, which can be more specifically achieved by using a background subtraction method or the like;

[0060] Build a nose tip recognition model based on neural network and train it;

[0061] The target extracted image of the animal to be counted is input into the trained nose tip point recognition model to obtain its recognition result.

[0062] According to the above-mentioned measurement method, a corresponding measurement system can be further designed, which includes an input module for inputting the original image and / or user instructions, an analysis and processing module for performing statistical processing of steps S1-S3 on the image, a storage module for storing various data, models, programs, etc. being processed and / or input, and an output module for finally outputting the measurement results.

[0063] Under this determination system, some specific implementation methods of the determination method can be referred to Figure 1 ,include:

[0064] S10 After obtaining the original image, screening foreground pixels and background pixels of the original image according to the background subtraction method selected by the user to obtain a pre-processed image after pixel screening;

[0065] The background subtraction method may be one or more of the following methods:

[0066] The moving target background subtraction method includes: modeling background pixels according to the color features of pixels in continuous frame images; based on the obtained background pixel model, calculating the maximum likelihood estimate of the current pixel as the background pixel by Bayesian formula to obtain a probability distribution map; thresholding the probability distribution map to obtain segmented foreground pixels and background pixels.

[0067] The background subtraction method based on the background image includes: obtaining a background image without animals by shooting or the like; subtracting the original image containing the test animal from the background image without animals to obtain a difference image; performing image enhancement processing such as denoising, corrosion, and expansion on the difference image to obtain a foreground image where the test animal is located.

[0068] The background subtraction method based on grayscale pixel classification is particularly suitable for situations where there is a strong contrast between the animal and its background, such as the color of the container in which it is placed. It includes: grayscale the image; binary classification of the pixel values ​​of the obtained grayscale image by means of a K-means algorithm, and calculating the number of pixels in each category, wherein the pixel points of the category with a small number are foreground pixels, and the pixel points of the category with a large number are background pixels.

[0069] The background subtraction method based on color picking is particularly suitable for situations where there is a strong contrast between the animal and its background, such as the color of the container in which it is placed. It includes: picking the color of the center point of the animal's body; establishing a pure color HSV image of the color picking point as the color background image; converting the current original image into HSV format, searching for pixels with similar colors to the color picking point according to a set similarity threshold, and forming foreground pixels from the similar pixels.

[0070] S11: binarizing the preprocessed image to obtain a binarized image in which foreground pixels and background pixels are segmented;

[0071] More specifically, the binarization process may be, for example, setting the pixel value of the foreground pixel to 255 and setting the pixel value of the background pixel to 0.

[0072] S13 performing image and / or edge enhancement processing, such as image denoising and / or morphological processing, on the obtained binary image to obtain an enhanced foreground image;

[0073] S14 sets a minimum rectangular bounding box in the foreground image, and extracts the image within the rectangular bounding box as a final target foreground image;

[0074] The inventors unexpectedly found that, for the determination of animal circling behavior, the most preferred background subtraction method among the above background subtraction methods is the moving target background subtraction method, referring to Figure 2 , and its better implementation includes:

[0075] S101 performs RGB quantization on the input continuous frame original image to obtain a color histogram of three colors in each frame image;

[0076] This step can increase robustness to noise while reducing storage and computation requirements.

[0077] S102: Based on the color histogram, model the input first T frames of continuous images to obtain the corresponding background model;

[0078] More specifically, the establishment of the background model includes:

[0079] (1) Obtain the pixel value of each pixel in the previous T frames of continuous images;

[0080] (2) Normalize each pixel value to the range of [0, 1.0];

[0081] (3) Performing sparse processing on the normalized pixel values ​​to obtain multiple sparse color intervals, and recording the number of pixels in each sparse color interval in each frame of the image;

[0082] (4) Calculate the number of pixels at each pixel position in each sparse color interval in the T-frame continuous image, and obtain the color distribution frequency at each pixel position, as follows:

[0083] ,

[0084]

[0085] ,

[0086] ,

[0087] in, represents the probability model established according to the RGB histogram of the previous T frames, that is, the sparse distribution frequency of the pixel values ​​of each pixel with coordinates (i, j) in the previous T frames; Represents a set of pixel values ​​in three-dimensional space (R, G, B); Indicates that the pixel value at the coordinate (i, j) at time k constitutes a sparse color interval; Indicates that the pixel values ​​at the coordinates (i, j) in the r-th frame image constitute a sparse color interval; L() represents a set; represents the number of consecutive frame images used for modeling, that is, when the first T frames are used, the value is T; q / 256 represents the normalization coefficient selected in the normalization, q is a constant less than 256, represents a sparse color interval containing k pixels, Represents the pixel value at the coordinate (i, j) at time k;

[0088] (5) Determine the background pixel point, including: when a certain sparse color interval at a certain pixel position The number of pixels in the pixel and the total number of pixels at that pixel location The ratio exceeds the background probability threshold If 0.8, it is determined that the color interval of the pixel position has a small degree of change in the T frame image. When the color value of the pixel point at the pixel position at time k falls into the color interval, the pixel point is a background point, otherwise it is a foreground point.

[0089] S103 is based on the background model obtained , the probability that a pixel point in the image obtained at any time k is a background pixel point is calculated by the Bayesian formula, and the corresponding probability distribution diagram is obtained;

[0090] More specifically, the Bayesian formula is as follows:

[0091] ,

[0092] in,

[0093] ,

[0094] ,

[0095] ,

[0096] Indicates the probability that the pixel with coordinates (i, j) is classified as a background point at time k; It represents the probability that at time k, when a pixel is judged as a background pixel, its coordinates are (i, j); It represents the probability that all pixels are judged as background pixels at time k, that is, the background probability threshold, which can be set according to actual needs, such as selecting is 0.8, then at time k, the probability that all pixels are judged as foreground pixels is the foreground probability threshold is 0.2; It represents the probability that at time k, when a pixel is judged as foreground, its coordinates are (i, j).

[0097] S104 Preferably, the obtained probability distribution map may be further subjected to morphological processing, such as opening operation, closing operation, etc., and whether the pixel point is a background pixel point is determined based on the processed probability distribution map.

[0098] S105 Background model for time k The background model at time k+1 is updated and the background determination of the next frame is performed based on the updated model.

[0099] The updating may further include:

[0100] set up is the set of pixels judged as foreground at time k. If the pixel at position (i, j) belongs to , then the background model at time k+1 uses the background model at time k, that is ;

[0101] If the pixel at position (i, j) does not belong to ,but:

[0102] Remove the color intervals with zero pixels in the model at time k, and redivide the remaining color intervals. The number of new color intervals is the minimum value that satisfies the requirement that there is no color interval with zero pixels in the background model at time k after redivision, and obtain a new histogram set. , where x represents the number of pixels in the re-divided sparse color interval;

[0103] Due to the sparsity limitation, if there is , then find and remove color intervals that meet the following conditions: , and then re-divide all color values ​​at position (i, j) into new color intervals to obtain a new background model, as follows:

[0104] ;

[0105] Add the color value of the position (i, j) at time k+1 to the model at time k In the above example, we get the following updated background model:

[0106]

[0107] Among them, α represents the learning rate, which is a value between 0 and 1, such as 0.025. The larger the value, the faster the model updates.

[0108] S20 uses the zero-order moment and the first-order moment of the target foreground image to calculate its center of gravity position, and the coordinates of the center of gravity obtained are the center of gravity position of the test animal;

[0109] More specifically, the calculation process may include:

[0110] Assume that the sum of the image pixel values ​​represented by the zero-order moment is as follows:

[0111] ;

[0112] The product of the abscissa and its corresponding pixel value, and the product of the ordinate and its corresponding pixel value expressed as the first-order moment are as follows:

[0113] , , where V(i, j) is the pixel value at that position;

[0114] Then the center of gravity position (x, y) is as follows:

[0115] .

[0116] S30 performs size processing on the obtained target foreground image, such as edge filling, proportional scaling, etc., so that it reaches the input dimension of the nose tip point recognition model.

[0117] S31 inputs the resized image into the trained nose tip point recognition model to obtain a single-channel heat map corresponding to the nose tip point.

[0118] S32 finds the maximum pixel value of the heat map and its corresponding coordinate value, and converts the coordinate value to the target foreground image scale according to the transformation relationship between the heat map scale and the target foreground image scale, so as to obtain the coordinates of the nose tip point in the target foreground image.

[0119] The nose tip recognition model can be further constructed based on an encoding-decoding neural network, such as a specific neural network including the following structure:

[0120]

[0121] In the above recognition model, the input image is forward propagated in the network, feature extraction is achieved through convolution of the encoding module, image information is expanded through upsampling of the decoding module, and the information lost in the pooling process can be obtained through learning in decoding. Finally, the single-channel heat map corresponding to the nose tip is obtained through upsampling of the decoding module.

[0122] A specific implementation process of identification based on this model is as follows:

[0123] Preprocessing: The 3-channel image obtained by intercepting the minimum rectangular bounding box is padded with pixel values ​​(0, 0, 0) to form a square, and then scaled proportionally to the input layer dimension (48, 48, 3);

[0124] Normalization: Divide each pixel value of the preprocessed image by 255.0 so that each pixel value is in the interval [0, 1];

[0125] Coding module processing: The local features of the image are obtained through its convolution layer, and the image is downsampled through its pooling layer to reduce the number of parameters, so that the output dimension is reduced from (48, 48, 64) to (24,24,64)), and the main features are further extracted;

[0126] Decoding module processing: The feature map obtained after the encoding module is input into its ReLu layer and upsampling layer for nonlinear upsampling to obtain a sparse feature map, and then a dense feature map is obtained through its convolution layer to fill the 0 value in the sparse feature map. Finally, the output layer outputs a feature map with the same width and height as the input image. The value of the position (i, j) of the feature map is the probability that the position is a key point. The feature map is the heat map output by the model, as shown in the attached figure. Figure 3 shown.

[0127] S40 connects the center of gravity and the nose tip point in each frame of the target foreground image to obtain the connection vector, and stores and calculates the relative deflection angles of the connection vectors in two adjacent images in an array in time sequence to obtain measurement parameters such as the number and direction of the animal's turns.

[0128] Wherein, further, obtaining the number of circles may include:

[0129] Get the line vector in the previous frame image Connect the vector to the next frame image The clockwise and / or counterclockwise rotation angle of

[0130] Accumulating the relative deflection angles of adjacent frame images;

[0131] When the accumulated angle reaches the turning angle statistical threshold, the number of turns in this direction is increased by one, and the accumulated value is reset to 0, and the accumulation calculation is restarted until all frames are calculated;

[0132] The turning angle statistical threshold may be set to an angle value slightly smaller than 360°, such as 340°.

[0133] Some specific implementation examples are:

[0134] Connection vector Relative to the line vector If the clockwise pointer rotates 20°, the clockwise deflection angle cwDegree = 20° or the counterclockwise deflection angle ccwDegree = -20° is recorded. When cwDegree or ccwDegree reaches the user-set turning angle statistical threshold, such as 340°, the number of turns in this direction is increased by one, and then cwDegree and ccwDegree are reset to 0°, and the calculation of the accumulated deflection angle is restarted until all frames are calculated. For example, at a certain moment, the statistical data is: the cumulative clockwise angle cwDegree = 350°, the cumulative counterclockwise angle ccwDegree = 50°, the number of clockwise turns cw = 0°, and the number of counterclockwise turns ccw = 0°; after the current frame is calculated, the statistical data becomes: the cumulative clockwise angle cwDegree = 0°, the cumulative counterclockwise angle ccwDegree = 0°, the number of clockwise turns cw = 1, and the number of counterclockwise turns ccw = 0.

[0135] Example 1

[0136] As attached Figure 4 As shown, the technical solution of the present invention is used to measure the circling behavior of mice, and the specific process includes:

[0137] (1) A unilateral Parkinson's disease model mouse was placed in a bowl-shaped test container with an inner diameter of 26 cm and an outer diameter of 59 cm fixed on a rack at a height of 50 cm. The video image was recorded by a monitoring system. The camera of the monitoring system was located directly above the center point of the container and 1.5 m away from the container. The sampling rate was 10 frames / second, and the pixels of each frame image were 640 * 480. The acquisition time was 25 minutes.

[0138] (2) Obtaining a foreground image containing mice by using the moving target background subtraction method, binarization processing, and enhancement processing (including dilation, erosion, and adaptive threshold processing to achieve the effects of denoising and strengthening the edges of animals) described in the specific implementation method;

[0139] (3) Generate a minimum bounding box in the foreground image and use the second-order moment of the image to calculate the center of gravity of the image within the bounding box, that is, the center of gravity of the mouse;

[0140] (4) The image within the bounding box is captured, edge-filled and proportionally scaled to the model input dimension, and then input into the trained nose tip recognition model to obtain a single-channel heat map, as shown in the attached figure. Figure 3 As shown, the maximum pixel value and its coordinate value are found in the obtained heat map, and the coordinate value is converted to the input image scale by comparing the heat map scale and the input image scale to generate the coordinates of the nose tip point in the input image;

[0141] (5) The deflection angle of the line vector connecting the center of gravity and the nose tip of each frame is saved in an array in chronological order. Each adjacent angle value in the array is analyzed to obtain the rotation angle of the animal in each direction and the total number of turns.

[0142] According to the above process, the number of circles and directions of 6 video files of different lengths were measured, and compared by manual counting method. The measurement results are shown in Table 1 below:

[0143] Table 1. Comparison of statistical results of the number and direction of animal turns

[0144]

[0145] Furthermore, the two sets of data counted manually and by the algorithm of the present invention were subjected to a KS test, and the p-value obtained was very close to 0, indicating that both sets of data did not obey the normal distribution, so the Kruskal test can be selected to compare the differences between the two sets of data. The p-value obtained by the Kruskal test was 0.9767, which was greater than the commonly used confidence level of significant difference of 0.05, so the two sets of data could be considered as having no statistical difference. Therefore, the present invention can be used as an accurate substitute for manual counting in animal rotation experiments.

[0146] The above embodiments are only preferred implementations of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims

1. A method for measuring animal circling behavior, characterized in that: It includes: S1 obtains the continuous frame image data of the test animal, that is, its original image; S2 identifying a first feature point of the test animal in each processed image of the original image; S3: in each processed image of the original image, identifying a second feature point of the subject animal; S4: obtaining a quantitative change of a feature vector composed of the first feature point and the second feature point in processed images of different frames of the original image, and determining a measurement parameter of the animal circling behavior according to the quantitative change; in, The processed image is a target image containing the test animal in the original image, or an enhanced image obtained after the target image is enhanced, or a target extracted image obtained by performing minimum bounding box extraction on the enhanced image; The first feature point is a motion feature point related to the animal's motion state, and the second feature point is a fixed feature point related to the animal's body structure; The feature vector is a line vector formed by connecting the first feature point and the second feature point, and the quantitative change is a deflection angle of the line vector.

2. The measuring method according to claim 1, characterized in that The first feature point is the center of gravity, and the second feature point is the nose tip of the test animal.

3. The measuring method according to claim 1, characterized in that The target image is a foreground image of the original image obtained by background subtraction and binarization.

4. The measuring method according to claim 3, characterized in that The background subtraction method includes one or more of the following methods: A moving target background subtraction method, comprising: modeling background pixels according to the color features of pixels in the original image of the continuous frames; based on the obtained background pixel model, calculating the maximum likelihood estimate of the current pixel as a background pixel by using the Bayesian formula to obtain its probability distribution map; performing thresholding processing on the probability distribution map to obtain segmented foreground pixels and background pixels; The background subtraction method based on the background image includes: obtaining a background image without animals; performing a difference process between the original image and the background image without animals to obtain a difference image; performing an image enhancement process on the difference image to obtain a processed foreground image; The background subtraction method based on grayscale pixel classification includes: grayscale the original image; binary classification of the pixel values ​​of the obtained grayscale image, and calculating the number of pixels in each category, wherein the pixel points of the category with a small number are determined as foreground pixel points, and the pixel points of the category with a large number are determined as background pixel points; The background subtraction method based on color picking includes: picking color from the center point of the animal's body; establishing a pure color HSV image of the color picking point as a color background image; converting the original image into an HSV format, searching for pixels with colors similar to the color picking point according to a set similarity threshold, and forming foreground pixels from the similar pixels.

5. The measuring method according to claim 4, characterized in that In the moving target background subtraction method, the color feature is the RGB color quantization value of the pixel point, and the thresholding process also includes morphological processing of the probability distribution map.

6. The measuring method according to claim 2, characterized in that The identification of the nose tip point includes: Inputting the processed image of the original image into a nose tip point recognition model to obtain a single-channel thermal map corresponding to the nose tip point; Find the maximum pixel value of the heat map and its corresponding coordinate value, and convert the coordinate value to the input image according to the transformation relationship between the heat map and the input image to obtain the coordinates of the nose tip point in the input image; Among them, the nose tip point recognition model is constructed based on a neural network with an encoding-decoding structure, which can generate a normalized Gaussian distribution map as the heat map label of the input image according to the label of the input image, and the corresponding Gaussian kernel center of gravity is the coordinate of the nose tip point.

7. The measuring method according to claim 1, characterized in that The measurement parameters include the number of turns and / or the direction of turns, and the process of obtaining the parameters includes: According to the deflection angle, calculating the clockwise and counterclockwise rotation angles of the feature vector in the previous frame image to the feature vector in the next frame image; Calculating the clockwise and counterclockwise rotation angles in adjacent frame images in sequence, and accumulating the rotation angles of adjacent frame images in accordance with their directions; When the accumulated angle reaches the turning angle statistical threshold, the number of turns in this direction is increased by one, and the accumulated rotation angle value is reset to 0, and the accumulated calculation starts again until all frames are calculated; The turning angle statistical threshold is an angle value greater than or equal to 310° and less than or equal to 350°.

8. A method for identifying animal feature points, characterized in that: The feature point is a nose tip point, and its identification includes: inputting the input image into a nose tip point recognition model to obtain a single-channel thermal map corresponding to the nose tip point; Find the maximum pixel value of the heat map and its corresponding coordinate value, and convert the coordinate value to the input image according to the transformation relationship between the heat map and the input image to obtain the coordinates of the nose tip point in the input image; Among them, the input image is a foreground image containing the test animal or an enhanced image after enhancement processing, or any extracted image obtained by extracting the enhanced image through the minimum bounding box; the nose tip point recognition model is constructed based on a neural network with an encoding-decoding structure, which can generate a normalized Gaussian distribution map as the heat map label of the input image according to the label of the input image, and the corresponding Gaussian kernel center of gravity is the coordinate of the nose tip point.

9. A system for measuring animal circling behavior, characterized in that: It comprises the following storage module: the module stores the model and / or program and / or required data required to implement the determination method according to any one of claims 1 to 7.