Intelligent medicine sorting processing method, system and medium

The drug sorting method, which combines a multimodal mechanism and a dual-threshold judgment mechanism with the comprehensive confidence calculation of drug barcode, visual and weight information, solves the problem of the single verification method in drug sorting and realizes an efficient and reliable drug sorting process.

CN121372899BActive Publication Date: 2026-04-28TAIZHOU VOCATIONAL COLLEGE OF SCI & TECH
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TAIZHOU VOCATIONAL COLLEGE OF SCI & TECH
Filing Date
2025-12-25
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing drug sorting and processing methods suffer from a lack of diverse drug information verification methods, resulting in low accuracy in drug sorting and a high risk of incorrect dispensing, which can negatively impact patient health.

Method used

A multimodal mechanism is used to obtain the barcode confidence, visual confidence, and weight confidence of drugs. A dynamic weight allocation strategy is used to fuse and calculate the overall confidence of the drug. A dual threshold judgment mechanism is used to verify the drug. Combined with a manual re-inspection process, the quality and safety of the drug are ensured.

Benefits of technology

It improves the accuracy and efficiency of drug sorting and processing, avoids incorrect drug dispensing, and enhances the robustness and reliability of drug sorting and processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121372899B_ABST
    Figure CN121372899B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of medicine intelligent sorting processing method, system and medium, the method is by respectively collecting medicine electronic supervision bar code image, visual detection processing and medicine weight information to the medicine transported to sorting station, processing obtains medicine bar code confidence, medicine visual confidence and medicine weight confidence, all confidence obtained by fusion processing is obtained Medicine comprehensive confidence, and the medicine comprehensive confidence is respectively judged with first pre-set confidence threshold and second pre-set confidence threshold, to determine whether the medicine is executed medicine delivery, intercept medicine delivery or medicine reinspection processing, avoid to be wrongly given patient due to quality or other security problems.Error delivery.For the medicine comprehensive confidence between two pre-set confidence thresholds, the method does not forcibly make high-risk decision, but starts more careful reinspection process to introduce manual audit process, greatly improves the robustness and reliability of medicine intelligent sorting processing method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of pharmaceutical sorting, and more particularly to a method, system, and medium for intelligent pharmaceutical sorting. Background Technology

[0002] With the continuous development of intelligent technology, pharmacy systems are gradually evolving from traditional manual drug sorting to intelligent drug sorting and processing, and this is being implemented more and more maturely.

[0003] In the current intelligent drug sorting and processing process, pharmacy staff (such as pharmacists) mainly perform manual review based on doctors' prescriptions, and then manually or by machine search the pharmacy's inventory to find the drug and verify the dosage. After the drug is found and the dosage is verified to be correct, it is then dispensed to the corresponding patient.

[0004] However, existing drug sorting and processing methods have shortcomings: the verification method based on doctors' prescriptions is too simplistic, which can easily lead to the wrong distribution of problematic drugs due to the failure to verify the accuracy of drug information through multiple methods. This not only reduces the accuracy and efficiency of drug sorting, but also has an adverse effect on the health of patients who are given the wrong drugs. Summary of the Invention

[0005] The first technical problem to be solved by the present invention is to provide a smart drug sorting and processing method that can comprehensively and accurately verify drug information, in light of the above-mentioned prior art.

[0006] The second technical problem to be solved by the present invention is to provide a drug intelligent sorting and processing system that implements the above-mentioned drug intelligent sorting and processing method, in view of the prior art.

[0007] The third technical problem to be solved by the present invention is to provide a readable storage medium for implementing the above-mentioned intelligent drug sorting and processing method.

[0008] The technical solution adopted by this invention to solve the first technical problem is: a method for intelligent sorting and processing of pharmaceuticals, characterized by comprising the following steps:

[0009] Step 1: Collect the electronic drug supervision barcode image of the medicines transported to the sorting station and process the electronic drug supervision barcode image to calculate the confidence level of the drug barcode;

[0010] Step 2: Perform visual inspection on the medicines delivered to the sorting station and calculate the visual confidence level of the medicines;

[0011] Step 3: Obtain and process the weight information of the medicines delivered to the sorting station, and calculate the confidence level of the medicine weight.

[0012] Step 4: The obtained drug barcode confidence, drug visual confidence, and drug weight confidence are fused to calculate the overall drug confidence.

[0013] Step 5: Make a judgment based on the obtained overall confidence level of the drug and the first preset confidence threshold:

[0014] When the overall confidence level of the drug is greater than the first preset confidence threshold, it is determined that the drug delivered to the sorting station has passed the multimodal verification and the drug is issued; otherwise, proceed to step 6.

[0015] Step 6: Make a judgment based on the obtained overall confidence level of the drug and the second preset confidence threshold:

[0016] When the overall confidence level of the drug is less than the second preset confidence threshold, it is determined that the drug delivered to the sorting station has failed the multimodal verification and the drug is intercepted for distribution; otherwise, the drug delivered to the sorting station is subjected to re-inspection; wherein, the second preset confidence threshold is less than the first preset confidence threshold.

[0017] Improved, in the intelligent drug sorting and processing method, the confidence level of the drug barcode is calculated as follows:

[0018] The drug's electronic regulatory barcode image is decoded to obtain the drug's regulatory information;

[0019] The drug regulatory information is compared with the drug regulatory information already stored in the drug regulatory database of the State Drug Administration to generate an initial decoding similarity score.

[0020] Computer vision technology was used to analyze the edge integrity, module fill degree, and soiled area of ​​the electronic drug supervision barcode image to obtain a quantified barcode damage value;

[0021] Based on the obtained decoding similarity score and barcode damage value, the confidence level of the drug barcode for electronic drug supervision is calculated.

[0022] Furthermore, in the aforementioned intelligent drug sorting and processing method, the calculation method for the visual confidence level of the drug is as follows:

[0023] Collect image information of medicines transported to the sorting station;

[0024] Using cosine similarity, the collected drug image information is matched with a pre-stored standard image of the drug to obtain an image similarity score for the drug image information, and the image similarity score is used as the visual confidence of the drug.

[0025] Furthermore, in the aforementioned intelligent drug sorting and processing method, the drug weight confidence level is calculated as follows:

[0026] S weight =1-| W actual - W standard | / (k·σ);k ∈[2.5,3];

[0027] in, S weight Confidence level for drug weight. W actual This refers to the actual weight of the medicine. W standard σ is the standard weight of the drug, σ is the standard deviation of all historical weights of the drug, and k is the adjustment factor.

[0028] Improved, in the intelligent drug sorting and processing method, in step 4, the fusion processing is the processing of each confidence level based on a dynamic weight allocation strategy; wherein, the calculation method of the overall confidence level of the drug is as follows:

[0029] S 综合 = α · S code + β · S image + γ · S weight ; α + β + γ =1;

[0030] in, S 综合 To assess the overall confidence level of the drug, S code For the confidence level of drug barcodes, S image For visual confidence of drugs, S weight α represents the confidence level for drug weight; α represents the confidence level assigned to the drug barcode. S code The dynamic weights, β, are assigned to the visual confidence level of the drug. S image The dynamic weights, γ, are the confidence scores assigned to the weight of the drug. S weight Dynamic weights.

[0031] Furthermore, in the intelligent drug sorting and processing method, the dynamic weight allocation strategy is set according to the drug type and the environmental conditions at the sorting station.

[0032] Further improvements include, in the intelligent drug sorting and processing method, the dynamic weight allocation strategy includes a dynamic weight allocation strategy based on drug type and a dynamic weight allocation strategy based on environmental conditions; wherein:

[0033] The dynamic weight allocation strategy based on drug type is as follows:

[0034] When the drug is a fully packaged drug, the dynamic weight assigned to the drug barcode confidence level is the highest among the drug barcode confidence level, the drug visual confidence level, and the drug weight confidence level.

[0035] When the medicine is a medicine that is sold in smaller quantities or a medicine whose appearance is easily damaged, the dynamic weights assigned to the drug visual confidence and drug weight confidence are increased respectively in the drug barcode confidence, drug visual confidence and drug weight confidence.

[0036] When the drug is a liquid preparation, the dynamic weight assigned to the drug weight confidence level is the highest among the drug barcode confidence level, the drug visual confidence level, and the drug weight confidence level.

[0037] The dynamic weight allocation strategy based on environmental conditions is as follows:

[0038] If the lighting intensity at the sorting station is weak, reduce the dynamic weight assigned to the visual confidence score of the medicine.

[0039] If significant vibration occurs at the sorting station, reduce the dynamic weight assigned to the confidence level of drug weight.

[0040] Improved, in the intelligent drug sorting and processing method, step 6, the re-inspection process includes the following steps:

[0041] Re-acquire images of the drug to obtain re-inspection images of the drug;

[0042] The weight information of the drug is retrieved again to obtain the drug re-inspection weight information;

[0043] The images and weight information of the re-inspected drugs are sent to the pharmacist simultaneously, so that the pharmacist can perform manual verification and review based on the images and weight information.

[0044] The technical solution adopted by this invention to solve the second technical problem is: a drug intelligent sorting and processing system, which implements the aforementioned drug intelligent sorting and processing method, characterized in that the drug intelligent sorting and processing system includes:

[0045] The drug image acquisition device is configured to acquire images of the electronic drug supervision barcodes of drugs transported to the sorting station.

[0046] The drug visual inspection device is configured to perform visual inspection on drugs transported to the sorting station and obtain visual inspection information of the drug.

[0047] The drug weight acquisition device is configured to acquire the drug weight information of drugs transported to the sorting station.

[0048] The processor, connected to a drug image acquisition device, a drug visual inspection device, and a drug weight acquisition device, is configured to process the drug electronic supervision barcode image acquired by the drug image acquisition device to obtain the drug barcode confidence score, process the visual inspection information detected by the drug visual inspection device to obtain the drug visual confidence score, and process the drug weight information acquired by the drug weight acquisition device to obtain the drug weight confidence score. Furthermore, it performs a fusion process based on the obtained drug barcode confidence score, drug visual confidence score, and drug weight confidence score to obtain a comprehensive drug confidence score. It then performs judgment processing on the comprehensive drug confidence score, a first preset confidence threshold, and a second preset confidence threshold to determine whether the drug delivered to the sorting station has passed multimodal verification and to execute drug dispensing, intercept drug dispensing, or perform re-inspection processing.

[0049] The technical solution adopted by the present invention to solve the third technical problem is: a readable storage medium having a computer program stored thereon, characterized in that, when the computer program is executed by a processor, it implements any of the intelligent drug sorting and processing methods described in the present invention.

[0050] Compared with existing technologies, the advantages of this invention are as follows: The intelligent drug sorting and processing method of this invention obtains the drug barcode confidence level, drug visual confidence level, and drug weight confidence level of the drugs delivered to the sorting station through a multimodal mechanism, and then fuses them to obtain the comprehensive drug confidence level. A dual-threshold judgment mechanism is adopted for the obtained comprehensive drug confidence level, thereby creating a "buffer zone" or "prudent decision zone" for judging the comprehensive drug confidence level. For high and low confidence level results of the comprehensive drug confidence level, a decision can be made quickly and automatically to ensure efficiency. Once the comprehensive drug confidence level is lower than the second preset confidence level threshold, the drug is intercepted for dispensing; if the comprehensive drug confidence level is higher than the first preset confidence level threshold, the drug is dispensed, thus avoiding incorrect dispensing to patients due to quality or other safety issues. In addition, for drugs with a comprehensive confidence level between two preset confidence thresholds, the intelligent drug sorting and processing method does not force high-risk decisions, but instead initiates a more prudent re-inspection process to introduce manual review, thereby greatly improving the robustness and reliability of the intelligent drug sorting and processing method. Attached Figure Description

[0051] Figure 1 This is a schematic diagram of the intelligent drug sorting and processing method in an embodiment of the present invention;

[0052] Figure 2 This is a schematic diagram of a drug intelligent sorting and processing system in an embodiment of the present invention. Detailed Implementation

[0053] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.

[0054] This embodiment provides a method for intelligent sorting and processing of pharmaceuticals. See also... Figure 1 As shown, the intelligent drug sorting and processing method of this embodiment includes the following steps 1 to 6:

[0055] Step 1: Collect the electronic drug supervision barcode image of the medicines transported to the sorting station and process the electronic drug supervision barcode image to calculate the confidence level of the drug barcode;

[0056] In this embodiment, the confidence level of the drug barcode is calculated using the following steps a1~a4:

[0057] Step a1: Decode the electronic regulatory barcode image of the drug to obtain the drug regulatory information;

[0058] Step a2 involves comparing the drug regulatory information with the drug regulatory information already stored in the drug regulatory database of the State Drug Administration to generate an initial decoding similarity score.

[0059] Here, the decoding similarity score is labeled as S similarity。 The specific steps for generating the decoding similarity score are as follows: a21~a24:

[0060] Step a21: After preprocessing the acquired electronic drug supervision barcode image, it is sent to the decoder for decryption to obtain a bit sequence. The preprocessing steps here include grayscale conversion, binarization, geometric correction, and noise suppression. The decoded bit sequence is labeled D. decoded ;

[0061] Step a22: Compare the decoded bit sequence with the standard reference sequence D retrieved from the drug regulatory authority's database. reference A bit-by-bit comparison is performed to obtain the number of differing bits and the basic similarity. The number of differing bits is denoted as E, and the basic similarity is denoted as [missing value]. S raw ; S raw =1-E / N' ; N’ The decoded bit sequence D decodedThe sequence length;

[0062] Step a23: Calculate the log-likelihood ratio of each decoded bit and the overall confidence of the decoded bit sequence; wherein, the overall confidence of the decoded bit sequence is denoted as... S LLR :

[0063] ; 1≤n≤ N’ ;

[0064] in, LLR n The decoded bit sequence D decoded The log-likelihood ratio of the nth bit within;

[0065] Step a24: Calculate the decoding similarity score based on the obtained basic similarity and overall confidence; the formula for calculating the decoding similarity score is as follows: S similarity =λ· sigmoid ( S LLR )+(1-λ)· S raw λ is the weighting coefficient. sigmoid ( S LLR ) is used to assign confidence values S LLR A logical function that maps values ​​to the interval [0,1].

[0066] Step a3: Analyze the edge integrity, module fill degree, and damaged area of ​​the drug electronic supervision barcode image using computer vision technology to obtain a quantified barcode damage value; this barcode damage value is denoted as D. damage ;

[0067] In this embodiment, the method for obtaining the quantified barcode damage value based on the edge integrity, module fill degree, and damaged area of ​​the drug electronic supervision barcode image is as follows: steps a31-36:

[0068] Step a31: Apply the Canny edge detection algorithm to the preprocessed binarized barcode image to extract the contour and obtain the edge line segments;

[0069] Step a32: Perform Hough transform line detection or use a contour tracking algorithm on the detected edge segments to calculate the edge integrity score of the edge segments; wherein, the edge integrity score of the edge segments is labeled as E. score :

[0070] E score =1-L1 / L2;

[0071] Where L1 is the sum of edge break lengths and values ​​among all edge segments, and L2 is the sum of ideal edge lengths and values; edge breaks are identified by analyzing the distance and angle deviations between adjacent edge segments;

[0072] Step a33: Using projection segmentation or connected component analysis, the electronic drug supervision barcode image is segmented into independent unit modules, and the proportion of expected color pixels within each module region and the fill score of each module are calculated; here, the expected color pixels are the black pixels in the black module, and the module fill score is denoted as F. score :

[0073] ;

[0074] Where M represents the total number of unit modules obtained after segmenting the electronic drug supervision barcode image, and q m Q represents the expected number of color pixels in the m-th unit module. m The total number of pixels in the m-th unit module; the fill score F for any module. score If the score is below the preset module fill threshold, then any module will be marked as a defective module.

[0075] Step a34: Apply morphological operations to the original grayscale or binary image of the drug electronic supervision barcode image while preserving the main bar and space structure to obtain the morphologically processed image.

[0076] Step a35: Perform a difference operation between the obtained morphologically processed image and the ideal image template to obtain the percentage of contaminated area in the morphologically processed image; wherein, the percentage of contaminated area in the morphologically processed image is denoted as A. ratio :

[0077] A ratio =A1 / A2;

[0078] Where A1 is the total number of significantly non-zero pixels in the differential image, and A2 is the total number of pixels in the barcode area corresponding to the electronic drug supervision barcode image;

[0079] Step a36: Based on the edge integrity score, module fill score, and percentage of soiled area of ​​the obtained edge segments, calculate the barcode damage value; the formula for calculating the barcode damage value is as follows:

[0080] D damage =ω e ·(1-E score )+ ω f ·(1-F score )+ ω a ·A ratio +b;

[0081] Where, ω e Edge integrity score E score The corresponding weight, ω f Module fill score F score The corresponding weight, ω a b represents the weight corresponding to the percentage of soiled area, and b is the bias term.

[0082] Step a4: Based on the obtained decoding similarity score and barcode damage value, calculate the confidence level of the drug barcode for electronic drug supervision; wherein, the confidence level of the drug barcode is marked as... S code :

[0083] S code = S similarity ·(1-D damage ); S similarity ∈[0,1],D damage ∈[0,1];

[0084] in, S similarity To decode the similarity score, D damage This is the barcode damage level value.

[0085] Step 2: Perform visual inspection on the medicines delivered to the sorting station and calculate the visual confidence level of the medicines;

[0086] For example, in this embodiment, the calculation of the visual confidence level of the drug is performed as follows: steps b1-b2:

[0087] Step b1: Collect image information of the medicines transported to the sorting station.

[0088] Step b2: Using cosine similarity, the acquired drug image information is matched with a pre-stored standard image of the drug to obtain an image similarity score for the drug image information. This image similarity score is used as the aforementioned visual confidence score of the drug; wherein, the visual confidence score of the drug is labeled as... S image :

[0089] ;

[0090] in, A i This represents the i-th feature component of the collected drug image information. B i This represents the i-th feature component of the pre-stored standard image of the drug; NThis represents the total number of feature components in the collected drug image information.

[0091] Step 3: Obtain and process the weight information of the medicines delivered to the sorting station, and calculate the confidence level of the medicine weight; wherein, in this embodiment, the calculation method of the confidence level of the medicine weight is as follows:

[0092] S weight =1-| W actual - W standard | / (k·σ);k ∈[2.5,3];

[0093] in, S weight Confidence level for drug weight. W actual This refers to the actual weight of the medicine. W standard Let σ be the standard weight of the drug, and k be the standard deviation of all historical weights of the drug. Regarding the confidence level of drug weight, the calculation method in this embodiment conforms to the scientific setting of statistical laws. This method acknowledges the normal fluctuations in drug weight and still assigns high confidence to small deviations (e.g., within 1·σ). Only when the deviation of drug weight exceeds the statistical control range (e.g., 3σ) will the confidence level of drug weight drop sharply, thereby effectively reducing false alarms caused by normal fluctuations in drug weight.

[0094] Step 4: The obtained drug barcode confidence score, drug visual confidence score, and drug weight confidence score are fused to calculate the overall drug confidence score. This fusion process involves applying a dynamic weight allocation strategy to each confidence score. The calculation method for the overall drug confidence score is as follows:

[0095] S 综合 = α · S code + β · S image + γ · S weight ; α + β + γ =1;

[0096] in, S 综合 To assess the overall confidence level of the drug, S code For the confidence level of drug barcodes,S image For visual confidence of drugs, S weight α represents the confidence level for drug weight; α represents the confidence level assigned to the drug barcode. S code The dynamic weights, β, are assigned to the visual confidence level of the drug. S image The dynamic weights, γ, are the confidence scores assigned to the weight of the drug. S weight Dynamic weights;

[0097] Step 5: Make a judgment based on the obtained overall confidence level of the drug and the first preset confidence threshold:

[0098] When the overall confidence level of the drug is greater than the first preset confidence threshold, it is determined that the drug delivered to the sorting station has passed the multimodal verification and the drug is issued; otherwise, proceed to step 6.

[0099] Step 6: Make a judgment based on the obtained overall confidence level of the drug and the second preset confidence threshold:

[0100] When the overall confidence level of the drug is less than the second preset confidence threshold, the drug delivered to the sorting station is determined to have failed the multimodal validation and its dispensing is intercepted; otherwise, the drug delivered to the sorting station is subjected to a re-inspection process; wherein, the second preset confidence threshold is less than the first preset confidence threshold. For example, in this embodiment, the first preset confidence threshold is set to 0.95 and the second preset confidence threshold is set to 0.5.

[0101] In this embodiment of the intelligent drug sorting and processing method, a dual-threshold judgment mechanism is adopted for the overall confidence level of the obtained drugs, thereby creating a "buffer zone" or "prudent decision zone" for judging the overall confidence level of drugs. For results with high and low confidence levels of the overall confidence level of drugs, decisions can be made quickly and automatically to ensure efficiency. Once the overall confidence level of a drug is lower than a second preset confidence threshold (which can be called the "interception threshold"), the drug dispensing is intercepted; conversely, once the overall confidence level of a drug is higher than a first preset confidence threshold (which can be called the "verification pass threshold"), the drug is dispensed, avoiding incorrect dispensing to patients due to quality or other safety issues. Furthermore, for overall confidence levels of drugs between the two preset confidence thresholds, this embodiment of the intelligent drug sorting and processing method does not force a high-risk decision, but instead initiates a more prudent re-inspection process to introduce manual review, thereby greatly improving the robustness and reliability of the intelligent drug sorting and processing method.

[0102] It should be noted that in step 4 of this embodiment, the aforementioned dynamic weight allocation strategy is set according to the drug type and the environmental conditions at the sorting station. Specifically, the dynamic weight allocation strategy here includes a dynamic weight allocation strategy based on drug type and a dynamic weight allocation strategy based on environmental conditions.

[0103] The dynamic weight allocation strategy based on drug type is as follows:

[0104] When a drug is packaged in a box, the dynamic weight assigned to the drug barcode confidence score is the highest among the drug barcode confidence score, drug visual confidence score, and drug weight confidence score. For example, when a drug is packaged in a box, the barcode confidence score is set... S code The dynamic weight α is 0.5, and the visual confidence level of the drug is... S image The dynamic weight β is 0.3, and the confidence level of drug weight is... S weight The dynamic weight γ is 0.2;

[0105] When a drug is sold in smaller quantities or is easily damaged, the dynamic weights assigned to the visual confidence level and weight confidence level should be increased, respectively, among the drug barcode confidence level, visual confidence level, and weight confidence level. For example, when a drug is sold in smaller quantities or is easily damaged, the weights assigned to the barcode confidence level should be increased. S code The dynamic weight α is 0.2, and the visual confidence level of the drug is... S image The dynamic weight β is 0.4, and the confidence level of drug weight is... S weight The dynamic weight γ is 0.4:

[0106] When a drug is a liquid dosage form, the dynamic weight assigned to the drug weight confidence score is the highest among the drug barcode confidence score, drug visual confidence score, and drug weight confidence score. For example, when a drug is a liquid dosage form, the drug barcode confidence score is set... S code The dynamic weight α is 0.2, and the visual confidence level of the drug is... S image The dynamic weight β is 0.2, and the confidence level of drug weight is... S weight The dynamic weight γ is 0.6.

[0107] The dynamic weight allocation strategy based on environmental conditions is as follows:

[0108] If the lighting intensity at the sorting station is weak, reduce the dynamic weight assigned to the visual confidence score of the medicine.

[0109] If significant vibration occurs at the sorting station, reduce the dynamic weight assigned to the confidence level of drug weight.

[0110] Additionally, it should be noted that in the intelligent drug sorting and processing method of this embodiment, the re-inspection process in step 6 above includes the following steps c1 to c3:

[0111] Step c1: Re-acquire images of the drug to obtain re-inspection images of the drug;

[0112] Step c2: Reacquire the weight information of the drug to obtain the weight information of the drug for re-inspection;

[0113] Step c3 involves simultaneously sending the drug re-inspection image and drug re-inspection weight information to the pharmacist, who will then perform manual verification and review based on these information.

[0114] This embodiment also provides a pharmaceutical intelligent sorting and processing system to implement the aforementioned pharmaceutical intelligent sorting and processing method. See also... Figure 2 As shown, the intelligent drug sorting and processing system of this embodiment includes a drug image acquisition device 1, a drug visual inspection device 2, a drug weight acquisition device 3, and a processor 4. The processor 4 is connected to the drug image acquisition device 1, the drug visual inspection device 2, and the drug weight acquisition device 3, respectively. Wherein:

[0115] The drug image acquisition device 1 is configured to acquire images of the electronic drug supervision barcodes of drugs transported to the sorting station.

[0116] The drug visual inspection device 2 is configured to perform visual inspection on drugs transported to the sorting station and obtain visual inspection information of the drugs.

[0117] The drug weight acquisition device 3 is configured to acquire the drug weight information of drugs transported to the sorting station.

[0118] The processor 4 is configured to process the drug electronic supervision barcode image acquired by the drug image acquisition device 1 to obtain the drug barcode confidence score, process the visual detection information detected by the drug visual inspection device 2 to obtain the drug visual confidence score, and process the drug weight information acquired by the drug weight acquisition device 3 to obtain the drug weight confidence score; and, based on the obtained drug barcode confidence score, drug visual confidence score, and drug weight confidence score, perform fusion processing to obtain the drug comprehensive confidence score, and perform judgment processing on the drug comprehensive confidence score, the first preset confidence threshold, and the second preset confidence threshold to determine whether the drug delivered to the sorting station has passed the multimodal verification and to perform drug dispensing or intercept the dispensing of the drug or perform re-inspection processing.

[0119] Of course, depending on actual needs, the intelligent drug sorting and processing system of this embodiment also includes a light intensity detection device for detecting the light intensity at the sorting station and a vibration detection device for detecting vibration interference at the sorting station. The light intensity detection device and the vibration detection device are respectively connected to the processor. By setting the light intensity detection device and the vibration detection device at the sorting station in this way, the intelligent drug sorting and processing system can detect the environmental conditions at the sorting station, thereby enabling the processor to execute the aforementioned dynamic weight allocation strategy based on the environmental conditions at the sorting station. This achieves dynamic weight allocation of the weights corresponding to the drug barcode confidence, drug visual confidence, and drug weight confidence, thereby improving the robustness and reliability of the entire intelligent drug sorting and processing system.

[0120] This embodiment also provides a readable storage medium. Specifically, the readable storage medium stores a computer program, which, when executed by a processor, implements the aforementioned intelligent drug sorting and processing method.

[0121] Although preferred embodiments of the present invention have been described in detail above, it should be clearly understood that various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for intelligent sorting and processing of pharmaceuticals, characterized in that, Includes the following steps: Step 1: Collect the electronic drug supervision barcode image of the medicines transported to the sorting station and process the electronic drug supervision barcode image to calculate the confidence level of the drug barcode; Step 2: Perform visual inspection on the medicines delivered to the sorting station and calculate the visual confidence level of the medicines; Step 3: Obtain and process the weight information of the medicines delivered to the sorting station, and calculate the confidence level of the medicine weight. Step 4: The obtained drug barcode confidence, drug visual confidence, and drug weight confidence are fused to calculate the overall drug confidence. Step 5: Make a judgment based on the obtained overall confidence level of the drug and the first preset confidence threshold: When the overall confidence level of the drug is greater than the first preset confidence threshold, it is determined that the drug delivered to the sorting station has passed the multimodal verification and the drug is issued; otherwise, proceed to step 6. Step 6: Make a judgment based on the obtained overall confidence level of the drug and the second preset confidence threshold: When the overall confidence level of the drug is less than the second preset confidence threshold, the drug delivered to the sorting station is determined to have failed the multimodal validation and its dispensing is intercepted; otherwise, the drug delivered to the sorting station is subject to re-inspection; wherein, the second preset confidence threshold is less than the first preset confidence threshold; wherein: In step 1, the confidence level of the drug barcode is calculated as follows: The drug's electronic regulatory barcode image is decoded to obtain the drug's regulatory information; The drug regulatory information is compared with the drug regulatory information already stored in the drug regulatory authority's database to generate an initial decoding similarity score; wherein the generation of the decoding similarity score includes the following steps a21~a24: Step a21: After preprocessing the acquired electronic drug supervision barcode image, it is sent to the decoder for decryption to obtain a bit sequence; wherein, the decoded bit sequence is labeled as D. decoded ; Step a22: Compare the decoded bit sequence with the standard reference sequence D retrieved from the drug regulatory authority's database. reference A bit-by-bit comparison is performed to obtain the number of differing bits and the basic similarity; whereby the number of differing bits is denoted as E, and the basic similarity is denoted as... S raw ; S raw =1-E / N' ; N’ The decoded bit sequence D decoded The sequence length; Step a23: Calculate the log-likelihood ratio of each decoded bit and the overall confidence of the decoded bit sequence; wherein, the overall confidence of the decoded bit sequence is denoted as... S LLR : ;1≤n≤ N’ ; in, LLR n The decoded bit sequence D decoded The log-likelihood ratio of the nth bit within; Step a24: Calculate the decoding similarity score based on the obtained basic similarity and overall confidence; the formula for calculating the decoding similarity score is as follows: S similarity =λ· sigmoid ( S LLR )+(1-λ)· S raw λ is the weighting coefficient. sigmoid ( S LLR ) is used to assign confidence values S LLR A logical function that maps values ​​to the interval [0,1]. The edge integrity, module fill degree, and damaged area of ​​the electronic drug supervision barcode image are analyzed using computer vision technology to obtain a quantified barcode damage value; wherein, the method for obtaining the quantified barcode damage value includes the following steps a31~36: Step a31: Apply the Canny edge detection algorithm to the preprocessed binarized barcode image to extract the contour and obtain the edge line segments; Step a32: Perform Hough transform line detection or use a contour tracking algorithm on the detected edge segments to calculate the edge integrity score of the edge segments; wherein, the edge integrity score of the edge segments is labeled as E. score : AND score =1-L1 / L2; Where L1 is the sum of edge break lengths and values ​​among all edge segments, and L2 is the sum of ideal edge lengths and values; edge breaks are identified by analyzing the distance and angle deviations between adjacent edge segments; Step a33: Using projection segmentation or connected component analysis, the electronic drug supervision barcode image is segmented into independent unit modules, and the proportion of expected color pixels and the fill score of each module are calculated. The expected color pixels are the black pixels in the black modules, and the module fill score is denoted as F. score : ; Where M represents the total number of unit modules obtained after segmenting the electronic drug supervision barcode image, and q m Q represents the expected number of color pixels in the m-th unit module. m The total number of pixels in the m-th unit module; the fill score F for any module. score If the score is below the preset module fill threshold, then any module will be marked as a defective module. Step a34: Apply morphological operations to the original grayscale or binary image of the drug electronic supervision barcode image while preserving the main bar and space structure to obtain the morphologically processed image. Step a35: Perform a difference operation between the obtained morphologically processed image and the ideal image template to obtain the percentage of contaminated area in the morphologically processed image; wherein, the percentage of contaminated area in the morphologically processed image is denoted as A. ratio : A ratio =A1 / A2; Where A1 is the total number of significantly non-zero pixels in the differential image, and A2 is the total number of pixels in the barcode area corresponding to the electronic drug supervision barcode image; Step a36: Based on the edge integrity score, module fill score, and percentage of soiled area of ​​the obtained edge segments, calculate the barcode damage value; the formula for calculating the barcode damage value is as follows: D damage =ω e ·(1-E score )+ ω f ·(1-F score )+ ω a ·A ratio +b; Where, ω e Edge integrity score E score The corresponding weight, ω f Module fill score F score The corresponding weight, ω a b represents the weight corresponding to the percentage of soiled area, and b is the bias term; Based on the obtained decoding similarity score and barcode damage value, the confidence level of the drug barcode for electronic drug supervision is calculated; whereby the drug barcode confidence level is tagged as follows: S code : S code = S similarity ·(1-D damage ); S similarity ∈[0,1],D damage ∈[0,1]; where, S similarity To decode the similarity score, D damage This represents the barcode damage level value. In step 2, the calculation method for the visual confidence level of the drug is as follows: steps b1~b2: Step b1: Collect image information of the medicines being transported to the sorting station; Step b2: Using cosine similarity, the acquired drug image information is matched with a pre-stored standard image of the drug to obtain an image similarity score for the drug image information. This image similarity score is used as the aforementioned visual confidence score of the drug; wherein, the visual confidence score of the drug is labeled as... S image : ; in, A i This represents the i-th feature component of the collected drug image information. B i This represents the i-th feature component of the pre-stored standard image of the drug; N This represents the total number of feature components in the collected drug image information; In step 3, the confidence level of the drug weight is calculated as follows: S weight =1-| W actual - W standard | / (k·σ);k∈[2.5,3]; in, S weight Confidence level for drug weight. W actual This refers to the actual weight of the medicine. W standard σ is the standard weight of the drug, σ is the standard deviation of all historical weights of the drug, and k is the adjustment factor. In step 4, the fusion process involves processing each confidence level based on a dynamic weight allocation strategy; the calculation method for the overall confidence level of the drug is as follows: S 综合 = α · S code + β · S image + γ · S weight ; α + β + γ =1; in, S 综合 To assess the overall confidence level of the drug, S code For the confidence level of drug barcodes, S image For visual confidence of drugs, S weight α represents the confidence level for drug weight; α represents the confidence level assigned to the drug barcode. S code The dynamic weights, β, are assigned to the visual confidence level of the drug. S image The dynamic weights, γ, are the confidence scores assigned to the weight of the drug. S weight The dynamic weights; and the dynamic weight allocation strategy includes a dynamic weight allocation strategy based on drug type and a dynamic weight allocation strategy based on environmental conditions; wherein: The dynamic weight allocation strategy based on drug type is as follows: When a drug is packaged in a box, the dynamic weight assigned to the drug barcode confidence level is the highest among the drug barcode confidence level, drug visual confidence level, and drug weight confidence level. When a drug is sold in smaller quantities or is easily damaged, the dynamic weights assigned to the drug's visual confidence and weight confidence are increased, respectively, in the confidence of the drug's barcode, visual confidence, and weight confidence. When a drug is a liquid preparation, the dynamic weight assigned to the drug weight confidence level is the highest among the drug barcode confidence level, drug visual confidence level, and drug weight confidence level. The dynamic weight allocation strategy based on environmental conditions is as follows: If the lighting intensity at the sorting station is weak, reduce the dynamic weight assigned to the visual confidence score of the medicine. If significant vibration occurs at the sorting station, reduce the dynamic weight assigned to the confidence level of the drug weight; In step 6, the re-inspection process includes the following steps c1 to c3: Step c1: Re-acquire images of the drug to obtain re-inspection images of the drug; Step c2: Reacquire the weight information of the drug to obtain the weight information of the drug for re-inspection; Step c3 involves simultaneously sending the drug re-inspection image and drug re-inspection weight information to the pharmacist, who will then perform manual verification and review based on these information.

2. A pharmaceutical intelligent sorting and processing system, implementing the pharmaceutical intelligent sorting and processing method of claim 1, characterized in that, The intelligent drug sorting and processing system includes: The drug image acquisition device is configured to acquire images of the electronic drug supervision barcodes of drugs transported to the sorting station. The drug visual inspection device is configured to perform visual inspection on drugs transported to the sorting station and obtain visual inspection information of the drug. The drug weight acquisition device is configured to acquire the drug weight information of drugs transported to the sorting station. The processor, connected to a drug image acquisition device, a drug visual inspection device, and a drug weight acquisition device, is configured to process the drug electronic supervision barcode image acquired by the drug image acquisition device to obtain the drug barcode confidence score, process the visual inspection information detected by the drug visual inspection device to obtain the drug visual confidence score, and process the drug weight information acquired by the drug weight acquisition device to obtain the drug weight confidence score. Furthermore, it performs a fusion process based on the obtained drug barcode confidence score, drug visual confidence score, and drug weight confidence score to obtain a comprehensive drug confidence score. It then performs judgment processing on the comprehensive drug confidence score, a first preset confidence threshold, and a second preset confidence threshold to determine whether the drug delivered to the sorting station has passed multimodal verification and to execute drug dispensing, intercept drug dispensing, or perform re-inspection processing.

3. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the intelligent drug sorting and processing method according to claim 1.

Citation Information

Patent Citations

  • Medicine management and prompt method suitable for smart hospital

    CN113096784A

  • Drug quantity conveying supervision method based on image recognition

    CN119204890A

  • Dual-binary Turbo decoding method based on deep learning

    CN120601897A