Mouse behavior automatic analysis system and method based on YOLO target detection

CN122906744APending Publication Date: 2026-10-13GUILIN MEDICAL UNIVERSITY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610964974.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-30
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

1.人工分析效率极低且主观性强: 现有的人工分析需要实验员逐帧观看视频,手动标记小鼠头部位置

Benefits of technology

1.精准定位: 利用YOLO算法直接锁定小鼠头部,相比传统的人工目测或整体轮廓追踪,定位精度达到像素级,消除了“身体在浅区、头在深区”的误判;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122906744A_ABST
    Figure CN122906744A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of animal experiment behavior analysis, and particularly discloses a mouse behavior automatic analysis system based on YOLO target detection, which comprises a box body, an image acquisition unit and a data processing unit. The application also discloses a mouse behavior automatic analysis method based on YOLO target detection, which comprises the following steps: step S1, video stream access and processing; step S2, deep and shallow region segmentation line calibration; step S3, mouse head target detection based on YOLO; step S4, deep and shallow region judgment logic; step S5, time statistics and DI value calculation; and step S6, data export. The mouse behavior automatic analysis method and system based on YOLO target detection can realize pixel-level accurate positioning of the mouse head position, automatically distinguish deep and shallow regions, and calculate standardized DI values, so as to replace manual analysis and improve the objectivity and accuracy of experimental data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of animal experimental behavior analysis technology, and in particular to an automated mouse behavior analysis system and method based on YOLO target detection. Background Technology

[0002] The visual cliff test is a classic paradigm for assessing depth perception and spatial cognition in rodents (such as mice). Current experimental data collection primarily relies on manual observation of video playback or simple photoelectric counting. The main drawbacks of this experiment are as follows: 1. Manual analysis is extremely inefficient and highly subjective: Current manual analysis requires experimenters to watch the video frame by frame and manually mark the position of the mouse's head. This is not only time-consuming and laborious, but also leads to large data bias and poor repeatability due to different experimenters having different visual judgment standards. 2. Lack of positioning accuracy in traditional sensors: Existing photoelectric sensors or ordinary monitoring can only record the general time of "passing" or "stopping", and cannot accurately identify the specific coordinate position of the mouse's head, nor can they distinguish whether the mouse is exploring in the "deep area" or the "shallow area". 3. Limited data output: It cannot automatically calculate complex cognitive indicators (such as DI values), making it difficult to meet the needs of high-throughput and refined neuroscience research. Summary of the Invention

[0003] The present invention aims to solve at least one of the technical problems mentioned above, and provides an automatic analysis system and method for mouse behavior based on YOLO target detection, which can achieve pixel-level precise localization of the mouse head position, automatically distinguish between light and dark regions, and calculate a standardized DI value, thereby replacing manual analysis and improving the objectivity and accuracy of experimental data.

[0004] To achieve the above objectives, the technical solution adopted by this invention is: an automated mouse behavior analysis system based on YOLO target detection, comprising: The box body is hollow inside, with a first opening on its side and an openable door panel installed thereon, and a second opening on the top and a transparent cover plate installed thereon. A first support plate and a second support plate are spaced apart in the inner cavity of the box body, and the first and second support plates are parallel to each other, with the first support plate positioned above the second support plate. The first support plate is divided into a first facet and a second facet, with the first facet having a black and white grid pattern and the second facet being transparent. The second support plate, located below the second facet, also has a black and white grid pattern. The image acquisition unit includes a high-definition camera installed on the top of the enclosure and a fill light located on the outer side of the top of the enclosure. The data processing unit includes a computer host with a Python runtime environment and analysis program installed. The analysis program calls computer vision and deep learning libraries to perform functions such as video stream processing, mouse head target detection, depth region determination, time statistics and DI value calculation, and data export.

[0005] Preferably, the edges of both the first and second bearing plates are glued to the inner wall of the housing.

[0006] Preferably, the inner wall of the box and the inner side of the door panel are covered with a black matte layer.

[0007] Preferably, the bottom of the box is provided with rollers, and the side of the box is equipped with a retractable pull rod.

[0008] Furthermore, this application also discloses an automated analysis method for mouse behavior based on YOLO target detection, employing any of the aforementioned automated analysis systems, comprising the following steps: Step S1: Video stream access and preprocessing. Open the cover and place the experimental mouse into the inner cavity of the box, positioning it accurately at the midpoint between the shallow and deep zones. Then close the cover and capture the real-time video stream using a high-definition camera, obtaining multiple consecutive frames of images. Step S2: Calibration of shallow and deep region segmentation lines. Use the mouse to click on the physical boundary between the shallow and deep regions in the preview screen. The analysis program obtains the coordinate value of the mouse click point and sets it as the coordinate value of the baseline segmentation line. This coordinate value is saved as the parameter of the current experiment and used for the determination of shallow and deep regions in all subsequent image frames. Step S3: Mouse head target detection based on YOLO. Each frame of image obtained in step S1 is input into the pre-trained YOLO target detection model. The computer host loads the trained YOLO model through the PyTorch framework. For each frame of input image, the YOLO model outputs the coordinates of the detected mouse head bounding box. The coordinates of the upper left corner of the bounding box are (x1, y1), and the coordinates of the lower right corner are (x2, y2). The analysis program calculates the coordinates of the center point P of the mouse head based on the bounding box coordinates, where x is the average of x1 and x2, and y is the average of y1 and y2. Step S4: Determining the shallow and deep regions. Based on the coordinates of the baseline dividing line determined in step S2 and the coordinates of the mouse head center point obtained in step S3, the analysis program executes the determination: if the center point is located on the shallow side of the dividing line, the mouse is determined to be in the shallow region; if the center point is located on the deep side of the dividing line, the mouse is determined to be in the deep region. Step S5: Time Statistics and DI Value Calculation. The analysis program initializes two timing variables to accumulate the time the mouse spends in the shallow and deep zones, respectively. Then, the analysis program calculates the Exploration Difference Index (DI) value according to the following formula: DI = (Shallow Zone Time - Deep Zone Time) / (Shallow Zone Time + Deep Zone Time). The DI value ranges from -1 to 1. Step S6: Data Export. After the experiment and calculation are completed, the analysis program automatically summarizes and exports the data from the entire experimental process. The data includes timestamp sequences, coordinates of the mouse head center point in each frame, region attribution, cumulative shallow zone time and deep zone time, the final calculated DI value, as well as a CSV file containing the detection results of each frame, a text report of the complete detection results, and a processing log file. All data files are automatically saved to the specified directory on the computer host.

[0009] Preferably, during the loop of executing steps S3 to S5, the program uses OpenCV's drawing functions to overlay visual annotations on the current image frame, including: drawing the detection box of the mouse head, drawing the center point of the head, and drawing the baseline segmentation line. At the same time, the current cumulative time values ​​of the shallow and deep areas are displayed in real time in the upper left corner of the screen.

[0010] Preferably, the analysis program also includes automatic screenshot logic: whenever the center point of the mouse's head crosses the baseline dividing line, the analysis program automatically saves the current labeled image frame as a screenshot file. The file name includes the current timestamp and the direction of regional change, and all screenshots are automatically stored in a specified folder.

[0011] Preferably, during the analysis process, the analysis program automatically identifies the continuous time periods when the mouse enters different areas, generates timeline segmented data, and for each continuous time period, the analysis program records its start frame number, end frame number, start time, end time, number of frames, and duration. The analysis program also counts the hotspot distribution of the mouse in different areas of the image, divides the image into three regions along the vertical direction: top, middle, and bottom, counts the total number of frames in each region where the center point of the mouse's head falls and its proportion, and automatically calculates the interaction heat ratio between shallow and deep areas and the dominant region.

[0012] Preferably, in step S1, for each frame of the original image obtained, the image is first converted into a grayscale image, and then Gaussian filtering is performed on the grayscale image.

[0013] Preferably, the training process of the YOLO object detection model includes: First, in the same visual cliff experimental environment, 5,000 grayscale images of mouse heads in different poses and positions are acquired by a high-definition camera. The positions of the mouse heads in the images are selected one by one using a labeling tool to generate a label file containing bounding box coordinate information. Then, the YOLO model is trained using these labeled data, iterating multiple times until the model converges.

[0014] The beneficial effects are as follows: Compared with the prior art, the automatic mouse behavior analysis system and method based on YOLO target detection of the present invention has the following advantages: 1. Precise positioning: The YOLO algorithm is used to directly lock the mouse's head. Compared with traditional manual visual inspection or overall contour tracking, the positioning accuracy reaches the pixel level, eliminating the misjudgment of "body in shallow area and head in deep area". 2. Fully automated analysis: The entire process from video input to data output is unattended, completely freeing up manpower and solving the pain point of "time-consuming and labor-intensive" manual frame-by-frame analysis; 3. Data Standardization: The criteria for determining "deep / shallow areas" have been unified (based on the baseline algorithm), avoiding data deviations caused by human factors and improving the credibility of scientific research data; 4. Results visualization and structuring: Automatically generates Excel / CSV tables (containing detailed time series time_locations) to facilitate subsequent statistical analysis. Attached Figure Description

[0015] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings, wherein: Figure 1 This is a schematic diagram of the structure of the housing and the image acquisition unit; Figure 2 This is a flowchart of the analysis process for an automated analysis system. Figure 3 This is a schematic diagram illustrating the effect of mouse head detection and deep / shallow region determination. Detailed Implementation

[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0017] It should be noted that when a component is described as "fixed to" another component, it can be directly on the other component or may have a central component. When a component is described as "connected to" another component, it can be directly connected to the other component or may have a central component. When a component is described as "set on" another component, it can be directly set on the other component or may have a central component. When a component is described as "set in the middle," it is not simply set in the exact center, as long as it is not set within the area defined by both ends being in the middle. The terms "vertical," "horizontal," "left," "right," and similar expressions used in this document are for illustrative purposes only.

[0018] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0019] like Figure 1 As shown, this application discloses an automated mouse behavior analysis system based on YOLO target detection, including a housing 1, an image acquisition unit, and a data processing unit, specifically: The box 1 can be a square box 1 with a hollow interior. Specifically, the box 1 includes a bottom plate and four side plates. One of the side plates has a first opening and is fitted with an openable door 2. The top of the box 1 has a second opening and is fitted with a transparent cover 3. When both the door 2 and the cover 3 are closed, the interior of the box 1 is sealed, forming an independent experimental space. The inner cavity of the housing 1 is provided with a square first support plate 4 and a second support plate 5, which are horizontally arranged and parallel to each other. The first support plate 4 is positioned above the second support plate 5 and is spaced a certain distance apart. Both ends of the first support plate 4 are divided into a first face 6 and a second face 7. The first face 6 has a black and white grid pattern 8, forming a visually "shallow" reference surface. The second face 7 is a transparent surface. The second support plate 5, located below the second face 7, also has a black and white grid pattern 8. Due to the height difference between this plane and the second face 7, the black and white grid pattern 8 below the second face 7 visually forms a "deep area," or "cliff," effect relative to the first face 6. In this application, the black and white grid pattern 8 can be formed by applying a black and white grid sticker to the first support plate 4 and the second support plate 5. Preferably, the edges of the first support plate 4 and the second support plate 5 are glued to the inner wall of the box 1, and the first support plate 4 and the second support plate 5 are a whole piece of material without any splicing seams. Therefore, no highly reflective bright lines will be formed under top lighting, eliminating the problem of interference with the mouse's depth perception judgment due to reflection from splicing seams in traditional devices.

[0020] The image acquisition unit includes a high-definition camera 9 mounted directly above the housing 1, and a supplementary light 10 located on the outer top of the housing 1. Both the high-definition camera 9 and the supplementary light 10 are mounted on a mounting bracket above the housing 1, which is fixedly connected to the side of the housing 1. The lens of the high-definition camera 9 points vertically downwards, capturing a complete image of the shallow and deep areas on the first support plate 4 and the second support plate 5 through the top transparent cover 3. The supplementary light 10 provides uniform illumination, ensuring uniform illumination on the upper surface of the first support plate 4, meeting the image quality requirements of machine vision analysis. The high-definition camera 9 transmits real-time video signals to the computer host via a data cable. Furthermore, the inner walls of the housing 1 and the inner sides of the door panels 2 are covered with a black matte layer to absorb light incident on the inner walls, further reducing stray light reflection interference with mouse behavior and subsequent video analysis. In addition, the bottom of the housing 1 is equipped with casters 11, and the side of the housing 1 is equipped with a retractable pull rod 12, improving the portability of the device.

[0021] The data processing unit includes a computer host with a Python runtime environment and analysis program installed. The analysis program calls computer vision and deep learning libraries to perform video stream processing, mouse head target detection, depth region determination, time statistics and DI value calculation, and data export functions.

[0022] In addition, such as Figure 2 As shown, this application also discloses an automated analysis method for mouse behavior based on YOLO target detection, which uses the aforementioned automated analysis system and includes the following steps: Step S1: Video stream access and preprocessing.

[0023] During the experiment, the operator opened the top cover 3 and gently placed the experimental mouse into the inner cavity of the chamber 1, positioning it precisely at the midpoint between the shallow and deep zones to ensure its initial exploration was free of positional bias. The cover 3 was then closed, allowing the mouse to freely explore and adapt to the environment within the enclosed and evenly lit chamber 1. After the adaptation period, a high-definition camera 9 was used to capture real-time video streams of the actual experiment.

[0024] The analysis program on the computer host accesses the real-time video stream from the camera via the `cv2.VideoCapture()` function in the OpenCV library, acquiring multiple consecutive frames of images at a frame rate of 24 / 30 / 60 frames per second. For each raw image frame, the `cv2.cvtColor()` function is first used to convert it to grayscale to reduce computation and eliminate color noise; then, the `cv2.GaussianBlur()` function is used to perform Gaussian filtering on the grayscale image to further smooth the image and remove noise points, providing high-quality image input for subsequent object detection.

[0025] Step S2: Calibrate the deep and shallow region segmentation lines.

[0026] Before the formal experiment begins, the shallow and deep region segmentation lines need to be calibrated to accurately determine the virtual boundary positions in the image coordinate system corresponding to the shallow and deep region boundaries in the physical device. The calibration process is as follows: After the analysis program starts, a video preview window pops up, displaying the real-time image captured by the camera. The image clearly shows the shallow and deep areas on the support plate and their physical boundary line. Because the shallow area is directly beneath a patterned sticker, while the deep area is suspended with another layer of patterned sticker underneath, the two areas have the same visual texture but different depth perception, resulting in a identifiable visual boundary line in the image. The experimenter clicks on the location of this physical boundary line in the preview screen with the mouse. The program obtains the coordinates of the clicked point and sets it as the coordinates of the baseline dividing line. This coordinate value is saved as a parameter for the current experiment and used to determine the shallow and deep regions in all subsequent image frames. In one specific experiment, the calibrated dividing line coordinates were 321 pixels. Through this manual calibration method, this invention can adapt to image differences caused by different experimental device placement positions and different camera installation angles, ensuring the accuracy and versatility of shallow and deep region determination.

[0027] Step S3: YOLO-based target detection of mouse head.

[0028] Each frame of image preprocessed in step S1 is input into the pre-trained YOLO object detection model. The training process of this model is as follows: First, in the same visual cliff experimental environment, a high-definition camera 9 captures 5000 grayscale images of mouse heads in different poses and positions. Professional experimenters use annotation tools to select the positions of the mouse heads in each image, generating annotation files containing bounding box coordinate information. Then, the YOLO model is trained using these annotation data, iterating multiple times until the model converges, resulting in a weight file that can accurately identify mouse heads.

[0029] The computer host loads the trained YOLO model using the PyTorch framework. For each input image frame, the model outputs the coordinates of the detected mouse head bounding box, specifically the coordinates of the top-left corner (x1, y1) and bottom-right corner (x2, y2). The program then calculates the coordinates of the mouse head center point P based on the bounding box coordinates: x is the average of x1 and x2, and y is the average of y1 and y2.

[0030] See Figure 3 , Figure 3 The image shows the effect of a processed frame, where the rectangle is the bounding box of the mouse head detected by the YOLO model, the dots inside the rectangle are the calculated center points of the mouse head, and the horizontal line is the baseline segmentation line determined by calibration in step S2.

[0031] Step S4: Logic for determining the depth of the region.

[0032] Based on the coordinates of the baseline segmentation line determined in step S2 and the coordinates of the mouse's head center point obtained in step S3, the program performs a judgment: if the center point is located on the shallow side of the segmentation line, the mouse is determined to be in the shallow area; if the center point is located on the deep side of the segmentation line, the mouse is determined to be in the deep area. This judgment method uses the precise position of the mouse's head as the basis for behavioral judgment. Compared with traditional manual visual estimation or overall contour tracking, it can effectively eliminate the misjudgment of "body in the shallow area, head already in the deep area", greatly improving the spatial accuracy of experimental data.

[0033] Step S5: Time statistics and DI value calculation.

[0034] The program initializes two timing variables, which are used to accumulate the time the mouse spends in the shallow and deep zones, respectively. Timing is done in frames: after the region classification is determined for each frame, the corresponding time increment (1 / 30 second) is added to the time variable of the corresponding region.

[0035] After the experiment, the program calculated the Exploration Difference Index (DI) value using the following formula: DI = (Shallow Zone Time - Deep Zone Time) / (Shallow Zone Time + Deep Zone Time). The DI value ranges from -1 to 1. A DI value closer to 1 indicates that the mouse prefers to stay in the shallow zone, exhibiting stronger depth perception and risk-avoidance behavior; a DI value closer to -1 indicates that the mouse prefers to stay in the deep zone; a DI value close to 0 indicates that the mouse has no significant preference between the deep and shallow zones.

[0036] In a specific experimental example: the input video had a total of 5414 frames, with a frame rate of 24 / 30 / 60 frames per second, and a total experimental duration of 180.47 seconds. The YOLO model detected the mouse 5413 times in the 5414 frames, achieving a detection coverage of nearly 100%. After region determination, the mouse spent a total of 130.03 seconds (72.05%) in the shallow region and 50.37 seconds (27.91%) in the deep region. Substituting these values ​​into the formula, the calculated DI value was 0.4416. This DI value is positive and significantly deviates from zero, indicating that the mouse possesses normal depth perception ability, can perceive the existence of visual cliffs, and significantly avoids deep regions.

[0037] Step S6: Data export.

[0038] After the experiment and calculations are completed, the program automatically summarizes and exports the data from the entire experimental process. The data includes: timestamp sequences, coordinates of the mouse's head center point for each frame, region classification (shallow / deep zone), cumulative shallow zone time and deep zone time, the final calculated DI value, a CSV file containing the detection results for each frame, a text report of the complete detection results, and a processing log file. All data files are automatically saved to a designated directory on the computer host, facilitating further inter-group comparisons and scientific analysis using statistical software.

[0039] In this embodiment, the entire processing flow performed well: the entire processing time for 5414 frames of video was approximately 197.8 seconds, with a processing throughput of 27.37 frames per second, which is close to the real-time playback rate of the original video at 24 / 30 / 60 frames per second, and can meet the efficiency requirements of experimental analysis.

[0040] Furthermore, during the loop execution of steps S3 to S5, the program uses OpenCV's drawing functions to overlay visual annotations onto the current image frame, including: drawing the detection box for the mouse head, drawing the head center point, and drawing the baseline segmentation line. Simultaneously, the current cumulative time values ​​for the shallow and deep regions are displayed in real-time in the upper left corner of the screen. This annotated real-time display on the computer monitor allows researchers to monitor the experimental progress without disturbing the mice.

[0041] Furthermore, the program includes automatic screenshot logic: whenever the center point of the mouse's head crosses the baseline (i.e., from the shallow zone to the deep zone, or from the deep zone back to the shallow zone), the program automatically saves the currently labeled image frame as a screenshot file, with the filename including the current timestamp and the direction of the region change. All screenshots are automatically stored in a designated folder. After the experiment, researchers can review these screenshots to quickly trace key behavioral transitions of the mice during the experiment, providing rich qualitative and visual evidence for behavioral analysis.

[0042] Furthermore, during the analysis, the program automatically identifies consecutive time periods when the mouse enters different areas, generating segmented timeline data. For each consecutive time period, the program records its start frame number, end frame number, start time, end time, number of frames, and duration. For example, in one experiment, the program recorded a complete shallow-deep zone alternation behavior sequence: the mouse first stayed in the shallow zone for approximately 67 seconds, then entered the deep zone for approximately 8 seconds, briefly returned to the shallow zone for approximately 2 seconds, and then entered the deep zone again for approximately 11 seconds, repeating this cycle. The entire experiment consisted of 9 consecutive time periods, including 5 shallow zone stays and 4 deep zone explorations.

[0043] In addition, the program also analyzed the hotspot distribution of the mouse in different regions of the image, dividing the image vertically into three equal regions: top, middle, and bottom. It then counted the total number of frames in each region where the mouse's head center point fell, along with its percentage. Simultaneously, it automatically calculated the interaction heat ratio between shallow and deep regions and the dominant region.

[0044] Through the aforementioned timeline segmentation analysis and hotspot distribution statistics, researchers can not only obtain the overall DI value but also observe the temporal changes in mouse behavior in a finer granular manner—for example, whether there are differences in the exploration patterns of mice in the early and later stages of the experiment, and whether deep exploration occurs concentratedly in specific time periods or is evenly distributed. These refined behavioral indicators provide neuroscience research with a much richer quantitative data dimension than traditional manual analysis.

[0045] The above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of the technical solutions of the present invention.

Claims

1. An automated mouse behavior analysis system based on YOLO target detection, characterized in that, include: The box (1) is hollow inside. It has a first opening on its side and a door panel (2) that can be opened and closed. It has a second opening on the top and a transparent cover plate (3) installed. The inner cavity of the box (1) is provided with a first support plate (4) and a second support plate (5) at intervals. The first support plate (4) and the second support plate (5) are parallel to each other. The first support plate (4) is located above the second support plate (5). The first support plate (4) is divided into a first face (6) and a second face (7). The first face (6) has a black and white grid pattern (8). The second face (7) is a transparent surface. The second support plate (5) is located below the second face (7) and also has a black and white grid pattern (8). The image acquisition unit includes a high-definition camera (9) installed on the top of the housing (1) and a fill light (10) set on the outer side of the top of the housing (1). The data processing unit includes a computer host with a Python runtime environment and analysis program installed. The analysis program calls computer vision and deep learning libraries to perform functions such as video stream processing, mouse head target detection, depth region determination, time statistics and DI value calculation, and data export.

2. The automated mouse behavior analysis system based on YOLO target detection according to claim 1, characterized in that, The edges of the first bearing plate (4) and the second bearing plate (5) are glued to the inner wall of the box (1).

3. The automated mouse behavior analysis system based on YOLO target detection according to claim 1, characterized in that, The inner wall of the box (1) and the inner side of the door panel (2) are covered with a black matte layer.

4. The automated mouse behavior analysis system based on YOLO target detection according to claim 1, characterized in that, The bottom of the box (1) is provided with rollers (11), and the side of the box (1) is provided with a retractable pull rod (12).

5. An automated method for analyzing mouse behavior based on YOLO target detection, characterized in that, The automatic analysis system according to any one of claims 1-4 includes the following steps: Step S1, video stream access and preprocessing: Open the cover (3), place the experimental mouse into the inner cavity of the box (1), and make it accurately located at the middle position of the boundary between the shallow and deep areas. Then close the cover (3), collect the real-time video stream through the high-definition camera (9), and obtain continuous multi-frame images. Step S2: Calibration of shallow and deep region segmentation lines. Use the mouse to click on the physical boundary between the shallow and deep regions in the preview screen. The analysis program obtains the coordinate value of the mouse click point and sets it as the coordinate value of the baseline segmentation line. This coordinate value is saved as the parameter of the current experiment and used for the determination of shallow and deep regions in all subsequent image frames. Step S3: Mouse head target detection based on YOLO. Each frame of image obtained in step S1 is input into the pre-trained YOLO target detection model. The computer host loads the trained YOLO model through the PyTorch framework. For each frame of input image, the YOLO model outputs the coordinates of the detected mouse head bounding box. The coordinates of the upper left corner of the bounding box are (x1, y1), and the coordinates of the lower right corner are (x2, y2). The analysis program calculates the coordinates of the center point P of the mouse head based on the bounding box coordinates. In the coordinates of P, x is the average of x1 and x2, and y is the average of y1 and y2. Step S4: Determining the shallow and deep regions. Based on the coordinates of the baseline dividing line determined in step S2 and the coordinates of the mouse head center point obtained in step S3, the analysis program executes the determination: if the center point is located on the shallow side of the dividing line, the mouse is determined to be in the shallow region; if the center point is located on the deep side of the dividing line, the mouse is determined to be in the deep region. Step S5: Time Statistics and DI Value Calculation. The analysis program initializes two timing variables to accumulate the time the mouse spends in the shallow and deep zones, respectively. Then, the analysis program calculates the Exploration Difference Index (DI) value according to the following formula: DI = (Shallow Zone Time - Deep Zone Time) / (Shallow Zone Time + Deep Zone Time). The DI value ranges from -1 to 1. Step S6: Data Export. After the experiment and calculation are completed, the analysis program automatically summarizes and exports the data from the entire experimental process. The data includes timestamp sequences, coordinates of the mouse head center point in each frame, region attribution, cumulative shallow zone time and deep zone time, the final calculated DI value, as well as a CSV file containing the detection results of each frame, a text report of the complete detection results, and a processing log file. All data files are automatically saved to the specified directory on the computer host.

6. The automatic analysis method for mouse behavior based on YOLO target detection according to claim 5, characterized in that, During the loop of steps S3 to S5, the program uses OpenCV's drawing functions to overlay visual annotations on the current image frame, including: drawing the detection box of the mouse head, drawing the center point of the head, and drawing the baseline segmentation line. At the same time, the current cumulative time values ​​of the shallow and deep areas are displayed in real time in the upper left corner of the screen.

7. The automatic analysis method for mouse behavior based on YOLO target detection according to claim 5, characterized in that, The analysis program also has an automatic screenshot logic. Whenever the center point of the mouse's head crosses the baseline, the analysis program automatically saves the current labeled image frame as a screenshot file. The file name includes the current timestamp and the direction of the area change, and all screenshots are automatically stored in a specified folder.

8. The automatic analysis method for mouse behavior based on YOLO target detection according to claim 5, characterized in that, During the analysis process, the analysis program automatically identifies the continuous time periods when the mouse enters different areas and generates timeline segmented data. For each continuous time period, the analysis program records its start frame number, end frame number, start time, end time, number of frames, and duration. The analysis program also counts the hotspot distribution of the mouse in different areas of the image, divides the image into three regions along the vertical direction: top, middle, and bottom, and counts the total number of frames and the proportion of the mouse's head center point falling in each region. The program also automatically calculates the interaction heat ratio between shallow and deep regions and the dominant region.

9. The automatic analysis method for mouse behavior based on YOLO target detection according to claim 5, characterized in that, In step S1, for each frame of the original image obtained, the image is first converted into a grayscale image, and then Gaussian filtering is performed on the grayscale image.

10. The automatic analysis method for mouse behavior based on YOLO target detection according to claim 5, characterized in that, The training process of the YOLO object detection model includes: First, in the same visual cliff experimental environment, 5,000 grayscale images of mouse heads with different poses and positions are collected by a high-definition camera (9). The position of the mouse head in the image is selected one by one using the annotation tool to generate an annotation file containing bounding box coordinate information. Then, the YOLO model is trained using these annotation data, and iterated multiple times until the model converges.