Medical article name and expiration date identification method and system
Automatically identifying the name and validity period of medical supplies through image recognition technology, solving the problems of low recognition efficiency and high cost in the existing technology, and achieving efficient and accurate medical supplies management.
Patent Information
- Application Number
- CN202411928262.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-18
AI Technical Summary
The name and validity period identification of traditional Chinese medicine supplies in the prior art has problems such as the labels that are prone to damage or loss, manual recordings are prone to errors and omissions, and RFID technology management efficiency is limited and costly.
Using a method based on image recognition technology, the packaging images of medical supplies are captured through a high-resolution camera, text detection and segmentation technology are used to identify text areas, and text recognition technology is used to convert text data into computer-processable text data, and information matching and verification are performed through preset matching algorithms.
Automatic identification of medical supplies names and validity periods is realized, which improves identification efficiency, reduces identification costs, and reduces recording errors and omissions.
Smart Images

Figure CN119851893A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical product identification, and in particular to a method and system for identifying the name and expiration date of medical products. Background Art
[0002] Medical supplies include medicines, sterile items and sterile instruments, and are an indispensable part of medical practice. Medicines are substances used to prevent, diagnose, treat diseases or adjust physiological functions, ensuring that patients receive effective treatment and rehabilitation under various medical conditions. Sterile items such as sterile gauze, sterile dressings and sterile gloves are mainly used in surgery and trauma care to prevent infection and protect patients from pathogens. Sterile instruments include surgical instruments, diagnostic instruments and therapeutic instruments, which are used in surgery and other sterile operations after strict sterilization to ensure the safety and effectiveness of medical operations. Through the strict management and scientific application of these medical supplies, medical institutions can provide high-quality medical services and protect the health and safety of patients.
[0003] 1. Medicines
[0004] a. Definition
[0005] Drugs are substances used to prevent, diagnose, treat diseases or adjust physiological functions. Drugs are usually divided into prescription drugs and over-the-counter drugs (OTC drugs).
[0006] b. Classification
[0007] Chemical drugs: made by chemical synthesis or extraction of natural substances, such as antibiotics, antiviral drugs, analgesics, etc.
[0008] Biological drugs: made by biotechnology, such as vaccines, blood products, antibody drugs, etc.
[0009] Traditional Chinese Medicine: Medicines made from natural herbs, such as herbal medicines, decoctions, pills, etc.
[0010] c. Management requirements
[0011] Drug management requires strict quality control and tracking mechanisms, including batch number management, expiration date management and storage conditions requirements, to ensure the safety and effectiveness of drugs.
[0012] 2. Sterile items
[0013] a. Definition
[0014] Sterile items refer to items that have been sterilized and do not contain any living microorganisms. Sterile items are mainly used in surgery and other medical operations that require a sterile environment.
[0015] b. Classification
[0016] Sterile gauze: used to bandage wounds to prevent infection.
[0017] Sterile dressing: covers the wound or surgical site to protect the wound surface.
[0018] Sterile gloves: used by medical staff during surgery or sterile operations to prevent infection.
[0019] c. Management requirements
[0020] The management of sterile items requires ensuring that they remain sterile after sterilization and must be stored and used in a sterile environment. Their packaging must be well sealed and marked with the sterilization date and expiration date.
[0021] 3. Sterile instruments
[0022] a. Definition
[0023] Sterile instruments are medical devices that have been sterilized to ensure that they do not contain any living microorganisms when used. These instruments are mainly used in surgery and other occasions that require aseptic operation.
[0024] b. Classification
[0025] Surgical instruments: such as scalpels, scissors, pliers, etc., used directly in surgical operations.
[0026] Diagnostic equipment: such as endoscopes, catheters, etc., used for internal examination and diagnosis.
[0027] Therapeutic devices: such as syringes, catheters, etc., used for therapeutic operations.
[0028] c. Management requirements
[0029] Sterile instruments must be manufactured, packaged, stored and transported under sterile conditions. Before use, make sure that the packaging is intact and the expiration date has not expired. After use, they must be cleaned and sterilized as required.
[0030] In the process of managing medical supplies, the names and expiration dates of medical supplies need to be accurately identified at key time points such as warehousing, outbound delivery, and inventory. These steps ensure the accuracy of inventory and the effectiveness of items, and prevent expired or non-compliant items from entering the use link.
[0031] In the prior art, manual management or RFID technology is usually used to identify and manage the name and expiration date of medical supplies. In manual management, medical supplies usually use paper labels to record information, and medical staff manually record drug information, including name, batch number, expiration date, etc. Labels are easily damaged or lost, and manual records are prone to recording errors and omissions, increasing management difficulty. In RFID technology, by printing or pasting barcodes on the packaging of medical supplies, RFID readers are used to automatically enter and track medical supply information, but manual scanning is still required, which is inefficient and costly.
[0032] Therefore, we need a new method to identify the names and expiration dates of medical supplies to solve the problems of labels being easily damaged or lost, manual records being prone to errors and omissions, and increasing management difficulty. The RFID technology management method still requires manual scanning, which has limited efficiency and high costs. Summary of the invention
[0033] In view of the above problems, the purpose of the present invention is to provide a method and system for identifying the names and expiration dates of medical supplies, which can realize automatic identification of the names and expiration dates of medical supplies based on image recognition technology, improve identification efficiency, reduce identification costs, and reduce recording errors and omissions.
[0034] The above-mentioned object of the present invention is achieved through the following technical solutions:
[0035] A method for identifying the name and expiration date of medical supplies, comprising the following steps:
[0036] S1: preparing a scanning device for capturing images of medical supplies;
[0037] S2: When the name and expiration date of the medical supplies are identified, the scanning device automatically identifies the medical supplies and acquires an image of the supplies;
[0038] S3: using image recognition technology to identify identification information including name and expiration date on the product image, wherein the image recognition technology uses text detection and segmentation technology to segment the text area of the product image, and uses text recognition technology to convert the segmented text area into text data that can be processed by a computer;
[0039] S4: Using a preset matching algorithm to match and verify the identification information of the medical supplies.
[0040] Furthermore, in step S1, the scanning device for capturing the image of the medical product is prepared, specifically:
[0041] The scanning device uses an industrial-grade camera with a resolution higher than 1080p to capture fine text and image details on the medical product packaging or label;
[0042] The scanning device uses an adjustable LED light source to provide uniform lighting, and adjusts the light intensity and color temperature as needed to ensure that high-quality images are obtained under various environmental conditions, wherein adjusting the light intensity and color temperature as needed includes: selecting an ambient light sensor that integrates multiple sensors and can measure parameters including light intensity and color temperature, designing an automated program to read the parameters of the ambient light sensor, judging whether the LED light source needs to be adjusted based on the parameters of the ambient light sensor, and when adjustment is needed, generating a control command based on an algorithm decision to adjust the light intensity or color temperature of the LED light source.
[0043] Further, judging whether the LED light source needs to be adjusted is performed based on the parameters of the ambient light sensor, specifically:
[0044] Defining a light intensity range of the LED light source including a minimum light intensity and a maximum light intensity, and a color temperature range including a minimum color temperature and a maximum color temperature;
[0045] If the light intensity read is less than the minimum light intensity, the brightness of the LED light source needs to be increased; if the light intensity read is greater than the maximum light intensity, the brightness of the LED light source needs to be reduced; if the color temperature read is less than the minimum color temperature, the color temperature of the LED light source needs to be increased; if the color temperature read is greater than the maximum color temperature, the color temperature of the LED light source needs to be reduced;
[0046] Reading the parameters of the ambient light sensor at a preset frequency, and adjusting the brightness and color temperature of the LED light source in real time;
[0047] In addition, when adjustment is required, a control command is generated according to the algorithm decision to adjust the light intensity or color temperature of the LED light source, specifically:
[0048] A PID control algorithm consisting of three parts, namely, a proportional P, an integral I and a differential D, is used to adjust the light intensity or color temperature of the LED light source, wherein the proportional P is directly adjusted according to the size of the current deviation, and increasing the gain of the proportional P can quickly respond to the deviation change, but will cause the system to overshoot or oscillate, the integral I is adjusted according to the accumulation of the deviation to eliminate the steady-state error, the integral I can handle long-term deviations, but an excessively large gain of the integral I will cause the system to react slowly or become unstable, the differential D is adjusted according to the rate of change of the deviation to suppress the oscillation and overshoot of the system, the differential D can improve the response speed and stability of the system, but will be sensitive to noise, and the proportional P, the integral I and the differential D are regularly updated to adapt to different environmental changes and performance requirements;
[0049] error=targetLux-currentLux;
[0050] integral=integral+error*dt;
[0051] derivative=(error-previousError) / dt;
[0052] output=Kp*error+Ki*integral+Kd*derivative;
[0053] previousError=error;
[0054] Wherein, error is the current error, targetLux is the target adjustment value, currentLux is the current value obtained, integral is the updated integral I, derivative is the updated differential D, previousError is the error saved last time, Kp is the gain of the proportion P, Ki is the gain of the integral I, Kd is the gain of the differential D, and dt is the time interval between two calculations.
[0055] Furthermore, in step S2, when the name and expiration date of the medical supplies are identified, the scanning device automatically identifies the medical supplies and obtains the image of the supplies, specifically:
[0056] When the medical supplies are put into storage, taken out of storage and counted, the scanning device is placed near the medical supplies management table to ensure that the medical supplies are within the shooting field of view of the scanning device;
[0057] When the medical supplies enter the scanning area of the scanning device, the presence of the medical supplies is detected by the sensor, and the scanning device is automatically started to complete the shooting of the image of the medical supplies;
[0058] The captured images of the products are preprocessed including denoising, adjusting brightness and adjusting contrast, wherein denoising is performed using methods including Gaussian filtering, median filtering and bilateral filtering, brightness is adjusted using methods including linear transformation and histogram equalization, and contrast is adjusted using methods including linear contrast stretching and contrast-limited adaptive histogram equalization.
[0059] Furthermore, in step S3, the text detection and segmentation technology is used in the image recognition technology to segment the text area of the product image, specifically:
[0060] For each type of medical supplies, a set of images of the supplies corresponding to the current medical supplies are collected in advance, and the position information of the bounding box where the text area to be identified is located and the category of the bounding box represented by the bounding box are marked for each of the supplies images;
[0061] Select the YOLO model as the recognition model for the text detection and segmentation technology, and configure the model parameters including the grid size and the number of bounding boxes according to the actual situation;
[0062] Using the set of labeled images of the medical supplies to train the YOLO model, and optimizing the weights of the YOLO model to accurately preset the bounding box of the medical supplies and the category of the bounding box;
[0063] When it is necessary to identify the newly scanned product image, the product image is input into the YOLO model, and the YOLO model outputs each of the bounding boxes identified by the product image and the category of the bounding box;
[0064] The text area in the boundary box is segmented into fields including the name and the expiration date by using any one of the methods including projection analysis, pixel connection and watershed algorithm.
[0065] Furthermore, in step S3, the segmented text area is converted into the text data processable by a computer using the text recognition technology, specifically:
[0066] Improving the image quality of the segmented text area with fields including name and expiration date by methods including removing background and enhancing contrast;
[0067] Using an OCR recognition engine to recognize the segmented text area, and extracting information including the name and expiration date from the recognized text data of the medical supplies;
[0068] The recognized text data is post-processed including removing spaces and correcting typos.
[0069] Furthermore, in step S4, the identification information of the medical supplies is matched and verified using the preset matching algorithm, specifically:
[0070] Preparing a supplies database containing information of all the medical supplies, wherein the supplies database includes information such as name, expiration date, batch number, and production date;
[0071] For the identified identification information including the name and expiration date, searching the product database for a record that is completely identical to the identification result, and if no completely matching record is found, using fuzzy matching to find the most similar record;
[0072] If the name and the validity period match successfully, the identification information is confirmed to be correct, otherwise an error message is recorded and manual intervention and proofreading are performed.
[0073] The method for identifying the name and expiration date of medical supplies also includes: the image of the supplies obtained by the scanning device involved in steps S1-S4, the identification information identified by the image recognition technology, and the matching and verification results of the preset matching algorithm are all exchanged with the centralized control center through wireless transmission, and transmitted to the mobile phone for real-time monitoring.
[0074] A medical product name and expiration date identification system for executing the medical product name and expiration date identification method as described above, comprising:
[0075] a scanning device preparation module for preparing a scanning device for capturing a product image of a medical product;
[0076] A product image scanning module, used for automatically identifying the medical product and acquiring the product image when the name and expiration date of the medical product are identified by the scanning device;
[0077] A text data recognition module, used to recognize identification information including name and expiration date on the product image by using image recognition technology, wherein the text detection and segmentation technology is used in the image recognition technology to segment the text area of the product image, and the text recognition technology is used to convert the segmented text area into text data that can be processed by a computer;
[0078] The identification information verification module is used to match and verify the identification information of the medical supplies using a preset matching algorithm.
[0079] A computer device comprises a memory and one or more processors, wherein the memory stores computer codes, and when the computer codes are executed by the one or more processors, the one or more processors execute the above method.
[0080] A computer-readable storage medium stores computer codes. When the computer codes are executed, the above method is executed.
[0081] Compared with the prior art, the present invention has at least one of the following beneficial effects:
[0082] (1) A method for identifying the name and expiration date of medical supplies is provided, comprising: S1: preparing a scanning device for capturing the image of medical supplies; S2: when identifying the name and expiration date of the medical supplies, the scanning device automatically identifies the medical supplies and obtains the image of the supplies; S3: using image recognition technology to identify the identification information including the name and expiration date on the image of the supplies, wherein the image recognition technology uses text detection and segmentation technology to segment the text area of the image of the supplies, and uses text recognition technology to convert the segmented text area into text data that can be processed by a computer; S4: using a preset matching algorithm to match and verify the identification information of the medical supplies. The above technical solution, based on image recognition technology, realizes automatic identification of the name and expiration date of medical supplies, improves the efficiency of identification, reduces the cost of identification, and reduces recording errors and omissions.
[0083] (2) The present invention uses a preset matching algorithm to match and verify the identification information of the medical supplies, which can effectively match and verify the identified medical supplies name and expiration information with the database records to ensure the accuracy and consistency of the identification information. BRIEF DESCRIPTION OF THE DRAWINGS
[0084] Figure 1 The overall flow chart of the method for identifying the name and expiration date of medical supplies of the present invention;
[0085] Figure 2 This is a schematic diagram of the connection interaction of the device of the present invention;
[0086] Figure 3 The figure is the overall structure diagram of the medical product name and expiration date identification system of the present invention. DETAILED DESCRIPTION
[0087] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0088] Those skilled in the art will appreciate that, unless otherwise stated, the singular forms "a", "an", "said" and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0089] First embodiment
[0090] like Figure 1 As shown, this embodiment provides a method for identifying the name and expiration date of medical supplies, comprising the following steps:
[0091] S1: Prepare a scanning device for capturing an image of a medical supply.
[0092] The scanning device uses an industrial-grade camera with a resolution higher than 1080p to capture subtle text and image details on the medical product packaging or label.
[0093] The scanning device uses an adjustable LED light source to provide uniform lighting, and adjusts the light intensity and color temperature as needed to ensure that high-quality images are obtained under various environmental conditions, wherein adjusting the light intensity and color temperature as needed includes: selecting an ambient light sensor that integrates multiple sensors and can measure parameters including light intensity and color temperature, designing an automated program to read the parameters of the ambient light sensor, judging whether the LED light source needs to be adjusted based on the parameters of the ambient light sensor, and when adjustment is needed, generating a control command based on an algorithm decision to adjust the light intensity or color temperature of the LED light source.
[0094] Wherein, judging whether the LED light source needs to be adjusted is performed according to the parameters of the ambient light sensor, specifically:
[0095] Defining a light intensity range of the LED light source including a minimum light intensity and a maximum light intensity, and a color temperature range including a minimum color temperature and a maximum color temperature;
[0096] If the light intensity read is less than the minimum light intensity, the brightness of the LED light source needs to be increased; if the light intensity read is greater than the maximum light intensity, the brightness of the LED light source needs to be reduced; if the color temperature read is less than the minimum color temperature, the color temperature of the LED light source needs to be increased; if the color temperature read is greater than the maximum color temperature, the color temperature of the LED light source needs to be reduced;
[0097] Reading the parameters of the ambient light sensor at a preset frequency, and adjusting the brightness and color temperature of the LED light source in real time;
[0098] In addition, when adjustment is required, a control command is generated according to the algorithm decision to adjust the light intensity or color temperature of the LED light source, specifically:
[0099] A PID control algorithm consisting of three parts, namely, a proportional P, an integral I and a differential D, is used to adjust the light intensity or color temperature of the LED light source, wherein the proportional P is directly adjusted according to the size of the current deviation, and increasing the gain of the proportional P can quickly respond to the deviation change, but will cause the system to overshoot or oscillate, the integral I is adjusted according to the accumulation of the deviation to eliminate the steady-state error, the integral I can handle long-term deviations, but an excessively large gain of the integral I will cause the system to react slowly or become unstable, the differential D is adjusted according to the rate of change of the deviation to suppress the oscillation and overshoot of the system, the differential D can improve the response speed and stability of the system, but will be sensitive to noise, and the proportional P, the integral I and the differential D are regularly updated to adapt to different environmental changes and performance requirements;
[0100] error=targetLux-currentLux;
[0101] integral=integral+error*dt;
[0102] derivative=(error-previousError) / dt;
[0103] output=Kp*error+Ki*integral+Kd*derivative;
[0104] previousError=error;
[0105] Wherein, error is the current error, targetLux is the target adjustment value, currentLux is the current value obtained, integral is the updated integral I, derivative is the updated differential D, previousError is the error saved last time, Kp is the gain of the proportion P, Ki is the gain of the integral I, Kd is the gain of the differential D, and dt is the time interval between two calculations.
[0106] At the same time, the proportion P, the integral I and the differential D are regularly updated to adapt to different environmental changes and performance requirements, which is done in the following way:
[0107] 1. Initial parameter setting
[0108] When the system starts running, set the initial P, I, and D parameters. These parameters can be initially set through experience or based on previous system performance.
[0109] 2. Data Collection
[0110] During system operation, the following data is collected regularly:
[0111] Deviation between target value and current value (Error): reflects the gap between the control target and the current actual value.
[0112] System response time: reflects the speed at which the system responds to control signals.
[0113] System stability: Check whether the system has overshoot, oscillation, etc.
[0114] 3. Data Analysis
[0115] Analyze the collected data to evaluate the performance of the current P, I, and D parameters:
[0116] Deviation analysis: Analyze the size and changing trend of deviation.
[0117] Response time analysis: Evaluate how fast the system responds.
[0118] Stability analysis: Check whether the system is stable and whether there is overshoot or oscillation.
[0119] 4. Parameter adjustment algorithm
[0120] According to the results of data analysis, adjust the P, I, and D parameters. Commonly used parameter adjustment algorithms are:
[0121] a. Manual adjustment
[0122] Experience adjustment: Manually adjust the P, I, and D parameters based on experience and data analysis results. Increasing P can increase the system response speed, but may cause overshoot; increasing I can eliminate deviations, but may cause oscillation; increasing D can suppress oscillation, but may cause system instability.
[0123] b. Automatic adjustment
[0124] Adaptive control algorithm: Adopt adaptive control algorithm to automatically adjust P, I, and D parameters according to real-time data. For example, fuzzy control algorithm, genetic algorithm, particle swarm optimization algorithm, etc.
[0125] 5. Parameter verification and optimization
[0126] After adjusting the parameters, rerun the system and collect data to verify and optimize the new parameters:
[0127] Verify parameter performance: Check whether the system performance under new parameters meets the expected requirements.
[0128] Optimize parameter settings: If the performance of the new parameters is not ideal, further adjust and optimize the parameters and repeat the process of data collection, analysis and adjustment until the system performance reaches a satisfactory level.
[0129] 6. Regular updates
[0130] According to environmental changes and performance requirements, perform the above steps regularly to update P, I, and D parameters to adapt to new control requirements and environmental conditions.
[0131] S2: When identifying the name and expiration date of the medical supplies, the scanning device automatically identifies the medical supplies and acquires the images of the supplies.
[0132] In this embodiment, step S2 is specifically:
[0133] When the medical supplies are put into storage, taken out of storage and counted, the scanning device is placed near the medical supplies management table to ensure that the medical supplies are within the shooting field of view of the scanning device;
[0134] When the medical supplies enter the scanning area of the scanning device, the presence of the medical supplies is detected by the sensor, and the scanning device is automatically started to complete the shooting of the image of the medical supplies.
[0135] The captured images of the products are preprocessed including denoising, adjusting brightness and adjusting contrast, wherein denoising is performed using methods including Gaussian filtering, median filtering and bilateral filtering, brightness is adjusted using methods including linear transformation and histogram equalization, and contrast is adjusted using methods including linear contrast stretching and contrast-limited adaptive histogram equalization.
[0136] 1. Denoising
[0137] The purpose of denoising is to reduce the noise in the image and make the image clearer. Common denoising methods include:
[0138] a. Gaussian filtering
[0139] Gaussian filtering smoothes the image through a convolution operation, thereby reducing high-frequency noise.
[0140] step:
[0141] (1) Choose an appropriate Gaussian kernel size (such as 3x3 or 5x5).
[0142] (2) Use a Gaussian kernel to perform convolution on the image to smooth the image.
[0143] b. Median filtering
[0144] Median filtering effectively removes salt and pepper noise by sorting the pixels of the image and selecting the middle value to replace the original pixel.
[0145] step:
[0146] (1) Choose an appropriate window size (such as 3x3 or 5x5).
[0147] (2) For each pixel, sort all pixel values within the window and select the middle value to replace the original pixel.
[0148] c. Bilateral filtering
[0149] Bilateral filtering smoothes the image while retaining the edge details.
[0150] step:
[0151] (1) Select appropriate spatial domain parameters and grayscale domain parameters.
[0152] (2) Perform bilateral filtering on the image to smooth out noise while retaining edges.
[0153] 2. Adjust brightness
[0154] The purpose of adjusting the brightness is to make the overall brightness of the image moderate. Common methods include:
[0155] a. Linear transformation
[0156] Adjust the image brightness using a linear transformation formula.
[0157] step:
[0158] (1) Set the linear transformation parameters α (gain) and β (offset).
[0159] (2) Perform a linear transformation on each pixel value: I new =α·I old +β.
[0160] b. Histogram equalization
[0161] Histogram equalization enhances contrast and brightness by redistributing the grayscale values of an image.
[0162] step:
[0163] (1) Calculate the grayscale histogram of the image.
[0164] (2) Calculate the cumulative distribution function (CDF).
[0165] (3) Use CDF to remap the grayscale values of the original image.
[0166] 3. Adjust the contrast
[0167] The purpose of adjusting the contrast is to make the grayscale difference of the image more obvious. Common methods include:
[0168] a. Linear contrast stretching
[0169] Enhances contrast by stretching the grayscale value range of an image.
[0170] step:
[0171] (1) Determine the minimum and maximum grayscale values of the image.
[0172] (2) Use the linear stretching formula to stretch the grayscale value:
[0173] b. Contrast Limited Adaptive Histogram Equalization (CLAHE)
[0174] CLAHE limits the contrast enhancement effect by equalizing the local area of the image, thereby avoiding over-enhancement.
[0175] step:
[0176] (1) Divide the image into small blocks (e.g. 8x8).
[0177] (2) Perform histogram equalization on each small block.
[0178] (3) The images after small block equalization are synthesized and contrast limiting technology is applied to avoid over-enhancement.
[0179] S3: Using image recognition technology to identify identification information on the product image, including the name and expiration date, wherein text detection and segmentation technology is used in the image recognition technology to segment the text area of the product image, and text recognition technology is used to convert the segmented text area into text data that can be processed by a computer.
[0180] In step S3, the text detection and segmentation technology is used in the image recognition technology to segment the text area of the product image, specifically:
[0181] For each type of medical supplies, a set of images of the supplies corresponding to the current medical supplies are collected in advance, and the position information of the bounding box where the text area to be identified is located and the category of the bounding box represented by the bounding box are marked for each of the supplies images;
[0182] Select the YOLO model as the recognition model for the text detection and segmentation technology, and configure the model parameters including the grid size and the number of bounding boxes according to the actual situation;
[0183] Using the set of labeled images of the medical supplies to train the YOLO model, and optimizing the weights of the YOLO model to accurately preset the bounding box of the medical supplies and the category of the bounding box;
[0184] When it is necessary to identify the newly scanned product image, the product image is input into the YOLO model, and the YOLO model outputs each of the bounding boxes identified by the product image and the category of the bounding box;
[0185] The text area in the boundary box is segmented into fields including the name and the expiration date by using any one of the methods including projection analysis, pixel connection and watershed algorithm.
[0186] Among them, the execution steps of projection analysis, pixel connection and watershed algorithm are:
[0187] 1. Projection analysis
[0188] (1) Binarize the image.
[0189] (2) Perform horizontal projection on the binary image to determine the position of the text line.
[0190] (3) Perform vertical projection on each line of text to determine the position of characters or words.
[0191] (4) Based on the projection results, the text is segmented into single characters or words.
[0192] 2. Pixel connection
[0193] (1) Binarize the image.
[0194] (2) Perform connected component analysis and mark all connected regions.
[0195] (3) Based on the connected regions, the text is segmented into individual characters or words.
[0196] 3. Watershed algorithm
[0197] (1) Calculate the gradient of the image and obtain the gradient amplitude map.
[0198] (2) Use morphological operations to mark foreground and background regions.
[0199] (3) Obtain the foreground mark through distance transformation and threshold operation.
[0200] (4) Apply the watershed algorithm to segment the gradient amplitude map.
[0201] (5) Based on the segmentation results, the text area is segmented into single characters or words.
[0202] In step S3, the segmented text area is converted into the text data that can be processed by a computer using the text recognition technology, specifically:
[0203] Improving the image quality of the segmented text area with fields including name and expiration date by methods including removing background and enhancing contrast;
[0204] Using an OCR recognition engine to recognize the segmented text area, and extracting information including the name and expiration date from the recognized text data of the medical supplies;
[0205] The recognized text data is post-processed including removing spaces and correcting typos.
[0206] S4: Using a preset matching algorithm to match and verify the identification information of the medical supplies.
[0207] In this embodiment, step S4 is specifically:
[0208] Preparing a supplies database containing information of all the medical supplies, wherein the supplies database includes information such as name, expiration date, batch number, and production date;
[0209] For the identified identification information including the name and expiration date, searching the product database for a record that is completely identical to the identification result, and if no completely matching record is found, using fuzzy matching to find the most similar record;
[0210] If the name and the validity period match successfully, the identification information is confirmed to be correct, otherwise an error message is recorded and manual intervention and proofreading are performed.
[0211] Second embodiment
[0212] like Figure 2 As shown, in this embodiment, the product image obtained by the scanning device, the identification information identified by the image recognition technology, and the matching and verification results of the preset matching algorithm involved in steps S1-S4 are all wirelessly transmitted to the centralized control center for data exchange and transmitted to the mobile phone for real-time monitoring.
[0213] Let's take a specific example:
[0214] In a hospital's drug warehouse, pharmacists use handheld scanning devices equipped with high-resolution cameras and OCR (optical character recognition) functions to identify and record the expiration dates of newly-arrived drugs. The drugs include various injections, tablets, and liquid drugs, and each drug's packaging is printed with important information such as the name, production date, and expiration date.
[0215] Steps in detail:
[0216] Step S1: Prepare to scan the device
[0217] The pharmacist picks up a handheld scanning device that has a high-resolution camera and OCR capabilities to capture the text on the drug packaging.
[0218] Step S2: Automatically obtain drug images
[0219] The pharmacist points the scanning device at a box of medicine, and the device automatically identifies the medicine packaging and takes a clear image, capturing information such as the medicine name, batch number, production date and expiration date. The captured image is uploaded to the hospital's centralized control center in real time, and data synchronization is achieved through wireless transmission technology.
[0220] Step S3: Image recognition technology application
[0221] Text detection and segmentation: After receiving the image, the system at the centralized control center starts the image recognition algorithm to process the image. The system identifies the text areas on the package and segments these areas. Text recognition: The system converts the information in the segmented text areas into digital text through OCR technology. This information includes the drug name "CeftriaxoneSodium", the production date "2023-05-10", and the expiration date "2025-05-10".
[0222] After identification is completed, these digitized text data are transmitted to the pharmacist's mobile phone in real time via the wireless network, and the pharmacist can immediately view the detailed information of the drug on the mobile phone screen.
[0223] Step S4: Information matching and verification
[0224] Information matching and verification: The system at the centralized control center compares the identified drug information with the hospital's inventory database to confirm whether the drug's name, batch number, and expiration date are consistent with the database records. The system detects that this information is a perfect match and no further verification is required.
[0225] Exception handling: If the identified information is inconsistent with the information in the database, the system will automatically send an alert to the pharmacist's mobile phone, indicating the possible error and requiring manual inspection. The final matching and verification results, together with the identified drug information, will be transmitted to the pharmacist's mobile phone via the wireless network for real-time monitoring and confirmation by the pharmacist.
[0226] Application scenario summary:
[0227] In this example, pharmacists use handheld scanning devices to automatically identify the name and expiration date of drugs. All identification information is transmitted in real time via a wireless network to the hospital's centralized control center for processing and verification. After the centralized control center confirms the information, it sends the matching results to the pharmacist's mobile phone to ensure the accuracy of drug information and promptly detect and correct any potential errors. This wireless transmission technology improves the efficiency and accuracy of the drug warehousing process while ensuring the safety of drugs in inventory management.
[0228] Third embodiment
[0229] like Figure 3 As shown, this embodiment provides a medical product name and expiration date recognition system for executing the medical product name and expiration date recognition method as in the first embodiment, comprising:
[0230] A scanning device preparation module 1, for preparing a scanning device for capturing an image of a medical device;
[0231] Supplies image scanning module 2, used for automatically identifying the medical supplies and acquiring the supplies image when the name and expiration date of the medical supplies are identified by the scanning device;
[0232] A text data recognition module 3, used for recognizing identification information including name and expiration date on the product image by using image recognition technology, wherein the text detection and segmentation technology is used in the image recognition technology to segment the text area of the product image, and the text recognition technology is used to convert the segmented text area into text data that can be processed by a computer;
[0233] The identification information verification module 4 is used to match and verify the identification information of the medical supplies using a preset matching algorithm.
[0234] A computer-readable storage medium stores a computer code. When the computer code is executed, the above method is executed. A person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program. The program can be stored in a computer-readable storage medium. The storage medium can include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0235] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
[0236] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0237] It should be noted that the above embodiments can be freely combined as needed. The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered as the protection scope of the present invention.
Claims
1. A method for identifying the name and expiration date of medical supplies, characterized in that: The following steps are involved: S1: preparing a scanning device for capturing images of medical supplies; S2: When the name and expiration date of the medical supplies are identified, the scanning device automatically identifies the medical supplies and acquires an image of the supplies; S3: using image recognition technology to identify identification information including name and expiration date on the product image, wherein the image recognition technology uses text detection and segmentation technology to segment the text area of the product image, and uses text recognition technology to convert the segmented text area into text data that can be processed by a computer; S4: Using a preset matching algorithm to match and verify the identification information of the medical supplies.
2. The method for identifying the name and expiration date of medical supplies according to claim 1, characterized in that: In step S1, the scanning device for capturing the image of the medical product is prepared, specifically: The scanning device uses an industrial-grade camera with a resolution higher than 1080p to capture fine text and image details on the medical product packaging or label; The scanning device uses an adjustable LED light source to provide uniform lighting, and adjusts the light intensity and color temperature as needed to ensure that high-quality images are obtained under various environmental conditions, wherein adjusting the light intensity and color temperature as needed includes: selecting an ambient light sensor that integrates multiple sensors and can measure parameters including light intensity and color temperature, designing an automated program to read the parameters of the ambient light sensor, judging whether the LED light source needs to be adjusted based on the parameters of the ambient light sensor, and when adjustment is needed, generating a control command based on an algorithm decision to adjust the light intensity or color temperature of the LED light source.
3. The method for identifying the name and expiration date of medical supplies according to claim 2, characterized in that: Whether the LED light source needs to be adjusted is judged according to the parameters of the ambient light sensor, specifically: Defining a light intensity range of the LED light source including a minimum light intensity and a maximum light intensity, and a color temperature range including a minimum color temperature and a maximum color temperature; If the light intensity read is less than the minimum light intensity, the brightness of the LED light source needs to be increased; if the light intensity read is greater than the maximum light intensity, the brightness of the LED light source needs to be reduced; if the color temperature read is less than the minimum color temperature, the color temperature of the LED light source needs to be increased; if the color temperature read is greater than the maximum color temperature, the color temperature of the LED light source needs to be reduced; Reading the parameters of the ambient light sensor at a preset frequency, and adjusting the brightness and color temperature of the LED light source in real time; In addition, when adjustment is required, a control command is generated according to the algorithm decision to adjust the light intensity or color temperature of the LED light source, specifically: A PID control algorithm consisting of three parts, namely, a proportional P, an integral I and a differential D, is used to adjust the light intensity or color temperature of the LED light source, wherein the proportional P is directly adjusted according to the size of the current deviation, and increasing the gain of the proportional P can quickly respond to the deviation change, but will cause the system to overshoot or oscillate, the integral I is adjusted according to the accumulation of the deviation to eliminate the steady-state error, the integral I can handle long-term deviations, but an excessively large gain of the integral I will cause the system to react slowly or become unstable, the differential D is adjusted according to the rate of change of the deviation to suppress the oscillation and overshoot of the system, the differential D can improve the response speed and stability of the system, but will be sensitive to noise, and the proportional P, the integral I and the differential D are regularly updated to adapt to different environmental changes and performance requirements; error=targetLux-currentLux; integral=integral+error*dt; derivative=(error-previousError) / dt; output=Kp*error+Ki*integral+Kd*derivative; previousError=error; Wherein, error is the current error, targetLux is the target adjustment value, currentLux is the current value obtained, integral is the updated integral I, derivative is the updated differential D, previousError is the error saved last time, Kp is the gain of the proportion P, Ki is the gain of the integral I, Kd is the gain of the differential D, and dt is the time interval between two calculations.
4. The method for identifying the name and expiration date of medical supplies according to claim 1, characterized in that: In step S2, when the name and expiration date of the medical supplies are identified, the scanning device automatically identifies the medical supplies and obtains the image of the supplies, specifically: When the medical supplies are put into storage, taken out of storage and counted, the scanning device is placed near the medical supplies management table to ensure that the medical supplies are within the shooting field of view of the scanning device; When the medical supplies enter the scanning area of the scanning device, the presence of the medical supplies is detected by the sensor, and the scanning device is automatically started to complete the shooting of the image of the medical supplies; The captured images of the products are preprocessed including denoising, adjusting brightness and adjusting contrast, wherein denoising is performed using methods including Gaussian filtering, median filtering and bilateral filtering, brightness is adjusted using methods including linear transformation and histogram equalization, and contrast is adjusted using methods including linear contrast stretching and contrast-limited adaptive histogram equalization.
5. The method for identifying the name and expiration date of medical supplies according to claim 1, characterized in that: In step S3, the text detection and segmentation technology is used in the image recognition technology to segment the text area of the product image, specifically: For each type of medical supplies, a set of images of the supplies corresponding to the current medical supplies are collected in advance, and the position information of the bounding box where the text area to be identified is located and the category of the bounding box represented by the bounding box are marked for each of the supplies images; Select the YOLO model as the recognition model for the text detection and segmentation technology, and configure the model parameters including the grid size and the number of bounding boxes according to the actual situation; Using the set of labeled images of the medical supplies to train the YOLO model, and optimizing the weights of the YOLO model to accurately preset the bounding box of the medical supplies and the category of the bounding box; When it is necessary to identify the newly scanned product image, the product image is input into the YOLO model, and the YOLO model outputs each of the bounding boxes identified by the product image and the category of the bounding box; The text area in the boundary box is segmented into fields including the name and the expiration date by using any one of the methods including projection analysis, pixel connection and watershed algorithm.
6. The method for identifying the name and expiration date of medical supplies according to claim 5, characterized in that: In step S3, the segmented text area is converted into the text data that can be processed by a computer using the text recognition technology, specifically: Improving the image quality of the segmented text area with fields including name and expiration date by methods including removing background and enhancing contrast; Using an OCR recognition engine to recognize the segmented text area, and extracting information including the name and expiration date from the recognized text data of the medical supplies; The recognized text data is post-processed including removing spaces and correcting typos.
7. The method for identifying the name and expiration date of medical supplies according to claim 1, characterized in that: In step S4, the identification information of the medical supplies is matched and verified using the preset matching algorithm, specifically: Preparing a supplies database containing information of all the medical supplies, wherein the supplies database includes information such as name, expiration date, batch number, and production date; For the identified identification information including the name and expiration date, searching the product database for a record that is completely identical to the identification result, and if no completely matching record is found, using fuzzy matching to find the most similar record; If the name and the validity period match successfully, the identification information is confirmed to be correct, otherwise an error message is recorded and manual intervention and proofreading are performed.
8. The method for identifying the name and expiration date of medical supplies according to claim 1, characterized in that: Also includes: The product image obtained by the scanning device, the identification information identified by the image recognition technology, and the matching and verification results of the preset matching algorithm involved in steps S1-S4 are all exchanged with the centralized control center through wireless transmission and transmitted to the mobile phone for real-time monitoring.
9. A medical product name and expiration date recognition system for executing the medical product name and expiration date recognition method according to any one of claims 1 to 8, characterized in that: include: a scanning device preparation module for preparing a scanning device for capturing a product image of a medical product; A product image scanning module, used for automatically identifying the medical product and acquiring the product image when the name and expiration date of the medical product are identified by the scanning device; A text data recognition module, used to recognize identification information including name and expiration date on the product image by using image recognition technology, wherein the text detection and segmentation technology is used in the image recognition technology to segment the text area of the product image, and the text recognition technology is used to convert the segmented text area into text data that can be processed by a computer; The identification information verification module is used to match and verify the identification information of the medical supplies using a preset matching algorithm. 10 . A computer-readable storage medium storing a computer code, wherein when the computer code is executed, the method according to claim 1 is executed.