A smart medicine cabinet medicine management method and system
Through the image acquisition and recognition technology of the smart drug cabinet, combined with real-time inventory management, the problems of manual operation errors and insufficient inventory monitoring in traditional drug management are solved, efficient and accurate drug inlet and out-of-warehouse management are achieved, and drug storage is optimized. space.
Patent Information
- Application Number
- CN202411501862.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-10-25
AI Technical Summary
Traditional drug management methods rely on manual operations, which can easily lead to errors in the inlet and outflow process, reduce efficiency, and lack of automated monitoring, making it difficult to always understand the status of the drug inventory, which may lead to shortage or expired, and inefficient storage.
The intelligent drug cabinet is adopted to collect and identify the drug inlet and outgoing orders through an integrated camera, combine real-time inventory table verification information, match the drug and cabinet space information, and update the inventory information through the drug image recognition model.
It reduces manual intervention, improves the speed and accuracy of drug in and out of the warehouse, ensures accurate identification and matching of drug information, monitors drug inventory in real time, avoids shortages or expires, optimizes storage space, and improves storage efficiency.
Smart Images

Figure CN119006764B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medicine management, and in particular to a medicine management method and system for an intelligent medicine cabinet. Background Art
[0002] A smart medicine cabinet is a device that combines automation technology and intelligent systems to manage the storage, distribution and monitoring of medicines. It is usually equipped with image recognition, real-time inventory updates and data analysis functions to improve the efficiency and accuracy of medicine management. Smart medicine cabinets can monitor the entry and exit of medicines in real time, ensure the accuracy of medicine information, reduce human errors, and optimize storage space.
[0003] Traditional methods rely on manual operations, which can easily lead to errors in the warehousing and outbound processes, reducing efficiency. Traditional methods are prone to errors when manually recording drug information, resulting in inconsistent accounts. Traditional methods lack automated monitoring, making it difficult to understand the inventory status of drugs in a timely manner, which may lead to shortages or expiration. Traditional management methods usually lack the ability to optimize space allocation, resulting in inefficient storage. Summary of the invention
[0004] The purpose of the present invention is to address the problems existing in the background technology and to propose a medicine management method and system for an intelligent medicine cabinet.
[0005] A first aspect of the present invention provides a method for managing medicines in an intelligent medicine cabinet, comprising:
[0006] Based on the camera integrated in the target intelligent medicine cabinet, the image of the medicine entry and exit list is collected to obtain the images of the medicine entry and exit list, and the image of the medicine to be entered and exited is collected to obtain the images of the medicine to be entered and exited;
[0007] Performing image recognition on the drug entry and exit order images to obtain first drug entry and exit information corresponding to the drug entry and exit order, and verifying the first drug entry and exit information based on the real-time inventory table of the target smart medicine cabinet to determine whether the first drug entry and exit information is compliant;
[0008] If the first drug entry and exit information is compliant, the first drug entry and exit information is matched with a preset target smart medicine cabinet space table to obtain the space information of the target smart medicine cabinet corresponding to the drug entry and exit order; otherwise, abnormal information corresponding to the drug entry and exit order is generated;
[0009] Performing image recognition on the images of the drugs to be entered and exited based on the trained drug image recognition model to obtain second drug entry and exit information corresponding to the drugs to be entered and exited, and matching the second drug entry and exit information corresponding to the drugs to be entered and exited with the first drug entry and exit information corresponding to the drug entry and exit order to determine whether the drugs to be entered and exited are compliant;
[0010] If the drugs to be entered and issued are compliant, the real-time inventory list of the target smart medicine cabinet is updated based on the second drug entry and exit information corresponding to the drugs to be entered and issued, so as to obtain a real-time dynamic inventory table; otherwise, abnormal information corresponding to the drugs to be entered and issued is generated.
[0011] Preferably, the drug warehousing and outbound information includes the types of drugs in and out and the quantities of drugs in and out, and the space information of the target smart medicine cabinet includes the cabinet space in the target smart medicine cabinet corresponding to the space of the types of drugs in and out.
[0012] Preferably, image recognition is performed on the drug storage entry and delivery order image to obtain first drug storage entry and delivery information corresponding to the drug storage entry and delivery order, including:
[0013] Preprocessing the drug inbound and outbound order images to obtain standard drug inbound and outbound order images;
[0014] Performing text detection on the standard drug entry and exit list images using a trained text detection model to obtain drug entry and exit text image frames corresponding to the standard drug entry and exit list images;
[0015] Performing text recognition on the drug entry and exit text image frames using a trained text recognition model to obtain drug entry and exit text corresponding to the text image frames;
[0016] The drug entry and exit text is matched with a preset entry and exit text library to obtain an entry and exit text feature matching pair corresponding to the drug entry and exit text, wherein the entry and exit text feature matching pair includes the entry and exit drug types and the entry and exit drug quantities, and the entry and exit text feature matching pair is the first drug entry and exit information.
[0017] Preferably, the drug inbound and outbound order images are preprocessed to obtain standard drug inbound and outbound order images, including:
[0018] The brightness components of the L channels of the drug inbound and outbound images and the preset reference image are extracted respectively, and the histogram of the brightness component of the L channel is calculated. The calculation formula of the histogram of the brightness component of the L channel is as follows:
[0019] ;
[0020] in, Indicates that when the brightness value is The percentage of the brightness histogram value in the total pixels, , Indicates the position in the reference image is The brightness value of
[0021] Based on the histogram of the brightness component of the L channel, a cumulative histogram corresponding to the histogram of the brightness component of the L channel is calculated, and the calculation formula of the cumulative histogram is as follows:
[0022] ;
[0023] in, Indicates that when the brightness value is The value of the brightness histogram, Indicates that when the brightness value is The percentage of the brightness histogram value at the total pixels;
[0024] Compare the brightness values of each pixel in the reference image and the drug entry and exit list image to obtain a corresponding brightness transformation relationship between the two, establish a mapping function of the brightness value and the cumulative histogram based on the corresponding brightness transformation relationship, and adjust the drug entry and exit list image at each identical brightness value based on the mapping function of the brightness value and the cumulative histogram so that the drug entry and exit list image has the same cumulative histogram as the reference image.
[0025] Preferably, the text detection model includes multiple convolution modules, multiple downsampling blocks, two shuffle layers and a final layer, wherein the convolution module is composed of a convolution layer, batch normalization, a ReLU activation function, a convolution layer, batch normalization and ReLU activation in sequence, and multiple convolution modules perform feature extraction on the standard drug entry and exit single images in a stacked form, the downsampling block is composed of a convolution layer, batch normalization and a ReLU activation function in sequence, and the downsampling block is connected to the convolution module, and multiple downsampling blocks are used for downsampling, the first shuffle layer has two resolution feature inputs, and the second shuffle layer has three resolution feature inputs, the shuffle layer is used to uniformly cut each resolution feature into N cropped features, the cropped features are upsampled to the corresponding size, and connected in series to form new features, and the final layer is used to connect the features of four scales in series into a single feature map to obtain the drug entry and exit text image frames corresponding to the standard drug entry and exit single images.
[0026] Preferably, the text recognition model includes an encoder and a decoder, wherein the encoder adopts ResNet and the decoder adopts Transformer.
[0027] Preferably, the first drug storage-in and storage-out information is matched with a preset target smart medicine cabinet space table to obtain the space information of the target smart medicine cabinet corresponding to the drug storage-in and storage-out list, including:
[0028] Predefine a target smart medicine cabinet space table, wherein the target smart medicine cabinet space table includes each medicine cabinet space, capacity, medicine characteristics and a set of medicine types corresponding to the cabinet space;
[0029] Set decision variables based on the target smart medicine cabinet space table ,in, Indicates medicine Is it placed in the cabinet space? If the drug Place in cabinet space In , otherwise, .
[0030] Preferably, matching the first drug storage-in and storage-out information with a preset target smart medicine cabinet space table to obtain the space information of the target smart medicine cabinet corresponding to the drug storage-in and storage-out list further includes:
[0031] An objective function is constructed based on the first drug storage-in and storage-out information and the target smart medicine cabinet space table to maximize the drug value, wherein the objective function is as follows:
[0032] ;
[0033] in, represents the objective function, Indicates the total number of cabinet spaces of the target smart medicine cabinet, Indicates medicine Place in cabinet space Medium benefit, and , Indicates medicine The value of drugs The value of is related to the market value of the drug type. Indicates cabinet space The suitability of the cabinet space Able to effectively store medicines and is currently available, then Otherwise, , among which, the cabinet space The suitability is related to the set of drug types corresponding to the cabinet space;
[0034] The total number of cabinet spaces of the target smart medicine cabinet and the set of medicine types corresponding to the cabinet spaces are taken as constraints, and the objective function is solved by a linear programming solver based on the constraints to obtain the space information of the target smart medicine cabinet corresponding to the medicine entry and exit orders.
[0035] Preferably, the drug image recognition model adopts a convolutional neural network.
[0036] A second aspect of the present invention provides a smart medicine cabinet drug management system, which is applicable to the smart medicine cabinet drug management method, including:
[0037] An image acquisition unit, the image acquisition unit is used to acquire images of drug entry and exit orders based on a camera integrated in a target intelligent medicine cabinet to obtain images of drug entry and exit orders, and to acquire images of drugs to be entered and exited to obtain images of drugs to be entered and exited;
[0038] A document recognition unit, the document recognition unit is used to perform image recognition on the drug entry and exit order image to obtain first drug entry and exit information corresponding to the drug entry and exit order, and verify the first drug entry and exit information based on the real-time inventory table of the target intelligent medicine cabinet to determine whether the first drug entry and exit information is compliant;
[0039] A space matching unit, wherein if the first drug entry and exit information is compliant, the first drug entry and exit information is matched with a preset target smart medicine cabinet space table to obtain the space information of the target smart medicine cabinet corresponding to the drug entry and exit list; otherwise, abnormal information corresponding to the drug entry and exit list is generated;
[0040] A drug identification unit, the drug identification unit is used to perform image recognition on the images of the drugs to be entered and shipped based on a trained drug image recognition model to obtain second drug entry and shipment information corresponding to the drugs to be entered and shipped, and match the second drug entry and shipment information corresponding to the drugs to be entered and shipped with the first drug entry and shipment information corresponding to the drug entry and shipment order to determine whether the drugs to be entered and shipped are compliant;
[0041] The inventory update unit is used to update the real-time inventory list of the target intelligent medicine cabinet based on the second drug entry and exit information corresponding to the drugs to be entered and exited if the drugs to be entered and exited are compliant, so as to obtain a real-time dynamic inventory table; otherwise, abnormal information corresponding to the drugs to be entered and exited is generated.
[0042] Compared with the prior art, the above technical solution of the present invention has the following beneficial technical effects:
[0043] The present invention reduces manual intervention and improves the speed and accuracy of drug warehousing and outbound delivery through automated image recognition and real-time inventory updates. It also uses image recognition technology to ensure accurate recognition and matching of drug information, thereby reducing the risk of errors caused by manual operations. It can also monitor the warehousing and outbound delivery of drugs in real time, update inventory information in a timely manner, ensure the timeliness and accuracy of drug supply, and accurately and efficiently identify the actual number of medicine boxes and drugs placed in the cabinet to ensure consistency between drug accounts and between accounts and actuals. Through the construction and solution of the objective function, it can effectively utilize the space in the medicine cabinet and maximize storage efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 A schematic flow chart of the steps of an overall method in an embodiment of the present invention;
[0045] Figure 2 A schematic diagram of the system architecture of an overall system in an embodiment of the present invention.
[0046] Figure numerals: 1. Image acquisition unit; 2. Document recognition unit; 3. Space matching unit; 4. Drug recognition unit; 5. Inventory update unit. DETAILED DESCRIPTION
[0047] Embodiment 1, as Figure 1 As shown, the present invention proposes a smart medicine cabinet medicine management method, comprising:
[0048] S1. Based on the camera integrated in the target intelligent medicine cabinet, the image of the medicine entry and exit list is collected to obtain the images of the medicine entry and exit list, and the image of the medicine to be entered and exited is collected to obtain the images of the medicine to be entered and exited;
[0049] S2. Perform image recognition on the drug entry and exit order images to obtain first drug entry and exit information corresponding to the drug entry and exit order, and verify the first drug entry and exit information based on the real-time inventory table of the target smart medicine cabinet to determine whether the first drug entry and exit information is compliant;
[0050] S3. If the first drug entry and exit information is compliant, the first drug entry and exit information is matched with the preset target smart medicine cabinet space table to obtain the space information of the target smart medicine cabinet corresponding to the drug entry and exit order; otherwise, abnormal information corresponding to the drug entry and exit order is generated;
[0051] S4. Perform image recognition on the images of drugs to be entered and exited based on the trained drug image recognition model to obtain second drug entry and exit information corresponding to the drugs to be entered and exited, and match the second drug entry and exit information corresponding to the drugs to be entered and exited with the first drug entry and exit information corresponding to the drug entry and exit order to determine whether the drugs to be entered and exited are compliant;
[0052] S5. If the drugs to be entered and issued are compliant, the real-time inventory list of the target smart medicine cabinet is updated based on the second drug entry and exit information corresponding to the drugs to be entered and issued to obtain a real-time dynamic inventory table. Otherwise, abnormal information corresponding to the drugs to be entered and issued is generated.
[0053] Embodiment 2, a smart medicine cabinet medicine management method proposed by the present invention, compared with embodiment 1, this embodiment also includes: the medicine entry and exit information includes the entry and exit medicine types and the entry and exit medicine quantities, and the space information of the target smart medicine cabinet includes the cabinet space corresponding to the entry and exit medicine types in the target smart medicine cabinet.
[0054] In an optional embodiment, image recognition is performed on the drug storage entry and delivery order images to obtain first drug storage entry and delivery information corresponding to the drug storage entry and delivery order, including:
[0055] Preprocessing the drug inbound and outbound order images to obtain standard drug inbound and outbound order images;
[0056] Perform text detection on the standard drug inbound and outbound order images using the trained text detection model to obtain drug inbound and outbound text image frames corresponding to the standard drug inbound and outbound order images;
[0057] Perform text recognition on the drug entry and exit text image frames through the trained text recognition model to obtain the drug entry and exit text corresponding to the text image frames;
[0058] The drug entry and exit text is matched with the preset entry and exit text library to obtain the entry and exit text feature matching pairs corresponding to the drug entry and exit texts, wherein the entry and exit text feature matching pairs include the entry and exit drug types and the entry and exit drug quantities, and the entry and exit text feature matching pairs are the first drug entry and exit information.
[0059] In an optional embodiment, preprocessing operations are performed on the drug inbound and outbound order images to obtain standard drug inbound and outbound order images, including:
[0060] The brightness components of the L channels of the drug inbound and outbound images and the preset reference image are extracted respectively, and the histogram of the brightness component of the L channel is calculated. The calculation formula of the histogram of the brightness component of the L channel is as follows:
[0061] ;
[0062] in, Indicates that when the brightness value is The percentage of the brightness histogram value in the total pixels, Indicates the width and height of the drug inbound and outbound images, and , Indicates the position in the reference image is The brightness value of
[0063] Based on the histogram of the brightness component of the L channel, the cumulative histogram corresponding to the histogram of the brightness component of the L channel is calculated. The calculation formula of the cumulative histogram is as follows:
[0064] ;
[0065] in, Indicates that when the brightness value is The value of the brightness histogram, Indicates that when the brightness value is The percentage of the brightness histogram value at the total pixels;
[0066] The brightness values of each pixel in the reference image and the drug entry and exit list image are compared to obtain the corresponding brightness transformation relationship between the two, and a mapping function of the brightness value and the cumulative histogram is established based on the corresponding brightness transformation relationship. The drug entry and exit list image is adjusted at each identical brightness value based on the mapping function of the brightness value and the cumulative histogram so that the drug entry and exit list image has the same cumulative histogram as the reference image.
[0067] It should be noted that the L channel refers to the brightness channel in the HSL (hue, saturation, brightness) color space, which represents the brightness information of each pixel in the image; the histogram is a graphical representation used to show the distribution of each brightness value in the image by counting the frequency of occurrence of each brightness value; the cumulative histogram calculates the cumulative value of the histogram, which represents the percentage of all pixels with brightness values less than or equal to a certain value, helping to analyze the overall brightness distribution of the image; the mapping function converts the input brightness value into a new brightness value through a mathematical relationship to adjust the image brightness so that it matches the histogram of the reference image; the reference image is a standard image used for comparison or correction.
[0068] In an optional embodiment, the text detection model includes multiple convolution modules, multiple downsampling blocks, two shuffle layers and a final layer, wherein the convolution module is composed of a convolution layer, batch normalization, a ReLU activation function, a convolution layer, batch normalization and ReLU activation in sequence, and multiple convolution modules perform feature extraction on standard drug entry and exit single images in a stacked form, the downsampling block is composed of a convolution layer, batch normalization and a ReLU activation function in sequence, and the downsampling block is connected to the convolution module, and multiple downsampling blocks are used for downsampling, the first shuffle layer has two resolution feature inputs, and the second shuffle layer has three resolution feature inputs, the shuffle layer is used to uniformly cut each resolution feature into N cropped features, the cropped features are upsampled to the corresponding size, and connected in series to form new features, and the final layer is used to connect the features of four scales in series into a single feature map to obtain the drug entry and exit text image frames corresponding to the standard drug entry and exit single images.
[0069] It should be noted that the text image box refers to the bounding box used to locate and identify the text area in the text detection task.
[0070] In an optional embodiment, the text recognition model includes an encoder and a decoder, wherein the encoder adopts ResNet and the decoder adopts Transformer.
[0071] It should be noted that ResNet is a deep convolutional neural network architecture that solves the gradient vanishing problem in deep network training through residual connections, allowing information to flow more efficiently in the network; Transformer is a model architecture based on the self-attention mechanism that is good at processing sequence data. It provides powerful contextual understanding capabilities by capturing the relationship between different parts of the input sequence.
[0072] In an optional embodiment, the first drug storage-in and storage-out information is matched with a preset target smart medicine cabinet space table to obtain the space information of the target smart medicine cabinet corresponding to the drug storage-in and storage-out list, including:
[0073] Predefine a target smart medicine cabinet space table, the target smart medicine cabinet space table includes each medicine cabinet space, capacity, medicine characteristics and a set of medicine types corresponding to the cabinet space;
[0074] Set decision variables based on the target smart medicine cabinet space table ,in, Indicates medicine Is it placed in the cabinet space? If the drug Place in cabinet space In , otherwise, .
[0075] In an optional embodiment, the first drug storage-in and storage-out information is matched with a preset target smart medicine cabinet space table to obtain the space information of the target smart medicine cabinet corresponding to the drug storage-in and storage-out order, and further includes:
[0076] Based on the first drug storage and outbound information and the target smart medicine cabinet space table, an objective function is constructed to maximize the drug value, wherein the objective function is as follows:
[0077] ;
[0078] in, represents the objective function, Indicates the total number of cabinet spaces of the target smart medicine cabinet, Indicates medicine Place in cabinet space Medium benefit, and , Indicates medicine The value of drugs The value of is related to the market value of the drug type. Indicates cabinet space The suitability of the cabinet space Able to effectively store medicines and is currently available, then Otherwise, , among which, the cabinet space The suitability is related to the set of drug types corresponding to the cabinet space;
[0079] The total number of cabinet spaces of the target smart medicine cabinet and the set of medicine types corresponding to the cabinet spaces are taken as constraints. Based on the constraints, the objective function is solved by a linear programming solver to obtain the space information of the target smart medicine cabinet corresponding to the medicine entry and exit orders.
[0080] It should be noted that linear programming is a mathematical optimization method that aims to maximize or minimize a linear objective function through linear constraints. It is suitable for problems such as resource allocation and production scheduling. A linear programming solver is an algorithm or software tool used to solve linear programming problems. Commonly used solvers include the Simplex algorithm, the interior point method, etc., which can handle optimization problems and return the optimal solution.
[0081] In an optional embodiment, the drug image recognition model adopts a convolutional neural network.
[0082] It should be noted that convolutional neural network (CNN) is a deep learning model specially designed for processing image data. It extracts features through convolution layers and uses pooling layers to reduce dimensions, thereby capturing spatial hierarchical structures. CNN has automatic feature extraction and highly effective parameter sharing capabilities. It is widely used in image and text recognition, target detection, and video analysis. Its structure usually contains multiple convolutional layers, activation functions, pooling layers, and fully connected layers, which enable the network to gradually learn complex features from the original image.
[0083] Embodiment three, as Figure 2 As shown, a smart medicine cabinet drug management system is applicable to the above-mentioned smart medicine cabinet drug management method, comprising:
[0084] The image acquisition unit 1 is used to acquire images of drug entry and exit orders based on a camera integrated in the target intelligent medicine cabinet to obtain images of drug entry and exit orders, and to acquire images of drugs to be entered and exited to obtain images of drugs to be entered and exited;
[0085] The document recognition unit 2 is used to perform image recognition on the drug entry and exit order images to obtain the first drug entry and exit information corresponding to the drug entry and exit order, and verify the first drug entry and exit information based on the real-time inventory table of the target intelligent medicine cabinet to determine whether the first drug entry and exit information is compliant;
[0086] The space matching unit 3 is used to match the first drug entry and exit information with the preset target smart medicine cabinet space table if the first drug entry and exit information is compliant, so as to obtain the space information of the target smart medicine cabinet corresponding to the drug entry and exit list, otherwise, to generate abnormal information corresponding to the drug entry and exit list;
[0087] The drug identification unit 4 is used to perform image recognition on the images of drugs to be entered and exited based on the trained drug image recognition model to obtain the second drug entry and exit information corresponding to the drugs to be entered and exited, and match the second drug entry and exit information corresponding to the drugs to be entered and exited with the first drug entry and exit information corresponding to the drug entry and exit order to determine whether the drugs to be entered and exited are compliant;
[0088] The inventory update unit 5 is used to update the real-time inventory list of the target intelligent medicine cabinet based on the second drug entry and exit information corresponding to the drugs to be entered and exited if the drugs to be entered and exited are compliant, so as to obtain a real-time dynamic inventory table; otherwise, abnormal information corresponding to the drugs to be entered and exited is generated.
[0089] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited thereto, and various changes can be made within the knowledge scope of technicians in the relevant technical field without departing from the purpose of the present invention.
Claims
1. A method for managing medicines in an intelligent medicine cabinet, characterized in that: include: Based on the camera integrated in the target intelligent medicine cabinet, the image of the medicine entry and exit list is collected to obtain the images of the medicine entry and exit list, and the image of the medicine to be entered and exited is collected to obtain the images of the medicine to be entered and exited; Performing image recognition on the drug entry and exit order images to obtain first drug entry and exit information corresponding to the drug entry and exit order, and verifying the first drug entry and exit information based on the real-time inventory table of the target smart medicine cabinet to determine whether the first drug entry and exit information is compliant; If the first drug entry and exit information is compliant, the first drug entry and exit information is matched with a preset target smart medicine cabinet space table to obtain the space information of the target smart medicine cabinet corresponding to the drug entry and exit order; otherwise, abnormal information corresponding to the drug entry and exit order is generated; Performing image recognition on the images of the drugs to be entered and exited based on the trained drug image recognition model to obtain second drug entry and exit information corresponding to the drugs to be entered and exited, and matching the second drug entry and exit information corresponding to the drugs to be entered and exited with the first drug entry and exit information corresponding to the drug entry and exit order to determine whether the drugs to be entered and exited are compliant; If the drugs to be stored and shipped are compliant, the real-time inventory list of the target intelligent medicine cabinet is updated based on the second drug storage and shipment information corresponding to the drugs to be stored and shipped, so as to obtain a real-time dynamic inventory table; otherwise, abnormal information corresponding to the drugs to be stored and shipped is generated; Performing image recognition on the drug storage entry and delivery order image to obtain first drug storage entry and delivery information corresponding to the drug storage entry and delivery order, including: Preprocessing the drug inbound and outbound order images to obtain standard drug inbound and outbound order images; Performing text detection on the standard drug entry and exit list images using a trained text detection model to obtain drug entry and exit text image frames corresponding to the standard drug entry and exit list images; Performing text recognition on the drug entry and exit text image frames using a trained text recognition model to obtain drug entry and exit text corresponding to the text image frames; Matching the drug entry and exit text with a preset entry and exit text library to obtain an entry and exit text feature matching pair corresponding to the drug entry and exit text, wherein the entry and exit text feature matching pair includes the entry and exit drug types and the entry and exit drug quantities, and the entry and exit text feature matching pair is the first drug entry and exit information; The drug inbound and outbound order images are preprocessed to obtain standard drug inbound and outbound order images, including: The brightness components of the L channels of the drug inbound and outbound images and the preset reference image are extracted respectively, and the histogram of the brightness component of the L channel is calculated. The calculation formula of the histogram of the brightness component of the L channel is as follows: ; in, Indicates that the brightness value is The percentage of the brightness histogram value in the total pixels, and Indicates the width and height of the drug inbound and outbound images, and , Indicates the position in the reference image is The brightness value of Based on the histogram of the brightness component of the L channel, a cumulative histogram corresponding to the histogram of the brightness component of the L channel is calculated, and the calculation formula of the cumulative histogram is as follows: ; in, Indicates that the brightness value is The value of the brightness histogram, Indicates that the brightness value is The percentage of the brightness histogram value at the total pixels; Compare the brightness values of each pixel in the reference image and the drug entry and exit list image to obtain a corresponding brightness transformation relationship between the two, establish a mapping function of the brightness value and the cumulative histogram based on the corresponding brightness transformation relationship, and adjust the drug entry and exit list image at each identical brightness value based on the mapping function of the brightness value and the cumulative histogram so that the drug entry and exit list image has the same cumulative histogram as the reference image.
2. The smart medicine cabinet medicine management method according to claim 1, characterized in that: The drug in-warehouse and out-warehouse information includes the types of in-warehouse and out-warehouse drugs and the quantities of in-warehouse and out-warehouse drugs, and the space information of the target smart medicine cabinet includes the cabinet space in the target smart medicine cabinet corresponding to the space of the in-warehouse and out-warehouse drug types.
3. The intelligent medicine cabinet medicine management method according to claim 1, characterized in that: The text detection model includes multiple convolution modules, multiple downsampling blocks, two shuffle layers and a final layer, wherein the convolution module is composed of a convolution layer, batch normalization, a ReLU activation function, a convolution layer, batch normalization and ReLU activation in sequence, and multiple convolution modules perform feature extraction on the standard drug entry and exit single images in a stacked form, the downsampling block is composed of a convolution layer, batch normalization and a ReLU activation function in sequence, and the downsampling block is connected to the convolution module, and multiple downsampling blocks are used for downsampling, the first shuffle layer has two resolution feature inputs, and the second shuffle layer has three resolution feature inputs, the shuffle layer is used to evenly cut each resolution feature into N cropped features, the cropped features are upsampled to the corresponding size, and are connected in series to form new features, and the final layer is used to connect the features of four scales in series into a single feature map to obtain the drug entry and exit text image frames corresponding to the standard drug entry and exit single images.
4. The smart medicine cabinet medicine management method according to claim 1, characterized in that: The text recognition model includes an encoder and a decoder, wherein the encoder adopts ResNet and the decoder adopts Transformer.
5. The intelligent medicine cabinet medicine management method according to claim 1, characterized in that: Matching the first drug storage-in and storage-out information with a preset target smart medicine cabinet space table to obtain the space information of the target smart medicine cabinet corresponding to the drug storage-in and storage-out list includes: Predefine a target smart medicine cabinet space table, wherein the target smart medicine cabinet space table includes each medicine cabinet space, capacity, medicine characteristics and a set of medicine types corresponding to the cabinet space; Set decision variables based on the target smart medicine cabinet space table ,in, Indicates medicine Is it placed in the cabinet space? If the drug Place in cabinet space In , otherwise, .
6. The intelligent medicine cabinet medicine management method according to claim 5, characterized in that: The first drug storage-in and storage-out information is matched with a preset target smart medicine cabinet space table to obtain the space information of the target smart medicine cabinet corresponding to the drug storage-in and storage-out list, and further includes: An objective function is constructed based on the first drug storage-in and storage-out information and the target smart medicine cabinet space table to maximize the drug value, wherein the objective function is as follows: ; in, represents the objective function, Indicates the total number of cabinet spaces of the target smart medicine cabinet, Indicates medicine Place in cabinet space Medium benefit, and , Indicates medicine The value of drugs The value of is related to the market value of the drug type. Indicates cabinet space The suitability of the cabinet space Effective storage of medicines and is currently available, then , otherwise, , among which, the cabinet space The suitability is related to the set of drug types corresponding to the cabinet space; The total number of cabinet spaces of the target smart medicine cabinet and the set of medicine types corresponding to the cabinet spaces are taken as constraints, and the objective function is solved by a linear programming solver based on the constraints to obtain the space information of the target smart medicine cabinet corresponding to the medicine entry and exit orders.
7. The smart medicine cabinet medicine management method according to claim 1, characterized in that: The drug image recognition model adopts a convolutional neural network.
8. An intelligent medicine cabinet drug management system, used to implement an intelligent medicine cabinet drug management method as claimed in any one of claims 1 to 7, characterized in that: include: An image acquisition unit (1), the image acquisition unit (1) being used to acquire images of drug entry and exit orders based on a camera integrated in a target intelligent medicine cabinet to obtain images of drug entry and exit orders, and to acquire images of drugs to be entered and exited to obtain images of drugs to be entered and exited; A document recognition unit (2), the document recognition unit (2) is used to perform image recognition on the drug storage entry and delivery order image to obtain first drug storage entry and delivery information corresponding to the drug storage entry and delivery order, and verify the first drug storage entry and delivery information based on the real-time inventory table of the target intelligent medicine cabinet to determine whether the first drug storage entry and delivery information is compliant; A space matching unit (3), wherein the space matching unit (3) is used to match the first drug entry and exit information with a preset target smart medicine cabinet space table if the first drug entry and exit information is compliant, so as to obtain the space information of the target smart medicine cabinet corresponding to the drug entry and exit list; otherwise, to generate abnormal information corresponding to the drug entry and exit list; A drug identification unit (4), the drug identification unit (4) is used to perform image recognition on the image of the drug to be entered and shipped based on a trained drug image recognition model to obtain second drug entry and shipment information corresponding to the drug to be entered and shipped, and match the second drug entry and shipment information corresponding to the drug to be entered and shipped with the first drug entry and shipment information corresponding to the drug entry and shipment order to determine whether the drug to be entered and shipped is compliant; The inventory updating unit (5) is used to update the real-time inventory list of the target intelligent medicine cabinet based on the second drug entry and exit information corresponding to the drugs to be entered and exited if the drugs to be entered and exited are compliant, so as to obtain a real-time dynamic inventory table; otherwise, abnormal information corresponding to the drugs to be entered and exited is generated.
Citation Information
Patent Citations
Goods storage warehouse-in and warehouse-out management method, device and equipment and storage medium
CN114781974A
Hospital medicine intelligent management system
CN117976136A