Method and system for monitoring medication compliance of patients in ovulation induction cycle

By utilizing video frame sequences and finite state machines combined with a porous media permeation model during ovulation induction treatment, patient medication adherence can be accurately monitored. This solves the problem of inaccurate instrument displacement tracking in existing technologies, enabling accurate calculation of drug volume and adherence assessment, thus improving the reliability and precision of treatment.

CN122290979APending Publication Date: 2026-06-26GENERAL HOSPITAL OF THE NORTHERN WAR ZONE OF THE CHINESE PEOPLES LIBERATION ARMY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GENERAL HOSPITAL OF THE NORTHERN WAR ZONE OF THE CHINESE PEOPLES LIBERATION ARMY
Filing Date
2026-06-01
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing computer vision-based medical motion monitoring systems cannot accurately track the displacement of instruments at microscopic dimensions under complex visual interference, and cannot accurately determine the physical integrity and temporal continuity of the drug pushing action during ovulation induction treatment, resulting in drug leakage or insufficient dosage, which affects the treatment effect.

Method used

By acquiring video frame sequences of the injection area, the pixel width of the injection pen shell is extracted to calculate the dynamic mapping coefficient. The relative motion vector is calculated by combining the dynamic mapping coefficient. The force action is segmented using filtering and finite state machine. The drug volume is calculated by combining the porous media permeation model. Finally, the compliance quantification index is calculated by weighted fusion to achieve accurate monitoring of patient medication compliance.

Benefits of technology

It significantly improves the accuracy and reliability of ovulation induction drug compliance assessment in complex home environments, eliminates interference from lens distortion and physiological tremors, accurately identifies interruptions, breaks through visual limitations to restore the true net drug retention, achieves cross-validation of microscopic action smoothness and macroscopic dose attainment rate, and plugs loopholes for cheating.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122290979A_ABST
    Figure CN122290979A_ABST
Patent Text Reader

Abstract

This application relates to the field of smart medical technology and discloses a method and system for monitoring medication adherence in patients during ovulation induction cycles. This invention significantly improves the accuracy and reliability of ovulation induction medication adherence assessment in complex home environments by deeply integrating the real physical boundaries of the human body, the mechanical rigidity constraints of instruments, and the fluid dynamics laws of porous media into a visual monitoring framework. Specifically, this application utilizes dynamic pixel physical mapping and biomechanical filtering technology to effectively eliminate the interference of lens distortion and physiological tremors, reconstructing a pure kinematic sequence. By using a finite state machine with dual boundaries of force application and limit, it accurately identifies and coherently processes the mid-process pauses caused by patients' fear of pain, completely solving the defect of traditional algorithms that are prone to logical breaks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of smart healthcare technology, and in particular to a method and system for monitoring medication adherence in patients during ovulation induction cycles. Background Technology

[0002] In ovulation induction treatment cycles in the field of assisted reproductive technology, patients typically need to administer subcutaneous abdominal injections of hormonal drugs at home for ten to fourteen consecutive days. As the treatment cycle progresses, changes in hormone levels lead to a significant increase in ovarian volume, resulting in noticeable abdominal bloating and pain. This persistent physical discomfort, coupled with the long-term psychological stress accumulated by the patient, can easily lead to fear and psychological resistance during injection procedures in the later stages of treatment. Under these conditions, patients often experience involuntary physiological tremors in their hands or pauses in medication administration due to pain reflexes. Accurate clinical medication administration not only requires accurate needle insertion into the subcutaneous tissue, but more importantly, it requires maintaining a uniform injection rate and keeping the needle in the tissue for five to ten seconds after the medication has been fully injected. This series of microscopic timing actions is a prerequisite for ensuring the full absorption of high-concentration hormones by local capillaries.

[0003] Most existing computer vision-based medical motion monitoring systems employ 3D convolutional neural networks for macroscopic spatial feature extraction and motion classification. This technology is only suitable for large-scale limb posture recognition, such as falls or gait analysis. In self-injection scenarios, the effective physical displacement of the needle plunger is only a few centimeters, and the plunger assembly is often severely obscured by the patient's fingers throughout the injection process. Current technology cannot accurately track the microscopic displacement of the instrument under the complex visual interference of strong obstruction and high-frequency physiological hand tremors. Current algorithms lack the ability to quantitatively identify minor abnormalities such as injection pauses and insufficient dwell time, and cannot accurately determine the physical integrity and temporal continuity of the injection action. If the system misjudges a short, non-standard injection as acceptable, medication spillage caused by premature needle removal or incomplete injection cannot be corrected in time. This small loss of effective dosage due to blind spots in technical monitoring, if accumulated over multiple cycles, can directly lead to the patient's blood drug concentration failing to reach the target threshold, ultimately resulting in premature ovulation or overall stunted follicle development, a serious treatment failure. Summary of the Invention

[0004] This application proposes a method and system for monitoring medication adherence in patients during ovulation induction cycles to address the problems raised in the background art.

[0005] To achieve the above objectives, this application adopts the following technical solution: a method for monitoring medication adherence in patients during ovulation induction cycles, comprising the following steps: Step S1: Obtain the video frame sequence of the injection area, extract the pixel width of the injection pen shell to calculate the dynamic mapping coefficient, extract the feature points of the pen body and the push rod, combine the dynamic mapping coefficient to calculate the relative motion vector, project the relative motion vector onto the unit direction vector, filter the projection result, and output a one-dimensional physical velocity sequence. Step S2: Receive a one-dimensional physical velocity sequence, calculate the physical acceleration by differentiating the one-dimensional physical velocity sequence, input the one-dimensional physical velocity sequence and physical acceleration into a finite state machine to perform force action segmentation, and output a physical state sequence including the force pushing state and the needle pulling state. Step S3: Receive the physical state sequence. When the physical state sequence is in the force-pushing state, integrate the one-dimensional physical velocity sequence to calculate the absolute drug volume. Extract the residence time in the physical state sequence before the needle removal state. Calculate the physical leakage volume based on the porous media permeation model combined with the residence time. The difference between the absolute drug volume and the physical leakage volume is obtained as the net drug volume. Step S4: Obtain the one-dimensional physical velocity sequence and the net volume of the drug solution. Perform time warping matching between the one-dimensional physical velocity sequence and the preset drug pushing trajectory to calculate the smoothness penalty value. Calculate the volume loss rate based on the net volume of the drug solution. Weight and fuse the smoothness penalty value and the volume loss rate to output the compliance quantification index.

[0006] Further, in step S1, the specific operation of extracting the pixel width of the injection pen shell to calculate the dynamic mapping coefficient is as follows: obtain the physical width of the injection pen shell; extract the needle insertion point in the video frame sequence, extract the pixel width of the injection pen shell at the needle insertion point, divide the physical width of the injection pen shell by the pixel width of the injection pen shell to obtain the pixel physical ratio, and use the pixel physical ratio as the dynamic mapping coefficient.

[0007] Furthermore, in step S1, the specific operation of filtering the projection result and outputting a one-dimensional physical velocity sequence is as follows: construct a band-stop filter, set the stopband frequency of the band-stop filter to 4 Hz to 12 Hz, input the projection result into the band-stop filter for filtering to obtain a filtered velocity sequence, and use the filtered velocity sequence as a one-dimensional physical velocity sequence.

[0008] Further, in step S2, the specific operation of inputting the one-dimensional physical velocity sequence and physical acceleration into the finite state machine for force action segmentation is as follows: obtain the upper limit and lower limit of the acceleration of the human hand pressing; construct a first boundary indicator function and a second boundary indicator function in the finite state machine; when the value of the physical acceleration is between the lower limit and the upper limit, the first boundary indicator function outputs a value of 1; when the value of the physical acceleration is greater than the upper limit or less than the lower limit, the first boundary indicator function outputs a value of 0, blocking the state transition of the finite state machine; when the current state of the finite state machine is the force pushing state and the value of the one-dimensional physical velocity sequence is greater than or equal to the value of 0, the second boundary indicator function outputs a value of 1; when the current state of the finite state machine is the force pushing state and the value of the one-dimensional physical velocity sequence is less than the value of 0, the second boundary indicator function outputs a value of 0, blocking the state transition of the finite state machine.

[0009] Further, in step S2, the specific operation of outputting the physical state sequence containing the force-pushing state and the needle-pulling state is as follows: under the condition that the first boundary indicator function outputs a value of 1 and the second boundary indicator function outputs a value of 1, the current state of the finite state machine, the one-dimensional physical velocity sequence, and the physical acceleration are input into the state transition kernel function; the continuous peaks and continuous troughs of the one-dimensional physical velocity sequence are extracted through the state transition kernel function; the force action is divided into the piercing contact state, the force-pushing state, the mechanical bottoming state, and the needle-pulling state according to the continuous peaks and continuous troughs; the piercing contact state, the force-pushing state, the mechanical bottoming state, and the needle-pulling state are combined in the order of their occurrence to obtain the combined state result; the combined state result is used as the physical state sequence containing the force-pushing state and the needle-pulling state.

[0010] Furthermore, in step S3, the specific operation of integrating the one-dimensional physical velocity sequence to calculate the absolute drug volume is as follows: obtain the effective cross-sectional area of ​​the injection needle tube cavity; extract the one-dimensional physical velocity sequence in the force-push state from the physical state sequence; perform numerical integration of the one-dimensional physical velocity sequence in the force-push state with the time axis to obtain the total displacement of the push rod; multiply the total displacement of the push rod by the effective cross-sectional area of ​​the injection needle tube cavity to obtain the absolute drug volume.

[0011] Further, in step S3, the specific operation of calculating the physical leakage volume based on the porous media permeation model combined with the residence time is as follows: obtain the maximum overflow rate coefficient caused by the initial surge of internal and external pressure gradients of the needle channel, the basic tissue relaxation time, the fat resistance penalty coefficient, and the individual abdominal fat thickness characterization value; multiply the fat resistance penalty coefficient by the individual abdominal fat thickness characterization value and then add it to the basic tissue relaxation time to obtain the tissue hysteresis coefficient; calculate the negative number of the quotient of the residence time divided by the tissue hysteresis coefficient as the target power; perform exponentiation with the natural logarithm base as the base and the target power as the exponent to obtain the pressure attenuation ratio; multiply the difference between the numerical value and the pressure attenuation ratio by the maximum overflow rate coefficient to obtain the real-time leakage rate; multiply the absolute drug volume by the real-time leakage rate to obtain the physical leakage volume.

[0012] Further, in step S4, the specific operation of time warping matching between the one-dimensional physical velocity sequence and the preset drug delivery trajectory to calculate the smoothness penalty value is as follows: obtaining an ideal average-speed delivery trajectory that can maintain a stable increase in subcutaneous tissue pressure as the preset drug delivery trajectory; obtaining a regularization smoothing factor; calculating the bending path nodes between the one-dimensional physical velocity sequence and the preset drug delivery trajectory using a dynamic time warping algorithm; performing phase alignment on the one-dimensional physical velocity sequence based on the bending path nodes to obtain a warped velocity sequence; calculating the sum of the Euclidean distances between each sampling point in the warped velocity sequence and the corresponding sampling point on the preset drug delivery trajectory to obtain the total deviation value; and dividing the total deviation value by the regularization smoothing factor to obtain the smoothness penalty value.

[0013] Further, in step S4, the specific operation of weighted fusion of the smoothness penalty value and the volume loss rate to output the compliance quantification index is as follows: obtain the target injection volume, kinematic deformation weight constant, and volume loss sensitivity index; calculate the difference between the target injection volume and the net drug volume; divide the difference by the target injection volume to obtain the base loss ratio; perform a power operation on the base loss ratio with the volume loss sensitivity index as the exponent to obtain the volume loss rate; multiply the kinematic deformation weight constant by the smoothness penalty value to obtain the first fusion weight term; multiply the difference between the value one and the kinematic deformation weight constant by the volume loss rate to obtain the second fusion weight term; calculate the sum of the first fusion weight term and the second fusion weight term to obtain the total penalty value; use the difference between the value one and the total penalty value as the preliminary quantification result; perform a maximum value operation on the preliminary quantification result and the value zero, and use the result of the maximum value operation as the compliance quantification index.

[0014] The medication adherence monitoring system for patients in ovulation induction cycles includes: a velocity sequence extraction module, a force action segmentation module, a net drug volume calculation module, and a adherence index calculation module. The velocity sequence extraction module is used to acquire the video frame sequence of the injection area, extract the pixel width of the injection pen shell to calculate the dynamic mapping coefficient, extract the feature points of the pen body and the push rod, calculate the relative motion vector by combining the dynamic mapping coefficient, project the relative motion vector onto the unit direction vector, filter the projection result, and output a one-dimensional physical velocity sequence. The force action segmentation module is used to receive a one-dimensional physical velocity sequence, calculate the physical acceleration by differentiating the one-dimensional physical velocity sequence, input the one-dimensional physical velocity sequence and physical acceleration into a finite state machine to segment the force action, and output a physical state sequence including the force pushing state and the needle pulling state. The net volume calculation module for the liquid medicine is used to receive the physical state sequence. When the physical state sequence is in the state of force pushing, it integrates the one-dimensional physical velocity sequence to calculate the absolute volume of the liquid medicine. It extracts the residence time in the physical state sequence before the needle is withdrawn. Based on the porous media permeation model and the residence time, it calculates the physical leakage volume. The difference between the absolute volume of the liquid medicine and the physical leakage volume is obtained as the net volume of the liquid medicine. The compliance index calculation module is used to obtain the one-dimensional physical velocity sequence and the net volume of the drug solution. It performs time warping matching between the one-dimensional physical velocity sequence and the preset drug delivery trajectory to calculate the smoothness penalty value. Based on the net volume of the drug solution, it calculates the volume loss rate. The smoothness penalty value and the volume loss rate are weighted and fused to output the compliance quantification index.

[0015] The beneficial effects of this invention are as follows: This invention significantly improves the accuracy and reliability of ovulation induction drug compliance assessment in complex home environments by deeply integrating the real physical boundaries of the human body, the mechanical rigidity constraints of instruments, and the fluid dynamics laws of porous media into a visual monitoring framework. Specifically, this application utilizes dynamic pixel physical mapping and biomechanical filtering technology to effectively eliminate interference from lens distortion and physiological tremors, reconstructing a pure kinematic sequence. By using a finite state machine with dual boundaries of force application and limit, it accurately identifies and coherently processes pauses caused by patients' fear of pain, completely solving the defect of logical breakage that is prone to occur in traditional algorithms. More importantly, this solution combines the individual fat impedance characteristics of patients and the pressure attenuation law to calculate the leakage volume, breaking the limitations of visual appearance and restoring the true net subcutaneous drug retention. Finally, through dual-domain weighted fusion of temporal topological regularization and nonlinear amplification of volume loss, it achieves cross-validation of microscopic movement smoothness and macroscopic dose attainment rate, fundamentally blocking the loophole of forging drug delivery records based solely on movement appearance. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort: Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a system framework diagram 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. Example 1

[0018] like Figure 1 As shown, this invention discloses a method for monitoring medication adherence in patients during ovulation induction cycles, comprising the following steps: Step S1: Obtain the video frame sequence of the injection area, extract the pixel width of the injection pen shell to calculate the dynamic mapping coefficient, extract the feature points of the pen body and the push rod, combine the dynamic mapping coefficient to calculate the relative motion vector, project the relative motion vector onto the unit direction vector, filter the projection result, and output a one-dimensional physical velocity sequence. Step S2: Receive a one-dimensional physical velocity sequence, calculate the physical acceleration by differentiating the one-dimensional physical velocity sequence, input the one-dimensional physical velocity sequence and physical acceleration into a finite state machine to perform force action segmentation, and output a physical state sequence including the force pushing state and the needle pulling state. Step S3: Receive the physical state sequence. When the physical state sequence is in the force-pushing state, integrate the one-dimensional physical velocity sequence to calculate the absolute drug volume. Extract the residence time in the physical state sequence before the needle removal state. Calculate the physical leakage volume based on the porous media permeation model combined with the residence time. The difference between the absolute drug volume and the physical leakage volume is obtained as the net drug volume. Step S4: Obtain the one-dimensional physical velocity sequence and the net volume of the drug solution. Perform time warping matching between the one-dimensional physical velocity sequence and the preset drug pushing trajectory to calculate the smoothness penalty value. Calculate the volume loss rate based on the net volume of the drug solution. Weight and fuse the smoothness penalty value and the volume loss rate to output the compliance quantification index.

[0019] As can be seen from the above process, this invention significantly improves the accuracy and reliability of ovulation induction drug compliance assessment in complex home environments by deeply integrating the real physical boundaries of the human body, the mechanical rigidity constraints of instruments, and the fluid dynamics laws of porous media into the visual monitoring framework. Specifically, this application utilizes dynamic pixel physical mapping and biomechanical filtering technology to effectively eliminate the interference of lens distortion and physiological tremors, reconstructing a pure kinematic sequence. By using a finite state machine with dual boundaries of force application and limit, it accurately identifies and coherently processes the patient's pauses due to pain, completely solving the defect of logical breakage that is prone to occur in traditional algorithms. More importantly, this solution combines the individual fat impedance characteristics of the patient and the pressure attenuation law to calculate the leakage volume, breaking the limitations of visual appearance and restoring the real net retention of subcutaneous drug fluid. Finally, through the dual-domain weighted fusion of temporal topological regularization and nonlinear amplification of volume loss, it achieves cross-validation of microscopic movement smoothness and macroscopic dose attainment rate, fundamentally blocking the cheating loophole of forging drug delivery records based solely on movement appearance.

[0020] The following describes in detail each step of the above process and the effects that can be further produced, with reference to the embodiments. First, with reference to the embodiments, the above step S1, namely "acquiring the video frame sequence of the injection area, extracting the pixel width of the injection pen shell to calculate the dynamic mapping coefficient, extracting the feature points of the pen body and the push rod, calculating the relative motion vector in combination with the dynamic mapping coefficient, projecting the relative motion vector onto the unit direction vector, filtering the projection result, and outputting a one-dimensional physical velocity sequence", will be described in detail.

[0021] As an implementable approach, in step S1, the specific operation of extracting the pixel width of the injection pen shell to calculate the dynamic mapping coefficient is as follows: obtain the physical width of the injection pen shell; extract the pixel width of the injection pen shell at the needle insertion point in the video frame sequence, divide the physical width of the injection pen shell by the pixel width of the injection pen shell to obtain the pixel physical ratio, and use the pixel physical ratio as the dynamic mapping coefficient.

[0022] Specifically, when obtaining the physical width of the injection pen casing, the system needs to automatically call the built-in medical device specification database during the initialization or electronic prescription reading stage. Based on the specific model of ovulation-inducing drug currently used by the patient (such as a pre-filled Gonal-F injection pen), the system extracts the inherent rigid casing standard diameter physical parameter (e.g., 15.0 mm) of that model of injection pen. This physical width serves as the only invariant absolute physical reference truth value in subsequent spatial projective geometric calculations and is stored in the system memory.

[0023] Secondly, the needle insertion point is extracted from the video frame sequence. Specifically, an image acquisition device is used to acquire a video stream containing the injection action and extract the needle insertion point from the video frame sequence. Specifically, when a patient is receiving a subcutaneous injection at home, the system activates an image acquisition device positioned in front of the injection site (preferably an RGB camera built into a smartphone, tablet, or other mobile terminal used by the patient, or a wide-angle camera on a home smart interactive screen) to acquire a continuous video stream of the patient pushing the injection pen towards the abdomen at a set frame rate and resolution. After acquiring this continuous video stream, the system calls a pre-trained visual keypoint detection model to analyze the image frame by frame, searching for the spatial intersection coordinates of the needle tip features and the abdominal skin contour features. When the system detects pixel-level overlap between the needle tip feature point and local image features on the skin surface, accompanied by slight tissue deformation, the two-dimensional image coordinates of this intersection are precisely locked as the needle insertion point, which serves as the origin anchor point for subsequent measurements.

[0024] Next, the pixel width of the pen shell at the needle insertion point is extracted. To overcome shadow interference and edge drift caused by side backlighting and warm-colored home lighting common in home environments, the system applies a lighting-invariant edge extraction algorithm based on the Laplacian-Gaussian operator (LoG) within a local image region centered on the needle insertion point. This algorithm filters out soft edges caused by lighting gradient changes, accurately extracting the true rigid physical boundary lines on both sides of the pen shell. Subsequently, the system calculates the pixel span between these two extracted rigid physical boundary lines along the normal direction perpendicular to the pen's central axis, immediately above the needle insertion point (the area where the pen body is not obscured by skin), to obtain the current pixel width of the pen shell in that frame.

[0025] As a further implementable detail, the specific processing logic for "applying a lighting-invariant edge extraction algorithm based on the Laplacian-Gaussian operator (LoG) to extract the true rigid physical boundary lines on both sides of the injection pen shell" is as follows: First, spatial domain Gaussian smoothing filtering is performed to eliminate high-frequency noise. The system extracts a two-dimensional grayscale matrix of the image within a local image region above the defined needle insertion point. Since mobile device cameras in home environments are prone to generating high-frequency image sensor noise, the system first uses a two-dimensional Gaussian convolution kernel to perform spatial domain smoothing filtering on this local grayscale matrix. The significance of this operation is to blur minute skin textures and image noise while preserving the macroscopic structural features of the injection pen casing.

[0026] Secondly, the second spatial derivative of the Gaussian-smoothed image is calculated to achieve illumination decoupling. The system applies the Laplacian operator (i.e., calculates the sum of the second partial derivatives of the image grayscale function in the X and Y axes) to the image matrix after Gaussian smoothing. Here, the core mathematical and physical logic reflecting the illumination invariance is as follows: Under the illumination of complex household light sources (such as side lamps and ceiling lights), the shadows and reflections generated on the surface of the injection pen cylinder and the background abdomen usually appear as slowly changing linear grayscale gradients (i.e., low-frequency illumination components) in the image grayscale space; the first derivative of such slowly changing linear gradients is usually a non-zero constant, while its second derivative always approaches zero. Conversely, the real physical boundary between the rigid shell of the injection pen and the background appears as a step abrupt change in grayscale in the image, and its second derivative will produce a large positive and negative reversal at the boundary. Therefore, by calculating the second spatial derivative, the system utilizes the inherent physical properties of mathematical operators to filter out the slowly changing illumination and shadow interference, retaining only the edge response signal representing high-frequency structural abrupt changes.

[0027] Next, the sub-pixel-level physical boundaries are located based on zero-crossing point search. After obtaining the Laplacian second derivative response matrix, the system does not simply set an absolute grayscale threshold (absolute thresholds are easily affected by the overall ambient brightness and become ineffective). Instead, it scans row by row in the response matrix to find zero-crossing points where the response value changes from positive to negative (or from negative to positive). These sets of pixel coordinates, where the second derivative is zero and the first derivative is extremely large, strictly correspond mathematically and physically to the locations where the image grayscale changes most drastically, i.e., the most realistic physical edge of the pen casing.

[0028] Finally, morphological constraints are used to extract the effective pixel width. The system connects all extracted zero-crossing points into edge connected regions and, combined with the prior geometric knowledge that the injection pen shell is a straight cylinder, removes non-parallel cluttered edge lines, ultimately locking two parallel, absolutely straight lines with the largest distance between them as the left and right rigid physical boundary lines of the injection pen. Subsequently, the system calculates the pixel span between these two physical boundary lines along a direction perpendicular to the injection pen's central axis, thus obtaining an extremely accurate and stable current pixel width of the injection pen shell without ignoring drastic changes in home lighting conditions.

[0029] Furthermore, the physical width of the injection pen casing is divided by the pixel width of the injection pen casing to obtain the pixel physical ratio. After obtaining the above absolute physical reference value and real-time pixel span, the system performs a division operation. For example, if the physical width read by the system is 15.0 mm, and the pixel width extracted in the current video frame is 150 pixels, then the system divides 15.0 by 150, calculating the current pixel physical ratio to be 0.1. This ratio means that, at the current shooting distance and focal length of the video frame, each pixel in the image represents a real physical spatial distance of 0.1 mm.

[0030] Finally, the pixel physical ratio is used as the dynamic mapping coefficient. The system assigns the calculated pixel physical ratio to this variable, the dynamic mapping coefficient. Because the patient's arm holding the device may slightly shift forward or backward during injection (causing the camera to zoom in or out), the pixel width occupied by the injection pen casing in the frame will dynamically scale accordingly. Therefore, the system repeats the extraction and division operations in each frame (or a set time window), refreshing the dynamic mapping coefficient in real time. Through this rigorous operation of updating the scale frame by frame in the video sequence, the system completely eliminates visual artifacts caused by changes in shooting distance, ensuring that the relative motion vector of the push rod calculated in subsequent steps can be absolutely and losslessly restored to the true physical displacement data.

[0031] As an feasible approach, in step S1, the specific operation of filtering the projection result and outputting a one-dimensional physical velocity sequence is as follows: construct a band-stop filter, set the stopband frequency of the band-stop filter to 4 Hz to 12 Hz, input the projection result into the band-stop filter for filtering to obtain a filtered velocity sequence, and use the filtered velocity sequence as a one-dimensional physical velocity sequence.

[0032] First, the system acquires the projection results and constructs a discrete-time sequence window. The system receives the projection results obtained from the preceding operation, which forcibly projects the relative motion vector onto the unit direction vector of the injection pen's central axis. Since this projection result is an instantaneous velocity value at a discrete time point generated in real-time along with the video frame rate (e.g., 30 or 60 frames per second), the system allocates a sliding data buffer in memory (e.g., a sliding time window of 1 second in length), arranges the continuous projection results within this time window in chronological order, and splices them into a raw one-dimensional discrete velocity sequence containing time-dimensional features. This sequence includes both the low-frequency macroscopic downward displacement generated by the patient's active force in pushing the medication and the alternating displacement noise generated by high-frequency hand tremors.

[0033] Secondly, the stopband frequency of the band-stop filter is set to 4 Hz to 12 Hz. Within the system's internal digital signal processing module, band-stop filter parameters based on prior biomechanical knowledge are pre-configured. The core physical and physiological basis for setting the stopband frequency here is as follows: According to clinical human kinematics, when an adult holds an instrument and applies force while suspended in the air, the frequency range of physiological tremors of involuntary muscles and clonic movements caused by fatigue is strictly and stably distributed within the frequency range of 4 Hz to 12 Hz; while the patient's subjectively controlled, uniformly accelerated drug delivery motion typically has a frequency far below 4 Hz (belonging to extremely low-frequency smooth physical movements). Therefore, precisely locking the stopband frequency to 4 Hz to 12 Hz allows for accurate physical definition of the boundaries of the interference signals that need to be stripped away.

[0034] Next, the projection result is input into a band-stop filter for filtering to obtain a filtered velocity sequence. The specific underlying algorithm logic for this step is as follows: the system calls the Fast Fourier Transform (FFT) algorithm to transform the original one-dimensional discrete velocity sequence within the sliding time window from the time domain to the frequency domain, generating a spectrum matrix containing each frequency component and its corresponding energy amplitude. Subsequently, the band-stop filter performs a masking operation on the spectrum matrix, that is, forcibly multiplying all energy spectrum components with frequency values ​​falling within the closed interval of 4Hz to 12Hz by a value of zero (or a very small attenuation coefficient), while keeping the original amplitude unchanged for frequency components below 4Hz or above 12Hz. After completing the precise fixed-point cutoff in the frequency domain, the system immediately calls the Inverse Fast Fourier Transform (IFFT) algorithm to restore the spectrum matrix after stopband suppression back to the time domain, thus obtaining a smooth filtered velocity sequence.

[0035] Finally, the filtered velocity sequence is used as a one-dimensional physical velocity sequence. After the above frequency domain segmentation and time domain restoration, the resulting filtered velocity sequence has completely eliminated the high-frequency back-and-forth jerking caused by hand nerve reflexes, eliminating the calculation risk of incorrectly integrating "hand tremor displacement" as "false drug delivery." The system formally defines and outputs this pure filtered velocity sequence as a one-dimensional physical velocity sequence. This sequence now possesses absolute physical significance: it is a true macroscopic dynamic curve that strictly corresponds to the active force exerted by the patient's large muscle groups and is the only one that propels the syringe along its central axis into the subcutaneous tissue. It will serve as the only legitimate data source and be directly input into the mechanical ratchet force state machine in the subsequent step S2 for action timing segmentation.

[0036] The following describes in detail step S2, namely, "receiving a one-dimensional physical velocity sequence, calculating the physical acceleration by differentiating the one-dimensional physical velocity sequence, inputting the one-dimensional physical velocity sequence and physical acceleration into a finite state machine for force action segmentation, and outputting a physical state sequence including the force-pushing state and the needle-pulling state", with reference to the embodiments.

[0037] As an implementable approach, in step S2, the specific operation of inputting the one-dimensional physical velocity sequence and physical acceleration into the finite state machine for force action segmentation is as follows: obtain the upper limit and lower limit of the acceleration of the human hand pressing; construct a first boundary indicator function and a second boundary indicator function in the finite state machine; when the value of the physical acceleration is between the lower limit and the upper limit, the first boundary indicator function outputs a value of 1; when the value of the physical acceleration is greater than the upper limit or less than the lower limit, the first boundary indicator function outputs a value of 0, blocking the state transition of the finite state machine; when the current state of the finite state machine is the force pushing state and the value of the one-dimensional physical velocity sequence is greater than or equal to the value of 0, the second boundary indicator function outputs a value of 1; when the current state of the finite state machine is the force pushing state and the value of the one-dimensional physical velocity sequence is less than the value of 0, the second boundary indicator function outputs a value of 0, blocking the state transition of the finite state machine.

[0038] Specifically, firstly, the upper and lower limits of human hand compression acceleration are obtained. During the system initialization phase, the processor pre-calls a set of biomechanical boundary parameters based on clinical prior statistics from a local or cloud database. Since ovulation-inducing drugs are primarily administered by adult women themselves, the system sets an ergonomically designed safety envelope for physical acceleration based on the maximum muscle burst force and rigid impact reaction force of an adult woman's thumb when pressing the injection pen plunger in mid-air. (For example, setting the lower limit of acceleration to -200 mm / s² and the upper limit to 200 mm / s². This is based on the fact that the maximum acceleration of an adult woman's thumb during subcutaneous injection is typically no more than 150 mm / s² according to biomechanical experimental data, while the peak rigid deceleration at the moment of mechanical contact is between 180-220 mm / s². Setting this range effectively covers real movements while eliminating instantaneous overload caused by visual noise (which usually far exceeds 500 mm / s²). This boundary is used by the system to distinguish between real human movements and false visual artifacts.)

[0039] Secondly, a first boundary indicator function and a second boundary indicator function are constructed within the finite state machine. In the finite state machine algorithm module deployed within the digital signal processor, these two boundary indicator functions are concatenated in the core decision path of state transitions, using built-in logic gates or Boolean conditional statements. Any driving signal attempting to change the current system state must be forced to pass through the logical checks of these two indicator functions sequentially.

[0040] Next, the first boundary indicator function is executed to filter out non-realistic physical overloads. The system inputs the real-time calculated physical acceleration value into the first boundary indicator function for comparison. When the physical acceleration value is between the lower and upper limits of acceleration, the system determines that the current push rod motion conforms to real Newtonian mechanics and human force application laws, and the first boundary indicator function outputs a value of one (i.e., logical true), allowing the data to pass; conversely, when the physical acceleration value is greater than the upper limit of acceleration or less than the lower limit of acceleration (for example, due to indoor light flicker causing the feature point to generate a transient acceleration equivalent to 1000 mm / s² between two adjacent frames), the system determines that this is a typical non-physical visual artifact overload, and the first boundary indicator function forces the output of a value of zero (logical false), thereby directly blocking any state transition attempt of the finite state machine from the bottom layer, locking the system in the original state, and making it immune to the interference of transient strong noise.

[0041] Subsequently, the second boundary indicator function is executed to conform to the mechanical one-way ratchet dead law. Clinically used pre-filled injection pens are equipped with a mechanical ratchet structure, which physically limits the push rod to be able to be pulled out in the opposite direction once it is pressed down (one-way limit dead zone). When the current state of the finite state machine is a force-pushing state and the value of the one-dimensional physical velocity sequence is greater than or equal to zero (i.e., the push rod is stationary or continues to move downwards), the second boundary indicator function outputs a value of one, determining that it conforms to the common sense of mechanical force. However, when the current state of the finite state machine is a force-pushing state and the value of the one-dimensional physical velocity sequence is less than zero (i.e., the visual image shows the push rod is pulling upwards), the system determines that this absolutely violates the physical and mechanical structure of the injection pen, and must be due to visual distortion caused by the patient's wrist rotation or the tilt of the mobile phone camera. At this time, the second boundary indicator function forcibly outputs a value of zero, ruthlessly blocking the state transition of the finite state machine and discarding the logical derivation of this abnormal frame.

[0042] Furthermore, the system uses the two indicator functions mentioned above. Only when both of these abnormal situations that violate the laws of nature are eliminated (i.e., both functions output a value of one) is the finite state machine allowed to perform the actual medical action segmentation based on the subsequent velocity peak and trough characteristics. This processing logic, which tightly binds the software state machine to objective physical laws, eliminates the ambiguity in software operation.

[0043] As an implementable approach, in step S2, the specific operation of outputting the physical state sequence containing the force-pushing state and the needle-pulling state is as follows: under the condition that the first boundary indicator function outputs a value of 1 and the second boundary indicator function outputs a value of 1, the current state of the finite state machine, the one-dimensional physical velocity sequence, and the physical acceleration are input into the state transition kernel function; the continuous peaks and continuous troughs of the one-dimensional physical velocity sequence are extracted through the state transition kernel function; based on the continuous peaks and continuous troughs, the force action is divided into the piercing contact state, the force-pushing state, the mechanical bottoming state, and the needle-pulling state; the piercing contact state, the force-pushing state, the mechanical bottoming state, and the needle-pulling state are combined in the order of their occurrence to obtain the combined state result; the combined state result is used as the physical state sequence containing the force-pushing state and the needle-pulling state.

[0044] Specifically, firstly, under the condition that both the first boundary indicator function and the second boundary indicator function output a value of 1, the current state of the finite state machine, the one-dimensional physical velocity sequence, and the physical acceleration are input into the state transition kernel function. In the system's underlying digital signal processor, the two previously constructed physical rigid boundaries act as logical gates. This gate is only opened when the real-time calculated physical acceleration does not exceed the human biomechanical force exertion limit (first boundary value 1), and the one-dimensional physical velocity sequence does not violate the unidirectional limit death law of the injection pen's mechanical ratchet (second boundary value 1). At this time, the system packages the physically cleaned legal data (i.e., the one-dimensional physical velocity sequence and the corresponding physical acceleration) together with the current state recorded by the finite state machine as valid feature parameters and safely injects them into the state transition kernel function for temporal evolution calculation.

[0045] Secondly, the continuous peaks and troughs of the one-dimensional physical velocity sequence are extracted using a state transition kernel function. After entering the state transition kernel function, the system performs topological analysis on the waveform of the one-dimensional physical velocity sequence based on the time axis. By finding the zero-crossing points where physical acceleration (i.e., the first derivative of velocity) changes from positive to negative, the system accurately locates the local maxima of the one-dimensional physical velocity sequence and extracts them as continuous peaks; simultaneously, by finding the zero-crossing points where physical acceleration changes from negative to positive, the system locates the local minima of the one-dimensional physical velocity sequence (i.e., the intervals where velocity approaches zero) and extracts them as continuous troughs. These peaks and troughs objectively record all the kinematic micro-fluctuations of the patient's thumb continuously applying pressure, releasing force midway due to pain, and finally impacting the bottom.

[0046] Next, based on the continuous peaks and troughs, the force-bearing action is divided into four states: insertion / contact, force-pushing, mechanical bottoming, and needle withdrawal. The state transition kernel function executes a strict conditional branch mapping: when the system detects a sudden rise in the one-dimensional physical velocity sequence from zero initial value to form the first peak, the state transition kernel function divides the force-bearing action into the insertion / contact state; when the one-dimensional physical velocity sequence remains within the continuous peak range, or fluctuates at high frequency between peaks and shallow troughs (the absolute value of physical acceleration is small, representing hesitation and pauses when the patient pushes the medication), the system determines that the push rod is still moving downwards, dividing the force-bearing action into the force-pushing state; when the system detects a very deep continuous trough (one-dimensional physical velocity sequence), the force-bearing action is divided into the insertion / contact state. The physical acceleration sequence approaches zero, and within the extremely short time window preceding the trough, the physical acceleration exhibits a drastic negative abrupt change (its absolute value approaches the aforementioned lower limit of acceleration). The state transition kernel function determines that this is a rigid physical collision deceleration caused by the push rod hitting the bottom of the injection pen cavity. At this point, the force action is divided into the mechanical bottoming state. Within the time window after the mechanical bottoming state, when the vision system detects that the overall spatial coordinates of the injection pen have undergone a reverse macroscopic displacement detached from the abdominal epidermis, the force action is finally divided into the needle removal state.

[0047] Finally, the insertion contact state, the applied pushing state, the mechanical bottoming state, and the needle withdrawal state are combined in chronological order to obtain a combined state result; this combined state result is used as a physical state sequence including the applied pushing state and the needle withdrawal state. The system allocates a time-series linked list in memory to encapsulate the four states generated by the rigorous physical condition judgment in a sequential manner along the time axis. The system formally outputs this ordered combined state result and defines it as a physical state sequence. This sequence eliminates the fatal flaw in traditional visual monitoring that misjudges a patient's pause as the end of injection, providing an absolutely accurate timestamp anchor for calculating the actual net volume of drug penetration in the tissue in the subsequent step S3.

[0048] The following describes in detail step S3, namely, "receiving the physical state sequence, calculating the absolute drug volume by integrating the one-dimensional physical velocity sequence when the physical state sequence is in the force-pushing state, extracting the residence time in the physical state sequence before the needle is withdrawn, calculating the physical leakage volume based on the porous media permeation model and the residence time, and obtaining the difference between the absolute drug volume and the physical leakage volume as the net drug volume," with reference to the embodiment.

[0049] As an implementable method, in step S3, the specific operation of integrating the one-dimensional physical velocity sequence to calculate the absolute drug volume is as follows: obtain the effective cross-sectional area of ​​the injection needle tube cavity; extract the one-dimensional physical velocity sequence in the force-pushing state from the physical state sequence; perform numerical integration of the one-dimensional physical velocity sequence in the force-pushing state with the time axis to obtain the total displacement of the push rod; multiply the total displacement of the push rod by the effective cross-sectional area of ​​the injection needle tube cavity to obtain the absolute drug volume.

[0050] Specifically, the first step is to obtain the effective cross-sectional area of ​​the injection needle's inner lumen. After the system identifies the injection pen model (e.g., by scanning the drug box's QR code or recognizing the pen's appearance), the background processor retrieves the corresponding physical specifications from a pre-set medical device parameter database. Specifically, the system extracts the inner diameter value directly related to the drug cavity and pre-calculates the effective cross-sectional area of ​​the injection needle's inner lumen using the formula for calculating the area of ​​a circle. This parameter exists as a constant throughout the calculation process and serves as the core physical scale for mapping one-dimensional displacement to three-dimensional volume.

[0051] Secondly, the one-dimensional physical velocity sequence under the applied pushing state is extracted from the physical state sequence. The system calls the physical state sequence output in step S2 and, based on the state timestamp information, precisely locks the start and end times of the applied pushing state on the time axis. Subsequently, the system uses this time interval as a mask to extract from the complete one-dimensional physical velocity sequence output in step S1. This operation ensures that subsequent calculations only target the actual drug pushing action, excluding preparatory actions before needle insertion and idle movements after needle withdrawal, thus guaranteeing the accuracy of volume calculation from the data source.

[0052] Next, the total downward displacement of the push rod is obtained by numerically integrating the one-dimensional physical velocity sequence under the applied pushing state over time. Since the one-dimensional physical velocity sequence is a discontinuous signal acquired based on discrete video frames, the system uses summation or the trapezoidal rule for numerical integration in the processor. Specifically, the system uses the time interval between two adjacent frames as a micro-element, multiplying it by the average physical velocity within that time interval to obtain the micro-displacement within that extremely short period. By accumulating all the micro-displacements within the applied pushing state interval, the absolute physical distance the push rod moves inside the liquid cavity is finally calculated, i.e., the total downward displacement of the push rod. This step, through mathematical integration, solidifies the dynamic velocity characteristics into static length characteristics, eliminating the interference of velocity fluctuations on the total displacement determination.

[0053] Finally, the total displacement of the push rod is multiplied by the effective cross-sectional area of ​​the injection needle's inner cavity to obtain the absolute drug volume. The system multiplies the calculated total displacement of the push rod with the obtained effective cross-sectional area of ​​the injection needle's inner cavity. Based on the cylindrical volume physical model, the product of the push rod's linear distance movement and the cavity's cross-sectional area precisely corresponds to the total volume of drug ejected from the needle tip and injected into the body. This absolute drug volume represents the ideal maximum dosage under conditions of neglecting external resistance and leakage. It serves as a benchmark value, input into the subsequent fluid dynamics leakage correction model, to ultimately determine the net drug volume reflecting the true efficacy.

[0054] As an feasible approach, step S3, which involves calculating the physical leakage volume based on a porous media permeation model combined with residence time, is as follows: The maximum overflow rate coefficient caused by the initial surge in pressure gradients inside and outside the needle tract, the baseline tissue relaxation time, the fat resistance penalty coefficient, and the individual abdominal fat thickness characterization value are obtained; the fat resistance penalty coefficient is multiplied by the individual abdominal fat thickness characterization value and then added to the baseline tissue relaxation time to obtain the tissue hysteresis coefficient; the negative value of the quotient of residence time divided by the tissue hysteresis coefficient is calculated as the target power; a power operation is performed with the base of the natural logarithm and the target power as the exponent to obtain the pressure attenuation ratio; the difference between the numerical value and the pressure attenuation ratio is multiplied by the maximum overflow rate coefficient to obtain the real-time leakage rate; the absolute drug volume is multiplied by the real-time leakage rate to obtain the physical leakage volume.

[0055] First, the physical characteristic parameters and individual heterogeneity parameters required for the model are obtained. The system retrieves key parameters needed to calculate the physical leakage volume from a pre-set parameter library and patient profiles, specifically including: 1. Maximum overflow rate coefficient: The preferred range is 0.10 to 0.25 (i.e., 10% to 25%). This coefficient represents the maximum physical limit of drug backflow due to pressure suppression in dense subcutaneous tissue under conditions of immediate needle withdrawal (zero dwell). The value is based on clinical in vivo imaging observations: when the needle is withdrawn without dwell, approximately 15% of the drug will flow back along the needle path to the skin surface. Setting this upper limit ensures the physical rationality of leakage estimation.

[0056] 2. Baseline tissue relaxation time: The preferred range is 2.0 seconds to 5.0 seconds. This parameter is based on the pressure dissipation theory of porous elastic media. Experiments show that the median time required for the local pressure in the subcutaneous tissue of the human abdomen to drop to 1 / e of the environmental equilibrium state after compression (injection) is approximately 3.5 seconds. This baseline time constant is set to provide a reference scale that conforms to biomechanical characteristics for the leakage model.

[0057] 3. Fat resistance penalty coefficient: The preferred range is 0.05 s / mm to 0.15 s / mm. This coefficient reflects the heterogeneous fit of patients. The basis for this is that the permeability of adipose tissue is much lower than that of muscle or connective tissue. For every 1 mm increase in the fat layer, the additional time required for pressure equilibrium increases linearly due to increased microcirculatory resistance. Using this coefficient, the system can differentiate the leakage risk between patients with higher BMI and those who are thin, demonstrating the medical value of the algorithm.

[0058] 4. Individual abdominal fat thickness characterization value: The range is set to 5mm to 45mm. The necessity of introducing this parameter is that subcutaneous adipose tissue is a typical porous elastic medium, and its permeability is inversely proportional to its thickness. If this characterization value is not considered, for patients with thicker fat, even if the residence time reaches the standard value (such as 5 seconds), the internal pressure may still not be balanced. At this time, there is still a very high risk of leakage when the needle is removed.

[0059] Secondly, the tissue hysteresis coefficient is obtained by multiplying the fat resistance penalty coefficient by the individual's abdominal fat thickness and then adding it to the baseline tissue relaxation time. The system performs a weighted calculation, the physical meaning of which is to personalize tissue permeability. According to the principles of porous media mechanics, the greater the thickness of adipose tissue, the lower its permeability, and the slower the drug diffuses in the interstitial spaces. By adding the impedance increment caused by fat thickness to the baseline relaxation time, the system generates a tissue hysteresis coefficient that reflects the rate of subcutaneous tissue pressure release in a specific patient. The thicker the fat, the larger this coefficient, meaning a longer physical time is required to maintain pressure balance.

[0060] Next, the negative value of the quotient of the residence time divided by the tissue hysteresis coefficient is used as the target power. The system retrieves the actual residence time from mechanical bottoming out to needle withdrawal identified in step S2. In this step, the system calculates the ratio of residence time to tissue hysteresis coefficient and takes its negative value. The physical essence of this operation is to assess the proportion of the current residence time to the total time required to achieve complete tissue equilibrium: the larger the ratio (the smaller the negative value), the higher the degree of pressure equilibrium; conversely, if the residence time is extremely short, the target power approaches zero.

[0061] Subsequently, the pressure attenuation ratio is obtained by exponentiation using the natural logarithm base and the target power as the exponent. Based on the exponential attenuation law, the system substitutes the aforementioned target power into the formula... In an exponential function with base , the calculation logic follows Darcy's law for transient evolution in elastic porous media: as the needle dwell time increases, the local pressure of the drug-eluting balloon decreases exponentially. The closer the calculated pressure decrease ratio is to zero, the more fully the local pressure has been released; if it is close to one, it means that the pressure has hardly been released.

[0062] Then, the difference between the numerical value and the pressure attenuation ratio is multiplied by the maximum overflow rate coefficient to obtain the real-time leakage rate. The system uses complement logic to calculate the residual pressure weight that has not yet been suppressed by the tissue. That is, the proportion of energy in a high-pressure imbalance state is obtained by subtracting the attenuated ratio from the numerical value, and then multiplying it by the maximum overflow rate coefficient. The resulting real-time leakage rate directly maps the physical probability that the medication will be squeezed out at the current needle removal moment due to the pressure gradient still existing inside and outside the needle channel.

[0063] Finally, the absolute drug volume is multiplied by the real-time leakage rate to obtain the physical leakage volume. The system uses the previously calculated absolute drug volume as a base and multiplies it by the real-time leakage rate at that moment. This operation completes the conversion from pressure probability to true volume, accurately calculating the amount of drug loss due to the patient not meeting the recommended residence time, resulting in residual drug in the needle tract or overflow onto the skin surface. This physical leakage volume is then used to perform a difference calculation with the absolute drug volume to determine the final effective net drug volume.

[0064] The following describes in detail step S4, namely, "obtaining a one-dimensional physical velocity sequence and the net volume of the drug solution, performing time warping matching between the one-dimensional physical velocity sequence and the preset drug pushing trajectory to calculate the smoothness penalty value, calculating the volume loss rate based on the net volume of the drug solution, weighting and fusing the smoothness penalty value and the volume loss rate, and outputting the compliance quantification index", with reference to the embodiments.

[0065] As an feasible approach, step S4, which involves time-warping matching between the one-dimensional physical velocity sequence and the preset drug delivery trajectory to calculate the smoothness penalty value, is as follows: An ideal, uniform-speed delivery trajectory capable of maintaining a stable increase in subcutaneous tissue pressure is obtained as the preset drug delivery trajectory; a regularization smoothing factor is obtained; the bending path nodes between the one-dimensional physical velocity sequence and the preset drug delivery trajectory are calculated using a dynamic time warping algorithm; the one-dimensional physical velocity sequence is phase-aligned based on the bending path nodes to obtain a warped velocity sequence; the sum of the Euclidean distances between each sampling point in the warped velocity sequence and the corresponding sampling point on the preset drug delivery trajectory is calculated to obtain the total deviation value; and the total deviation value is divided by the regularization smoothing factor to obtain the smoothness penalty value.

[0066] First, an ideal, uniform-velocity injection trajectory that maintains a steady increase in subcutaneous tissue pressure is obtained as the preset drug delivery trajectory. The system retrieves a standard motion mode matching the current injection dose from a reproductive medicine drug delivery benchmark library. Specifically, this preset drug delivery trajectory is not a simple mathematical average, but a velocity-time series set based on the optimal pharmacokinetic absorption model, typically ranging from 0.5 mm to 2.0 mm per second. The physical basis for setting this trajectory is that uniform velocity injection allows the drug solution to form a uniform pressure gradient in the porous subcutaneous medium, avoiding excessive local shear force or deterioration of the absorption environment due to excessive instantaneous velocity. Simultaneously, the system obtains a regularization smoothing factor, which is calibrated based on the total number of discrete sampling points or energy characteristics of the preset drug delivery trajectory, and is used for subsequent dimensional normalization of injection actions of different durations.

[0067] Secondly, a dynamic time warping algorithm is used to calculate the bending path nodes between the one-dimensional physical velocity sequence and the preset drug delivery trajectory. Because patients may experience non-linear time scaling during actual injection due to pain or tension, such as slow initial acceleration followed by acceleration or mid-injection pauses, direct linear Euclidean distance comparison cannot reflect the true topological similarity of the actions. The system constructs a two-dimensional distance cost matrix, using the one-dimensional physical velocity sequence output from step S1 as the input sequence and the preset drug delivery trajectory as the template sequence. A dynamic programming algorithm is used to search for a path with the minimum cumulative deviation in the matrix; each coordinate pair on this path is a bending path node.

[0068] Next, the one-dimensional physical velocity sequence is phase-aligned based on the bend path nodes to obtain a regularized velocity sequence. The system then uses the previously calculated bend path nodes to perform nonlinear time resampling on the original one-dimensional physical velocity sequence. Specifically, feature points in the original sequence that have shifted on the time axis (such as the starting point of force application and velocity peaks) are forcibly mapped to the corresponding time phase of the preset drug delivery trajectory. The physical essence of this process is to eliminate the non-critical interference factor of injection speed, thereby focusing the comparison on the smoothness of the action. The regularized velocity sequence generated after phase alignment is completely synchronized with the standard model on the time axis.

[0069] Subsequently, the total deviation value is obtained by summing the Euclidean distances between each sampling point in the regular velocity sequence and the corresponding sampling point on the preset drug delivery trajectory. Within a space where the phases are perfectly aligned, the system performs point-by-point difference calculations between the regular velocity sequence and the preset drug delivery trajectory. By summing the squares of the velocity differences at each sampling point and then taking the square root, the total deviation value reflecting the degree of waveform deformation between the two is obtained. This value objectively quantifies the physical degree to which the patient deviates from the ideal uniform velocity trajectory during drug delivery, such as micro-fluctuations caused by hand tremors, explosive pushing, or resistance to release force.

[0070] Finally, the total deviation value is divided by the regularization smoothing factor to obtain the smoothness penalty value. The system performs a normalized division operation to convert the absolute deviation into a relative penalty coefficient. Through the correction of the regularization smoothing factor, it is ensured that even if there are significant differences in the total injection time among different patients, their smoothness penalty values ​​are still comparable. As a key evaluation indicator of the action process domain, this smoothness penalty value can accurately identify those behaviors where the medication was administered in sufficient quantity but the administration process was extremely irregular, effectively identifying the potential for poor local tissue absorption caused by drastic speed fluctuations, and providing rigorous kinematic evidence for the generation of the final compliance quantification index.

[0071] As an implementable approach, step S4, which involves weighted fusion of the smoothness penalty value and the volume loss rate to output the compliance quantification index, specifically involves: obtaining the target injection volume, the kinematic deformation weight constant, and the volume loss sensitivity index; calculating the difference between the target injection volume and the net drug volume; dividing the difference by the target injection volume to obtain the baseline loss ratio; exponentially powering the baseline loss ratio with the volume loss sensitivity index to obtain the volume loss rate; multiplying the kinematic deformation weight constant by the smoothness penalty value to obtain the first fusion weight term; multiplying the difference between the value one and the kinematic deformation weight constant by the volume loss rate to obtain the second fusion weight term; calculating the sum of the first and second fusion weight terms to obtain the total penalty value; subtracting the total penalty value from the value one as the preliminary quantification result; performing a maximum value operation between the preliminary quantification result and the value zero, and using the result of the maximum value operation as the compliance quantification index.

[0072] First, the target injection volume, kinematic deformation weighting constant, and volume loss sensitivity index are obtained. The system extracts the target injection volume to be achieved for this injection from the electronic prescription data. Simultaneously, two key weighting parameters are retrieved from the algorithm configuration file: 1. Kinematic deformation weighting constant: preferably in the range of 0.4 to 0.7, which is used to balance the evaluation weight of the smoothness of the operation process and the final dosage; 2. Volume Loss Sensitivity Index: The preferred range is greater than or equal to 2. This index reflects the zero-tolerance bottom line for nonlinear amplification of effective dose loss in the reproductive medicine clinical pathway. The physical basis for setting this index is that even a small amount of drug loss may have nonlinear negative effects in pharmacokinetics. Power calculation can ensure that when the leakage exceeds the clinical warning threshold, the compliance index will drop sharply.

[0073] Secondly, the difference between the target injection volume and the net drug volume is calculated, and this difference is divided by the target injection volume to obtain the baseline loss ratio. The system quantifies the absolute amount of physical drug loss due to insufficient residence time or premature needle withdrawal through simple subtraction. This absolute amount is then normalized relative to the preset prescription dose. This baseline loss ratio objectively reflects the degree of defect in the physical outcome of this injection, providing a data base for subsequent nonlinear penalties.

[0074] Next, the volumetric loss ratio is calculated by exponentially multiplying the baseline loss ratio by the volumetric loss sensitivity index. This is the core logic for preventing cheating in this step. The system uses a power function to ensure that the volumetric loss ratio is no longer a linear mapping of the baseline loss ratio. When the baseline loss ratio is small, the calculated result increases slowly; however, once the loss ratio increases, the volumetric loss ratio will rise rapidly. This design ensures severe penalties for serious operational errors (such as removing the needle before administering sufficient medication), making the final evaluation results highly valuable for clinical reference.

[0075] Subsequently, the first fusion weight term, the second fusion weight term, and the total penalty value are calculated. The system uses kinematic deformation weight constants to weight and integrate the smoothness of the process domain with the loss rate of the result domain. Multiplying the kinematic deformation weight constant by the smoothness penalty value yields the first fusion weight term, which represents the contribution of motion quality to the final evaluation. The difference between the numerical value and the kinematic deformation weight constant is multiplied by the volume loss rate to obtain the second fusion weight term, which represents the contribution of physical loss to the final evaluation. The total penalty value is obtained by summing the two items. This dual-domain fusion mechanism effectively prevents the possibility of "fake video check-in" based solely on visual actions, because even if the actions appear to be standard (low smoothness penalty value), if physical leakage actually exists (high volumetric loss rate), the total penalty value will still remain high.

[0076] Finally, the preliminary quantitative results are calculated, and the maximum value of the preliminary quantitative results and the value of zero is taken to output the compliance quantitative index. The system subtracts the total penalty value mentioned above from the full score benchmark (value one) to obtain a percentage score that can intuitively reflect the quality of drug administration. To address the risk of mathematical logic collapse caused by extreme violations (such as a total penalty value exceeding one), the system implements boundary protection logic. By taking the maximum value, the output compliance quantitative index is ensured to be strictly locked within the legal range of zero to one. This index, as the ultimate evaluation criterion for the reproductive medicine clinical pathway, accurately defines the effectiveness of the injection procedure and provides an unfalsifiable numerical basis for doctors to adjust the ovulation induction protocol.

[0077] To further illustrate the technical effects achievable by the proposed solution, a specific implementation method is given below, along with experimental and simulation verification results.

[0078] In this embodiment, the method of the present invention is applied to a typical home-based auto-injection ovulation induction treatment scenario, using a mainstream pre-filled hormone injection pen (Gonal-fPen), the physical width of which is... The monitoring system is implemented using a mobile computing platform on a smartphone terminal, with the video capture frame rate set to [value missing]. The resolution is The control logic is based on the integration of a deep learning inference engine and a fluid dynamics compensation model. The implementation steps are as follows: First, the pixel width of the injection pen shell is extracted using a visual recognition algorithm, and then based on... Calculate the pixel physical ratio (approximately) from known physical quantities. () is used as the dynamic mapping coefficient. The Laplace-Gaussian operator is used to extract the push rod feature points in the second derivative space, and a stopband frequency of () is introduced. A band-stop filter is used to filter out physiological tremors and solve a one-dimensional physical velocity sequence.

[0079] Construct a finite state machine based on dual physical boundaries: Set the first boundary (upper acceleration limit) as... To filter visual displacement noise, a second boundary (unidirectional limit) is set to filter reverse pull-back interference. When the state machine evolves to the point of applying force and pushing and completes, the velocity sequence is numerically integrated and combined with the cavity cross-sectional area data (set as follows in this embodiment). ) Calculate the absolute drug volume. Then extract the actual residence time from mechanical bottoming out to needle withdrawal. Retrieve the fat thickness characterization value mapped by the patient's BMI ( ), and compare it with the relaxation time of the basic organization ( ) and fat resistance penalty coefficient ( The tissue hysteresis coefficient was constructed by fusion. Based on Darcy's law, a pressure decay index model was constructed to calculate the real-time leakage rate caused by insufficient residence, and the effective net volume of drug solution was obtained by difference.

[0080] To verify the effectiveness of this method, multi-dimensional tests were conducted in a simulation environment and a clinical control group. The baseline scenario was that a patient experienced pain during medication administration due to fear of pain. A significant pause, and a quick needle removal procedure after medication administration (dwell time) Traditional 3D-CNN-based behavior recognition methods suffer from logical breaks during pauses, resulting in a high false positive rate. Furthermore, it cannot identify the loss of medication sprayed along the needle path, and the average error in dose monitoring is as high as [missing information]. The compliance score (out of 1.0) was misjudged as .

[0081] After adopting this method, the system achieves dual-domain accounting: in the kinematic domain, the topological deviation between the measured velocity trajectory and the ideal stationary trajectory is calculated using the Dynamic Time Warping (DTW) algorithm; in the volumetric domain, the deviation is calculated using nonlinear power operations (sensitivity index). ) Amplified dosage loss. Experimental results show that the error in calculating the net volume of the drug solution is from Down to Error reduction approximately The accuracy of action logic recognition has been improved to [percentage missing]. This method successfully captured the pause during the injection process as a continuation of the injection state. In a scenario involving spoofed drug delivery cheating, this method detects situations where the displacement integral is zero and the trajectory topology is severely mismatched, resulting in an output compliance quantization index as low as [insert value here]. (Accurately determines failure), while traditional methods still maintain a scoring system. The above. Statistical analysis of multiple randomized scenario tests (30 subjects with different BMIs) shows that the average dose monitoring accuracy remained stable at [value missing]. The consistency coefficient of the compliance assessment exceeded the above. This verifies the robustness and superiority of the proposed method in personalized medical monitoring. Example 2

[0082] like Figure 2 As shown, the present invention also discloses a medication compliance monitoring system for patients in ovulation induction cycles, comprising: a velocity sequence extraction module, a force action segmentation module, a net drug volume calculation module, and a compliance index calculation module, wherein; The velocity sequence extraction module is used to acquire the video frame sequence of the injection area, extract the pixel width of the injection pen shell to calculate the dynamic mapping coefficient, extract the feature points of the pen body and the push rod, calculate the relative motion vector by combining the dynamic mapping coefficient, project the relative motion vector onto the unit direction vector, filter the projection result, and output a one-dimensional physical velocity sequence. The force action segmentation module is used to receive a one-dimensional physical velocity sequence, calculate the physical acceleration by differentiating the one-dimensional physical velocity sequence, input the one-dimensional physical velocity sequence and physical acceleration into a finite state machine to segment the force action, and output a physical state sequence including the force pushing state and the needle pulling state. The net volume calculation module for the liquid medicine is used to receive the physical state sequence. When the physical state sequence is in the state of force pushing, it integrates the one-dimensional physical velocity sequence to calculate the absolute volume of the liquid medicine. It extracts the residence time in the physical state sequence before the needle is withdrawn. Based on the porous media permeation model and the residence time, it calculates the physical leakage volume. The difference between the absolute volume of the liquid medicine and the physical leakage volume is obtained as the net volume of the liquid medicine. The compliance index calculation module is used to obtain the one-dimensional physical velocity sequence and the net volume of the drug solution. It performs time warping matching between the one-dimensional physical velocity sequence and the preset drug delivery trajectory to calculate the smoothness penalty value. Based on the net volume of the drug solution, it calculates the volume loss rate. The smoothness penalty value and the volume loss rate are weighted and fused to output the compliance quantification index.

[0083] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for monitoring medication adherence in patients during ovulation induction cycles, characterized in that, Includes the following steps: Step S1: Obtain the video frame sequence of the injection area, extract the pixel width of the injection pen shell to calculate the dynamic mapping coefficient, extract the feature points of the pen body and the push rod, combine the dynamic mapping coefficient to calculate the relative motion vector, project the relative motion vector onto the unit direction vector, filter the projection result, and output a one-dimensional physical velocity sequence. Step S2: Receive a one-dimensional physical velocity sequence, calculate the physical acceleration by differentiating the one-dimensional physical velocity sequence, input the one-dimensional physical velocity sequence and physical acceleration into a finite state machine to perform force action segmentation, and output a physical state sequence including the force pushing state and the needle pulling state. Step S3: Receive the physical state sequence. When the physical state sequence is in the force-pushing state, integrate the one-dimensional physical velocity sequence to calculate the absolute drug volume. Extract the residence time in the physical state sequence before the needle removal state. Calculate the physical leakage volume based on the porous media permeation model combined with the residence time. The difference between the absolute drug volume and the physical leakage volume is obtained as the net drug volume. Step S4: Obtain the one-dimensional physical velocity sequence and the net volume of the drug solution. Perform time warping matching between the one-dimensional physical velocity sequence and the preset drug pushing trajectory to calculate the smoothness penalty value. Calculate the volume loss rate based on the net volume of the drug solution. Weight and fuse the smoothness penalty value and the volume loss rate to output the compliance quantification index.

2. The method for monitoring patient medication adherence during ovulation induction cycles according to claim 1, characterized in that, In step S1, the specific operation of extracting the pixel width of the injection pen shell and calculating the dynamic mapping coefficient is as follows: Get the physical width of the injection pen casing; The pixel width of the pen shell at the needle insertion point is extracted from the video frame sequence. The physical width of the pen shell is divided by the pixel width of the pen shell to obtain the pixel-physical ratio, which is then used as the dynamic mapping coefficient.

3. The method for monitoring patient medication adherence during ovulation induction cycles according to claim 2, characterized in that, In step S1, the specific operation of filtering the projection result and outputting the one-dimensional physical velocity sequence is as follows: Construct a band-stop filter, setting the stopband frequency of the band-stop filter to 4 Hz to 12 Hz, input the projection result into the band-stop filter for filtering to obtain the filtered velocity sequence, and use the filtered velocity sequence as a one-dimensional physical velocity sequence.

4. The method for monitoring patient medication adherence during ovulation induction cycles according to claim 3, characterized in that, In step S2, the specific operation of inputting the one-dimensional physical velocity sequence and physical acceleration into the finite state machine for force action segmentation is as follows: Obtain the upper and lower limits of acceleration due to human hand pressure; Construct the first boundary indicator function and the second boundary indicator function in the finite state machine; When the physical acceleration value is between the lower and upper limits of acceleration, the first boundary indicator function outputs a value of one. When the physical acceleration value is greater than the upper limit of acceleration or less than the lower limit of acceleration, the first boundary indicator function outputs a value of zero, thus blocking the state transition of the finite state machine. When the current state of the finite state machine is the force-pushing state and the value of the one-dimensional physical velocity sequence is greater than or equal to zero, the second boundary indicator function outputs a value of one. When the current state of the finite state machine is the force-pushing state and the value of the one-dimensional physical velocity sequence is less than zero, the second boundary indicator function outputs a value of zero, thus blocking the state transition of the finite state machine.

5. The method for monitoring patient medication adherence during ovulation induction cycles according to claim 4, characterized in that, In step S2, the specific operation of outputting the physical state sequence containing the force-pushing state and the needle-pulling state is as follows: Under the condition that the first boundary indicator function outputs a value of 1 and the second boundary indicator function outputs a value of 1, the current state of the finite state machine, the one-dimensional physical velocity sequence, and the physical acceleration are input into the state transition kernel function; The continuous peaks and troughs of the one-dimensional physical velocity sequence are extracted using the state transition kernel function; Based on the continuous peaks and troughs, the force-bearing action is divided into the piercing contact state, the force-pushing state, the mechanical bottoming state, and the needle withdrawal state. The combined state results are obtained by combining the puncture contact state, the force pushing state, the mechanical bottoming state, and the needle withdrawal state in the order of their occurrence. The combined state results are used as a physical state sequence that includes the force-pushing state and the needle-pulling state.

6. The method for monitoring patient medication adherence during ovulation induction cycles according to claim 5, characterized in that, In step S3, the specific operation of integrating the one-dimensional physical velocity sequence to calculate the absolute volume of the liquid medicine is as follows: Obtain the effective cross-sectional area of ​​the injection needle lumen; Extract the one-dimensional physical velocity sequence from the physical state sequence that is under the applied pushing state; The total displacement of the push rod under pressure is obtained by numerically integrating the one-dimensional physical velocity sequence under the applied pushing state with time axis. The absolute volume of the drug solution is obtained by multiplying the total displacement of the push rod by the effective cross-sectional area of ​​the injection needle.

7. The method for monitoring patient medication adherence during ovulation induction cycles according to claim 6, characterized in that, In step S3, the specific operation of calculating the physical leakage volume based on the porous media permeation model and residence time is as follows: The maximum overflow rate coefficient caused by the initial surge of internal and external pressure gradients of the needle path, the baseline tissue relaxation time, the fat resistance penalty coefficient, and the individual abdominal fat thickness characterization value were obtained. The tissue hysteresis coefficient is obtained by multiplying the fat resistance penalty coefficient by the individual abdominal fat thickness characterization value and then adding it to the baseline tissue relaxation time. The negative of the quotient of the dwell time divided by the organizational lag coefficient is used as the target power; The pressure attenuation ratio is obtained by exponentiation with the natural logarithm base and the target power as the exponent. The real-time leakage rate is obtained by multiplying the difference between the value 1 and the pressure attenuation ratio by the maximum overflow rate coefficient. The physical leakage volume is obtained by multiplying the absolute liquid volume by the real-time leakage rate.

8. The method for monitoring patient medication adherence during ovulation induction cycles according to claim 7, characterized in that, In step S4, the specific operation of time-warping matching between the one-dimensional physical velocity sequence and the preset propellant trajectory to calculate the smoothness penalty value is as follows: Obtain an ideal, uniform-speed propulsion trajectory that can maintain a steady increase in subcutaneous tissue pressure as the preset drug delivery trajectory. Obtain the regularization smoothing factor; The bending path nodes between the one-dimensional physical velocity sequence and the preset drug delivery trajectory are calculated using a dynamic time warping algorithm. A regular velocity sequence is obtained by phase alignment of the one-dimensional physical velocity sequence based on the nodes of the winding path. The total deviation value is obtained by calculating the sum of the Euclidean distances between each sampling point in the regular velocity sequence and the corresponding sampling point of the preset drug delivery trajectory. Divide the total deviation value by the regularization smoothing factor to obtain the smoothness penalty value.

9. The method for monitoring patient medication adherence during ovulation induction cycles according to claim 8, characterized in that, In step S4, the specific operation of weighted fusion of the smoothness penalty value and the volume loss rate to output the compliance quantification index is as follows: Obtain the target injection volume, kinematic deformation weighting constant, and volume loss sensitivity index; Calculate the difference between the target injection volume and the net volume of the drug solution; Divide the difference by the target injection volume to obtain the baseline loss ratio; The volume loss rate is obtained by exponentiating the basic loss ratio with the volume loss sensitivity index as the exponent. Multiplying the kinematic deformation weight constant by the smoothness penalty value yields the first fusion weight term; The difference between the first value and the kinematic deformation weight constant is multiplied by the volume loss rate to obtain the second fusion weight term; The total penalty value is obtained by summing the first fusion weight term and the second fusion weight term. The difference between the numerical value and the total penalty value is used as the preliminary quantification result. The preliminary quantization result is compared with the value of zero to obtain the maximum value, and the result of the maximum value operation is used as the compliance quantization index.

10. A medication adherence monitoring system for patients in ovulation induction cycles, employing the medication adherence monitoring method for patients in ovulation induction cycles as described in any one of claims 1-9, characterized in that, include: The module includes a velocity sequence extraction module, a force action segmentation module, a net volume calculation module for liquid medicine, and a compliance index calculation module. The velocity sequence extraction module is used to obtain the video frame sequence of the injection area, extract the pixel width of the injection pen shell to calculate the dynamic mapping coefficient, extract the feature points of the pen body and the push rod, combine the dynamic mapping coefficient to calculate the relative motion vector, project the relative motion vector onto the unit direction vector, filter the projection result, and output a one-dimensional physical velocity sequence. The force action segmentation module is used to receive a one-dimensional physical velocity sequence, calculate the physical acceleration by differentiating the one-dimensional physical velocity sequence, input the one-dimensional physical velocity sequence and physical acceleration into a finite state machine to segment the force action, and output a physical state sequence including the force pushing state and the needle pulling state. The net volume calculation module for the liquid medicine is used to receive the physical state sequence. When the physical state sequence is in the state of force pushing, it integrates the one-dimensional physical velocity sequence to calculate the absolute volume of the liquid medicine. It extracts the residence time in the physical state sequence before the needle is pulled out. Based on the porous media permeation model and the residence time, it calculates the physical leakage volume. The difference between the absolute volume of the liquid medicine and the physical leakage volume is obtained as the net volume of the liquid medicine. The compliance index calculation module is used to obtain the one-dimensional physical velocity sequence and the net volume of the drug solution. It performs time warping matching between the one-dimensional physical velocity sequence and the preset drug delivery trajectory to calculate the smoothness penalty value. Based on the net volume of the drug solution, it calculates the volume loss rate. The smoothness penalty value and the volume loss rate are weighted and fused to output the compliance quantification index.