An automatic annotation method for insect key points based on top-down deep learning architecture and its application

Through the top-down deep learning architecture and HRNet model, the accuracy and efficiency problems of automatic annotation of key points in insect social behavior analysis are solved, and fast and accurate identification of key points of individual insects is achieved, which is suitable for complex environments and overlapping situations.

CN113516734BActive Publication Date: 2024-09-06WESTLAKE UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110756718.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-05
Publication Date
2024-09-06
Estimated Expiration
2041-07-05

AI Technical Summary

Technical Problem

In the existing analysis of insect social behavior, the automatic annotation method of key points has the following problems: manual annotation is time-consuming, traditional image processing methods have poor generalization, and bottom-up methods have low recognition accuracy in overlapping situations.

Method used

An automatic annotation method for insect key points based on a top-down deep learning architecture is adopted. By segmenting the outline of the interactive unit from the original image, processing the individual elliptical area of ​​the insect, a neural network model is constructed for automatic annotation, and HRNet is used for key point identification, and through Multi-process processing improves efficiency.

Benefits of technology

It achieves fast and accurate key point identification, improves identification accuracy, can handle overlapping individuals in complex environments, has good universality, and is suitable for research on insect social behavior.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113516734B
    Figure CN113516734B
Patent Text Reader

Abstract

The present invention provides an automatic labeling method and application of insect key points based on a top-down deep learning architecture. The automatic labeling method includes: (1) segmenting the outline of the interaction unit from the original image; segmenting the elliptical area of ​​the insect individual from each interaction unit outline, and processing the elliptical area to obtain a centralized image; (2) manually labeling the key points of the insect individuals in the centralized image to obtain a data set of the key points of the insect individuals, and constructing a neural network model with the data set as a training set; (3) performing step (1) on the original image to be processed to obtain a centralized image to be labeled, and automatically labeling the key points of the centralized image to be labeled using the above neural network model; (4) processing the centralized image with the labeled key points to obtain the coordinates of the key points in the corresponding interaction unit outline. The automatic labeling method of the present invention has fast recognition speed and high accuracy, and can identify individuals in complex environments or overlapping states.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of animal behavior and machine vision technology, and specifically relates to an automatic labeling method and application of insect key points based on a top-down deep learning architecture. Background Art

[0002] Insect behavior is the final output of neural activity, and in social behavior, individuals show more complex behavioral patterns than when they are alone. Insect individuals perceive other individuals of the same species, estimate the other's behavior and plan their own actions, and respond to the other's behavior accordingly. Many elements of this interactive process are important aspects of neuroscience research.

[0003] Small insects (such as fruit flies) have the following advantages as research subjects for social behavior: rapid reproduction, simple neural structure, easy neural manipulation, and small size that makes it easy to design high-throughput experimental devices.

[0004] Detection and analysis of insects during behavior is the basis for quantitative analysis and provides raw data for further system modeling.

[0005] Social behavior involves multiple insect individuals. To analyze the behavior patterns, accurate key point location information of each individual is needed. In the prior art, there are generally three methods for labeling key points: manual labeling, traditional image processing, and bottom-up neural network automatic labeling.

[0006] In high-throughput measurements, if manual observation and annotation methods are used, it will consume a huge amount of manpower and time, and will also lead to deviations caused by subjective factors.

[0007] Traditional image processing-based methods (ctrax (Branson, K., Robie, AA, Bender, J., Perona, P., and Dickinson, MH (2009). High-throughput ethomics in large groups of Drosophila. Nat Methods 6, 451-457.), qtrak (Dankert, H., Wang, L., Hoopfer, ED, Anderson, DJ, and Perona, P. (2009). Automated monitoring and analysis of social behavior in Drosophila. Nat Methods 6, 297-303.)) require prior knowledge such as animal body structure and environmental information, have poor generalization, are sensitive to changes in the environment and animal body shape, and have low accuracy in identifying insects under social behavior.

[0008] Therefore, automatic key point detection technology is the basis of large-scale social behavior analysis. However, the existing bottom-up method (DeepLabCut (Mathis, A., Mamidanna, P., Cury, KM, Abe, T., Murthy, VN, Mathis, MW, and Bethge, M. (2018). DeepLabCut: markerless pose estimation of user-defined body parts with deep learning. Nat Neurosci 21, 1281-1289.)) is based on the principle of first detecting all key points and then classifying each key point to each individual. When there is overlap between individual contours (which often occurs in social behavior), the various parts of the individual are difficult to separate, and the key points between individuals are easily confused with each other. At the same time, occlusion can also cause key points to be missed or deviated. Summary of the invention

[0009] In order to solve the problems existing in the above-mentioned prior art and quantify the social behavior of small insects, the present invention provides a top-down automatic labeling method for multiple insect key points based on deep learning, and its application in insect behavior recognition.

[0010] An automatic insect key point labeling method based on a top-down deep learning architecture includes the following steps:

[0011] (1) Segment the contour of the interaction unit from the original image and determine its range;

[0012] (2) Segmenting the elliptical area of ​​the insect individual from the contour of each interaction unit, and segmenting a rectangular area outside the elliptical area, and processing the elliptical area within the rectangular area to obtain a centralized image;

[0013] (3) Manually annotate the key points of individual insects in the centralized image to obtain a data set of key points of individual insects, and use this data set as a training set to build a neural network model;

[0014] (4) performing steps (1) and (2) on the original image to be processed to obtain a centralized image to be labeled, and automatically labeling key points of the centralized image to be labeled using the above neural network model;

[0015] (5) Process the centralized image with marked key points to obtain the coordinates of the key points in the corresponding interaction unit contour.

[0016] In the above technical solution, in step (1), the original image can be obtained by intercepting from a video; the interaction unit is an area where a group of insects conduct behavioral social activities, and the original image can contain multiple interaction units.

[0017] In step (2), the size of the rectangular area is not less than the size of the individual insect in a fully stretched state, ensuring that all individual insects fall into the rectangular area. It should be noted that for the same neural network model, the size of the selected rectangular area should be uniform.

[0018] Step (5) is the inverse process of obtaining the centralized image process, that is, restoring the centralized image with the key points marked to the corresponding interactive unit contour, and obtaining the coordinates of each key point in the interactive unit contour.

[0019] Preferably, in step (1), computer graphics technology is used to identify the contours of each interactive unit in the original image and determine its range.

[0020] In the above technical solution, in order to facilitate the analysis and distinction of experimental groups, when identifying the outline of the interactive unit, a user interface can be optionally added to enter information (such as experimental environment, insect species, status and other additional information) for each interactive unit outline.

[0021] Preferably, in step (2), when obtaining the elliptical region of the insect individual, the gray threshold segmentation method is firstly used to obtain one or more connected regions, and then an ellipse is fitted to each connected region to obtain the elliptical region.

[0022] As a further preferred method, when the connected regions are obtained by using the gray threshold segmentation method:

[0023] When the number of connected regions obtained is equal to the number of known insects in the corresponding interaction unit, an ellipse is directly fitted to each connected region;

[0024] When the number of connected regions obtained is less than the number of known insects in the corresponding interaction unit, the Gaussian mixture model (GMM) is used for segmentation to obtain Gaussian distributions with the same number as the known insects, and the covariance matrix of all Gaussian distributions is decomposed to obtain ellipses.

[0025] As a further preferred embodiment, when the gray threshold segmentation method is used to obtain the connected regions, the number of connected regions obtained is calculated after the connected regions with an area smaller than a set value are removed.

[0026] The above technical method can effectively remove the interference of the miscellaneous points and improve the accuracy of the connected area counting. The setting value of the connected area is determined according to the size of the insects and the main miscellaneous points in the interactive unit contour.

[0027] Preferably, in step (2), the specific operation of processing the elliptical area within the rectangular area to obtain a centralized image is as follows:

[0028] By translating and rotating, the center point of the elliptical area is located at the center of the rectangular area, and its long axis is in a vertical state, so that a rectangular centralized image centered on the insect individual is obtained.

[0029] The two adjacent sides of the rectangular area are respectively perpendicular and parallel to the horizontal line.

[0030] Preferably, in step (2), the centralized images of all insect individuals within all interaction unit contours in all original images constitute the data set to be labeled.

[0031] In step (3), the key points of the insect individuals in the centralized image in the dataset to be labeled are manually labeled to obtain a dataset of the key points of the insect individuals;

[0032] Preferably, in step (3), when manually marking key points of the insects in the centralized image, a user interface is added to facilitate manual marking and proofreading.

[0033] Preferably, in step (3), when manually marking key points of insects in the centralized image, if there is overlap of individual insects, only the key points of the individual insects located at the center of the centralized image are marked.

[0034] By adopting the above technical solution, the neural network can strengthen its recognition of the central insect and prevent the error of recognizing the bodies of other insects; at the same time, when some environmental interference appears in the centralized image, the neural network can be strengthened to eliminate the environmental interference.

[0035] As a further preference, to ensure that all key points can be detected, the key points are estimated and labeled when occlusion (overlap) occurs; and to ensure consistency among different labelers, the same labeling rules are used for the same occlusion situations and special postures, and the labeling rules are determined based on the physical characteristics of the specific individual insects.

[0036] Preferably, in step (3), after obtaining a data set with labeled key points, the data set is used as input to divide the data set into a training set and a validation set, the training set is used to construct a neural network model, and the validation set is used to verify the constructed neural network model.

[0037] For example, a data set with labeled key points can be divided into a training set and a validation set in a ratio of 4:1. The training set is used to train the network model, and the validation set is used for hyperparameter tuning and training completion judgment.

[0038] In the above technical solution, the neural network adopts an artificial neural network, such as HRNet, and the construction of the insect neural network model is realized by modifying the number of key points.

[0039] Optionally use graphics processing unit (GPU) acceleration to increase the speed of neural network model building.

[0040] In order to obtain better detection results and a neural network model with higher recognition accuracy, preferably, in step (3), the number of centralized images in the data set is greater than 1000.

[0041] Preferably, in step (4), a multi-process processing flow is used to automatically mark key points to speed up detection and improve work efficiency. Specifically, multiple tasks are executed simultaneously, each interactive unit is assigned multiple processes to extract individual insect elliptical regions and process image centering, and each GPU is assigned two processes to detect key points.

[0042] The present invention utilizes the human key point recognition technology based on deep learning to detect the key point positions of multiple human bodies without the need for prior knowledge about the human body. By changing the number of key points (determined according to the physical characteristics of insects), the artificial neural network model is applied to animal key point detection; and by performing regional centralization processing on the insect individuals in the original image, a top-down method is used to identify and label the key points of the insect individuals in each centralized image, which effectively reduces the amount of calculation and the spatial scale of the behavior pattern, and improves the accuracy of key point detection; combined with the position guessing of the overlapping key points of the insect individuals, the integrity of the data is ensured.

[0043] An application of the automatic insect key point labeling method based on a top-down deep learning architecture as described in any of the above items in insect behavior recognition.

[0044] Specifically, after the original image is processed by the automatic labeling method of the present invention, an image with key point coordinates is obtained, and then the individual characteristics of the insects (body shape, color, texture, specific behavior and other information) are analyzed, and the identities are assigned in combination with the key point positions (coordinates), and finally the activity trajectory and posture of each identified insect individual are obtained.

[0045] Furthermore, the main application of the key point automatic labeling method of the present invention is to serve as the infrastructure for behavioral analysis and to provide data for behavioral analysis (and behavioral analysis is an important analytical method in neuroscience, such as inferring the working mode of the brain through behavior, and inferring the function of the neural structure by changing the neural structure and then measuring the change in behavior). The data obtained by this method can add more and more detailed quantitative indicators than a simple motion trajectory, such as body orientation, the angle of each wing, the perspective of an individual to another individual, etc. These indicators can be used to detect complex behavioral patterns (for example, during the courtship of male and female fruit flies, the male flaps his wings at a specific position, or makes specific movements while flapping his wings) or detect subtle behavioral changes (for example, during the courtship of male and female fruit flies, the male exhibits more double-wing flapping behavior, or the wing flapping amplitude decreases, etc.).

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

[0047] (1) By performing regional centering processing on individual insects in the original image (reducing the size of the recognition image), key points can be quickly and accurately identified.

[0048] (2) By changing the number of key points, the artificial neural network is applied to the process of identifying the key points of individual insects. It can detect the positions of multiple key points and does not require prior knowledge about the insects. It has good universality and high recognition accuracy.

[0049] (3) In addition to the central individual, other individuals (overlapping situations) are introduced into the centralized image of the training set, so that the constructed neural network model has a better recognition effect on individuals with occlusion.

[0050] In summary, the insect key point labeling method of the present invention has fast key point recognition speed, high accuracy, can identify individuals in complex environments (such as when overlap occurs), and has good universality. It is particularly suitable for the study of insect social behavior, and of course it can also be used for the study of single animal behavior with lower requirements. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 This is a flow chart of a method for automatically marking key points in an embodiment of the present invention;

[0052] Figure 2 This is a schematic diagram of a user interface for manually marking key points in an embodiment of the present invention;

[0053] Figure 3 This is an image of a male and female fruit fly in the courtship process after being centrally processed in an embodiment of the present invention;

[0054] Figure 4 A schematic diagram of an interactive unit profile information input interface in an embodiment of the present invention;

[0055] Figure 5 This is a flowchart of automatic labeling of key points of individual fruit flies in an embodiment of the present invention;

[0056] Figure 6 This is a diagram showing the activity trajectory and posture of a fruit fly after the identity is assigned in an embodiment of the present invention. DETAILED DESCRIPTION

[0057] The following takes the courtship process of male and female fruit flies as an example, where each interaction unit includes two fruit flies, one male and one female, to further illustrate the technical solution of the present invention.

[0058] like Figure 1 As shown, the method for marking the key points of a fruit fly comprises the following steps:

[0059] (1) Original images are captured from the collected videos of the Drosophila courtship process, and machine vision technology is used to identify the outline of each interaction unit in each original image and determine its range.

[0060] (2) Taking the interaction unit contour of the determined range as the unit, the grayscale threshold segmentation method is used to obtain the connected area within the interaction unit contour, and the connected areas with an area smaller than the set value are deleted, and then the number of connected areas is calculated:

[0061] If the number of connected regions is equal to 2, an ellipse is fitted to each connected region to obtain the elliptical region of the fruit fly individual;

[0062] If there is only one connected region, the Gaussian mixture model is used for segmentation to obtain two Gaussian distributions. The covariance matrix of the two Gaussian distributions is decomposed to obtain an ellipse, that is, the elliptical region of the fruit fly individual.

[0063] (3) a rectangular area is divided outside each elliptical area so that the entire body of the fruit fly (including the trunk and wings) is located in the rectangular area;

[0064] Within the rectangular area, the elliptical area is translated and rotated so that the center point of the elliptical area is located at the center of the rectangular area and its long axis is in a vertical state (centralization processing), and a centralized image with the fruit fly individual located at the center of the rectangular area is obtained.

[0065] The centralized images of all fruit fly individuals within the outlines of all interaction units in all the above original images constitute the dataset to be labeled.

[0066] (4) Manually annotate the key points of individual fruit flies in the centralized image in the above-mentioned data set to be annotated, and obtain a data set of annotated key points of individual fruit flies; divide the data set of annotated key points into two groups, a training set and a validation set, and train and validate HRNet respectively to obtain a verified neural network model.

[0067] The key points of the above manual annotation of fruit fly individuals are: head, center, tail, left wing end, right wing end, so the number of key points of HRNet is changed to 5. The user interface is used to make manual annotation and proofreading more convenient, such as Figure 2 shown.

[0068] Note that in some images, in addition to the fruit fly in the center, there is another fruit fly's body in other locations, and some will block the central fruit fly (the fruit flies overlap). When manually annotating, only the key points of the fruit fly in the center of the centralized image are annotated. This can strengthen the neural network's recognition of the central fruit fly and prevent the error of identifying other fruit flies' bodies. At the same time, some environmental interference will also appear in the image, which can strengthen the neural network to eliminate environmental interference.

[0069] In addition, to ensure that all key points can be detected, key points are estimated and labeled when occlusion occurs. To ensure consistency among different labelers, e.g. Figure 3 As shown in the figure, the following estimation rules are uniformly adopted for the same occlusion situation and special posture:

[0070] Head, front view (frames 1, 5, and 6), located between the two tentacles. Side view (frames 3 and 4), located below the tentacles.

[0071] Center, front and side view, located at the geometric center of the black part of the body, equidistant from the corresponding two sides (e.g. 1, 2, 9 frames).

[0072] The tail, from the front and side view, is located at the very end of the body. When the tail is rolled up from the side view (e.g. frame 11), it is located at the farthest end of the line connecting the head and the center, slightly offset from the tail.

[0073] Wings, located at the tip of the wing. From the frontal perspective (frame 1), try to ensure that there is a point on each side of the body (the two points are not on the same side of the head-to-tail line). From the side perspective (frame 3), the two points are on the same side of the head-to-tail line. When not open (frame 1), close to the tip, symmetrical on both sides. When beyond the boundary (frames 7 and 12), located on the boundary or at the boundary between light and dark. When blocked (frames 8, 10, and 14), located at the boundary between light and dark. When the head is facing up (frame 6), the ends of the left and right wings are located on the left and right sides of the body respectively. When the head is facing down (frames 1 and 15), the ends of the left and right wings are located on the right and left sides of the body respectively.

[0074] Except for the center, other points should be located at the boundary between light and dark as much as possible.

[0075] During mating (frames 12 and 13), it is necessary to infer the male head and the female tail, and try to ensure that the head, center, and tail are in a straight line (frame 13).

[0076] In order to obtain better detection results and obtain a neural network model with higher recognition accuracy, the number of images in the data set with labeled key points is 1000. This embodiment uses HRNet as the key point recognition network, and other neural networks can also be used to recognize key points. The data set with labeled key points is divided into a training set and a validation set in a ratio of 4:1. The training set is used to train the neural network model, and the validation set is used for hyperparameter tuning and training end judgment, that is, to verify the neural network model.

[0077] (5) The video to be processed is processed through the processes of steps (1) to (3) to obtain a centralized image to be labeled, and the neural network model obtained in step (4) is used to automatically label the key points of the centralized image to be labeled using a multi-process processing flow.

[0078] When performing step (1) on the video to be processed, use the user interface to screen the contours of each segmented interactive unit and enter the information so as to distinguish the experimental groups in subsequent analysis, such as Figure 4 shown.

[0079] For the same neural network model, the size of the centralized image to be labeled is the same as the size of the centralized image in the dataset when the neural network model is built.

[0080] (6) Process the centralized image of the annotated key points to obtain the coordinates (position transformation) of the key points in the corresponding interaction unit contour.

[0081] Specifically, this process is the inverse process of obtaining the centralized image process, that is, restoring the centralized image with marked key points to the corresponding interactive unit contour, and obtaining the coordinates of each key point in the interactive unit contour.

[0082] like Figure 5 As shown in the figure, the specific process of automatically marking the key points of fruit fly individuals in the processed video is as follows:

[0083] First, the fruit fly individuals within the interaction unit outline in the original image to be processed (obtained from the video to be processed) are segmented into elliptical areas, and then the insect individuals are centralized based on the elliptical areas to obtain the centralized image to be labeled; then the constructed neural network model is used to automatically label the key points of the fruit fly individuals in the centralized image to be labeled (key point detection), and finally, through position transformation, the fruit fly individuals with marked key points are restored to the corresponding interaction unit outline, and the coordinates of each key point in the corresponding interaction unit outline are obtained.

[0084] Application of the key point automatic labeling method of the present invention in fruit fly behavior identification (courtship behavior):

[0085] The key point automatic labeling method of the present invention is used to process the video within a certain time period to obtain multiple images with key point coordinates, and then analyze the behavioral characteristics of individual fruit flies, and perform identity assignment (such as manual assignment) in combination with the key point position (coordinates). Arrange all corresponding interaction unit contours within the processed time period in chronological order; take a key point (such as the center point) to represent the individual fruit fly, and draw the activity trajectory of the known identity fruit fly within the time period, such as Figure 6 shown.

[0086] Figure 6 In the figure, the upper and lower groups are the activity trajectories and postures of two pairs of male and female fruit flies within 15 seconds. Among them, AB and A'B' are the activity trajectories and postures of two pairs of male and female fruit flies respectively; A and A' are the activity trajectories and postures of two female fruit flies; B and B' are the activity trajectories and postures of two male fruit flies. Figure 6 It can be seen that B chases A quickly without flapping its wings, while B' chases A' slowly while vibrating one wing.

Claims

1. An automatic annotation method for insect key points based on top-down deep learning architecture, It is characterized in that The following steps are involved: (1) Segment the contour of the interaction unit from the original image and determine its range; (2) Segmenting the elliptical area of ​​the insect individual from the contour of each interaction unit, and segmenting a rectangular area outside the elliptical area, and processing the elliptical area within the rectangular area to obtain a centralized image; (3) Manually annotate the key points of individual insects in the centralized image to obtain a data set of key points of individual insects, and use this data set as a training set to build a neural network model; (4) performing steps (1) and (2) on the original image to be processed to obtain a centralized image to be labeled, and automatically labeling key points of the centralized image to be labeled using the above neural network model; (5) Processing the centralized image with the marked key points to obtain the coordinates of the key points in the corresponding interaction unit contour; In step (2), the specific operation of processing the elliptical area within the rectangular area to obtain a centralized image is as follows: By translating and rotating, the center point of the elliptical area is located at the center of the rectangular area, and its long axis is in a vertical state, so as to obtain a rectangular centralized image centered on the insect individual; In step (3), when manually marking the key points of the insects in the centralized image, if there is overlap of individual insects, only the key points of the individual insects located at the center of the centralized image are marked.

2. The method for automatic annotation of insect key points based on a top-down deep learning architecture according to claim 1, It is characterized in that In step (1), computer graphics technology is used to identify the contours of each interaction unit in the original image and determine its range.

3. The method for automatic annotation of insect key points based on a top-down deep learning architecture according to claim 1, It is characterized in that In step (2), when obtaining the elliptical region of the insect individual, firstly, a gray threshold segmentation method is used to obtain one or more connected regions, and then an ellipse is fitted to each connected region to obtain the elliptical region.

4. The method for automatic annotation of insect key points based on a top-down deep learning architecture according to claim 3, It is characterized in that When using the gray threshold segmentation method to obtain connected areas: When the number of connected regions obtained is equal to the number of known insects in the corresponding interaction unit, an ellipse is directly fitted to each connected region; When the number of connected regions obtained is less than the number of known insects in the corresponding interaction unit, the Gaussian mixture model is used for segmentation to obtain Gaussian distributions with the same number as the known insects, and the covariance matrix of all Gaussian distributions is decomposed to obtain ellipses.

5. The method for automatic annotation of insect key points based on a top-down deep learning architecture according to claim 3, It is characterized in that When the gray threshold segmentation method is used to obtain connected regions, the number of connected regions obtained is calculated after removing the connected regions whose area is smaller than the set value.

6. The method for automatic annotation of insect key points based on a top-down deep learning architecture according to claim 1, It is characterized in that In step (3), after obtaining the data set, the data set is divided into two groups: a training set and a validation set. The training set is used to construct a neural network model, and the validation set is used to verify the constructed neural network model.

7. The method for automatic annotation of insect key points based on a top-down deep learning architecture according to claim 1, It is characterized in that In step (4), a multi-process processing flow is used to automatically mark key points.