Monitoring method and system for intravenous drug dispensing center
By smoothing the monitoring images of the IV drug distribution center, background removal and neural network training, irregular dispensing behaviors are identified in real time, the problem of the IV drug distribution center lacking real-time monitoring capabilities is solved, and the safety and effectiveness of the drug preparation process is improved.
Patent Information
- Application Number
- CN202411828169.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-04-11
AI Technical Summary
Intravenous drug distribution centers lack real-time monitoring capabilities, making it difficult to quickly detect and correct deviations in distribution.
By acquiring monitoring images, smoothing and background removal, irregular dispensing behaviors are calibrated, training samples are formed, and monitoring models are obtained using neural network training to identify irregular dispensing behaviors in real time and issue alarms.
Real-time monitoring of the drug preparation process is achieved, and potential problems and abnormal situations can be quickly identified, mistakes caused by human factors are reduced, and drug safety and effectiveness are improved.
Smart Images

Figure CN119810736A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image monitoring technology, and in particular to a monitoring method and system for an intravenous medication preparation center. Background Art
[0002] As an important part of hospital pharmacy services, the intravenous medication compounding center is responsible for the special compounding and management of intravenous medications. This process not only involves complex drug combinations and dosage calculations, but also requires ensuring the safety and effectiveness of the drugs. With the continuous increase in medical needs and the increasing emphasis on patient safety and medication management, the monitoring and management of the intravenous medication compounding process has become increasingly important. At present, the intravenous medication compounding center lacks the ability to monitor the compounding process in real time, making it difficult to quickly discover and correct deviations in the compounding process. Summary of the invention
[0003] To solve the above problems, an embodiment of the present invention aims to provide a monitoring method and system for an intravenous medication preparation center.
[0004] A monitoring method for an intravenous drug compounding center, comprising:
[0005] Step 1: Obtain surveillance images of the intravenous medication preparation center;
[0006] Step 2: Smoothing the monitoring image to obtain a smoothed monitoring image;
[0007] Step 3: removing the background area of the smoothed monitoring image to obtain an image of the region of interest;
[0008] Step 4: calibrating the irregular medication dispensing behaviors in the image of the region of interest to form training samples;
[0009] Step 5: Input the training sample into the neural network for training to obtain a monitoring model;
[0010] Step 6: Use the monitoring model to identify irregular medication dispensing behaviors and issue an alarm.
[0011] Preferably, the step 2: smoothing the monitoring image to obtain a smoothed monitoring image comprises:
[0012] Step 2.1: Take a smoothing window for each point on the monitoring image;
[0013] Step 2.2: Calculate the median of the pixels within the smoothing window;
[0014] Step 2.3: Construct a smoothing model based on the median value of the pixels in the smoothing window;
[0015] Step 2.4: Use the smoothing model to smooth the monitoring image to obtain a smoothed monitoring image.
[0016] Preferably, in step 2.3, the formula is used:
[0017]
[0018] Construct a smoothing model; where f(x, y) represents the smoothed monitoring image, D is the preset coefficient, x(x, y) represents the pixel value of the pixel point at the position (x, y) in the smoothing window, median(x, y) represents the median of the pixels in the smoothing window, σ x (x,y) represents the variance of the pixel values within the smoothing window.
[0019] Preferably, the step 2.4: using the smoothing model to smooth the monitoring image to obtain a smoothed monitoring image includes:
[0020] Step 2.4.1: Evaluate the smoothed monitoring image to obtain a smoothing effect evaluation value; wherein the smoothing effect evaluation value calculation formula is:
[0021]
[0022] Among them, P represents the smoothing effect evaluation value, f i represents the pixel value of the i-th pixel, h(q) represents the probability of the i-th pixel appearing, and μ1(k) represents the pixel mean of the ultrasonic denoised image;
[0023] Step 2.4.2: When the smoothing effect evaluation value exceeds the preset value, the smoothed monitoring image is output.
[0024] Preferably, the step 3: removing the background area of the smoothed monitoring image to obtain an image of the region of interest includes:
[0025] Step 3.1: Classify the pixels of the smoothed monitoring image to obtain grayscale; the grayscale is the ratio of each pixel to the entire monitoring image;
[0026] Step 3.2: Use pixel threshold to divide the smoothed surveillance image into the first category and the second category;
[0027] Step 3.3: Calculate the similarity between the first category and the second category;
[0028] Step 3.4: The pixel threshold corresponding to the maximum similarity is taken as the optimal threshold;
[0029] Step 3.5: Use the optimal threshold to divide the smoothed monitoring image into a background area and a region of interest, and remove the background area of the smoothed monitoring image to obtain a region of interest image.
[0030] Preferably, in step 3.3, the formula is used:
[0031]
[0032] Calculate the similarity between the first and second categories; where t represents the pixel threshold, m k1 Indicates the pixel ratio of the first category, m k2 Indicates the pixel proportion of the second category, m j It represents the ratio of the points with gray level j to the entire monitoring image, u0 represents the pixel mean of the monitoring image, Represents the similarity between the first category and the second category.
[0033] Preferably, the step 5: inputting the training samples into a neural network for training to obtain a monitoring model comprises:
[0034] Step 5.1: normalizing the training samples to obtain normalized training samples;
[0035] Step 5.2: Input the normalized training samples into the neural network for training, and use the cross entropy loss as an optimization indicator;
[0036] Step 5.3: When the optimization index reaches the preset value, the trained neural network is output to obtain the monitoring model.
[0037] The present invention also provides a monitoring system for an intravenous medication preparation center, comprising:
[0038] A monitoring image acquisition module, used to acquire monitoring images of an intravenous medication preparation center;
[0039] A smoothing module, used for smoothing the monitoring image to obtain a smoothed monitoring image;
[0040] A background area removal module, used to remove the background area of the smoothed monitoring image to obtain an image of a region of interest;
[0041] A calibration module, used for calibrating the irregular medication dispensing behavior in the image of the region of interest to form a training sample;
[0042] A training module, used for inputting the training samples into a neural network for training to obtain a monitoring model;
[0043] The alarm module is used to identify irregular medication dispensing behaviors using the monitoring model and issue an alarm.
[0044] The present invention also provides an electronic device, comprising a bus, a transceiver, a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the transceiver, the memory and the processor are connected via the bus, and wherein the computer program, when executed by the processor, implements the steps in the above-mentioned monitoring method for an intravenous drug preparation center.
[0045] The present invention also provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the steps of the above-mentioned monitoring method for an intravenous drug preparation center are implemented.
[0046] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0047] The present invention relates to a monitoring method and system for an intravenous drug preparation center. Compared with the prior art, the present invention can identify potential problems and abnormal situations in the drug preparation process in real time by using image recognition technology to identify irregular drug preparation behaviors, thereby providing instant feedback to medical staff and reducing errors caused by human factors.
[0048] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0050] Figure 1 A flow chart of a monitoring method for an intravenous medication preparation center in an embodiment provided by the present invention;
[0051] Figure 2 A schematic diagram of a monitoring system for an intravenous medication preparation center in an embodiment provided by the present invention. DETAILED DESCRIPTION
[0052] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the present invention.
[0053] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0054] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0055] See also Figure 1 , a monitoring method for an intravenous drug compounding center, comprising:
[0056] Step 1: Obtain surveillance images of the intravenous medication preparation center;
[0057] Step 2: Smoothing the monitoring image to obtain a smoothed monitoring image;
[0058] Furthermore, the step 2 comprises:
[0059] Step 2.1: Take a smoothing window for each point on the monitoring image;
[0060] Step 2.2: Calculate the median of the pixels within the smoothing window;
[0061] Step 2.3: Construct a smoothing model based on the median value of the pixels in the smoothing window;
[0062] In step 2.3, the formula is used:
[0063]
[0064] Construct a smoothing model; where f(x, y) represents the smoothed monitoring image, D is the preset coefficient, x(x, y) represents the pixel value of the pixel point at the position (x, y) in the smoothing window, median(x, y) represents the median of the pixels in the smoothing window, σ x (x,y) represents the variance of the pixel values within the smoothing window.
[0065] The present invention completes the image smoothing process based on the median value of pixels. Compared with the traditional mean filtering method, the median filter can better preserve details and edges while smoothing the image. This is because the median filter will not pull the pixel values in the edge area to the average value of its neighborhood, thereby reducing the risk of edge blur.
[0066] Step 2.4: Smoothing the monitoring image using the smoothing model to obtain a smoothed monitoring image;
[0067] Among them, step 2.4 includes:
[0068] Step 2.4.1: Evaluate the smoothed monitoring image to obtain a smoothing effect evaluation value; wherein the smoothing effect evaluation value calculation formula is:
[0069]
[0070] Among them, P represents the smoothing effect evaluation value, f i represents the pixel value of the i-th pixel, h(q) represents the probability of the i-th pixel appearing, and μ1(k) represents the pixel mean of the ultrasonic denoised image;
[0071] Step 2.4.2: When the smoothing effect evaluation value exceeds the preset value, the smoothed monitoring image is output.
[0072] By setting the smoothing effect evaluation value, you can ensure that the output surveillance image quality meets the expected standards. This helps avoid outputting blurry, distorted, or information-lost images.
[0073] Step 3: removing the background area of the smoothed monitoring image to obtain an image of the region of interest;
[0074] Furthermore, step 3 includes:
[0075] Step 3.1: Classify the pixels of the smoothed monitoring image to obtain grayscale; the grayscale is the ratio of each pixel to the entire monitoring image;
[0076] Step 3.2: Use pixel threshold to divide the smoothed surveillance image into the first category and the second category;
[0077] Step 3.3: Calculate the similarity between the first category and the second category;
[0078] In step 3.3, the formula is used:
[0079]
[0080] Calculate the similarity between the first and second categories; where t represents the pixel threshold, m k1 Indicates the pixel ratio of the first category, m k2 Indicates the pixel proportion of the second category, m j It represents the ratio of the points with gray level j to the entire monitoring image, u0 represents the pixel mean of the monitoring image, Represents the similarity between the first category and the second category.
[0081] Step 3.4: The pixel threshold corresponding to the maximum similarity is taken as the optimal threshold;
[0082] Step 3.5: Use the optimal threshold to divide the smoothed monitoring image into a background area and a region of interest, and remove the background area of the smoothed monitoring image to obtain a region of interest image.
[0083] The present invention uses the pixel point threshold corresponding to the maximum similarity as the optimal threshold, thereby eliminating the subjectivity and inconsistency caused by manually selecting the threshold.
[0084] Step 4: calibrating the irregular medication dispensing behaviors in the image of the region of interest to form training samples;
[0085] Step 5: Input the training sample into the neural network for training to obtain a monitoring model;
[0086] Furthermore, step 5 includes:
[0087] Step 5.1: normalizing the training samples to obtain normalized training samples;
[0088] Step 5.2: Input the normalized training samples into the neural network for training, and use the cross entropy loss as an optimization indicator;
[0089] Step 5.3: When the optimization index reaches the preset value, the trained neural network is output to obtain the monitoring model.
[0090] Step 6: Use the monitoring model to identify irregular medication dispensing behaviors and issue an alarm.
[0091] The present invention uses image recognition technology to identify irregular dispensing behaviors, and can identify potential problems and abnormal situations in the drug preparation process in real time, thereby providing instant feedback to medical staff and reducing errors caused by human factors.
[0092] The present invention also provides a monitoring system for an intravenous medication preparation center, comprising:
[0093] A monitoring image acquisition module, used to acquire monitoring images of an intravenous medication preparation center;
[0094] A smoothing module, used for smoothing the monitoring image to obtain a smoothed monitoring image;
[0095] A background area removal module, used to remove the background area of the smoothed monitoring image to obtain an image of a region of interest;
[0096] A calibration module, used for calibrating the irregular medication dispensing behavior in the image of the region of interest to form a training sample;
[0097] A training module, used for inputting the training samples into a neural network for training to obtain a monitoring model;
[0098] The alarm module is used to identify irregular medication dispensing behaviors using the monitoring model and issue an alarm.
[0099] The present invention also provides an electronic device, comprising a bus, a transceiver, a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the transceiver, the memory and the processor are connected via the bus, and wherein the computer program, when executed by the processor, implements the steps in the above-mentioned monitoring method for an intravenous drug preparation center. Compared with the prior art, the beneficial effects of the electronic device provided by the present invention are the same as the beneficial effects of the monitoring method for an intravenous drug preparation center described in the above-mentioned technical solution, and are not elaborated herein.
[0100] The present invention also provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the steps of the above-mentioned monitoring method for an intravenous drug preparation center are implemented. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present invention are the same as the beneficial effects of the monitoring method for an intravenous drug preparation center described in the above-mentioned technical scheme, which will not be repeated here.
[0101] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technical solution that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A monitoring method for an intravenous medication preparation center, characterized in that: include: Step 1: Obtain surveillance images of the intravenous medication preparation center; Step 2: Smoothing the monitoring image to obtain a smoothed monitoring image; Step 3: removing the background area of the smoothed monitoring image to obtain an image of the region of interest; Step 4: calibrating the irregular medication dispensing behaviors in the image of the region of interest to form training samples; Step 5: Input the training sample into the neural network for training to obtain a monitoring model; Step 6: Use the monitoring model to identify irregular medication dispensing behaviors and issue an alarm.
2. A monitoring method for an intravenous medication preparation center according to claim 1, characterized in that: The step 2: performing smoothing processing on the monitoring image to obtain a smoothed monitoring image includes: Step 2.1: Take a smoothing window for each point on the monitoring image; Step 2.2: Calculate the median value of the pixels within the smoothing window; Step 2.3: Construct a smoothing model based on the median value of the pixels in the smoothing window; Step 2.4: Use the smoothing model to smooth the monitoring image to obtain a smoothed monitoring image.
3. A monitoring method for an intravenous medication preparation center according to claim 2, characterized in that: In step 2.3, the formula is used: Construct a smoothing model; where f(x, y) represents the smoothed monitoring image, D is the preset coefficient, x(x, y) represents the pixel value of the pixel point at the position (x, y) in the smoothing window, median(x, y) represents the median of the pixels in the smoothing window, σ x (x,y) represents the variance of the pixel values within the smoothing window.
4. A monitoring method for an intravenous medication preparation center according to claim 3, characterized in that: The step 2.4: using the smoothing model to smooth the monitoring image to obtain a smoothed monitoring image, comprises: Step 2.4.1: Evaluate the smoothed monitoring image to obtain a smoothing effect evaluation value; wherein the smoothing effect evaluation value calculation formula is: Among them, P represents the smoothing effect evaluation value, f i represents the pixel value of the i-th pixel, h(q) represents the probability of the i-th pixel appearing, and μ1(k) represents the pixel mean of the ultrasonic denoised image; Step 2.4.2: When the smoothing effect evaluation value exceeds the preset value, the smoothed monitoring image is output.
5. A monitoring method for an intravenous medication preparation center according to claim 4, characterized in that: The step 3: removing the background area of the smoothed monitoring image to obtain an image of the region of interest, includes: Step 3.1: Classify the pixels of the smoothed monitoring image to obtain grayscale; the grayscale is the ratio of each pixel to the entire monitoring image; Step 3.2: Use pixel threshold to divide the smoothed surveillance image into the first category and the second category; Step 3.3: Calculate the similarity between the first category and the second category; Step 3.4: The pixel threshold corresponding to the maximum similarity is taken as the optimal threshold; Step 3.5: Use the optimal threshold to divide the smoothed monitoring image into a background area and a region of interest, and remove the background area of the smoothed monitoring image to obtain a region of interest image.
6. A monitoring method for an intravenous medication preparation center according to claim 5, characterized in that: In step 3.3, the formula is used: Calculate the similarity between the first and second categories; where t represents the pixel threshold, m k1 Indicates the pixel ratio of the first category, m k2 Indicates the pixel proportion of the second category, m j It represents the ratio of the points with gray level j to the entire monitoring image, u0 represents the pixel mean of the monitoring image, Represents the similarity between the first category and the second category.
7. A monitoring method for an intravenous medication preparation center according to claim 6, characterized in that: The step 5: inputting the training sample into a neural network for training to obtain a monitoring model includes: Step 5.1: normalizing the training samples to obtain normalized training samples; Step 5.2: Input the normalized training samples into the neural network for training, and use the cross entropy loss as an optimization indicator; Step 5.3: When the optimization index reaches the preset value, the trained neural network is output to obtain the monitoring model.
8. A monitoring system for an intravenous medication preparation center, characterized in that: include: A monitoring image acquisition module, used to acquire monitoring images of an intravenous medication preparation center; A smoothing module, used for smoothing the monitoring image to obtain a smoothed monitoring image; A background area removal module, used to remove the background area of the smoothed monitoring image to obtain an image of a region of interest; A calibration module, used for calibrating the irregular medication dispensing behavior in the image of the region of interest to form a training sample; A training module, used for inputting the training samples into a neural network for training to obtain a monitoring model; The alarm module is used to identify irregular medication dispensing behaviors using the monitoring model and issue an alarm.
9. An electronic device, comprising a bus, a transceiver, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the transceiver, the memory, and the processor are connected via the bus, wherein: When the computer program is executed by the processor, the steps of a monitoring method for an intravenous drug preparation center as described in any one of claims 1-7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, the steps in the monitoring method for an intravenous drug preparation center as described in any one of claims 1-7 are implemented.