Decoction piece verification method and device, storage medium, electronic equipment and product

CN122889240APending Publication Date: 2026-10-09CHENGDU YH INTELLIGENT EQUIP TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611070037.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-17
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0006]本申请实施例提供了一种饮片核验方法和装置、存储介质、电子设备和产品,以至少解决相关技术中,中药煎药终审环节主要依赖人工对中药饮片进行核验,导致核验准确性不高的问题

Benefits of technology

[0017]通过本申请,通过第一图像识别模型对混合容器内混合的多种饮片进行目标检测,得到所述多种饮片的第一置信度;确定处方单中记载的多种目标饮片是否均存在于所述混合容器内,以及根据所述多种饮片的第一置信度确定所述多种饮片是否均记载于所述处方单;在确定所述多种目标饮片均存在于所述混合容器,且所述多种饮片均记载于所述处方单的情况下,确定所述多种饮片核验合格;从而解决了相关技术中,中药煎药终审环节主要依赖人工对中药饮片进行核验,导致核验准确性不高的问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122889240A_ABST
    Figure CN122889240A_ABST
Patent Text Reader

Abstract

The application discloses a medicinal decoction piece verification method and device, a storage medium, an electronic device and a product, relates to the technical field of medical robot motion control, and the method comprises the steps of: performing target detection on a plurality of medicinal decoction pieces mixed in a mixing container through a first image recognition model to obtain first confidence of the plurality of medicinal decoction pieces; determining whether the plurality of target medicinal decoction pieces recorded in a prescription sheet exist in the mixing container, and determining whether the plurality of medicinal decoction pieces are recorded in the prescription sheet according to the first confidence of the plurality of medicinal decoction pieces; and in the case that it is determined that the plurality of target medicinal decoction pieces exist in the mixing container and the plurality of medicinal decoction pieces are recorded in the prescription sheet, determining that the plurality of medicinal decoction pieces pass the verification. Thus, the problem that in the related art, the medicinal decoction piece verification in the final review link mainly depends on manual verification, resulting in low verification accuracy is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of medical technology, and more specifically, to a method and apparatus for verifying medicinal herbs, a storage medium, an electronic device, and a product. Background Technology

[0002] In the standardized production process of modern Chinese medicine decoction centers, prescription dispensing typically includes automated dispensing, manual refilling, ingredient aggregation, manual final review, and decoction. Among these, the final review is the last quality control checkpoint before the prescription is put into the pot, directly determining the safety of the entire prescription.

[0003] Currently, most traditional Chinese medicine (TCM) decoction centers in China rely primarily on manual verification for the final review process. Specifically, after the automated dispensing and manual replenishment processes, all single-herb TCM slices in the prescription are collected into a single container. At the final review station, staff must visually inspect each slice stacked in the container, verifying the prescription categories and checking for any anomalies such as missing herbs, incorrect herbs, extra herbs, or mislabeled prescriptions. However, with the dramatic increase in daily prescription processing volume in modern TCM decoction centers, traditional manual verification is prone to omissions and misjudgments.

[0004] Regarding the issue that the final review of traditional Chinese medicine decoction mainly relies on manual verification of the medicinal materials, resulting in low verification accuracy, no effective solution has yet been proposed.

[0005] Therefore, it is necessary to improve the relevant technology to overcome the aforementioned defects. Summary of the Invention

[0006] This application provides a method and apparatus for verifying medicinal herbs, a storage medium, an electronic device, and a product, to at least solve the problem in related technologies where the final review of traditional Chinese medicine decoction mainly relies on manual verification of medicinal herbs, resulting in low verification accuracy.

[0007] According to one aspect of the embodiments of this application, a method for verifying medicinal herbs is provided, comprising: performing target detection on multiple medicinal herbs mixed in a mixing container using a first image recognition model to obtain a first confidence level of the multiple medicinal herbs; determining whether multiple target medicinal herbs recorded in a prescription are all present in the mixing container, and determining whether multiple medicinal herbs are all recorded in the prescription based on the first confidence level of the multiple medicinal herbs; and determining that the multiple medicinal herbs are qualified if it is determined that multiple target medicinal herbs are all present in the mixing container and multiple medicinal herbs are all recorded in the prescription.

[0008] In an exemplary embodiment, determining whether all the various medicinal herbs are recorded in the prescription based on a first confidence level includes: determining a first category of the various medicinal herbs based on the detection results obtained by target detection of the various medicinal herbs using a first image recognition model; determining whether the first category of medicinal herbs is the same as a second category of the various target medicinal herbs; if the first category of medicinal herbs is the same as the second category of medicinal herbs, determining a prescription indication value as a first preset value, wherein the prescription indication value is used to characterize whether the prescription contains medicinal herbs corresponding to the first category of medicinal herbs; if the first category of medicinal herbs is different from the second category of medicinal herbs, determining the prescription indication value as a second preset value; determining a second confidence level of the various medicinal herbs based on the prescription indication value and the first confidence level, and determining whether all the various medicinal herbs are recorded in the prescription based on the second confidence level.

[0009] In an exemplary embodiment, determining a second confidence level for the various medicinal herbs based on the prescription indication value and the first confidence level, and determining whether all the various medicinal herbs are recorded on the prescription based on the second confidence level, includes: determining the second confidence level S according to the following formula: ,in, The first confidence level is defined as occ, where occ is the occlusion value of the various medicinal slices, and the occlusion value is used to characterize the degree of occlusion of the various medicinal slices. The coefficient for the obstruction value of the medicinal slices. The prescription indication value, The coefficient of the prescription indication value; when multiple second confidence levels are greater than a preset threshold, it is determined that all kinds of medicinal herbs are recorded in the prescription, wherein the multiple second confidence levels correspond one-to-one with the multiple kinds of medicinal herbs.

[0010] In an exemplary embodiment, after determining whether all the target medicinal herbs listed in the prescription are present in the mixing container, and determining whether all the target medicinal herbs are listed in the prescription based on a first confidence level, the method further includes: if it is determined that any one of the target medicinal herbs is not present in the mixing container, determining that the mixing container is missing a prescription drug; or if it is determined that any one of the target medicinal herbs is not listed in the prescription, determining that the mixing container contains an over-the-counter drug; and if the mixing container is missing the prescription drug or contains the over-the-counter drug, determining that the multiple medicinal herbs fail verification.

[0011] In an exemplary embodiment, after determining whether all the target medicinal herbs recorded in the prescription are present in the mixing container, and determining whether all the target medicinal herbs are recorded in the prescription based on a first confidence level, the method further includes: if the verification of the target medicinal herbs is qualified, controlling the flow of the target medicinal herbs to the next process; if the verification of the target medicinal herbs is unqualified, issuing a warning signal to the target object to instruct the target object to manually review the target medicinal herbs.

[0012] In an exemplary embodiment, before performing target detection on multiple medicinal herbs mixed in a mixing container using a first image recognition model, the method further includes: acquiring first images of multiple single-herb medicinal herbs in the mixing container, and acquiring multiple sets of second images of multiple-herb medicinal herbs in the mixing container, wherein the multiple medicinal herbs in the first images do not obscure each other, while the multiple medicinal herbs in the second images do obscure each other; determining the smallest target medicinal herb among the multiple medicinal herbs, and generating an anchor frame size set based on the size of the target medicinal herb, wherein the multiple anchor frame sizes in the anchor frame size set are used to detect medicinal herbs in multiple first images and multiple second images, with each of the multiple first images corresponding to one of the multiple single-herb medicinal herbs, and each of the multiple second images corresponding to one of the multiple sets of multiple-herb medicinal herbs; building a second image recognition model based on the anchor frame size set, and training the second image recognition model sequentially based on the multiple first images and multiple second images to obtain the first image recognition model.

[0013] According to another aspect of the embodiments of this application, a medicinal herb verification device is also provided, comprising: a detection module, configured to perform target detection on multiple medicinal herbs mixed in a mixing container using a first image recognition model, and obtain a first confidence level of the multiple medicinal herbs; a first determination module, configured to determine whether multiple target medicinal herbs recorded in a prescription are all present in the mixing container, and to determine whether multiple medicinal herbs are all recorded in the prescription based on the first confidence level of the multiple medicinal herbs; and a second determination module, configured to determine that the multiple medicinal herbs are verified as qualified when it is determined that multiple target medicinal herbs are all present in the mixing container and multiple medicinal herbs are all recorded in the prescription.

[0014] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer-readable storage medium, and the computer program is configured to execute the above-described method for verifying medicinal slices when running.

[0015] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-mentioned medicinal slice verification method through the computer program.

[0016] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps of the methods described in various embodiments of this application.

[0017] This application utilizes a first image recognition model to perform target detection on multiple medicinal herbs mixed in a mixing container, obtaining a first confidence level for the multiple medicinal herbs; it determines whether all the multiple target medicinal herbs recorded in the prescription are present in the mixing container, and determines whether all the multiple medicinal herbs are recorded in the prescription based on the first confidence level; if it is determined that all the multiple target medicinal herbs are present in the mixing container and all the multiple medicinal herbs are recorded in the prescription, it determines that the multiple medicinal herbs are qualified; thus solving the problem in related technologies where the final review of traditional Chinese medicine decoction mainly relies on manual verification of medicinal herbs, resulting in low verification accuracy. Attached Figure Description

[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a hardware structure block diagram of a medical robot for a method of verifying medicinal slices according to an embodiment of this application;

[0021] Figure 2 This is a flowchart of a method for verifying medicinal slices according to an embodiment of this application;

[0022] Figure 3 This is a structural block diagram of a medicinal herb verification device according to an embodiment of this application. Detailed Implementation

[0023] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0024] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0025] The methods and embodiments provided in this application can be executed in a medical robot or a similar computing device. Taking its operation on a medical robot as an example, Figure 1 This is a hardware structure block diagram of a medical robot for a method of verifying medicinal slices according to an embodiment of this application. Figure 1 As shown, a medical robot may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a central processing unit (CPU) or a field-programmable gate array (FPGA)) and a memory 104 for storing data are also shown. The medical robot may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the medical robot described above. For example, the medical robot may also include components that are larger than... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0026] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the data integration method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thus implementing the above-described method. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the medical robot via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0027] The medical robot's communication provider offers a wireless network. In one example, transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, transmission device 106 can be a Radio Frequency (RF) module for wireless communication with the Internet.

[0028] This embodiment provides a method for verifying medicinal slices. Figure 2 This is a flowchart of a method for verifying medicinal slices according to an embodiment of this application, such as... Figure 2 As shown, the process includes the following steps:

[0029] Step S202: Target detection is performed on the various medicinal slices mixed in the mixing container using a first image recognition model to obtain the first confidence level of the various medicinal slices;

[0030] For example, a panoramic image of the mixed medicinal slices in a mixing container is captured by an image acquisition device to obtain an image of the mixed medicinal slices. The image of the mixed medicinal slices is then used to perform target detection by a first image recognition model to extract the first confidence (original confidence) of all identifiable medicinal slice instances in the image.

[0031] Step S204: Determine whether all the target medicinal slices recorded in the prescription are present in the mixing container, and determine whether all the medicinal slices are recorded in the prescription based on the first confidence level of the medicinal slices;

[0032] Step S206: If it is determined that all the target medicinal slices are present in the mixing container and all the medicinal slices are recorded in the prescription, then the medicinal slices are determined to be qualified.

[0033] This application utilizes a first image recognition model to perform target detection on multiple medicinal herbs mixed in a mixing container, obtaining a first confidence level for the multiple medicinal herbs; it determines whether all the multiple target medicinal herbs recorded in the prescription are present in the mixing container, and determines whether all the multiple medicinal herbs are recorded in the prescription based on the first confidence level; if it is determined that all the multiple target medicinal herbs are present in the mixing container and all the multiple medicinal herbs are recorded in the prescription, it determines that the multiple medicinal herbs are qualified; thus solving the problem in related technologies where the final review of traditional Chinese medicine decoction mainly relies on manual verification of medicinal herbs, resulting in low verification accuracy.

[0034] In an exemplary embodiment, determining whether all the various medicinal herbs are recorded in the prescription based on a first confidence level includes: determining a first category of the various medicinal herbs based on the detection results obtained by target detection of the various medicinal herbs using a first image recognition model; determining whether the first category of medicinal herbs is the same as a second category of the various target medicinal herbs; if the first category of medicinal herbs is the same as the second category of medicinal herbs, determining a prescription indication value as a first preset value, wherein the prescription indication value is used to characterize whether the prescription contains medicinal herbs corresponding to the first category of medicinal herbs; if the first category of medicinal herbs is different from the second category of medicinal herbs, determining the prescription indication value as a second preset value; determining a second confidence level of the various medicinal herbs based on the prescription indication value and the first confidence level, and determining whether all the various medicinal herbs are recorded in the prescription based on the second confidence level.

[0035] In an exemplary embodiment, determining a second confidence level for the various medicinal herbs based on the prescription indication value and the first confidence level, and determining whether all the various medicinal herbs are recorded on the prescription based on the second confidence level, includes: determining the second confidence level S according to the following formula: ,in, The first confidence level is defined as occ, where occ is the occlusion value of the various medicinal slices, and the occlusion value is used to characterize the degree of occlusion of the various medicinal slices. The coefficient for the obstruction value of the medicinal slices. The prescription indication value, The coefficient of the prescription indication value; when multiple second confidence levels are greater than a preset threshold, it is determined that all kinds of medicinal herbs are recorded in the prescription, wherein the multiple second confidence levels correspond one-to-one with the multiple kinds of medicinal herbs.

[0036] First, the first image recognition model is used to perform multi-target detection on the acquired mixed medicinal slice images, extracting the category of all identifiable medicinal slice instances in the image (equivalent to the first medicinal slice category) and the first confidence level of each type of medicinal slice. Simultaneously, the system identifies the various second-category medicinal materials that should be included in the prescription. A consistency comparison is then performed. If the first-category medicinal material detected by the first image recognition model matches one of the multiple second-category medicinal materials, the material is determined to be included in the prescription, and the prescription indication value is updated. If the first category of a medicinal herb is different from multiple second categories, then it is determined that the medicinal herb is not recorded in the prescription, and the prescription instruction value is set accordingly. The second preset value is determined, wherein in this embodiment, the first preset value is 0 and the second preset value is 1. According to the formula... Calculate the second confidence level S, where occ is the occlusion value of various medicinal slices identified by the first image recognition model, with a value range of [0,1]. The more severe the occlusion, the higher the value. This is a coefficient representing the shading value of medicinal slices, used to compensate for errors in the shading value caused by on-site shading, dust, and lighting deviations. The coefficient for the prescription indication value is used to reduce the weighting of the detection results of non-prescription herbal pieces. When the second confidence level of multiple herbal pieces is greater than a preset threshold, it is determined that all herbal pieces in the mixing container are recorded in the prescription.

[0037] It should be clarified that the prescription indication value in this embodiment The detection result of the first image recognition model for a certain herbal medicine is recorded on the prescription, but it does not mean that the herbal medicine is necessarily recorded on the prescription. For example, the first image recognition model detects that a certain herbal medicine is Banlangen, but Banlangen may not actually exist on the prescription.

[0038] In an exemplary embodiment, after determining whether all the target medicinal herbs listed in the prescription are present in the mixing container, and determining whether all the target medicinal herbs are listed in the prescription based on a first confidence level, the method further includes: if it is determined that any one of the target medicinal herbs is not present in the mixing container, determining that the mixing container is missing a prescription drug; or if it is determined that any one of the target medicinal herbs is not listed in the prescription, determining that the mixing container contains an over-the-counter drug; and if the mixing container is missing the prescription drug or contains the over-the-counter drug, determining that the multiple medicinal herbs fail verification.

[0039] The system iterates through the various target medicinal herbs listed in the prescription. If one or more medicinal herbs explicitly listed in the prescription are not found in the image detection of the mixing container (i.e., the target medicinal herb does not exist in the mixing container), the prescription is determined to have a missing or incomplete prescription, constituting a prescription incompleteness. Secondly, it iterates through all medicinal herb instances (equivalent to multiple medicinal herbs) successfully identified and assigned a valid confidence level by the first image recognition model within the mixing container. If any identified medicinal herb is not found in the current prescription (i.e., the medicinal herb is not listed in the prescription), the mixing container is determined to contain non-prescription drugs. Once any of the above abnormal situations—namely, missing or incorrect medication—is triggered, the verification of multiple medicinal herbs is directly determined to be unqualified. At this point, a severe anomaly warning is immediately triggered, the decoction process is locked, and a pop-up window prompts for manual review and rectification, thereby completely intercepting the risk of medication errors before the herbs are put into the pot.

[0040] In an exemplary embodiment, after determining whether all the target medicinal herbs recorded in the prescription are present in the mixing container, and determining whether all the target medicinal herbs are recorded in the prescription based on a first confidence level, the method further includes: if the verification of the target medicinal herbs is qualified, controlling the flow of the target medicinal herbs to the next process; if the verification of the target medicinal herbs is unqualified, issuing a warning signal to the target object to instruct the target object to manually review the target medicinal herbs.

[0041] When multiple medicinal herbs pass inspection, it confirms that all required ingredients in the prescription have been accurately detected and no over-the-counter drugs have been mixed in. The mixing container is then transferred to the next decoction step, achieving a fully automated closed-loop process without manual intervention, thus significantly improving operational efficiency. Conversely, when multiple medicinal herbs fail inspection, such as when prescription shortages or incorrect over-the-counter drug combinations are detected, an anomaly response mechanism is immediately activated. This sends audible and visual or digital warning signals to pre-defined target entities (such as on-site prescription reviewers, quality control specialists, or mobile devices). These warning signals explicitly instruct the target entity to manually review the medicinal herbs in the current mixing container. The mixture can only be transferred after the review is passed, ensuring that each dose of traditional Chinese medicine meets compatibility standards before being added to the pot, and preventing medication safety hazards caused by automated misjudgments or interference from complex operating conditions.

[0042] In an exemplary embodiment, before performing target detection on multiple medicinal herbs mixed in a mixing container using a first image recognition model, the method further includes: acquiring first images of multiple single-herb medicinal herbs in the mixing container, and acquiring multiple sets of second images of multiple-herb medicinal herbs in the mixing container, wherein the multiple medicinal herbs in the first images do not obscure each other, while the multiple medicinal herbs in the second images do obscure each other; determining the smallest target medicinal herb among the multiple medicinal herbs, and generating an anchor frame size set based on the size of the target medicinal herb, wherein the multiple anchor frame sizes in the anchor frame size set are used to detect medicinal herbs in multiple first images and multiple second images, with each of the multiple first images corresponding to one of the multiple single-herb medicinal herbs, and each of the multiple second images corresponding to one of the multiple sets of multiple-herb medicinal herbs; building a second image recognition model based on the anchor frame size set, and training the second image recognition model sequentially based on the multiple first images and multiple second images to obtain the first image recognition model.

[0043] Images of various single-herb medicinal slices were collected, laid out independently without occlusion, to allow the model to establish a basic, fine-grained understanding of the complete shape, texture, and color of the slices. Simultaneously, images of multiple groups of multi-herb medicinal slices were collected, randomly stacked in a mixing container, exhibiting occlusion and fragmentation, to simulate the complex interference environment of a real final review station. Subsequently, to address the issue of missed detections and positioning errors caused by the mismatch between the default anchor boxes of the general YOLO model and the shapes of Chinese medicinal slices (e.g., long, flat, fragmented), the smallest target slice instances were extracted from all collected slice samples. Based on the true aspect ratio and size distribution of these smallest physical units, a set of anchor box sizes adapted to the characteristics of Chinese medicinal herbs was generated using the K-means clustering algorithm. This size set includes various ratio anchor boxes optimized for fragmented and irregularly shaped slices, aiming to improve the model's ability to capture small and overlapping targets. Based on this anchor frame size set, a second image recognition model is built, and a hierarchical progressive training strategy is adopted to train the second image recognition model. First, a clean first herbal slice image is used for basic pre-training, so that the model can master the basic features of single herbal slices. Then, the second herbal slice image with occlusion is used for fine-tuning, so that the model can learn to separate and recognize individual herbal slices from mixed backgrounds. Finally, a first image recognition model that can adapt to mixed scenes and has high generalization ability is obtained.

[0044] For the first image recognition model, it is solidified in ONNX format and subjected to INT8 quantization processing. This significantly reduces the model size and computational complexity, thereby improving the multi-objective inference speed under complex conditions and ensuring millisecond-level full detection of the entire mixed herbal medicine image. Secondly, at the service deployment level, an Artificial Intelligence (AI) inference server is built based on the first image recognition model to support batch processing of high-concurrency prescription data, fully adapting to the final review needs of the decoction center's massive daily prescription volume. In addition, to ensure the security and compliance of medical data, a six-layer security protection mechanism is adopted, including HyperText Transfer Protocol Secure (HTTPS), timestamp authentication, RSA (Rivest–Shamir–Adleman) encryption, anti-replay attack, Internet Protocol (IP) whitelist restriction, and parameter signature verification, to achieve end-to-end encryption of the herbal medicine image data. Finally, we strictly implement data privacy protection strategies. The images of medicinal slices collected on-site are only used for real-time inference and temporary caching. They are automatically destroyed immediately after data processing is completed, ensuring that the original medical image data is not retained or leaked, which fully complies with the strict medical data compliance standards of the traditional Chinese medicine industry.

[0045] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.

[0046] Figure 3 This is a structural block diagram of a medicinal herb verification device according to an embodiment of this application. The device includes:

[0047] Detection module 32 is used to perform target detection on multiple medicinal slices mixed in the mixing container using a first image recognition model, and obtain the first confidence level of the multiple medicinal slices;

[0048] The first determining module 34 is used to determine whether all the target medicinal slices recorded in the prescription are present in the mixing container, and to determine whether all the medicinal slices are recorded in the prescription based on the first confidence level of the multiple medicinal slices.

[0049] The second determining module 36 is used to determine that the multiple target medicinal slices are qualified when it is determined that all of the multiple target medicinal slices are present in the mixing container and all of the multiple medicinal slices are recorded in the prescription.

[0050] Using the aforementioned device, a first image recognition model is used to perform target detection on multiple medicinal slices mixed in the mixing container, obtaining a first confidence level for the multiple medicinal slices; it is determined whether all the multiple target medicinal slices recorded in the prescription are present in the mixing container, and based on the first confidence level of the multiple medicinal slices, it is determined whether all the multiple medicinal slices are recorded in the prescription; if it is determined that all the multiple target medicinal slices are present in the mixing container and all the multiple medicinal slices are recorded in the prescription, it is determined that the multiple medicinal slices are qualified; thereby solving the problem in related technologies where the final review of traditional Chinese medicine decoction mainly relies on manual verification of traditional Chinese medicine slices, resulting in low verification accuracy.

[0051] In an exemplary embodiment, the first determining module 34 is further configured to: determine a first category of the multiple medicinal slices based on the detection results obtained by target detection of the multiple medicinal slices using the first image recognition model; determine whether the first category of medicinal slices is the same as a second category of the multiple target medicinal slices; if the first category of medicinal slices is the same as the second category of medicinal slices, determine a prescription indication value as a first preset value, wherein the prescription indication value is used to characterize whether the prescription form records the medicinal slices corresponding to the first category of medicinal slices; if the first category of medicinal slices is different from the second category of medicinal slices, determine the prescription indication value as a second preset value; determine a second confidence level of the multiple medicinal slices based on the prescription indication value and the first confidence level, and determine whether the multiple medicinal slices are all recorded in the prescription form based on the second confidence level.

[0052] In an exemplary embodiment, the first determining module 34 is further configured to determine a second confidence level S according to the following formula: ,in, The first confidence level is defined as occ, where occ is the occlusion value of the various medicinal slices, and the occlusion value is used to characterize the degree of occlusion of the various medicinal slices. The coefficient for the obstruction value of the medicinal slices. The prescription indication value, The coefficient of the prescription indication value; when multiple second confidence levels are greater than a preset threshold, it is determined that all kinds of medicinal herbs are recorded in the prescription, wherein the multiple second confidence levels correspond one-to-one with the multiple kinds of medicinal herbs.

[0053] In an exemplary embodiment, the first determining module 34 is further configured to determine that a prescription drug is missing in the mixing container if any one of the multiple target medicinal slices is not present in the mixing container; or to determine that an over-the-counter drug is present in the mixing container if any one of the multiple medicinal slices is not recorded on the prescription form; and to determine that the multiple medicinal slices fail verification if the prescription drug is missing in the mixing container or the over-the-counter drug is present in the mixing container.

[0054] In an exemplary embodiment, the first determining module 34 is further configured to control the multiple medicinal slices to be transferred to the next process when it is determined that the multiple medicinal slices have passed the verification; and to issue a warning signal to the target object when it is determined that the multiple medicinal slices have failed the verification, so as to instruct the target object to manually review the multiple medicinal slices.

[0055] In an exemplary embodiment, the detection module 32 is further configured to acquire first images of multiple single-flavor medicinal slices within the mixing container, and second images of multiple groups of multi-flavor medicinal slices within the mixing container, wherein the multiple medicinal slices in the first images do not obscure each other, while the multiple medicinal slices in the second images do obscure each other; and to determine the smallest target medicinal slice among the multiple medicinal slices, and generate an anchor frame size set based on the size of the target medicinal slice, wherein the multiple anchor frame sizes in the anchor frame size set are used to detect the medicinal slices in the multiple first images and multiple second images, wherein the multiple first images correspond one-to-one with the multiple single-flavor medicinal slices, and the multiple second images correspond one-to-one with the multiple groups of multi-flavor medicinal slices; to build a second image recognition model based on the anchor frame size set, and to train the second image recognition model sequentially based on the multiple first images and multiple second images to obtain the first image recognition model.

[0056] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when run.

[0057] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:

[0058] S1, target detection is performed on the various medicinal slices mixed in the mixing container using the first image recognition model to obtain the first confidence level of the various medicinal slices;

[0059] S2, determine whether all the target medicinal materials recorded in the prescription are present in the mixing container, and determine whether all the medicinal materials are recorded in the prescription based on the first confidence level of the medicinal materials;

[0060] S3, if it is determined that all the target medicinal slices are present in the mixing container and all the medicinal slices are recorded in the prescription, then the verification of the multiple medicinal slices is determined to be qualified.

[0061] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0062] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.

[0063] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.

[0064] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0065] S1, target detection is performed on the various medicinal slices mixed in the mixing container using the first image recognition model to obtain the first confidence level of the various medicinal slices;

[0066] S2, determine whether all the target medicinal materials recorded in the prescription are present in the mixing container, and determine whether all the medicinal materials are recorded in the prescription based on the first confidence level of the medicinal materials;

[0067] S3, if it is determined that all the target medicinal slices are present in the mixing container and all the medicinal slices are recorded in the prescription, then the verification of the multiple medicinal slices is determined to be qualified.

[0068] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0069] Embodiments of this application also provide a computer program product, including a non-volatile computer-readable storage medium storing the computer program product, wherein the computer program, when executed by a processor, implements the steps of the methods described in various embodiments of this application.

[0070] Optionally, in this embodiment, the computer program described above can be configured to perform the following steps when executed by the processor:

[0071] S1, target detection is performed on the various medicinal slices mixed in the mixing container using the first image recognition model to obtain the first confidence level of the various medicinal slices;

[0072] S2, determine whether all the target medicinal materials recorded in the prescription are present in the mixing container, and determine whether all the medicinal materials are recorded in the prescription based on the first confidence level of the medicinal materials;

[0073] S3, if it is determined that all the target medicinal slices are present in the mixing container and all the medicinal slices are recorded in the prescription, then the verification of the multiple medicinal slices is determined to be qualified.

[0074] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.

[0075] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular hardware and software combination.

[0076] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for verifying medicinal slices, characterized in that, include: The first image recognition model is used to perform target detection on the various medicinal slices mixed in the mixing container to obtain the first confidence level of the various medicinal slices; Determine whether all the target medicinal herbs listed in the prescription are present in the mixing container, and determine whether all the medicinal herbs are listed in the prescription based on a first confidence level. If it is determined that all the target medicinal materials are present in the mixing container and that all the medicinal materials are recorded in the prescription, then the verification of the multiple medicinal materials is deemed qualified.

2. The method for verifying medicinal slices according to claim 1, characterized in that, Determining whether all of the various medicinal herbs are recorded in the prescription based on a first confidence level includes: Based on the detection results obtained by performing target detection on the multiple medicinal slices using the first image recognition model, the first category of the multiple medicinal slices is determined; Determine whether the first category of medicinal slices is the same as the second category of the multiple target medicinal slices; If it is determined that the first category of medicinal slices is the same as the second category of medicinal slices, the prescription indication value is determined to be a first preset value, wherein the prescription indication value is used to indicate whether the prescription contains medicinal slices corresponding to the first category of medicinal slices; If it is determined that the first category of medicinal slices is different from the second category of medicinal slices, the prescription indication value is determined to be a second preset value; A second confidence level is determined based on the prescription indication value and the first confidence level, and it is determined based on the second confidence level whether all the various medicinal herbs are recorded in the prescription.

3. The method for verifying medicinal slices according to claim 2, characterized in that, Determining a second confidence level for the various medicinal herbs based on the prescription indication value and the first confidence level, and determining whether all the various medicinal herbs are recorded in the prescription based on the second confidence level, including: The second confidence level S is determined using the following formula: ,in, The first confidence level is defined as occ, where occ is the occlusion value of the various medicinal slices, and the occlusion value is used to characterize the degree of occlusion of the various medicinal slices. The coefficient for the obstruction value of the medicinal slices. The prescription indication value, The coefficient of the prescription indication value; If multiple second confidence levels are greater than a preset threshold, it is determined that all the various medicinal herbs are recorded in the prescription, wherein each of the multiple second confidence levels corresponds one-to-one with the various medicinal herbs.

4. The method for verifying medicinal slices according to claim 1, characterized in that, After determining whether all target medicinal herbs listed in the prescription are present in the mixing container, and determining whether all target medicinal herbs are listed in the prescription based on a first confidence level, the method further includes: If it is determined that any one of the target medicinal materials is not present in the mixing container, it is determined that the mixing container is lacking the prescription drug; or If it is determined that any one of the various medicinal herbs is not listed on the prescription, it is determined that an over-the-counter drug is present in the mixing container; If the prescription drug is missing from the mixing container, or if the non-prescription drug is present in the mixing container, the verification of the various medicinal slices is determined to be unqualified.

5. The method for verifying medicinal slices according to claim 4, characterized in that, After determining whether all target medicinal herbs listed in the prescription are present in the mixing container, and determining whether all target medicinal herbs are listed in the prescription based on a first confidence level, the method further includes: Once it is confirmed that the various medicinal slices have passed inspection, the flow of the various medicinal slices to the next process shall be controlled; If it is determined that the above-mentioned multiple medicinal slices fail the verification, an early warning signal is issued to the target object to instruct the target object to manually review the above-mentioned multiple medicinal slices.

6. The method for verifying medicinal slices according to claim 1, characterized in that, Before performing target detection on the various medicinal slices mixed in the mixing container using the first image recognition model, the method further includes: First images of multiple single-flavor medicinal slices are acquired within a mixing container, and second images of multiple groups of multi-flavor medicinal slices are acquired within the mixing container. In the first images, the medicinal slices do not obscure each other, while in the second images, the medicinal slices do obscure each other. Among various Chinese medicinal herbs, the smallest target herb is determined, and an anchor frame size set is generated based on the size of the target herb. The multiple anchor frame sizes in the anchor frame size set are used to detect herbs in multiple first herb images and multiple second herb images. The multiple first herb images correspond one-to-one with the multiple single-herb herbs, and the multiple second herb images correspond one-to-one with the multiple groups of multi-herb herbs. A second image recognition model is built based on the anchor frame size set, and the second image recognition model is trained sequentially based on multiple first herbal slice images and multiple second herbal slice images to obtain the first image recognition model.

7. A medicinal slice verification device, characterized in that, include: The detection module is used to perform target detection on multiple medicinal slices mixed in the mixing container using a first image recognition model, and obtain the first confidence level of the multiple medicinal slices; The first determining module is used to determine whether all the target medicinal materials recorded in the prescription are present in the mixing container, and to determine whether all the medicinal materials are recorded in the prescription based on a first confidence level of the multiple medicinal materials. The second determining module is used to determine that the multiple target medicinal slices are qualified when it is determined that all of the multiple target medicinal slices are present in the mixing container and all of the multiple medicinal slices are recorded in the prescription.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method of any one of claims 1 to 6.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.