Stimulation pain threshold measurement method and device based on image feature recognition and medium

By using image feature recognition technology to automatically locate animal paws and control stimulation needles, the problems of low efficiency and insufficient accuracy in traditional methods are solved, achieving high-precision, fully automated pain threshold measurement and improving the reliability and efficiency of experiments.

CN121867703APending Publication Date: 2026-04-17XUANWU HOSPITAL OF CAPITAL UNIV OF MEDICAL SCI
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-09
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing methods for detecting pain threshold through mechanical stimulation rely on manual operation, resulting in low efficiency, insufficient accuracy, poor reproducibility of results, and difficulty in popularizing expensive imported equipment.

Method used

Using an image feature recognition method, RGB images of experimental animals are acquired through a camera, and color space conversion and binarization segmentation are performed to identify and locate the centroid coordinates of the stimulation site. Combined with a drive device, the movement of the stimulation needle is controlled and mechanical stimulation is applied. Images and pressure signals are monitored in real time, and the pain threshold is automatically determined.

Benefits of technology

It achieves high-precision, fully automated pain threshold measurement, improves the consistency and repeatability of experiments, lowers the barrier to entry, replaces expensive equipment, and enhances the accuracy of pain threshold determination.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121867703A_ABST
    Figure CN121867703A_ABST
Patent Text Reader

Abstract

The invention discloses a stimulation pain threshold measurement method and device based on image feature recognition and a medium, and the method comprises the steps: obtaining an RGB image of a to-be-stimulated part of an experimental animal, carrying out the image processing, recognizing the center-of-mass coordinate of the to-be-stimulated part, calculating the needle feeding coordinate of a stimulation needle through combining with a preset cage bottom plate hole site, and carrying out the positioning. Recording the initial area and the center-of-mass coordinate of the to-be-stimulated part when the stimulation is in place, and controlling the stimulation needle to apply mechanical stimulation upwards. In the stimulation process, images are collected in real time, and the area and centroid coordinates of each period are calculated and are dynamically compared with initial values. And according to a comparison result of area shrinkage or coordinate displacement, whether the stimulation needle continues to move or not is automatically determined, so that full automation of pain threshold judgment is realized. Full automation of stimulation positioning, applying, monitoring and judging is achieved, and objectivity, accuracy and experiment efficiency of pain threshold measurement are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer vision technology, and in particular to a method, device and medium for measuring stimulation pain threshold based on image feature recognition. Background Technology

[0002] In the fields of pain biology research and analgesic drug development, the detection of pain thresholds through mechanical stimulation in laboratory animals (such as mice) is a core and fundamental step. The accuracy and reproducibility of the detection results directly affect the reliability of research on pain mechanism analysis and drug efficacy evaluation. The core requirement of this detection is to objectively capture the pain response threshold of laboratory animals through controlled mechanical stimulation, providing quantitative data support for related research.

[0003] Currently, the mainstream detection methods fall into two categories: one is the traditional manual operation method, which relies on operators manually locating the animal's paw, controlling the intensity and frequency of needle stimulation, and simultaneously determining the pain threshold by observing the animal's paw retraction and other reactions. This method is inefficient due to the manual location of the paw and insufficient precision in needle control, which can easily delay the experimental progress; the coarse control of stimulation parameters leads to large differences in results between different operators and different experimental batches, resulting in poor repeatability; it also requires multiple people to cooperate or a single person to operate simultaneously, which can easily lead to overstimulation or misjudgment of the pain threshold, and lacks synchronous recording of the stimulation process and behavioral responses, resulting in insufficient data traceability. The other category is imported specialized equipment, which, although improving accuracy, suffers from high prices and maintenance costs, making it difficult to widely apply in ordinary scientific research laboratories. Summary of the Invention

[0004] To address the technical problems existing in the background art, this application provides a method, device, and medium for measuring stimulation pain threshold based on image feature recognition. The method includes: acquiring an RGB experimental image of the stimulation site of an experimental animal captured by a camera; performing color space conversion and binarization segmentation on the RGB experimental image to identify and locate the centroid coordinates of the stimulation site; calculating the upper needle coordinates of the stimulation needle based on the centroid coordinates and the hole coordinates of a preset cage bottom plate, thereby controlling a first driving device to move the stimulation needle below the stimulation site; the cage bottom plate is a transparent acrylic plate with an array of funnel-shaped through holes, installed between the experimental animal and the stimulation needle; the first driving device is a slide rail motor that controls the movement of the stimulation needle in a horizontal plane; and recording the stimulation site at the moment the stimulation needle is positioned. The initial area and initial centroid coordinates are determined; based on the needle coordinates, the second driving device is controlled to drive the stimulation needle upward to apply mechanical stimulation to the stimulation site; the second driving device is a push rod motor that controls the vertical movement of the stimulation needle; during the upward movement of the stimulation needle to apply stimulation, RGB experimental images of the stimulation site are acquired in real time according to a preset acquisition cycle, and color space conversion and binarization segmentation are performed on the RGB experimental images acquired in each cycle to calculate the area and centroid coordinates of the stimulation site in each acquisition cycle; the area and centroid coordinates of the stimulation site in each acquisition cycle are compared with the initial area and initial centroid coordinates of the stimulation site at the moment the stimulation needle is in place; based on the area comparison result and / or coordinate comparison result, it is decided whether the stimulation needle should continue to move upward to determine the stimulation pain threshold of the experimental animal.

[0005] In one example, the RGB experimental image undergoes color space conversion and binarization segmentation to identify and locate the centroid coordinates of the region to be stimulated. Specifically, this includes: converting the RGB experimental image to the HSV color space to obtain an HSV experimental image; determining the HSV threshold range of the region to be stimulated based on preset color characteristics; performing binarization segmentation on the HSV experimental image based on the HSV threshold range to obtain an initial binary image; performing morphological opening and closing operations sequentially on the initial binary image to remove noise and connect the region to be stimulated; performing connected component analysis on the processed binary image and selecting the connected component with the largest area as the target region to be stimulated; and calculating the centroid coordinates of the target region to be stimulated as the centroid coordinates of the region to be stimulated.

[0006] In one example, the upper needle coordinates of the stimulation needle are calculated based on the centroid coordinates and the hole coordinates of the preset cage bottom plate, so as to control the first driving device to drive the stimulation needle to move below the part to be stimulated. Specifically, this includes: obtaining all preset cage bottom plate hole coordinates within a search area with the RGB image acquisition center as the center and a preset length as the radius; calculating the planar distance between the centroid coordinates of the part to be stimulated and the coordinates of each hole in the search area; determining the minimum distance value from all planar distances; determining whether the minimum distance value is less than or equal to a preset distance threshold; if the minimum distance value is less than or equal to the preset distance threshold, determining the hole coordinates corresponding to the minimum distance value as the upper needle coordinates; if the minimum distance value is greater than the preset distance threshold, calculating the upper needle coordinates by linear interpolation based on the centroid coordinates, the RGB image acquisition center coordinates, and a preset offset coefficient.

[0007] In one example, when the stimulation needle is in place, the initial area and initial centroid coordinates of the stimulation site at the moment of needle placement are recorded. Specifically, this includes: when the first driving device completes positioning based on the needle coordinates, a frame of the field of view confirmation image at the moment of positioning is captured by a camera; color space conversion and binarization segmentation processing are performed on the field of view confirmation image to identify and locate the stimulation site region at the moment of positioning; the total pixel area of ​​the stimulation site region at the moment of positioning is calculated and recorded as the initial area; the geometric center coordinates of the stimulation site region at the moment of positioning are calculated and recorded as the initial centroid coordinates of the stimulation site region at the moment of positioning.

[0008] In one example, the area and centroid coordinates of the stimulation site in each acquisition cycle are compared with the initial area and initial centroid coordinates of the stimulation site at the moment the stimulation needle is in place. Specifically, this includes: for each acquisition cycle, calculating the ratio of the area of ​​the stimulation site in the acquisition cycle to the initial area; determining whether the ratio is less than or equal to a preset area threshold to obtain an area comparison result; for each acquisition cycle, calculating the planar Euclidean distance between the centroid coordinates of the stimulation site in the acquisition cycle and the initial centroid coordinates; determining whether the planar Euclidean distance is greater than or equal to a preset coordinate threshold to obtain a coordinate comparison result.

[0009] In one example, based on area comparison results and / or coordinate comparison results, a decision is made on whether the stimulation needle should continue to move upward to determine the stimulation pain threshold of the experimental animal. Specifically, this includes: in each acquisition cycle, if the area of ​​the stimulation site in the cycle is less than or equal to half of the initial area, it is determined that area contraction has occurred; in each acquisition cycle, if the planar Euclidean distance between the centroid coordinates of the stimulation site in the cycle and the initial centroid coordinates is greater than or equal to a preset distance, it is determined that coordinate displacement has occurred; if at least one of area contraction or coordinate displacement is determined, a stop command is generated to control the second driving device to stop moving upward, thus determining the stimulation pain threshold of the experimental animal; if neither area contraction nor coordinate displacement is determined, a continue command is generated to control the second driving device to continue moving upward.

[0010] In one example, the method further includes: during the upward movement of the stimulation needle to apply stimulation, acquiring stimulation pressure values ​​in each acquisition cycle through a preset pressure acquisition device; comparing the stimulation pressure values ​​in each acquisition cycle to determine the peak stimulation pressure and the acquisition cycle in which the peak stimulation pressure occurs; determining whether the peak stimulation pressure is greater than a preset peak threshold; and adjusting the control commands of the second driving device according to the determination result.

[0011] In one example, based on the judgment result, the control command of the second driving device is adjusted, specifically including: when the stimulation pressure peak is less than a preset peak threshold and the control command is a stop command, the stimulation pressure peak of the peak event signal is used as a false threshold, and the corresponding acquisition period is recorded as the false threshold time node; the stop command is determined to be invalid, and a continue command is generated to control the second driving device to continue driving the stimulation needle upward; when the stimulation pressure peak is greater than the preset peak threshold and the control command is a continue command, the continue command is determined to be valid, and the second driving device is controlled to continue driving the stimulation needle upward; when the stimulation pressure peak is greater than the preset peak threshold and the control command is a stop command, the stop command is determined to be valid; when the stimulation pressure peak is less than the preset peak threshold and the control command is a continue command, the continue command is determined to be valid.

[0012] On the other hand, embodiments of this application provide a stimulus pain threshold measurement device based on image feature recognition, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform any of the above-described stimulus pain threshold measurement methods based on image feature recognition.

[0013] On the other hand, embodiments of this application provide a non-volatile computer storage medium for measuring stimulation pain threshold based on image feature recognition, which stores computer-executable instructions that can execute any of the above-mentioned stimulation pain threshold measurement methods based on image feature recognition.

[0014] The above-described technical solutions adopted in the embodiments of this application can achieve the following beneficial effects: This invention automatically locates animal paws and calculates and moves stimulation needle coordinates using image recognition algorithms, replacing the traditional method that relies on manual observation and operation. This completely eliminates errors caused by subjective judgment, significantly improving experimental consistency and repeatability, achieving fully automated detection, and enhancing efficiency and objectivity. By employing a specific algorithm-based visual positioning technology combined with a transparent base plate design featuring characteristic holes, high-precision, interference-resistant stimulation positioning is achieved. The entire system has high integration and a simple operation process, lowering the barrier to entry and facilitating its widespread adoption in research settings, replacing expensive and single-function imported equipment. By combining real-time image behavior analysis with stimulation pressure signal monitoring, a fusion judgment logic is constructed. This mechanism effectively distinguishes between specific pain avoidance responses and non-specific motion interference, significantly improving the accuracy of pain threshold determination through dual verification. Attached Figure Description

[0015] To more clearly illustrate the technical solution of this application, some embodiments of this application will be described in detail below with reference to the accompanying drawings, in which: Figure 1 A schematic flowchart illustrating a stimulation pain threshold measurement method based on image feature recognition provided in this application embodiment; Figure 2 A schematic diagram of a fully automated mechanical stimulation pain threshold detection device for a stimulation pain threshold measurement method based on image feature recognition provided in this application embodiment; Figure 3 A top view of the cage floor plate for a stimulation pain threshold measurement method based on image feature recognition provided in an embodiment of this application; Figure 4 A side view of the cage bottom plate for a stimulation pain threshold measurement method based on image feature recognition provided in an embodiment of this application; Figure 5 The internal structure of a stimulator host for a stimulation pain threshold measurement method based on image feature recognition provided in this application embodiment; Figure 6 This is a schematic diagram of the structure of a stimulation pain threshold measurement device based on image feature recognition, provided in an embodiment of this application. Detailed Implementation

[0016] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0017] Some embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0018] Figure 1 This is a flowchart illustrating a stimulation pain threshold measurement method based on image feature recognition, provided as an embodiment of this application. This method can be applied to various business domains. Certain input parameters or intermediate results in this process can be manually adjusted to help improve accuracy.

[0019] The analysis method involved in the embodiments of this application can be implemented by a terminal device or a server, and this application does not impose any special limitations on it. For ease of understanding and description, the following embodiments are all described in detail using a server as an example.

[0020] Based on this Figure 1 The process may include the following steps: S101: Acquire RGB experimental images of the stimulation sites of the experimental animals captured by the camera.

[0021] In one specific embodiment of this application, the camera is an industrial digital camera fixedly installed above the experimental platform, with its optical axis perpendicular to the cage bottom plate made of transparent acrylic material, to ensure that a top-down image of the animal's foot without perspective distortion is obtained.

[0022] The specific steps involve the camera continuously capturing RGB color images at a fixed frequency of 30 frames per second and a resolution of 1920×1080. The image data is transmitted in real-time to a control computer with an integrated image processing unit via a high-speed USB 3.0 interface. To eliminate the impact of ambient lighting changes on color recognition, a blank background image is captured during system initialization as a background reference. Each subsequent frame undergoes real-time white balance correction and mild Gaussian filtering noise reduction during transmission, thus providing a stable and high-quality input source for subsequent accurate image segmentation based on color features.

[0023] Cage bottom plate structure as follows Figure 3 and Figure 4 As shown, it has funnel-shaped through holes arranged in a regular pattern. This design not only ensures visual transparency but also effectively prevents animal excrement from falling into the mechanical device below.

[0024] S102: Perform color space conversion and binarization segmentation on the RGB experimental image to identify and locate the centroid coordinates of the stimulation site.

[0025] In one specific embodiment of this application, after acquiring the corrected RGB image, the system executes an automated image processing pipeline to accurately identify and locate the mouse's paw (i.e., the area to be stimulated).

[0026] First, convert the RGB image The conversion from the RGB color space to the HSV color space, which is more robust to changes in lighting, follows a standard formula:

[0027] Since mouse paw pads are typically a distinct pink or light pink, contrasting sharply with the surrounding dark fur and cage environment, the system defines a feature threshold range for the paw pads in the HSV space based on this prior knowledge. Specifically, hue (H) is set to be close to red to light orange (e.g., 0-30), while saturation (S) and lightness (V) are set with corresponding lower and upper limits based on actual calibration, thus forming a three-dimensional threshold range.

[0028] This threshold range is used to evaluate each pixel in the HSV image. Pixels that meet the criteria are marked as foreground (white 1), and others as background (black 0), thus generating the initial binary image.

[0029] However, due to factors such as the reflection of the cage floor texture and the blurring of the animal's fur edges, the initial binary image often contains a large amount of noise and fragmented regions. To enhance the integrity and accuracy of the foot region, the system performs morphological opening and closing operations on the initial binary image sequentially: the opening operation uses a small elliptical structuring element to eliminate small noise points (such as reflective bright spots); the subsequent closing operation uses a slightly larger elliptical structuring element to connect the broken parts in the foot region caused by uneven color or shadows, thus obtaining an optimized binary image with good connectivity. Opening operation to eliminate noise caused by glare from acrylic panels:

[0030] in It is an elliptical matrix with a size of 7×7 pixels.

[0031] Closure operation connects mouse paw fragments to the toe pad region:

[0032] in It is an elliptical matrix with a size of 15×15 pixels.

[0033] The candidate regions for mouse paws obtained after processing.

[0034] Furthermore, connected component analysis is performed on the optimized image to calculate the pixel area of ​​each independent connected region. The system assumes the sole of the foot is the largest and most continuous pink area in the visual field; therefore, the connected region with the largest area is selected as the target stimulation area, i.e.: The paw pad of a mouse is a large, continuous region, much larger than a single noise point. Therefore, connected component analysis was used to determine the paw pad location. right Connected component labeling is performed by identifying whether each pixel in the image has the same value as its eight surrounding pixels, thus obtaining a set of connected components:

[0035] in Let be the set of pixels in the i-th connected component.

[0036] Each connected component The area is:

[0037] The connected component with the largest area from the set of connected components is selected to represent the mouse paw, denoted as . .

[0038] Finally, to accurately locate this region, its geometric centroid coordinates are calculated. This is for regions containing the mouse paw. Binary image:

[0039] Its zeroth moment and first moment are respectively:

[0040]

[0041]

[0042] Therefore, the coordinates of the foot's center of mass are: , , The coordinates of the image center are The relative position of the mouse's foot in the image center is determined by calculating the difference and sign between the coordinates of the mouse's foot centroid and the coordinates of the image center. This coordinate accurately represents the two-dimensional center position of the foot in the current image, providing a crucial spatial reference point for subsequent mechanical positioning.

[0043] S103: Calculate the upper needle coordinates of the stimulation needle based on the centroid coordinates and the hole coordinates of the preset cage bottom plate, so as to control the first driving device to drive the stimulation needle to move below the stimulation site; the cage bottom plate is a transparent acrylic plate with funnel-shaped through holes arranged in an array, which is installed between the experimental animal and the stimulation needle; the first driving device is a slide rail motor that controls the movement of the stimulation needle in the horizontal plane.

[0044] In one specific embodiment of this application, after obtaining the coordinates of the foot's center of gravity, the system enters an automated positioning decision-making stage to determine which hole the stimulation needle should extend from in the cage bottom plate.

[0045] To this end, the system internally stores a digital coordinate map that perfectly corresponds to the bottom plate of the physical cage, containing the precise location information of the center of each funnel-shaped hole. The positioning algorithm first uses the center point of the current image... Based on this, a circular area with a preset radius is defined as the search range. Next, the algorithm calculates and compares the straight-line distance between the center of the foot's mass and the center of each hole within this search area, thus finding the hole with the closest distance. The algorithm formula is:

[0046] The algorithm then compares this shortest distance with a preset positioning tolerance threshold (e.g., 0.5 mm). If the shortest distance is less than or equal to the threshold, the system determines that the center of the foot is basically aligned with the hole, and directly sets the center coordinates of the hole as the final target needle coordinates.

[0047] If the shortest distance is greater than the tolerance threshold, it indicates that the sole of the foot may be located in the area between the two holes. In this case, the system uses an interpolation algorithm to calculate a new coordinate point as the target needle coordinate at a suitable position on the line connecting the centroid coordinates of the sole of the foot, the coordinates of the image center, and a preset offset ratio coefficient. This point is close to the center of the sole of the foot and ensures that the stimulation needle can pass smoothly through the hole in the base plate.

[0048] The formula for the coordinates of the upper needle is:

[0049]

[0050] After the coordinates are calculated, the system converts them into drive commands, controlling the first drive device, composed of precision slide rails and motors, to move horizontally. This causes the stimulation needle to be precisely positioned directly below the target coordinates under real-time visual feedback from the camera. The entire positioning process is fully automated and controlled in a closed loop, completely replacing traditional manual alignment operations and laying a precise spatial foundation for subsequent standardized stimulation.

[0051] S104: When the stimulation needle is in place, record the initial area and initial centroid coordinates of the site to be stimulated at the moment of needle placement.

[0052] In one specific embodiment of this application, after the first driving device completes horizontal positioning and the stimulation needle reaches the predetermined position, the system performs a key initialization operation to establish an accurate reference benchmark for subsequent dynamic monitoring.

[0053] The system first controls the camera to acquire a new positioning confirmation image, and then performs the same image recognition and processing procedure as in step S102 on this image to ensure that the target foot region can be identified and its morphological parameters extracted based on the latest state before the stimulus begins. The total pixel area of ​​the foot region identified at this moment is recorded as the initial area. The calculated coordinates of the center point of the foot region are recorded as the initial centroid coordinates. .

[0054] These two values, along with the current timestamp, are stored as an immutable initial state dataset. All subsequent judgments regarding whether the foot contracts or moves will be strictly compared to this initial state, thus completely eliminating measurement errors caused by differences in the animal's initial posture and ensuring the objectivity and consistency of the pain threshold determination benchmark.

[0055] S105: Based on the upper needle coordinates, control the second driving device to drive the stimulation needle to move upward to apply mechanical stimulation to the stimulation site; the second driving device is a push rod motor that controls the movement of the stimulation needle in the vertical direction.

[0056] In one specific embodiment of this application, after successfully establishing an initial state baseline, the system automatically initiates the mechanical stimulation program. Control commands are sent to a second drive device responsible for vertical movement, typically a high-precision, programmable pushrod motor. This motor smoothly drives the stimulation needle upward along the vertical axis according to preset constant speed parameters (e.g., 0.1 mm / s). The tip of the stimulation needle extends uniformly from a pre-determined target hole in the cage floor, begins to contact and continuously presses on the paw pad area to be stimulated on the animal's foot, thereby applying a standardized mechanical stimulation with intensity increasing linearly over time.

[0057] Simultaneously, the system's multimodal data acquisition function is activated: the camera continues to acquire images at fixed intervals, while the high-sensitivity pressure sensor integrated into the stimulation mechanism begins to operate continuously at a higher frequency, measuring and recording the pressure values ​​transmitted by the needle tip in real time. The image data stream and the pressure data stream are synchronized and aligned using a unified timestamp, ensuring that behavioral responses and mechanical signals can accurately correspond in subsequent analysis, providing a complete and synchronized data foundation for fusion determination.

[0058] S106: During the upward movement of the stimulation needle to apply stimulation, RGB experimental images of the stimulation site are acquired in real time according to the preset acquisition cycle, and color space conversion and binarization segmentation are performed on the RGB experimental images acquired in each cycle to calculate the area and centroid coordinates of the stimulation site in each acquisition cycle.

[0059] In one specific embodiment of this application, the system enters a high-frequency real-time monitoring and analysis cycle from the moment stimulation begins. Throughout the entire ascent of the stimulation needle, the camera continuously captures RGB images of the animal's foot at fixed time intervals (e.g., 10 times per second). Each newly acquired image is immediately sent to the image processing pipeline, a process completely consistent with the initial recognition process described in S102, including conversion to the HSV color space, binarization segmentation based on a preset color threshold, performing morphological opening and closing operations to optimize the region shape, performing connected component analysis, and finally calculating the pixel area and geometric center coordinates of the selected region.

[0060] Through this continuous processing, the system transforms the morphological changes of the foot during stimulation into a series of continuous, time-evolving data points. Each acquisition cycle corresponds to a real-time "area" value and a "centroid coordinate" value. This real-time data stream objectively and quantitatively characterizes the dynamic response of an animal's foot to external pressure, transforming the previously subjective human judgment of "whether to retract the foot" behavior into an objective indicator that can be precisely tracked and quantified by a computer.

[0061] S107: Compare the area and centroid coordinates of the stimulation site in each acquisition cycle with the initial area and initial centroid coordinates of the stimulation site at the moment the stimulation needle is in place.

[0062] In one specific embodiment of this application, this step is the core calculation step for automated pain threshold determination. The system compares each "real-time area" and "real-time centroid coordinate" calculated in step S106 with the initial area saved in step S104. and initial centroid coordinates A one-to-one, dynamic comparison is performed. The comparison process uses a preset quantification threshold standard: for area, the system calculates the reduction ratio of the real-time area relative to the initial area and determines whether this ratio reaches or exceeds a preset shrinkage threshold (e.g., the area is reduced by more than half). ≤0.5

[0063] For coordinates, the system calculates the planar movement distance of the real-time centroid relative to the initial centroid and determines whether this distance reaches or exceeds a preset displacement threshold (e.g., movement exceeding 0.5 mm). ≥0.5 Each comparison produces a clear binary result: whether the foot has experienced "significant area shrinkage" or "significant positional movement" during the current data collection period. These two criteria are logically related as "or," meaning that if either condition is met, the system considers a positive behavioral response signal based on visual images detected at that moment. This continuously running comparison process constitutes an automated, digital perception of animal pain avoidance behavior.

[0064] S108: Based on the area comparison results and / or coordinate comparison results, determine whether the stimulation needle should continue to move upward in order to determine the stimulation pain threshold of the experimental animal.

[0065] In one specific embodiment of this application, based on the comparison results generated in real time in step S107, the system executes the final control decision to complete the automatic determination of the pain threshold: at each decision point during the ascent of the stimulation needle (usually at the end of each image acquisition cycle), the system checks the latest comparison results. If the results indicate that the animal's paw has experienced "area contraction" or "positional movement," the system will immediately generate a "stop" command. This command is sent to the controller controlling the second drive device, causing it to instantly stop advancing the stimulation needle, and can also perform a withdrawal action as needed. At this moment, the stimulation intensity applied by the stimulation needle (which can be converted through the upward displacement or directly read the synchronous pressure peak) is automatically determined by the system and recorded as the "mechanical stimulation pain threshold" for this experiment. All relevant data, including time, image frames, pressure curve inflection points, etc., are completely saved. Conversely, if no significant morphological changes are detected in the current monitoring cycle, the system generates a "continue" command, the drive device maintains its original movement, and the stimulation intensity continues to increase linearly until a positive reaction is detected or the programmed safe upper limit intensity is reached. Through this closed-loop control process, the present invention achieves full automation from stimulus localization, intensity loading, behavior monitoring to threshold determination, completely eliminating the dependence on the subjective experience and immediate reaction of operators, thereby significantly improving the objectivity, accuracy, repeatability and overall experimental efficiency of pain threshold measurement.

[0066] It should be noted that during the upward movement of the stimulation needle to apply stimulation, the stimulation pressure value within each acquisition cycle is acquired through a preset pressure acquisition device; the stimulation pressure value within each acquisition cycle is compared to determine the peak stimulation pressure and the acquisition cycle in which the peak stimulation pressure occurs; it is determined whether the peak stimulation pressure is greater than a preset peak threshold; when the peak stimulation pressure is less than the preset peak threshold and the control command is a stop command, the peak stimulation pressure of the peak event signal is used as a false threshold, and the corresponding acquisition cycle is recorded as the false threshold time node; the stop command is determined to be invalid, and a continue command is generated to control the second driving device to continue driving the stimulation needle upward; when the peak stimulation pressure is greater than the preset peak threshold and the control command is a continue command, the continue command is determined to be valid, and the second driving device is controlled to continue driving the stimulation needle upward; when the peak stimulation pressure is greater than the preset peak threshold and the control command is a stop command, the stop command is determined to be valid; when the peak stimulation pressure is less than the preset peak threshold and the control command is a continue command, the continue command is determined to be valid.

[0067] It should be noted that, although the embodiments in this application are based on... Figure 1 Steps S101 to S108 will be described sequentially, but this does not mean that steps S101 and S108 must be performed in a strict order. The reason this embodiment follows this order is... Figure 1 The order in which steps S101 to S108 are described is provided to facilitate understanding of the technical solutions of the embodiments of this application by those skilled in the art. In other words, in the embodiments of this application, the order of steps S101 to S108 can be appropriately adjusted according to actual needs.

[0068] pass Figure 1 This invention utilizes image recognition algorithms to automatically locate animal paws, calculate and move stimulation needle coordinates, replacing the traditional method that relies on manual observation and operation. This completely eliminates errors caused by subjective judgment, significantly improving experimental consistency and repeatability, achieving fully automated detection, and enhancing efficiency and objectivity. By employing a specific algorithm-based visual positioning technology combined with a transparent base plate design featuring characteristic holes, high-precision, interference-resistant stimulation positioning is achieved. The entire system has high integration and a simple operation process, lowering the barrier to entry and facilitating its widespread adoption in research settings, replacing expensive and single-function imported equipment. By combining real-time image behavior analysis with stimulation pressure signal monitoring, a fusion judgment logic is constructed. This mechanism effectively distinguishes between specific pain avoidance responses and non-specific motion interference, significantly improving the accuracy of pain threshold determination through dual verification.

[0069] Figure 2This is a schematic diagram of a fully automated mechanical stimulation pain threshold detection device for a stimulation pain threshold measurement method based on image feature recognition, provided in an embodiment of this application.

[0070] exist Figure 2 The device consists of four parts: the top animal cage for securing the experimental animals; below that is the cage base, made of acrylic material with funnel-shaped holes; below the cage base is the stimulation host, which includes stimulation needles, a drive unit, a camera, a central processor, and control circuitry; and there is also a touch screen control panel for easy human operation.

[0071] Figure 3 This is a top view of the cage bottom plate of a stimulation pain threshold measurement method based on image feature recognition provided in an embodiment of this application.

[0072] exist Figure 3 The image shown is a top view of the cage's bottom plate, which has funnel-shaped holes.

[0073] Figure 4 This is a side view of the cage bottom plate, which is a method for measuring the pain threshold based on image feature recognition provided in an embodiment of this application.

[0074] exist Figure 4 The image shows a side view of the cage floor, with the hole smaller on the side closer to the animal and larger on the side closer to the stimulation needle.

[0075] Figure 5 The internal structure of the stimulator host of a stimulation pain threshold measurement method based on image feature recognition provided in this application embodiment.

[0076] exist Figure 5 The image shows the internal structure of the stimulation unit, including two motor rails, a camera, stimulation needles, an upward-pushing motor, and the most important central processor and control circuitry.

[0077] Figure 6 A schematic diagram of a stimulation pain threshold measurement device based on image feature recognition provided in this application embodiment includes: At least one processor; and, A memory that is communicatively connected to at least one processor; wherein, The memory stores instructions that can be executed by at least one processor, which enable the at least one processor to perform any of the above-mentioned methods for measuring the pain threshold based on image feature recognition.

[0078] Some embodiments of this application provide a non-volatile computer storage medium for measuring stimulation pain threshold based on image feature recognition, which stores computer-executable instructions capable of executing any of the above-mentioned stimulation pain threshold measurement methods based on image feature recognition.

[0079] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and medium embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the description of the method embodiments.

[0080] The devices and media provided in this application are one-to-one with the methods. Therefore, the devices and media also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.

[0081] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0082] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0083] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0084] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0085] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0086] Memory may include non-persistent storage in computer-readable media, random access memory (RAM), and non-volatile memory such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0087] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0088] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0089] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the technical principles of this application should fall within the protection scope of this application.

Claims

1. A method for measuring a pain threshold of a stimulus based on image feature recognition, characterized by, The method includes: Acquire RGB experimental images of the stimulation sites of experimental animals captured by a camera; The RGB experimental image is subjected to color space conversion and binarization segmentation to identify and locate the centroid coordinates of the stimulation site. Based on the centroid coordinates and the hole coordinates of the preset cage bottom plate, the upper needle coordinates of the stimulation needle are calculated to control the first driving device to drive the stimulation needle to move below the stimulation site; the cage bottom plate is a transparent acrylic plate with funnel-shaped through holes arranged in an array, which is installed between the experimental animal and the stimulation needle; the first driving device is a slide rail motor that controls the movement of the stimulation needle in the horizontal plane. When the stimulation needle is in place, record the initial area and initial centroid coordinates of the site to be stimulated at the moment of needle placement. Based on the upper needle coordinates, the second driving device is controlled to drive the stimulation needle to move upward to apply mechanical stimulation to the stimulation site; the second driving device is a push rod motor that controls the vertical movement of the stimulation needle. During the upward movement of the stimulation needle to apply stimulation, RGB experimental images of the stimulation site are acquired in real time according to the preset acquisition cycle. Color space conversion and binarization segmentation are performed on the RGB experimental images acquired in each cycle to calculate the area and centroid coordinates of the stimulation site in each acquisition cycle. The area and centroid coordinates of the stimulation site in each acquisition cycle are compared with the initial area and initial centroid coordinates of the stimulation site at the moment the stimulation needle is in place. Based on the area comparison results and / or coordinate comparison results, a decision is made on whether the stimulation needle should continue to move upwards in order to determine the stimulation pain threshold of the experimental animal.

2. The method of claim 1, wherein, The step of performing color space conversion and binarization segmentation on the RGB experimental image to identify and locate the centroid coordinates of the region to be stimulated specifically includes: The RGB experimental image was converted to the HSV color space to obtain the HSV experimental image; Based on the preset color characteristics of the area to be stimulated, determine the HSV threshold range of the area to be stimulated. Based on the HSV threshold range, the HSV experimental image is binarized and segmented to obtain an initial binary image; The initial binary image is subjected to morphological opening and closing operations in sequence to remove noise and connect the regions to be stimulated. Connectivity analysis is performed on the processed binary image, and the connected component with the largest area is selected as the target stimulation region. The centroid coordinates of the target stimulation region are calculated as the centroid coordinates of the stimulation region.

3. The method of claim 1, wherein, The step of calculating the upper needle coordinates of the stimulation needle based on the centroid coordinates and the hole coordinates of the preset cage bottom plate, in order to control the first driving device to drive the stimulation needle to move below the site to be stimulated, specifically includes: Obtain the coordinates of all preset cage bottom plate holes within a search area centered on the RGB image acquisition center and with a preset length as the radius; Calculate the planar distance between the centroid coordinates of the site to be stimulated and the coordinates of each pore within the search area; then determine the minimum distance value from all planar distances. Determine whether the minimum distance value is less than or equal to a preset distance threshold; If the minimum distance value is less than or equal to the preset distance threshold, the hole coordinates corresponding to the minimum distance value are determined as the upper needle coordinates; If the minimum distance value is greater than the preset distance threshold, the upper needle coordinates are calculated by linear interpolation based on the centroid coordinates, the RGB image acquisition center coordinates, and the preset offset coefficient.

4. The method of claim 1, wherein, The step of recording the initial area and initial centroid coordinates of the site to be stimulated at the moment the stimulation needle is in place specifically includes: When the first driving device completes positioning according to the upper needle coordinates, a frame of field of view confirmation image at the moment of positioning is captured by the camera. Color space conversion and binarization segmentation are performed on the visual field confirmation image to identify and locate the region to be stimulated at the moment of completion of localization; Calculate the total pixel area of ​​the region to be stimulated at the moment of positioning completion, and record the total pixel area as the initial area; Calculate the geometric center coordinates of the region to be stimulated at the moment of completion of positioning, and record the geometric center coordinates as the initial centroid coordinates of the region to be stimulated at the moment of completion of positioning.

5. The method according to claim 1, characterized in that, The step of comparing the area and centroid coordinates of the stimulation site in each acquisition cycle with the initial area and initial centroid coordinates of the stimulation site at the moment the stimulation needle is in place specifically includes: For each acquisition cycle, the ratio of the area of ​​the site to be stimulated in the acquisition cycle to the initial area is calculated; Determine whether the ratio is less than or equal to a preset area threshold to obtain the area comparison result; For each acquisition cycle, the planar Euclidean distance between the centroid coordinates of the site to be stimulated in the acquisition cycle and the initial centroid coordinates is calculated; Determine whether the plane Euclidean distance is greater than or equal to a preset coordinate threshold to obtain the coordinate comparison result.

6. The method according to claim 1, characterized in that, The determination of whether the stimulation needle should continue to move upward based on the area comparison results and / or coordinate comparison results, in order to determine the stimulation pain threshold of the experimental animal, specifically includes: In each acquisition cycle, if the area of ​​the stimulation site in the cycle is less than or equal to half of the initial area, it is determined that area shrinkage has occurred. In each acquisition cycle, if the planar Euclidean distance between the centroid coordinates of the stimulated part and the initial centroid coordinates is greater than or equal to a preset distance, it is determined that a coordinate displacement has occurred. If it is determined that at least one of area contraction or coordinate displacement has occurred, a stop command is generated to control the second drive device to stop moving upward and determine the stimulation pain threshold of the experimental animal. If neither area shrinkage nor coordinate displacement is determined, a continue command is generated to control the second drive device to continue moving upward.

7. The method according to claim 1, characterized in that, The method further includes: During the upward movement of the stimulation needle to apply stimulation, the stimulation pressure value within each acquisition cycle is acquired through a preset pressure acquisition device. By comparing the stimulation pressure values ​​within each acquisition cycle, the peak stimulation pressure and the acquisition cycle in which the peak stimulation pressure occurred can be determined. Determine whether the peak value of the stimulation pressure is greater than a preset peak value threshold; Based on the judgment result, the control commands for the second drive device are adjusted.

8. The method according to claim 7, characterized in that, The step of adjusting the control command of the second drive device based on the judgment result specifically includes: When the peak stimulation pressure is less than the preset peak threshold and the control command is a stop command, the peak stimulation pressure of the peak event signal is used as a false threshold, and the corresponding acquisition period is recorded as the false threshold time node. If the stop command is deemed invalid, a continue command is generated to control the second drive device to continue driving the stimulation needle upward. When the peak stimulation pressure is greater than the preset peak threshold and the control command is a continue command, the continue command is determined to be valid, and the second driving device is controlled to continue driving the stimulation needle to move upward. When the peak value of the stimulation pressure is greater than the preset peak value threshold and the control command is a stop command, the stop command is determined to be valid; When the peak stimulation pressure is less than a preset peak threshold and the control command is a continue command, the continue command is deemed valid.

9. A stimulus pain threshold measurement device based on image feature recognition, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform a stimulation pain threshold measurement method based on image feature recognition as described in any one of claims 1-8.

10. A stimulus pain threshold measurement storage medium based on image feature recognition, storing computer-executable instructions, characterized in that, The computer-executable instructions are capable of executing the stimulation pain threshold measurement method based on image feature recognition as described in any one of claims 1-8.