Constant-current mouse electric shock stimulation device based on behavior recognition closed-loop control
The constant current mouse electric shock stimulation device based on behavior recognition closed-loop control solves the problem that existing devices cannot adjust stimulation according to animal behavior, and achieves stable and safe electric shock output and efficient experimental management, thereby improving the scientific nature and automation level of the experiment.
Patent Information
- Application Number
- CN202511750869.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2026-02-24
AI Technical Summary
Existing electric shock devices for mice cannot adjust stimulation according to the animal's real-time behavior, resulting in ineffective or excessive stimulation. They also have low adjustment accuracy, unstable electric shock output, and insufficient safety protection measures, which affect the accuracy of experimental data and animal welfare.
The constant current mouse electric shock stimulation device based on behavior recognition closed-loop control includes a high voltage generation module, a constant current control module, a behavior recognition module, an output module, a display and data management module, and a safety protection unit. The behavior recognition module analyzes the mouse's behavior in real time to achieve automatic triggering or termination of stimulation, and is equipped with multi-layer safety protection and data management functions.
It improves the relevance and scientific rigor of experiments, ensures the stability of stimulus intensity and the reproducibility of experimental results, supports complex experimental design and remote collaboration, reduces the risk of animal stress and equipment failure, and enhances the level of experimental automation.
Smart Images

Figure CN121549291A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of experimental animal behavioral research devices, specifically relating to a constant current mouse electric shock stimulation device based on behavioral recognition closed-loop control, which is suitable for experimental research in the fields of neuroscience, pharmacology and behavioral science. Background Technology
[0002] Existing electric shock devices for mice generally suffer from the following shortcomings: First, most employ fixed timing or manual control, making it impossible to adjust the stimulation based on the animal's real-time behavior, easily leading to ineffective or excessive stimulation, affecting the accuracy of experimental data and animal welfare; second, traditional devices mostly use knobs and simple indicator lights to set and display parameters, resulting in low adjustment precision and a lack of data recording and management functions; third, the electric shock output is significantly affected by the electrode contact state, often causing current instability due to impedance changes, leading to poor experimental repeatability. Furthermore, safety protection measures are limited, making it difficult to meet the requirements of high-standard behavioral experiments.
[0003] Therefore, there is an urgent need for an intelligent mouse electric shock stimulation device with behavioral recognition closed-loop control, constant current output and safety protection functions to improve the scientific rigor, stability and automation of experiments. Summary of the Invention
[0004] To address the problems of existing technologies, this invention provides a constant-current mouse electrostimulation device based on behavior recognition closed-loop control. This device aims to overcome issues such as single-control operation, lack of targeted stimulation, unstable output, and insufficient safety in existing mouse electrostimulation devices. The device can automatically trigger or terminate electrostimulation based on the mouse's real-time behavioral state, achieving behavior-driven closed-loop control. A high-precision constant-current output circuit ensures stable stimulation intensity. Furthermore, it is equipped with multi-layered safety protection and data management functions, significantly improving the scientific rigor, repeatability, and automation of experiments.
[0005] To achieve the above objectives, the present invention provides the following solution: A constant current mouse electric shock stimulation device based on behavior recognition closed-loop control, the device includes: a high voltage generation module, a constant current control module, a main control unit, a behavior recognition module, an output module, a display and data management module, and a safety protection unit. The modules are interconnected by wires and bus circuits to achieve signal interaction and power supply. High voltage generation module, used to increase voltage through boost chip; The constant current control module is used to regulate the output current and keep it within a preset current range. The behavior recognition module is used to acquire video images of the experimental mice's movements, analyze the behavioral state of the experimental mice through the embedded processing unit, generate trigger signals, and transmit the trigger signals to the main control unit. The main control unit is used to receive parameters set by the experimenter and trigger signals generated by the behavior recognition module, and drives the output module by controlling the output of the constant current control module through preset logic. The output module provides an independent channel for connection to an external stun gun, controlling the execution or termination of electric shock stimulation. The display and data management module is used to display the boot screen, parameter setting screen, running status screen and historical record screen, and upload experimental parameters, electric shock logs and behavioral videos to the host computer or cloud to realize remote management and data traceability. The safety protection unit is used to monitor the electrode contact status in real time and provide alarms and safety protection in case of abnormalities.
[0006] Preferably, the high voltage generation module adopts an IC integrated boost circuit, and the main control unit adjusts the output voltage through a digital potentiometer, with a voltage range of 50~200V.
[0007] Preferably, the constant current control module consists of a constant current source circuit composed of an operational amplifier and a MOSFET. It achieves a constant current output in the range of 0.01~2mA through the control voltage of the main control unit, and the output current is independent of the load.
[0008] Preferably, the method for the behavior recognition module to acquire motion video images of experimental mice, analyze the behavioral state of experimental mice through an embedded processing unit, generate a trigger signal, and transmit the trigger signal to the main control unit includes: The behavior recognition module acquires motion video images of experimental mice through a camera, and obtains a stable input frame sequence after grayscale conversion, histogram equalization and Gaussian filtering for noise reduction; Based on the input frame sequence, the improved YOLOv5s or MobileNet-SSD network structure is used to perform target detection on experimental mice and obtain the target region. A lightweight pose recognition network based on HRNet or OpenPose-Lite is used to estimate key points in the target region and obtain the key point coordinate set of the experimental mice. Based on the key point coordinate set of experimental mice, behavioral feature vectors are extracted, and behavioral category labels are obtained by using TCN or LSTM network structures. The behavior category labels within the preset time window are smoothed by voting, trigger signals are generated and sent to the main control unit.
[0009] Preferably, methods for detecting targets in experimental mice and obtaining target regions based on input frame sequences using improved YOLOv5s or MobileNet-SSD network structures include: The loss function L includes the location regression loss L. box Confidence loss L objAnd classification loss L cls : L = λ1L box + λ2L obj + λ3L cls ; Where λ1, λ2, and λ3 are all weights.
[0010] Preferably, the output module includes 8 independent programmable output channels, which are connected to an external stun gun array, which includes multiple stun guns. When the device is working, the main control unit polls and selects the 8 independent programmable output channels according to a preset timing control strategy, so that only one independent programmable output channel is pressurized at any given time, while the other independent programmable output channels remain in a low-voltage state. The output module supports alternating shock mode, synchronous shock mode, and user-defined timing mode.
[0011] Preferably, the display and data management module supports setting voltage, current, pulse width, and running time parameters via a touch screen, and enables real-time uploading and remote management of experimental data via USB or WiFi interface.
[0012] Preferably, the safety protection unit includes: an electrode impedance detection circuit, an overcurrent protection circuit, and an abnormal alarm system; The electrode impedance detection circuit is used to monitor the electrode contact status in real time. When non-contact or abnormal contact is detected, the electric shock output is stopped immediately and an audible and visual alarm is triggered. Overcurrent protection circuit is used to automatically cut off high voltage output when the current exceeds a set threshold; An abnormality alarm system is used to provide audible and visual alarm prompts when no contact is detected or abnormal contact is detected.
[0013] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention provides a constant-current electric shock stimulation device for mice based on behavioral recognition closed-loop control. Through behavioral recognition closed-loop control, stimulation is only administered under behavioral conditions that meet experimental requirements, improving the relevance and scientific rigor of the experiment. Constant current output and impedance detection ensure stable stimulation intensity, significantly improving the reproducibility of experimental results. Multi-channel programmable control and data management functions support complex experimental designs and remote collaboration. Multi-layered safety protection mechanisms reduce the risks of animal stress and equipment malfunction. This device is particularly suitable for neuroscience research fields such as reward mechanisms, motivational behavior, conditioned reflexes, and neural circuit modulation, providing strong technical support for high-level experimental research.
[0014] Furthermore, this invention provides a stress schedule orchestration unit in the display and data management module, which can insert "constant current plantar stimulation" as a subroutine into a multi-week schedule. The device supports strong / weak randomization (random day, random time, random pulse width / interval) and is linked with a behavior recognition closed loop, outputting only when a safe posture and good contact are detected; abnormalities (excessive impedance or overcurrent) are hard-cut off and alarms are triggered within 2 ms. Compared to manual execution, the system achieves a long-term, mild stress process with consistent parameters, traceable timing, and verifiable compliance. Attached Figure Description
[0015] To more clearly illustrate the technical solution of the present invention, the drawings used in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a schematic diagram of a constant current mouse electric shock stimulation device based on behavior recognition closed-loop control according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the high-voltage generation and constant current control circuit according to an embodiment of the present invention; Figure 3 This is a schematic diagram of signal processing and triggering logic in an embodiment of the present invention, wherein (a), (b), and (c) are output circuits for voltage control, and (d), (e), and (f) are current feedback circuits; Figure 4 This is a schematic diagram of the display and data management module interface in an embodiment of the present invention, wherein 1-return, 2-mouse click, 3-year month day minute second, 4-parameter area, 5-light up, 6-light up duration display, 7-sound, 8-sound duration display, 9-start; Figure 5 The following is a diagram of the settings interface of the display and data management module in this embodiment of the invention, including the following: system settings (including configuration of experimental parameters such as voltage settings, current settings, period settings, and pulse width), electric shock settings (electric shock duration, interval time, and electric shock time settings for different stages), and light and sound settings (setting of light duration and sound duration to coordinate with visual and auditory feedback during the experiment). Figure 6 This is a schematic diagram of the operation of the security protection unit in an embodiment of the present invention; Figure 7 This is a flowchart of the behavior recognition closed-loop control in an embodiment of the present invention. Detailed Implementation
[0017] 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 some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0019] Example 1 like Figure 1 As shown, the present invention provides a constant current mouse electric shock stimulation device based on behavior recognition closed-loop control, including: a high voltage generation module, a constant current control module, a main control unit, a behavior recognition module, an output module, a display and data management module, and a safety protection unit. The modules are interconnected by wires and bus circuits to achieve signal interaction and power supply. High voltage generation module, used to increase voltage through boost chip; The constant current control module is used to regulate the output current and keep it within a preset current range. The behavior recognition module is used to acquire video images of the experimental mice's movements, analyze the behavioral state of the experimental mice through the embedded processing unit, generate trigger signals, and transmit the trigger signals to the main control unit. The main control unit is used to receive parameters set by the experimenter and trigger signals generated by the behavior recognition module, and drives the output module by controlling the output of the constant current control module through preset logic. The output module provides an independent channel for connection to an external stun gun, controlling the execution or termination of electric shock stimulation. The display and data management module is used to display the boot screen, parameter setting screen, running status screen and historical record screen, and upload experimental parameters, electric shock logs and behavioral videos to the host computer or cloud to realize remote management and data traceability. The safety protection unit is used to monitor the electrode contact status in real time and provide alarms and safety protection in case of abnormalities.
[0020] Figure 2 This is a block diagram illustrating the principle of the high-voltage generation and constant current control circuit of the present invention. Figure 2 The system includes: a DC input terminal, a boost converter chip (such as MAX1771), a CAT5171 digital potentiometer, a voltage feedback network, an operational amplifier, a MOSFET, and output terminals. High-voltage output regulation is achieved by adjusting the feedback resistor using the digital potentiometer; the operational amplifier and MOSFET form a constant current source circuit to achieve a constant current output.
[0021] Specifically, the high-voltage generation module uses a 12V DC power supply as input and boosts the voltage using a MAX1771 boost chip. The main control unit controls a CAT5171 digital potentiometer to adjust the feedback resistor value, thereby dynamically controlling the output voltage range between 50 and 200V. Compared with traditional transformer-based methods, this solution is smaller, has higher conversion efficiency, and can quickly respond to voltage regulation needs.
[0022] Furthermore, the constant current control module employs operational amplifiers and MOSFETs to form a constant current source circuit. The main control unit outputs a 0-3V control voltage, which drives the MOSFETs via the operational amplifier to adjust the output current, maintaining it within the 0.01-2mA set range. The main control unit outputs a 0-3V voltage signal via a DA converter, which is input to the first operational amplifier U4. This operational amplifier acts as a follower, buffering and enhancing the signal's driving capability to drive the subsequent eight constant current source circuits. The non-inverting input of each constant current source's operational amplifier U2, etc., is connected to the output of U4. According to the characteristics of operational amplifiers, the inverting input remains equal to the non-inverting input. When the DA output voltage is fixed, the inverting input voltage is also fixed, and the resistor value connected to the inverting input is also fixed. Therefore, the current flowing through this resistor is a fixed value, and consequently, the current flowing through transistor Q1 is also a fixed value, thus forming a stable constant current control circuit and ensuring the stability and accuracy of the current output. The constant current output is independent of the load. When changes in mouse behavior during the experiment cause fluctuations in electrode contact impedance, the output current remains constant, ensuring the stability of the stimulus intensity and the repeatability of experimental data.
[0023] Furthermore, the behavior recognition module is used to acquire motion video images of the experimental mice, analyze the behavioral state of the experimental mice through an embedded processing unit, generate trigger signals, and transmit the trigger signals to the main control unit. Specifically, it includes: The behavior recognition module, mounted on the top of the experimental chamber, includes a high-definition camera and an embedded processing unit. The camera captures real-time video of the mouse's movements, while the embedded processing unit analyzes the mouse's behavioral state, such as stillness, lingering in a specific area, or a preset behavioral sequence, using target detection and posture recognition algorithms. When a behavioral state matching the set conditions is detected, the behavior recognition module outputs a trigger signal to the main control unit, achieving closed-loop control driven by the stimulus.
[0024] To achieve closed-loop control based on behavior recognition, the behavior recognition module of this invention adopts a multi-stage algorithm framework that combines target detection and posture recognition. By analyzing the real-time video stream captured by the camera, it realizes the recognition and triggering control of specific behavioral states of mice (such as stillness, walking, specific posture or area stay).
[0025] I. Overall Flow of Target Detection and Pose Recognition Algorithms The processing flow of the behavior recognition algorithm is as follows: (1) Image acquisition and preprocessing The behavior recognition module captures motion video images of experimental mice in the experimental chamber at 30 frames per second using a camera. After grayscale conversion, histogram equalization, and Gaussian filtering for noise reduction, a stable input frame sequence I is obtained. t ': I t ' = G σ HistEq(Gray(I t )); Among them, I t For the original image frame, G σ The Gaussian kernel function is used; HistEq is histogram equalization, which performs cumulative histogram mapping on the grayscale image to enhance contrast; Gray is grayscale conversion. If I... t For color images, convert them to grayscale using the BT.601 luminance model.
[0026] (2) Target detection stage Mouse target detection is achieved using a lightweight convolutional neural network (CNN). This invention employs an improved YOLOv5s or MobileNet-SSD network architecture to achieve efficient real-time detection of laboratory mice on embedded platforms.
[0027] For YOLOv5s, the specific improvements are as follows: • Object detection network output: The YOLOv5s network outputs the position of the mouse bounding box (x, y, w, h), where x and y represent the center coordinates of the bounding box, and w and h represent the width and height of the bounding box.
[0028] The loss function L comprises the following components: location loss L box The calculation of the difference between the predicted bounding box and the ground truth bounding box typically uses the CIoU (Complete Intersection over Union) loss function to measure the overlap between the predicted and ground truth boxes, further improving localization accuracy; confidence loss L obj : Represents the detector's confidence in a particular target, i.e., whether the predicted bounding box contains the target. This loss function is calculated using the binary cross-entropy function; classification loss L cls : Used to calculate the loss for class prediction. The commonly used loss function is Focal Loss, which reduces the influence of the background on the model by weighting easy-to-classify and hard-to-classify samples.
[0029] The general form of the loss function is: L = λ1L box+ λ2L obj + λ3L cls ; λ1, λ2, and λ3 are weights, which are set based on experimental experience.
[0030] • Network structure improvement: Backbone network replacement: YOLOv5s uses CSPDarknet as its backbone network, providing more efficient feature extraction capabilities. Compared to the original Darknet53, CSPDarknet employs more residual blocks and cross-stage partial networks (CSP), effectively reducing computational cost while improving feature representation capabilities.
[0031] Optimized feature fusion: The later convolutional layers of the network employ a more powerful feature fusion module, which enhances the ability to detect small objects by merging feature maps of different scales.
[0032] Anchor-free design: YOLOv5s does not rely on traditional anchor boxes during object detection, but instead uses an adaptive frame for object localization and classification. This design improves the detection accuracy of small objects and reduces false detections caused by inappropriate preset frame sizes.
[0033] • Optimize the loss function: CIoU Loss: By introducing the Complete IoU loss function, the traditional IoU (Intersection over Union) loss function is improved, further enhancing the localization accuracy of the bounding box. CIoU not only considers positional deviations but also incorporates factors such as the aspect ratio difference of the bounding box and the distance between the center points, making the optimization process more consistent with the actual objectives.
[0034] Focal Loss: To avoid the influence of background regions, YOLOv5s uses Focal Loss to optimize classification tasks. This loss function specifically addresses the class imbalance problem, enhancing the model's attention to hard-to-classify samples.
[0035] • Performance improvements: The improved YOLOv5s maintains high accuracy and real-time performance on low-computing-resource platforms by optimizing the network structure and loss function, making it particularly suitable for embedded devices and small object detection.
[0036] In particular, for the detection of small objects such as mice, YOLOv5s significantly improves detection accuracy through multi-scale feature fusion and an optimized loss function.
[0037] For MobileNet-SSD (SSDLite), the specific improvements are as follows: 1. Backbone Network Replacement and Optimization: The original network backbone was replaced with MobileNetV3-Small. Through Depthwise Separable Convolution (DW / PW), the computational load was significantly reduced, decreasing the overall model's computational cost from k... 2 MN is reduced to k 2 M + MN (where M and N are the number of channels; k is the side length of the convolution kernel). This optimization reduces the computational complexity of the model while improving inference speed, making it suitable for deployment on embedded platforms.
[0038] 2. Detection Head and Prior Box Optimization: In SSDLite, a small-scale prior box is used, and its matching range is optimized to IoU=0.45. Combined with a Hard-Negative Mining ratio of 1:3, the accuracy of small object detection is improved. The small-scale prior box setting range is 0.05–0.30, which can better adapt to the irregular posture and size changes of mice in the experimental environment.
[0039] 3. Improvements to the attention mechanism and loss function: • Attention mechanism: SE (Squeeze-and-Excitation) and ECA (Efficient Channel Attention) modules were added to the network to improve the model's ability to respond to important features and help to enhance feature extraction of key parts (such as the limbs and head of mice).
[0040] • Regression loss function: GIoU (Generalized Intersection over Union) and CIoU (Complete Intersection over Union) are used as regression losses to improve the accuracy of bounding box regression and avoid the shortcomings of traditional IoU, which only considers the intersection and fails to make full use of boundary information.
[0041] • Classification loss function: Focal Loss is adopted, which solves the bias of conventional loss functions in class imbalance by assigning higher weights to difficult-to-classify samples.
[0042] By improving the MobileNet-SSD and YOLOv5s network architectures, this invention significantly enhances mouse behavior recognition performance on low-computational-resource platforms. The optimized model not only improves real-time performance but also enhances the accuracy of detecting small objects (such as mouse limbs and head), thus ensuring the efficient and stable operation of the electric shock stimulation system. These improvements make the device more suitable for long-term, large-scale experiments, enhancing the scientific rigor and accuracy of behavior recognition.
[0043] (3) Pose recognition stage Within the detected target area, further pose estimation is performed. A lightweight pose recognition network based on HRNet or OpenPose-Lite is used to output the keypoint coordinate set P of the experimental mice. P = {(x i , y i ) | i = 1,2,…,k}; Among them, (x i , y i ) represents the coordinates of key points on the experimental mouse, and k represents the number of key points detected (e.g., 8-12 points in total, including the head, trunk, and limbs).
[0044] (4) Behavioral feature extraction and determination Temporal analysis is performed on the trajectories of key points in consecutive frames. Velocity vectors and attitude angle changes are calculated to extract the behavioral feature vector F. t : F t = [v t , Δθ t , a t , r t ]; Among them, v t Let Δθ be the displacement velocity. t Let a be the change in attitude angle. t For acceleration, r t These are the body posture proportion parameters.
[0045] The features are input into a lightweight temporal convolutional network (TCN) or a long short-term memory network (LSTM) for behavior classification, and the behavior category label B of the current frame is output. t : B t = f LSTM (F t-n:t ); Among them, f LSTM (·) represents the LSTM network model, F t-n:tThis represents the feature sequence from frame tn to frame t (a total of n+1 time steps).
[0046] This invention improves upon the existing TCN / LSTM framework in terms of lightweight design and online stability, including: (a) Improved TCN (TCN-Lite) 1. Causal Dilated Convolution: This invention employs causal dilated convolution, which, unlike traditional convolution, relies only on current and historical inputs, thus avoiding the leakage of future information. This method is suitable for online sliding window models, and is particularly significant in real-time processing tasks such as behavior recognition.
[0047] Causal convolution ensures the temporal order of information flow, making it suitable for time-series data analysis, such as the extraction and prediction of behavioral features.
[0048] 2. Depthwise Separable Convolution: This invention employs depthwise separable convolution, decomposing the convolution operation into two steps: first performing depthwise convolution, then performing pointwise convolution. This structure significantly reduces computational cost. Compared to standard convolution, depthwise separable convolution reduces FLOPs (floating-point operations) by 30%-50%, substantially reducing computational overhead while maintaining network performance.
[0049] This improvement makes the model more lightweight, making it suitable for deployment on embedded or low-resource devices.
[0050] 3. Channel Attention (ECA): To enhance the model's ability to learn key features, the ECA (Efficient Channel Attention) mechanism is employed to suppress noisy channels and highlight useful feature channels. ECA automatically adjusts the weights of different channels, enabling the network to focus more on features helpful to the task and improving feature representation capabilities.
[0051] This method effectively improves the model's ability in the feature extraction stage, especially in complex behavior recognition tasks, and can better capture the detailed features of mouse behavior.
[0052] 4. Effective Receptive Field Calculation (R): Introducing the formula for calculating the effective receptive field: R=1+ (k-1)2 l-1 Where R represents the length of the historical input that the output can cover at the current time, L is the number of temporal convolutional layers, and k is the size of the convolutional kernel.
[0053] For example, for k=3 and L=4, the formula calculates R to be approximately 31, which means that the effective receptive field can cover approximately 31 frames (a time span of approximately 1 second at 30fps).
[0054] The increased effective receptive field helps the model capture information over a longer time span, making it suitable for long-term dependency modeling of dynamic behaviors.
[0055] 5. Quantization Awareness Training (QAT) and Hardware Adaptation: To further optimize network deployment, Quantization-Aware Training (QAT) is employed, which allows the model to simulate low-precision (e.g., 8-bit) inference during training. This helps the model perform 8-bit inference at the deployment end, thereby reducing memory usage and computational latency.
[0056] The QAT method uses high-precision computation during training and quantized low-precision computation during deployment, ensuring performance stability and improving inference speed.
[0057] Through the improvements described above, TCN-Lite has achieved significant technical benefits in the following aspects: • Improved computational efficiency: By using depthwise separable convolutions and causal dilation convolutions, computational load and memory consumption are effectively reduced. This improved computational efficiency makes the model highly suitable for deployment in resource-constrained embedded devices or real-time systems.
[0058] • Improved accuracy: The introduction of the ECA attention mechanism enhances the network's ability to extract key features and improves the response to important behavioral features, which helps to improve accuracy in complex environments, especially in the recognition of small object behavior, and can reduce noise interference and focus on important parts.
[0059] • Time-dependent modeling capability: By effectively expanding the receptive field (R), TCN-Lite can capture temporal information over longer time spans, demonstrating better modeling capabilities on long-sequence data, and is particularly suitable for analyzing long-term dependence in mouse behavior.
[0060] • Hardware optimization: Quantization-aware training (QAT) enables the model to perform efficient 8-bit inference on hardware devices, significantly reducing computational latency and power consumption, making it suitable for use in edge devices and real-time experimental equipment.
[0061] The improved TCN (TCN-Lite) of this invention provides a computationally efficient and high-performance time series analysis model through a series of technical optimizations. It can run stably on embedded platforms and real-time experimental systems, and improves the accuracy and real-time performance of the model, especially in tasks such as behavior recognition.
[0062] (ii) Improved LSTM (LSTM-Lite) 1. Gating simplification and projection layer: The improved LSTM (LSTM-Lite) employs a gating simplification method and a projection layer design. Gating simplification reduces redundant computations in the original LSTM by simplifying the gating structure to reduce computational complexity while maintaining the model's expressive power. The projection layer reduces the dimensionality of the network's output, which helps reduce the number of model parameters and computational cost, thereby improving inference speed.
[0063] 2. Double-layer 128-element connection with residual jump: This invention uses a two-layer 128-unit LSTM structure and introduces residual skip connections. This design allows gradients to propagate better during training, alleviating the vanishing gradient problem present in traditional LSTM networks.
[0064] Through residual connections, the network can learn more complex nonlinear features while remaining stable during training.
[0065] 3. Time Attention: In the improved LSTM, a time attention mechanism is employed to enhance the model's ability to model temporal data. Specifically, the softmax function is used to weight the output at each time step to obtain a weighted hidden state output.
[0066] The formula is: a k =softmax( q^{\mathrm T} h k ) ; Among them, h k Let q be the hidden state at time step k, and a be the query vector. k These are attention weights. `softmax()` is a function that transforms a set of real numbers into a probability distribution. q^{\mathrm T} It is the transpose of vector q; 4. Online Sliding Window Inference: LSTM-Lite achieves inference latency of less than 200ms through sliding window inference. Sliding window inference ensures that the model can respond promptly to external changes by making predictions within a certain time window, making it suitable for applications with high real-time requirements.
[0067] For example, when N is the size of the sliding window, the model only uses data from the most recent N time steps to make predictions, reducing computational overhead and improving real-time processing capabilities.
[0068] 5. State Triggering and Action Execution: In LSTM-Lite, pattern recognition is used to trigger specific actions. For example, the model triggers a corresponding behavior or action by recognizing a certain state (such as "the mouse has been still for more than 2 seconds" or "the mouse has entered a specific area").
[0069] The `mode` function is used to vote on the prediction results, selecting the category that appears most frequently as the prediction result: ; Where mode(·) (mode / vote) is defined as the category that appears most frequently within the window as the smoothed state, B t The category label for time t.
[0070] When a certain state is detected (such as "stillness for more than 2 seconds" or "entering a specific area"), the system will trigger the corresponding control signal according to the predicted action, and control the execution modules such as the electric shock stimulation module through the main control unit.
[0071] Through the improvements described above, LSTM-Lite has achieved significant technical benefits in the following aspects: • Improved computational efficiency: By using gating simplification and projection layers, the computational cost and memory footprint of LSTM-Lite are significantly reduced, improving the model's inference speed. It is particularly suitable for real-time systems and embedded platforms, meeting the requirements of low latency and high real-time performance.
[0072] • Improved Accuracy and Stability: The use of residual connections improves model stability and avoids the vanishing gradient problem in traditional LSTM. Through deep learning and temporal attention convergence mechanisms, the model's ability to model long-term sequence data is enhanced, enabling it to achieve higher accuracy in mouse behavior recognition tasks.
[0073] • Enhanced real-time response capability: Employing online sliding window inference ensures the model can process input data promptly with a latency of less than 200ms, enabling the system to quickly respond to changes in mouse behavior. This is crucial for real-time experimental control and feedback systems.
[0074] • Flexible state triggering mechanism: Pattern recognition and triggering mechanisms enable the system to flexibly trigger different control operations (such as electric shock stimulation) according to the actual needs of the experiment. This flexible control method makes the experimental process more automated and efficient.
[0075] The improved LSTM (LSTM-Lite) of this invention significantly enhances the computational efficiency and real-time response capability of the model based on the traditional LSTM network through a series of technological innovations, making it particularly suitable for real-time experimental tasks such as mouse behavior recognition. Optimization of the model structure not only improves the model's accuracy but also enhances its ability to run on low-resource devices, greatly improving the automation and intelligence of experiments.
[0076] II. Network Structure and Hardware Implementation Front-end detection network: A lightweight version of YOLOv5s is used. The backbone feature extraction network consists of the CSPDarknet module. The detection head outputs three-scale feature maps (80×80, 40×40, 20×20) to adapt to mouse targets at different distances and poses.
[0077] Pose estimation network: HRNet-W18 architecture is used to maintain high-resolution feature flow in order to accurately acquire key points.
[0078] Timing recognition module: uses a three-layer LSTM structure with 128 hidden units and a time step of 30 frames.
[0079] Hardware platform: The embedded processing unit is an ARM Cortex-A53 quad-core processor or an NVIDIA Jetson Nano. The algorithm runs locally in real time with a latency of less than 200ms, which can meet the closed-loop control requirements.
[0080] III. Algorithm Performance and Optimization To meet the requirements of embedded real-time recognition, the present invention has made the following optimizations to the network: Model quantization (8-bit quantization) and structural pruning are used to reduce computational load. Accelerate the inference process using OpenCV and ONNX Runtime; Dynamic ROI cropping is used to reduce calculations of irrelevant backgrounds; Optical flow was used to optimize the motion vectors between keyframes to improve the robustness of mouse recognition during rapid movements.
[0081] IV. Identification Results and Closed-Loop Control Interface The recognition results are output in the form of status codes (e.g., 0 = not triggered, 1 = stationary, 2 = entered the target area, 3 = specific posture).
[0082] The main control unit triggers different output logics based on the status code to achieve the following functions: Behavior-driven electric shock triggering; Misidentified states are automatically masked. Real-time log recording and synchronized video annotation.
[0083] Through the above algorithm design, this invention achieves high-precision recognition and closed-loop trigger control of mouse behavior on embedded systems, combining real-time performance and stability, and significantly improving the level of experimental automation.
[0084] Furthermore, the main control unit uses an STM32G071 MCU as the core controller to receive parameters (voltage, current, pulse width, running time) set by the user via the touchscreen and trigger signals from the behavior recognition module. The main control unit controls the constant current module output and drives the output module according to preset logic.
[0085] The output module includes eight independent programmable output channels, which connect to an external array of electric shock rods (e.g., 42 rods). During operation, the main control unit polls and selects the eight independent programmable output channels according to a preset timing control strategy. Only one channel is pressurized at a time, while the others remain at low voltage. The output module supports alternating shock modes, synchronous shock modes, and user-defined timing modes for precise stimulation control. LED indicators synchronously display the operating status of each independent programmable output channel for real-time monitoring. These LED indicators are part of the human-machine interface of the "Display and Data Management Module" and are used to synchronously display the operating status of the eight independent programmable output channels. The LED indicators / touchscreen status bar communicate with the main control unit via I²C (or GPIO) and are mounted on the front panel of the device (next to the touchscreen), avoiding direct connection to the high-voltage side to prevent safety risks.
[0086] To facilitate near-end maintenance, an optional embodiment may be provided with a low-voltage status light (for local maintenance only) next to each connector on the output board, which is electrically isolated from the high-voltage circuit for power supply and signal.
[0087] Figure 3This is a schematic diagram of the signal processing and triggering logic of the present invention. The output circuit of the present invention is designed with 8 independent cyclic outputs, each corresponding to multiple electrode rods. At any given time, only one output is allowed to be in a high-voltage constant current state (the other 7 outputs are locked at low potential) to avoid simultaneous stimulation of multiple points and to meet safety interlocking requirements. The electrode rods are fixedly installed on the ground (or pedal array) of the test area, with the spacing between the two rods arranged according to the stride of a mouse, so that the subject may simultaneously contact two electrodes in the same path when walking naturally, thereby forming a closed current path during the activation window of that path; if the subject steps on multiple electrodes at the same time, since only one path is activated, only the paired electrodes of the activated path can form a stimulation circuit, while the other electrodes remain at low potential and are not conductive.
[0088] Eight independent programmable output channels switch to high voltage (time multiplexing) in turn according to a preset timing table. The high voltage pulse width Tp of each channel and the protection interval Tg between adjacent channels can be parameterized; a complete polling cycle is... In the default implementation: Tp = 20 ms, Tg = 5 ms, then Ts = 200 ms. Through this timing control, the experimental mice will inevitably come into contact with both a high-voltage electrode and a low-voltage electrode at some point during the experiment. "Some point" refers to any moment when a certain path is set to high voltage and is within its effective pulse window Tp, not just the instant of switching; as long as the subject simultaneously contacts both electrodes of that path within the effective window, a loop-triggered stimulus is formed. To further ensure sequence and safety, the device of this invention employs a non-adjacent activation strategy (channels at adjacent physical locations are not activated at the same time), and single-path high-voltage interlocking is achieved through firmware mutual exclusion and hardware gate circuits.
[0089] Figure 3 Parts (a), (b), and (c) are the output circuits used for voltage control. Each circuit controls the voltage of one output channel. These circuits have basically the same working principle and configuration, only the output channels are different. Figure 3 Sections (d), (e), and (f) constitute the current feedback circuit. These networks enable current feedback control to maintain a stable current output. The combination of these six sections achieves precise voltage and current control on the output channel, ensuring the stability and accuracy of the system.
[0090] Figure 3 Circuit 1 in (a) has the following inputs: a positive voltage input (+10V) and a negative voltage (GND); an output that controls the first output channel (OUT1); and a structure that uses a transistor (Q2) and an operational amplifier (U4) to regulate the output voltage while controlling the stability of the voltage through resistors (R11, R19) and other components.
[0091] Figure 3Circuit 2 in (b) has the following characteristics: Input: same voltage input as circuit 1 (+10V); Output: controls the second output channel (OUT2); Structure: very similar to the construction of circuit 1, using different transistors (Q7) and resistors (R16, R24) to ensure the stability of the voltage output.
[0092] Figure 3 Circuit 3 in (c) has the same input as circuits 1 and 2; output: controls the third output channel (OUT3); structure: uses a different transistor (Q8) and slightly different resistor configuration (R17, R25), and its function is similar to that of circuits 1 and 2, adjusting the output voltage.
[0093] Figure 3 Circuit 4 in (d) has the following inputs: current feedback signal (DAOUT) from the output voltage control; output: this circuit is used to regulate the current output and provide feedback control through an operational amplifier (U4); structure: the operational amplifier (U4) is connected to the piezoelectric sensor (PZTA42) through resistors (R43, R49) and transistor (Q18) to control the current output and provide feedback.
[0094] Figure 3 Circuit 5 in (e) has the following inputs: the same current feedback signal (DAOUT) is used to control the current output; the output current is regulated by feedback through an operational amplifier (U7) and a transistor (Q21); the structure is similar to circuit 4, but may be used for different output channels or feedback adjustments, with feedback achieved through different resistor configurations (R48, R49).
[0095] Figure 3 Circuit 6 in (f) has the following inputs: similar to circuits 4 and 5, receiving the current feedback signal (DAOUT); and outputs: regulating the current output through feedback control via operational amplifier (U5) and transistor (Q19). The circuit operates on the same principle as the previous two, but uses a different combination of components (resistors R44 and R50, transistor Q19) to ensure current stability and feedback control.
[0096] Furthermore, such as Figure 4As shown, the display and data management module includes a parameter setting interface, a running status display interface, and a historical data viewing interface. It can be operated via a touchscreen and supports USB / WiFi data interaction. The display and data management module is a 10-inch touchscreen that can display the power-on interface, parameter setting interface, running status interface, and historical data interface. Experimenters can set experimental parameters via the touchscreen and view parameters such as voltage, current, pulse width, and running time in real time. The display and data management module has built-in data storage and management functions, supporting the uploading of experimental parameters, electric shock logs, and behavioral videos to a host computer or cloud via USB or WiFi interface, enabling remote management and data traceability.
[0097] Figure 4 The specific meanings of each number in the text are as follows: 1. Back: Interface navigation key, returns to the previous menu / main interface, without affecting the current parameter storage.
[0098] 2. Mouse electric shock: Current function label / page title, indicating that you have entered the "Electric shock stimulation control" interface.
[0099] 3. Year, Month, Day, Minute, Second: System clock display, used to timestamp experimental parameters and events.
[0100] 4. Parameter Area (within the black rectangle): Display and setting area for core operating parameters, including: (1) Voltage (unit V): Setting / measured value of the high voltage generation module; (2) Current (unit mA): Setting / measured value of constant current output; (3) Pulse Width (unit ms): Duration of a single stimulation pulse; (4) Total Timing Length (unit minutes): Preset cumulative running time for this experiment; (5) Runtime (unit minutes): Cumulative running time since "start". (Settings can be modified via touch / input box, and the modified values are written to the main controller and displayed in real time.) 5. Light On: Lighting / Indicator Light On button, used for cabin ambient lighting or status indication testing.
[0101] 6. Lighting duration display: The timer only starts after "starting" and displays the cumulative duration (unit: seconds / minute) of the lighting being on in real time; the timer pauses after the lighting is stopped or turned off (it can be set to reset or continue accumulating, depending on the example).
[0102] 7. Sound: Control button to turn on the buzzer / speaker.
[0103] 8. Sound duration display: The timer only starts after "Start" and displays the cumulative duration of sound being on in real time (unit: seconds / minute); the timer pauses after stopping or muting (the reset / accumulation strategy is the same as above).
[0104] 9. Start: The main control button to begin the test run. After pressing, it will execute according to the settings in the parameter area, and simultaneously start logging and timestamp recording; press again or stop after the total timeout period is reached.
[0105] Furthermore, such as Figure 5 As shown in the image, the upper part of the diagram represents the system settings. This section displays system-related settings, which are typically used to adjust experimental parameters and system behavior.
[0106] Voltage setting: This setting determines the output voltage range of the electric shock device. The experimenter can adjust the voltage value to ensure the stimulation intensity is suitable for the experimental requirements. Current setting: Sets the range of output current for the electric shock device. The experimenter can set the output current to ensure that the stimulation is not too strong or too weak; Period setting: Sets the period time for electric shocks, i.e., the time interval between each shock. Setting the period time helps control the frequency of shocks; Pulse width setting: Sets the range of pulse width for the electric shock signal. The pulse width setting determines the proportion of the electrical stimulation duration; Light duration: Controls the duration of light during the experiment. Light can be used as a visual cue or feedback. Sound Duration: Sets the duration of the sound signal. Similar to lights, sound signals can serve as feedback signals or experimental cues; Disinfection duration: This option is used to set the duration of the disinfection process after the experiment ends.
[0107] The lower part of the electric shock setting area is mainly used to configure the duration and interval of electric shocks in different stages. These settings determine the execution duration and interval of each electric shock stimulus in the experiment. By adjusting these parameters, the experimenter can precisely control the timing of the electric shock stimulus to ensure that the stimulation in each stage meets the needs of the experiment.
[0108] The duration of the electric shock can be set in three stages, each corresponding to a different time period in the experiment. The duration of the electric shock in each stage can be set independently, from 0 seconds to the desired length. For example, electric shock duration 1, electric shock duration 2, and electric shock duration 3 correspond to three different stages in the experiment, and the duration of the electric shock in each stage can be adjusted individually.
[0109] In addition to the duration of the electric shock, there are also settings for the interval between each phase. Interval 1, Interval 2, and Interval 3 control the rest or transition time within different phases, respectively. Adjusting these intervals helps experimenters set the duration of the interval between electric shock stimuli in order to provide appropriate recovery time or control the intensity of the stimulation.
[0110] Furthermore, the duration of each phase can be set individually. The durations of Phase 1, Phase 2, and Phase 3 determine the total duration of each phase of the experiment. These settings help experimenters precisely control the duration of each phase to ensure the experiment is completed on time and to dynamically adjust the arrangement of electrical stimulation according to the experimental progress.
[0111] Overall, these shock settings offer a high degree of flexibility, allowing experimenters to precisely adjust the shock stimulation time, interval, and duration of each phase according to specific experimental needs, thereby optimizing experimental design and ensuring the effectiveness of the experiment and the accuracy of the data.
[0112] Furthermore, such as Figure 6 As shown, the safety protection unit includes: an electrode impedance detection circuit, an overcurrent protection circuit, and an abnormal alarm system; The electrode impedance detection circuit is used to monitor the electrode contact status in real time. When non-contact or abnormal contact is detected, the electric shock output is stopped immediately and an audible and visual alarm is triggered. The overcurrent protection circuit is used to automatically cut off the high voltage output when the current exceeds the set threshold to prevent equipment failure or accidental injury to animals. An abnormal alarm system, installed on the electric shock box, is used to provide audible and visual alarm prompts when no contact or abnormal contact is detected.
[0113] The safety protection unit can also control the ultraviolet disinfection lamp to automatically disinfect the experimental chamber after the experiment, ensuring hygiene and safety.
[0114] Figure 7 The flowchart of the behavior recognition closed-loop control of the present invention includes the following steps: starting the device—the camera acquires images of the mouse—the embedded algorithm analyzes the behavior state—it determines whether the preset behavior conditions have been met—if met, a trigger signal is sent to the main control unit—the main control unit controls the constant current output electric shock—the electric shock is stopped and the data is recorded when the behavior state changes or the termination condition is met.
[0115] Working Principle: During the experiment, the experimenter sets parameters and starts the device via a touchscreen. The camera in the behavior recognition module continuously captures mouse behavior, and the embedded processing unit analyzes the behavioral state in real time. When the mouse enters a set behavioral state (such as prolonged stillness), the behavior recognition module sends a trigger signal to the main control unit. The main control unit then controls the constant current module to output a set current to the corresponding channel's electric shock rod, completing the electric shock stimulation. When the mouse's behavior changes or the experiment reaches the set termination condition, the device automatically stops operating. All operational data and video recordings are synchronously uploaded and stored for analysis and verification.
[0116] In summary, this invention improves the targeting and scientific rigor of stimulation through behavior recognition and closed-loop control; ensures the stability and safety of the experiment through constant current output and safety protection mechanisms; and expands the flexibility and scalability of the experiment through programmable multi-channel output and data management functions, significantly outperforming existing mouse electric shock stimulation devices.
[0117] Example 2 The device of this invention is also applicable to the construction of animal models of depression. It uses a plantar constant current stimulation subroutine, supports parameterized scheduling and randomized insertion, and timestamps and records and traces stimulation events and behavioral indicators.
[0118] Furthermore, when used in depression modeling programs, the display and data management module provides stress schedule scheduling and template library, which can insert the plantar constant current stimulation subroutine into the schedule with parameters of 0.1–0.5 mA, 0.2–0.5 s, 0–2 times per day, for 2–6 consecutive weeks, and manage and record it together with other stress items.
[0119] Furthermore, the display and data management module includes a stress scheduling unit, which provides a template library and random seed settings. It can randomize the execution day, execution time, pulse width and interval into a uniform or exponential distribution and manage them in a unified manner with other stress items (damp bedding, day-night reversal, etc.).
[0120] Furthermore, when the electrode contact resistance R > Rt h or output current I>I t When h is present, the main control unit shuts down the output and triggers an audible and visual alarm within 2 ms of an abnormality; when the behavior recognition module detects an abnormal posture, it pauses the subroutine and automatically reschedules the schedule.
[0121] The application for depression modeling (foot constant current stimulation subroutine) specifically includes: This embodiment does not include additional drawings; the apparatus and processes used are described in [reference needed]. Figures 1-6 .
[0122] This embodiment illustrates the application scenario of the device of the present invention in animal models of depression. As a constant current stimulation subroutine of the plantar surface in a depression modeling scheme, the device relies on existing high-voltage generation modules, constant current control modules, main control units, behavior recognition modules, output modules, display and data management modules, and safety protection units to achieve a long-term, mild, and traceable stimulation process to induce depression-like behaviors and quantify and record them.
[0123] I. Schedule Arrangement and Parameter Setting Establish a continuous 2-6 week schedule using the stress scheduling unit in the display and data management module, and randomly insert "plantar constant flow stimulation" as a mild stress subroutine. Typical parameters are as follows, all of which can be set and saved as templates in the interface: 1. Current: 0.1–0.5 mA (constant current closed loop, default 0.3 mA); 2. Pulse width: 0.2–0.5 s (default 0.3 s); 3. Number of times per day: 0–2 times / day (default 1 time / day); 4. Insertion strategy: Random date and random time (uniform / exponential distribution optional); 5. Parameter perturbation: Apply ±10–20% jitter to the pulse width / interval; 6. Random seed: can be saved in the experimental record to ensure reproducibility.
[0124] It can be managed uniformly within the same schedule as other molding methods (such as wet padding, day and night inversion, etc.), without the need for additional hardware or diagrams.
[0125] II. Closed-loop triggering and safety interlock Foot stimulation is output only when the behavior recognition module determines that the test animal is in a safe posture (e.g., standing on all fours) and the electrode contact impedance meets the threshold: 1. Contact criterion: R≤R th Default R th =200kΩ; 2. Overcurrent criterion: I≤I th Default I th =2.2mA; 3. If R > R th , or I>I th The main controller hard-cuts off the output and triggers an audible and visual alarm within <2 ms; 4. Employ single-channel high-voltage interlock (force low potential on other channels), and if necessary, enable non-adjacent activation strategy to reduce the risk of false triggering.
[0126] The above controls all correspond to Figures 1-6 The existing modules and security logic do not require additional diagrams.
[0127] III. Data Recording Aligned with "Depression" Related Indicators The system records the following for each foot stimulation: channel number, current, pulse width, trigger timestamp, random seed, behavioral label, and alarm event, and aligns it with video frames and output current samples in time (error ≤ ±5 ms). To adapt to depression-related assessments, it provides export fields such as spontaneous activity level, exploration / rest time ratio, and avoidance / obstacle-crossing latency for correlation analysis with external tests such as sucrose preference and tail suspension / forced swimming. This device does not alter the aforementioned behavioral testing process; it only provides timestamp and log interfaces.
[0128] IV. Execution Process The operator activates the plantar stimulation subroutine in the "CUMS Schedule" and sends it to the main controller; the system executes it on random days / times. When "safe posture + good contact" is detected, a constant current pulse of 0.1–0.5 mA and 0.2–0.5 s is output; if the posture or contact is abnormal, the current cycle is skipped and the "skip reason" is recorded. The cycle stops when the daily limit is reached or the allowed time period is exceeded; after the cycle ends, a weekly / summary report is generated, including the execution percentage, omissions, rescheduling, and alarm lists, facilitating ethical auditing and quality traceability.
[0129] V. Technical Effects By relying on constant current closed loop + single-channel interlock + randomized schedule, a long-term mild stress process with consistent parameters, traceable timing, and compliant verification can be achieved under low current and short pulse width conditions, thereby improving the consistency and repeatability of depressive-like behavior modeling, while avoiding the need for new diagrams and hardware modifications.
[0130] Mouse ethics: All parameters are set according to the principle of minimization under the premise of animal ethics approval; if abnormal signs occur, the current subroutine can be skipped / delayed through the scheduling unit and marked in the log.
[0131] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made by those skilled in the art to the technical solutions of the present invention without departing from the spirit of the present invention should fall within the protection scope defined by the present invention.
Claims
1. A constant-current mouse electric shock stimulation device based on behavior recognition closed-loop control, characterized in that, The device includes: a high-voltage generation module, a constant current control module, a main control unit, a behavior recognition module, an output module, a display and data management module, and a safety protection unit. The modules communicate with each other via wires and bus circuits to exchange signals and supply power. High voltage generation module, used to increase voltage through boost chip; The constant current control module is used to regulate the output current and keep it within a preset current range. The behavior recognition module is used to acquire video images of the experimental mice's movements, analyze the behavioral state of the experimental mice through the embedded processing unit, generate trigger signals, and transmit the trigger signals to the main control unit. The main control unit is used to receive parameters set by the experimenter and trigger signals generated by the behavior recognition module, and drives the output module by controlling the output of the constant current control module through preset logic. The output module provides an independent channel for connection to an external stun gun, controlling the execution or termination of electric shock stimulation. The display and data management module is used to display the boot screen, parameter setting screen, running status screen and historical record screen, and upload experimental parameters, electric shock logs and behavioral videos to the host computer or cloud to realize remote management and data traceability. The safety protection unit is used to monitor the electrode contact status in real time and provide alarms and safety protection in case of abnormalities.
2. The apparatus according to claim 1, characterized in that, The high-voltage generation module uses an IC integrated boost circuit, and the main control unit adjusts the output voltage through a digital potentiometer, with a voltage range of 50~200V.
3. The apparatus according to claim 1, characterized in that, The constant current control module consists of a constant current source circuit composed of an operational amplifier and a MOSFET. It achieves a constant current output in the range of 0.01~2mA through the control voltage of the main control unit, and the output current is independent of the load.
4. The apparatus according to claim 1, characterized in that, The method for the behavior recognition module to acquire motion video images of experimental mice, analyze the behavioral state of the experimental mice through an embedded processing unit, generate trigger signals, and transmit the trigger signals to the main control unit includes: The behavior recognition module acquires motion video images of experimental mice through a camera, and obtains a stable input frame sequence after grayscale conversion, histogram equalization and Gaussian filtering for noise reduction; Based on the input frame sequence, the improved YOLOv5s or MobileNet-SSD network structure is used to detect targets in experimental mice and obtain the target region. A lightweight pose recognition network based on HRNet or OpenPose-Lite is used to estimate key points in the target region and obtain the key point coordinate set of the experimental mice. Based on the key point coordinate set of experimental mice, behavioral feature vectors are extracted, and behavioral category labels are obtained by using TCN or LSTM network structures. The behavior category labels within the preset time window are smoothed by voting, trigger signals are generated and sent to the main control unit.
5. The apparatus according to claim 4, characterized in that, Based on the input frame sequence, using an improved YOLOv5s or MobileNet-SSD network structure, target detection is performed on experimental mice to obtain the target region. Methods include: The loss function L includes the location regression loss L. box Confidence loss L obj And classification loss L cls : L = λ1 L box + λ2 L obj + λ3 L cls ; Where λ1, λ2, and λ3 are all weights.
6. The apparatus according to claim 1, characterized in that, The output module includes 8 independent programmable output channels, which are connected to an external stun gun array. The stun gun array contains multiple stun guns. The main control unit polls the 8 independent programmable output channels according to a preset timing control strategy, so that only one independent programmable output channel is selected and outputs high voltage at any given time, while the other independent programmable output channels remain in a low-voltage state. The output module supports alternating shock mode, synchronous shock mode, and user-defined timing mode.
7. The apparatus according to claim 1, characterized in that, The display and data management module supports setting parameters such as voltage, current, pulse width, and runtime via a touchscreen, and enables real-time uploading and remote management of experimental data via USB or WiFi interface.
8. The apparatus according to claim 1, characterized in that, The safety protection unit includes: an electrode impedance detection circuit, an overcurrent protection circuit, and an abnormal alarm system; The electrode impedance detection circuit is used to monitor the electrode contact status in real time. When non-contact or abnormal contact is detected, the electric shock output is stopped immediately and an audible and visual alarm is triggered. The overcurrent protection circuit is used to automatically cut off the high voltage output when the current exceeds a set threshold. An abnormality alarm system is used to provide audible and visual alarm prompts when no contact is detected or abnormal contact is detected.