A mouse visual behavior experiment control system and method based on visual programming
The mouse visual behavior experimental control system based on visual programming solves the problems of long experimental cycles, high technical thresholds and low timing synchronization accuracy. It achieves efficient and accurate synchronization of visual stimuli and rewards, supports researchers in configuring complex experimental procedures without code, and improves the efficiency and data accuracy of neuroscience research.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI YUYAN SCIENCE INSTRUMENT CO LTD
- Filing Date
- 2026-04-24
- Publication Date
- 2026-07-21
AI Technical Summary
Existing technologies for mouse visual behavior experiments suffer from problems such as long experimental cycles, high technical barriers, and low temporal synchronization accuracy. In particular, it is difficult to achieve precise binocular visual stimulation and millisecond-level neuro-behavioral synchronization in visual grating experiments.
The experimental control system adopts a visual programming-based approach, allowing experimental procedures to be configured through a drag-and-drop graphical interface. Combined with dual independent screens and a hardware synchronization control module, it achieves millisecond-level synchronization of visual stimuli and rewards. This supports researchers in customizing complex experimental procedures without coding, and ensures the efficiency and accuracy of experiments through a logic parsing engine and a hardware synchronization module.
This significantly lowers the interdisciplinary technical threshold, shortens the mouse training cycle, improves experimental efficiency and stimulation precision, achieves millisecond-level neuro-behavioral synchronization, and ensures the accuracy of neuroscience data.
Smart Images

Figure CN122431234A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of neuroscience and animal behavior testing technology, specifically to a mouse visual behavior experimental control system and method based on visual programming. Background Technology
[0002] In neuroscience and cognitive science research, exploring the mechanisms of brain-behavior connections typically requires the use of animal models (such as mice) to test visual cognition, attention, and decision-making behaviors. Currently, the industry commonly uses visual grating experiments where mice run freely in mazes or open boxes, combined with visual stimuli displayed on an external screen, and their behavioral responses are judged by capturing the mice's movement trajectories using cameras. Advanced laboratories commission engineers to develop customized experimental control programs, using code scripts to control stimuli and feedback.
[0003] However, existing technologies have the following drawbacks:
[0004] First, the experiment has a long cycle and large error. In the traditional free-running paradigm, the mouse's perspective and distance from the screen change constantly, making it impossible to guarantee the accuracy of binocular visual stimulation; moreover, it requires an extremely long pre-training period for the mouse to understand the experimental rules, resulting in extremely low experimental efficiency.
[0005] Second, the interdisciplinary technical barriers are high, and flexibility is lacking. Currently, there is a lack of universal behavioral control platforms on the market. Biological researchers typically lack advanced programming skills, and when experimental paradigms require fine-tuning (such as modifying the flashing frequency of a sinusoidal grating or changing the minimum number of occurrences of random stimulus events), the underlying source code needs to be modified. Hard-coding greatly limits the flexibility of scientific research.
[0006] Third, the timing synchronization accuracy is low. In traditional hardware and software separation solutions, screen visual presentation, external device signal acquisition, and reward execution are handled by independent threads, which easily leads to system latency and cannot achieve the millisecond-level timing synchronization recording required by neuro-behavioral science. Summary of the Invention
[0007] The present invention aims to provide a mouse visual behavior experimental control system and method based on visual programming, so as to solve the technical problems of long experimental cycle, high technical threshold and low timing synchronization accuracy in the prior art.
[0008] To achieve the above objectives, the present invention provides the following technical solution: a mouse visual behavior experimental control system based on visual programming, comprising:
[0009] The visual programming module provides a drag-and-drop graphical interface that responds to user drag-and-drop operations, generating hierarchical experimental configuration sequences containing waiting, looping, random, and stimulus modules. This module allows researchers to freely arrange the waiting, training, and stimulus modules, configure the flashing frequency of single or multiple images (upper limit limited by the hardware refresh rate of approximately 100Hz), and configure graphical attributes and sucrose reward levels (0-5 levels).
[0010] The logic parsing engine, connected to the visualization programming module, is used to compile the experimental configuration sequence into a hardware execution queue with timestamps, and generate a dual-screen visual stimulus timeline and a mapping table between stimulus graphics and reward parameters. The logic parsing engine incorporates a random distribution algorithm, supporting two random modes: "fixed frequency of each random event" and "fixed total frequency with a minimum guaranteed frequency for each type of random event," ensuring the statistical validity of the sample size.
[0011] The hardware synchronization control module, connected to the logic parsing engine, includes a display controller and a serial communication submodule. The display controller drives two independent screens corresponding to the left and right eyes of the mouse, respectively, outputting visual grating stimuli according to the visual stimulus timeline, supporting independent or asynchronous refresh of the left and right eye screens. The serial communication submodule connects to the signal acquisition control board and the reward execution device.
[0012] The behavior monitoring and recording module, connected to the hardware synchronization control module, is used to monitor the physical feedback signals of the mouse in real time through the signal acquisition control board. When a feedback signal matching the current visual stimulus is detected, an execution command is sent to the reward execution device through the serial communication submodule to issue a reward, and the stimulus graphic, occurrence time, and feedback response delay data are synchronously stored in the database.
[0013] A method for controlling mouse visual behavior experiments based on visual programming includes the following steps:
[0014] Step S1: Obtain the configuration information of the visualization experiment program. Receive the experiment flowchart generated by the user through dragging and dropping visualization components, and parse the binocular independent graphic parameters, image duration, flicker frequency, and the distribution rules of the total number of random events and the minimum guaranteed number of events contained in the flowchart.
[0015] Step S2: Compile the configuration information into a low-level timing control sequence. The system engine automatically reduces the dimensionality of the graphical configuration information into a hardware execution queue with timestamps, ensuring that each stimulus event has a unique time anchor and associated reward configuration (such as the base and level configuration of the sugar water reward).
[0016] Step S3: Perform high-concurrency dual-screen visual stimulation and hardware synchronization control. The mouse is fixed in place by a mouse holder, and the system outputs visual grating stimulation to the two independent screens of the mouse's left and right eyes respectively through a dual-channel graphics interface (the left and right eyes can be configured with different patterns or alternate flashing).
[0017] Step S4: Receive hardware feedback signals and distribute rewards. A dedicated signal acquisition and control board monitors the physical feedback signals from the mouse's movement of the lever in real time. When a correct lever signal matching the current visual stimulus is detected, the system sends an execution command to the syringe via serial port, dispensing sugar water according to the configured reward level. Simultaneously, a millisecond-level "stimulus-feedback-reward" synchronization log is recorded in the SQLite database.
[0018] Compared with the prior art, the present invention has the following beneficial effects:
[0019] First, it features a groundbreaking "no-code" behavioral science paradigm design. By encapsulating complex experimental logic (such as fixed randomization, guaranteed randomization, and multi-level loops) into visual drag-and-drop modules, researchers can customize extremely complex experimental procedures without writing any code, greatly reducing the interdisciplinary technical barriers.
[0020] Secondly, it eliminates pre-training costs and improves stimulation accuracy. Abandoning the traditional free-running paradigm, it uses a fixed mouse barrel combined with lever operation and dual independent screens, enabling precise stimulation of the left and right eyes through independent visual gratings. This eliminates environmental and spatial interference and significantly shortens the training cycle for mice.
[0021] Third, it achieves millisecond-level "brain-behavior" hardware synchronization. The underlying system aligns the timestamps of visual rendering frames, lever physical feedback, and syringe water flow control through an independent signal acquisition board and serial communication architecture, solving the high latency problem between components in traditional systems and ensuring the research value of neuroscience data. Attached Figure Description
[0022] Figure 1 This is a flowchart of the experimental control method of the present invention;
[0023] Figure 2 This is a schematic diagram of the experimental control system of the present invention. Detailed Implementation
[0024] Example 1
[0025] like Figure 1 As shown, this embodiment provides a method for controlling mouse visual behavior experiments based on visual programming, including the following steps:
[0026] Step S1: Obtain the configuration information for the visualization experiment program. Users generate an experimental flowchart by dragging and dropping visualization components (including wait, loop, random, and stimulus modules). The system parses the binocular independent graphic parameters, image duration, flicker frequency, and the distribution rules for the total number of random events and the minimum guaranteed number of events contained in the flowchart. For example, users can configure the left eye screen to display a vertical grating, the right eye screen to display a horizontal grating, each stimulus to last 500ms, a flicker frequency of 20Hz, and a total of 100 random events, with each type of random event occurring at least 10 times.
[0027] Step S2: Compile the configuration information into a low-level timing control sequence. The system engine automatically reduces the dimensionality of the above graphical configuration information into a hardware execution queue with timestamps, ensuring that each stimulus event has a unique time anchor and associated reward configuration. For example, a correct response to a vertical grating stimulus corresponds to a sugar water reward base of 10 μL and a reward level of 3, while a correct response to a horizontal grating stimulus corresponds to a base of 10 μL and a reward level of 5.
[0028] Step S3: Execute high-concurrency dual-screen visual stimulation and hardware synchronization control. The mouse is fixed in place using a mouse holder, and the system outputs visual grating stimuli to the two independent screens corresponding to the mouse's left and right eyes via a dual-channel graphics interface. The display controller supports independent refresh of the left and right eye screens, and the left and right eyes can be configured with the same or different graphics.
[0029] Step S4: Receive hardware feedback signals and distribute rewards. A dedicated signal acquisition control board monitors the physical feedback signals from the mouse's movement of the lever in real time. When a correct lever signal matching the current visual stimulus is detected, the system sends an execution command to the syringe via serial port, dispensing sugar water according to the product of the configured reward level and the base amount. Simultaneously, a millisecond-level "stimulus-feedback-reward" synchronization log is recorded in the SQLite database.
[0030] like Figure 2 As shown, this embodiment also provides a mouse visual behavior experimental control system based on visual programming, including:
[0031] The Visual Programming Module 100 provides a drag-and-drop interface that allows researchers to freely arrange waiting, training, and stimulation modules, and configure the flashing frequency, graphic attributes, and reward levels for single or multiple images.
[0032] The logic parsing engine 200 is used to transform visual processes into machine-executable sequences. It has a built-in random distribution algorithm and supports two random modes.
[0033] The hardware synchronization control module 300 includes a display controller and a serial communication submodule. The display controller enables independent screen refresh for the left and right eyes; the serial communication submodule connects to an external signal acquisition control board and a syringe.
[0034] The behavior monitoring and recording module 400 is used to capture the mouse's operation of the lever, calculate the accuracy rate in combination with the current stimulation phase, persist the millisecond-level time series data of the entire experiment to the internal SQLite database, and provide data result parsing and CSV format export functions after the experiment.
[0035] Example 2
[0036] This embodiment, based on Embodiment 1, provides an alternative design for the feedback input method. In other embodiments, the system's behavioral feedback input method is not limited to the mouse's paw moving a lever; the signal acquisition control board can also be connected to an infrared licking detection sensor or an eye-tracking camera system. The logic parsing engine can use these alternative input signals as experimental feedback trigger conditions with the same timing recording standard.
[0037] In addition, the underlying data storage is not limited to a local SQLite database, but can also be replaced with a MySQL database uploaded to the cloud via the network, and provides data reports in JSON or XML formats other than CSV format during export, so as to facilitate seamless integration with other third-party neurophysiological analysis software.
[0038] While the specific embodiments of the present invention have been described in detail above, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention, and modifications or variations without creative effort are still within the protection scope of the present invention.
Claims
1. A mouse visual behavior experimental control system based on visual programming, characterized in that, include: The visual programming module provides a drag-and-drop graphical interface that responds to user drag-and-drop operations and generates a hierarchical experimental configuration sequence containing waiting modules, loop modules, random modules, and stimulus modules. The logic parsing engine, connected to the visualization programming module, is used to compile the experimental configuration sequence into a hardware execution queue with timestamps, and generate a dual-screen visual stimulus timeline and a mapping table of stimulus graphics and reward parameters. The hardware synchronization control module, connected to the logic parsing engine, includes a display controller and a serial communication submodule. The display controller drives two independent screens corresponding to the left and right eyes of the mouse, respectively, and outputs visual grating stimuli according to the visual stimulus time axis. The serial communication submodule is used to connect the signal acquisition control board and the reward execution device. The behavior monitoring and recording module, connected to the hardware synchronization control module, is used to monitor the physical feedback signals of the mouse in real time through the signal acquisition control board. When a feedback signal matching the current visual stimulus is detected, an execution command is sent to the reward execution device through the serial communication submodule to issue a reward, and the stimulus graphic, occurrence time, and feedback response delay data are synchronously stored in the database.
2. The mouse visual behavior experimental control system based on visual programming according to claim 1, characterized in that, The logic parsing engine has a built-in random distribution algorithm that supports a first random mode and a second random mode. In the first random mode, the number of occurrences of each random event is fixed. In the second random mode, the total number of random events is fixed while ensuring a minimum number of occurrences for each type of random event.
3. The mouse visual behavior experimental control system based on visual programming according to claim 1, characterized in that, The hardware synchronization control module also includes a dedicated signal acquisition control board, which is used to independently acquire the physical feedback signal generated by the mouse moving the lever in real time, and align the signal timestamp with the visual stimulus time axis.
4. The mouse visual behavior experimental control system based on visual programming according to claim 1, characterized in that, The reward parameters include a base amount of sugar water reward and a reward level; the reward level ranges from 0 to 5; the reward execution device is a syringe, which dispenses a corresponding amount of sugar water based on the product of the reward level and the base amount of sugar water reward.
5. The mouse visual behavior experimental control system based on visual programming according to claim 1, characterized in that, The database is an SQLite database, and the behavior monitoring and recording module is also used to export the data as a CSV file after the experiment.
6. The mouse visual behavior experimental control system based on visual programming according to claim 1, characterized in that, The display controller supports independent or asynchronous refresh of the left and right eye screens, and the visual grating stimuli output by the left and right eye screens can be configured to be the same or different graphics.
7. The mouse visual behavior experimental control system based on visual programming according to claim 1, characterized in that, The visualization programming module also supports configuring image duration, flashing frequency, total number of random events, and minimum guaranteed number of events distribution rules.
8. A method for controlling mouse visual behavior experiments based on visual programming, employing the mouse visual behavior experimental control system based on visual programming as described in any one of claims 1-7, characterized in that... Includes the following steps: Step S1: Obtain the configuration information of the visualization experiment program, receive the experiment process tree generated by the user through dragging and dropping visualization components, and parse the binocular independent graphic parameters, image duration, flicker frequency, and distribution rules of the total number of random events and the minimum guaranteed number of times contained in the process tree; Step S2: The configuration information is compiled into a low-level timing control sequence. The system engine automatically reduces the dimensionality of the graphical configuration information into a hardware execution queue with timestamps to ensure that each stimulus event has a unique time anchor and associated reward configuration. Step S3: Execute high-concurrency dual-screen visual stimulation and hardware synchronization control. Fix the mouse with a mouse tube and output visual grating stimulation to the two independent screens of the corresponding left and right eyes of the mouse through a dual-channel graphics interface. Step S4: Receive hardware feedback signals and issue rewards. The physical feedback signals of the mouse are monitored in real time through the signal acquisition control board. When a feedback signal matching the current visual stimulus is detected, an execution command is sent to the reward execution device through the serial port. The reward is issued according to the configured reward, and the stimulus-feedback-reward synchronization log is recorded in the database at the same time.
9. The method according to claim 8, characterized in that, In step S4, the reward execution device is a syringe, the reward is sugar water, and the amount of reward issued is the product of the reward level and the base amount of the sugar water reward.