Method for recording and identifying social behaviors of drosophila melanogaster

By building a shooting platform and machine learning model, automatically identifying and quantifying Drosophila social behavior, the problem of the inability to record and identify social behavior in the existing technology is solved, and data support for neural circuit mechanisms and gene-behavior association research is provided.

CN120495955APending Publication Date: 2025-08-15THE SECOND AFFILIATED HOSPITAL OF GUANGZHOU MEDICAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510582508.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-07
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

The prior art cannot effectively record and identify social behaviors in fruit flies, especially the inability to output processing results suitable for further analysis.

Method used

Build a shooting platform, collect video images and train adaptive models through machine learning models, identify the key point coordinates of fruit flies in the video, and generate social behavior statistics tables.

Benefits of technology

Fully automatic identification and index quantification of Drosophila social behavior is realized, and key data is provided to support neural circuit mechanisms and gene-behavior association research.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120495955A_ABST
    Figure CN120495955A_ABST
Patent Text Reader

Abstract

The invention relates to a method for recording and identifying social behaviors of drosophila melanogaster, and belongs to the technical field of neuroscience. The method comprises the steps of building a shooting platform, training an adaptive model through an existing machine learning model, recognizing postures of fruit flies in a video through the adaptive model, and putting a machine learning coordinate file into a patent program to obtain social behavior statistics. Through collaborative design of an adaptive machine learning model and a structured data processing program, full-automatic identification and index quantification of the social behaviors of the drosophila melanogaster are realized, the technical blank that the social behaviors cannot be identified by a drosophila melanogaster mating identification method is filled up, key data support is provided for research of a neural circuit mechanism, gene-behavior association and the like, and the social behaviors of the drosophila melanogaster mating identification method are optimized. Compared with the prior art, the method is obviously improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of neuroscience, and in particular relates to a method for recording and identifying the social behavior of fruit flies. Background Art

[0002] Drosophila have long been widely used in research in neuroscience, behavior, and genetics due to their clear genetic background, short life cycle, relatively simple nervous system, and ease of manipulation. Their social behaviors (such as courtship, group interactions, and territorial disputes) offer a crucial window into the mechanisms of complex neural circuits and the connections between genes and behaviors.

[0003] However, existing technologies for recording and analyzing fruit fly social behavior still have significant limitations. They can only obtain the mating behavior of fruit flies and cannot output processing results suitable for further processing. In view of this, the present invention is proposed so that the output results can be further used to mark fruit fly social behavior. Summary of the Invention

[0004] The purpose of the present invention is to provide a method for recording and identifying the social behavior of fruit flies, so as to solve the above-mentioned deficiencies in the prior art.

[0005] In order to achieve the above object, the present invention provides the following technical solutions: A method for recording and identifying the social behavior of fruit flies, characterized by comprising the following steps: S1. Build a filming platform to capture video images of Drosophila social behavior; S2, collecting the video images acquired in step S1 and pre-analyzing the video to process the region of interest, the background of the image, and the target; Mark the key points of the fruit fly and obtain image files and marking files; Use the machine learning model to train the adaptive model using the above image files and labeled files; S3, pre-analyze the video image and select the background and target; The coordinates of all key points in the adaptive model video image; Generate a coordinate table that records the video frame number and the coordinates of the key points at the corresponding frame number; S4. Integrate the table files and analyze them to obtain a social behavior statistics table.

[0006] Furthermore, the key points include the head, body, tail and tips of both wings of the fruit fly.

[0007] Furthermore, in step S4, the social behavior of the fruit fly is identified by identifying the angle between the two vectors from the head to the tail and from the middle of the body to the head of one of the fruit flies, as well as the distance between the heads of the two fruit flies; When the distance between the heads of two fruit flies is between 3 and 20 degrees and the absolute value of the above angle is greater than 30 degrees, it is identified as social behavior.

[0008] The beneficial effects of the present invention are: Through the collaborative design of adaptive machine learning models and structured data processing programs, we can achieve fully automatic identification and quantification of fruit fly social behavior, filling the technical gap that fruit fly mating identification methods cannot identify social behavior. It provides key data support for research on neural circuit mechanisms, gene-behavior associations, etc., and is a significant improvement compared to existing technologies.

[0009] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention and implement it according to the contents of the specification, the following is a detailed description of the preferred embodiments of the present invention with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 This is a structural diagram of the shooting platform shown in step 1 of the present invention; Figure 2 An exploded view of the fruit fly activity board shown in step 1 of the present invention; Figure 3 This is a schematic diagram of the training video image shown in step 2 of the present invention; Figure 4 This is a schematic diagram of the key points of Drosophila shown in step 2 of the present invention; Figure 5 This is a schematic diagram of the record table shown in step 3 of the present invention; Figure 6 This is an example diagram of the social situation data shown in step 4 of the present invention.

[0011] Description of the accompanying drawings: 1. Main frame; 2. Camera; 3. Fruit fly activity board; 31. Transparent acrylic board; 32. PC plastic board; 33. Light box. DETAILED DESCRIPTION

[0012] The technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of the present invention.

[0013] In the description of the present invention, it should be noted that, unless otherwise expressly specified or limited, the terms "mounted," "connected," and "connected" should be understood in a broad sense. For example, they may refer to fixed, detachable, or integral connections; mechanical or electrical connections; direct or indirect connections through an intermediate medium; and internal communication between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on the specific circumstances.

[0014] In addition, the technical features involved in different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0015] The method for recording and identifying fruit fly social behavior shown in a preferred embodiment of the present application includes the following steps: Step 1: Build a shooting platform See Figure 1 The shooting platform includes a main body bracket and a connecting plate arranged on the main body bracket, a camera is arranged on the connecting plate, and a fruit fly activity plate is arranged below the camera.

[0016] The fruit fly activity board has three layers, including two transparent acrylic plates and an opaque PC plastic plate in the middle. The PC plastic plate has four observation holes for placing fruit flies and observing their activities through cameras. Specifically, a light box is provided below the fruit fly activity board, and a diffuse reflection plate is provided between the light box and the fruit fly activity board to provide light source for easy observation; More specifically, at least two fruit flies are placed in each observation hole to identify social behavior.

[0017] Step 2: Train an adaptive model using an existing machine learning model 2.1. Execute pip install -r requirements.txt to install the required Python packages; 2.2. Collect training videos shot on the shooting platform; 2.3. Perform video pre-analysis: execute the SoAL_PreProcess.py program and process the region of interest, image background, and target according to the UI; 2.4. Execute tools / SoAL_DatasetGen.py to generate a custom dataset for model training; 2.5. Run python tools / SoAL_LabelUI.py to manually label the key points of Drosophila to form a dataset. 2.6. Put the image file and annotation file (annotation.json) generated in step 2.5 into the training folder data; 2.7. Execute python tools / SoAL_DatasetGen.py DSNAME divide (divide the collected dataset into a training set (80%) and a validation set (20%). 2.8. To save training time, combine the pre-training database for training. Open hrnet / fly_w32.yaml and edit the following content: DATASET: ROOT: 'dataset / ' TEST_SET: 'person_keypoints_train_test2' TRAIN_SET: 'train_SDPD-15k' MODEL: PRETRAINED: 'hrnet_model / hrnet_w32-36af842e.pth' 2.9. Execute python hrnet / tools / train.py --cfg hrnet / fly_w32.yaml until the AP value displayed in the terminal does not increase.

[0018] Step 3: Recognize the posture of the fruit fly in the video through the adaptive model 3.1. Collect video files and move them to the video folder in the machine learning root directory: 3.2. Execute python SoAL_PreProcess.py to perform video pre-analysis, pre-process the video according to the UI, and select the background and target.

[0019] 3.3. Execute python SoAL_KptDetect.py all to obtain the coordinates of all key points of the fruit fly in the video 3.4. When the message "[Main]: all finished" appears in the terminal, the video processing is complete.

[0020] 3.5. A folder will be generated under the video folder according to the recognition range calibrated in 3.2. The Excel table containing the coordinates will be in the folder corresponding to the recognition range (such as Figure 5 The file records the frame and point:x / point:y (the horizontal and vertical coordinates of the five points on the fruit fly's head, body, tail, and the tips of its two wings) required for this patent processing.

[0021] Step 4: Put the machine learning coordinate file into this patented program to obtain social behavior statistics 4.1. Input all Excel files into the following location of this patent application: input_files = [ r"C:\" # Use your uploaded CSV file ] 4.2. Run the program to complete the data analysis and output it to the output folder in the root directory of the program; 4.3. Obtain a table that records the social situation data of all frames of the video.

[0022] In summary, the present invention can automatically label the social behavior of two fruit flies after machine learning and output specific social indicators in the form of an Excel table, which is a significant improvement compared to the existing technology.

[0023] Specifically, the present invention provides the complete source code of the patented program in step 4.1 below.

[0024]

[0025]

[0026] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0027] The above-described embodiments merely illustrate several implementations of the present invention, and while their descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent. It should be noted that a person skilled in the art would be able to make numerous variations and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the patent for this invention shall be determined by the appended claims.

Claims

1. A method for recording and identifying the social behavior of fruit flies, characterized in that: The following steps are involved: S1. Build a filming platform to capture video images of Drosophila social behavior; S2, collecting the video images acquired in step S1 and pre-analyzing the video to process the region of interest, the background of the image, and the target; Mark the key points of the fruit fly and obtain image files and marking files; Use the machine learning model to train the adaptive model using the above image files and labeled files; S3, pre-analyze the video image and select the background and target; The coordinates of all key points in the adaptive model video image; Generate a coordinate table that records the video frame number and the coordinates of the key points at the corresponding frame number; S4. Integrate the table files and analyze them to obtain a social behavior statistics table.

2. The method for recording and identifying fruit fly social behavior according to claim 1, wherein: The key points include the fruit fly's head, body, tail, and the tips of its two wings.

3. The method for recording and identifying fruit fly social behavior according to claim 2, wherein: In step S4, the social behavior of the fruit fly is identified by identifying the angle between the two vectors from the head to the tail and from the middle of the body to the head of one of the fruit flies, as well as the distance between the heads of the two fruit flies; When the distance between the heads of two fruit flies is between 3 and 20 degrees and the absolute value of the above angle is greater than 30 degrees, it is identified as social behavior.