Medicine sorting device

The drug sorting device addresses the challenges of diverse drug marks and standby times by using multiple compartments and automated sorting, achieving accurate and efficient drug type discrimination and storage.

JP2024163171AActive Publication Date: 2024-11-21YUYAMA MFG CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2024149985
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2021-06-08
Filing Date
2024-08-30
Publication Date
2024-11-21
Estimated Expiration
2041-10-27

AI Technical Summary

Technical Problem

Existing drug sorting devices face challenges in accurately discriminating drug types due to diverse mark contents and lighting conditions, and they struggle with processing time when drugs are placed on standby, limiting storage capacity and requiring manual intervention.

Method used

A drug sorting device with multiple compartments, a reading part, counting section, notification unit, and conveying section to efficiently sort drugs by type, reducing standby time and enhancing storage capacity.

Benefits of technology

The device achieves high-accuracy drug type discrimination and reduces processing time by efficiently sorting drugs into designated storage compartments, ensuring timely storage and minimizing standby times.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024163171000001_ABST
    Figure 2024163171000001_ABST
Patent Text Reader

Abstract

To provide a medicine sorting device which can present an evidence of a determination result of a medicine and cope with a variety of marks.SOLUTION: A computer (60) includes a feature extraction part (64) and a determination part (65). The feature extraction part creates an extraction mark image (83) in which a mark photographed on a taken image (82) taken with an image of an unknown type of object medicine is extracted, on the basis of an output value acquired by inputting the taken image into a learning model (84) constituted to extract the mark formed on the medicine. The determination part determined the type of object medicine on the basis of a matching result between the extraction mark image and a registration mark image pre-registered for each type of medicine.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a type discrimination device that discriminates the type of medicine by using an image of the medicine, and also to a medicine sorting device that sorts medicines by type. [Background technology]

[0002] Conventionally, multiple types of returned medicines were sorted by type by pharmacists or doctors. The returned medicines are either prescribed to various patients or prescribed and dispensed medicines. Therefore, compared to the dispensing work of assembling (packaging) (one or multiple types) of medicines (tablets) for each dosing period from groups of medicines (medicine cassettes) that have been organized by medicine type in advance in dispensing equipment, etc. based on prescription information for each patient, the types of medicines that are returned together as medicines prescribed for multiple patients are very large. Therefore, it is very useful to automatically sort and reuse returned medicines.

[0003] In the automatic sorting of medicines, it is necessary to identify the type of medicine from the image of the medicine, and one of the major clues for this type identification is the mark formed on the medicine. The mark includes both engraved and printed marks. The content of the mark also varies, and examples include figures, symbols, letters, and numbers.

[0004] Patent Document 2 discloses a medicine sorting device that realizes automatic medicine sorting. The medicine sorting device of Patent Document 2 captures images of multiple types of medicine stored in a first storage unit one by one, identifies the type of medicine based on the captured image, and sorts the medicines by type into second storage units based on the identification results. [Prior art documents] [Patent documents]

[0005] [Patent Document 1] JP 2020-52627 A [Patent Document 2] International Publication No. 2018 / 190394 Summary of the Invention [Problem to be solved by the invention]

[0006] It is difficult to accurately identify the type of medicine based on the mark, because, as described above, the contents of the mark are diverse, and the appearance of the mark in the captured image changes depending on the way the light hits the medicine when the image is captured.

[0007] Here, image processing techniques using machine learning have been known for some time. For example, the above-mentioned Patent Document 1 describes the use of a trained model in the medical field, such as for supporting case judgment using images. More specifically, Patent Document 1 discloses a verification system that determines the validity of a discrimination result output by an output layer of a trained model in response to input of medical information to the input layer of the trained model, based on information on the calculation result stored in a storage unit and the calculation result output by an intermediate layer of the trained model. This verification system makes it possible to verify the validity of the discrimination result.

[0008] Applying a trained model to drug type discrimination is expected to improve discrimination accuracy. However, when using a trained model to discriminate drug types, there is a problem that it is difficult to explain the basis for the discrimination result, in other words, it is difficult to present evidence of the discrimination result. For example, it is difficult to predict what discrimination result will be output when an image of a drug that has not been trained is input to a trained model to discriminate drug types. And when the discrimination result is incorrect, evidence of the discrimination result is required in the medical field. However, when using a trained model such as the one described above, it is difficult to present evidence.

[0009] In addition, as mentioned above, the content of the marks formed on medicines is diverse, so there is also the problem that building a trained model that has learned all of them requires significant costs, including money, manpower, and time.

[0010] One aspect of the present invention aims to realize a type discrimination device that discriminates the type of medicine, which enables the presentation of evidence of the discrimination results and is capable of handling a variety of marks.

[0011] Furthermore, the medicine sorting device of Patent Document 2 does not limit the number of types of medicine that can be stored in the first storage unit. On the other hand, the number of types of medicine that can be stored in the second storage unit is limited. Therefore, if the first storage unit contains more types of medicine than the second storage unit can contain, there will be medicines that cannot be contained in the second storage unit even if the type is determined. The medicine sorting device of Patent Document 2 temporarily holds medicines that cannot be contained in the second storage unit in a standby position (standby tray) different from the second storage unit until they are sorted into the second storage unit.

[0012] In the medicine sorting device of Patent Document 2, after all medicines stored in the first storage unit are transported to the second storage unit or the waiting position, the medicines are removed from the second storage unit, for example, by packaging the medicines in the second storage unit. Thereafter, the medicine sorting device of Patent Document 2 again determines the type of medicines that have been kept waiting at the waiting position, and stores them in the second storage unit by type. Here, if more types of medicines than can be stored in the second storage unit are kept waiting at the waiting position, there will again be medicines that cannot be stored in the second storage unit even if the types have been determined. In this case, the medicine sorting device of Patent Document 2 will once again keep the medicines waiting at the waiting position (the first storage unit or the waiting tray).

[0013] In this way, when the drug sorting device of Patent Document 2 waits for drugs in the waiting position, it determines the type of drug and repeatedly stores the drugs in the second storage section by type based on the determination result until the drugs waiting in the waiting position are all gone.

[0014] Another aspect of the present invention aims to provide a medicine sorting device that makes it possible to reduce the processing time that occurs when medicines are made to wait at a waiting position. [Means for solving the problem]

[0015] In order to solve the other problem described above, a drug sorting device according to one embodiment of the present invention includes a first storage unit having a plurality of first compartments and capable of storing a plurality of types of drugs, a second storage unit having a plurality of second compartments and capable of storing the drugs by type in each of the second compartments, a reading unit that reads information indicating the types of drugs stored in the first storage unit, a counting unit that counts the number of types of drugs stored in the first storage unit based on the information read by the reading unit, an alarm unit that issues an alarm to change the first compartment in which the drugs are to be stored each time the total number of types of drugs counted by the counting unit reaches the number of the second compartments, and a transport unit that transports the drugs stored in the first storage unit to the second storage unit for each of the first compartments and stores them by type in the second storage unit. Effect of the Invention

[0016] According to a medicine sorting device according to another aspect of the present invention, it is possible to reduce the processing time that occurs when medicines are kept waiting at the waiting position. [Brief description of the drawings]

[0017] [Figure 1] 1 is a block diagram showing the overall configuration of a medicine sorting device. [Diagram 2] FIG. 1 is a diagram illustrating a configuration example of a medicine sorting device. [Diagram 3] FIG. 2 is a perspective view showing an overall configuration of an imaging unit and a perspective view showing an example of a medicine placing table. [Figure 4] FIG. 13 is a diagram for explaining the rotation of the imaging unit. [Diagram 5] 1A and 1B are diagrams showing an example of a captured image and an example of an extraction mark image extracted from the captured image; [Figure 6] 13A and 13B are diagrams showing another example of a captured image and another example of an extraction mark image extracted from the captured image. [Figure 7] 13 is a flowchart showing an example of the flow of a determination process. [Figure 8] FIG. 13 is a diagram illustrating an example of teacher data. [Figure 9]13A to 13C are diagrams for explaining the packaging operation of the packaging mechanism when packaging normal medicines. [Figure 10] 13A and 13B are diagrams for explaining the packaging operation of the packaging mechanism when packaging medicines that require caution when heated. [Figure 11] 11A to 11C are diagrams showing examples of packaging by a packaging mechanism, examples of printing, and examples of cutting of packaging sheets. [Figure 12] FIG. 1 is a diagram showing a configuration example of a medicine dispensing system. [Figure 13] 13 is a diagram showing a state in which a two-dimensional code is printed on a medicine packet packaged by a packaging machine. FIG. [Figure 14] 1 is a block diagram showing the overall configuration of a medicine sorting device. [Figure 15] 10 is a flowchart showing an example of a process flow when a medicine is introduced into a first container. [Figure 16] 13 is a flowchart showing an example of the flow of a medicine sorting process. [Figure 17] 11A and 11B are diagrams for explaining a method of capturing an image of the inside of the sorting cup. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0018] [Embodiment 1] [Overview of the medicine sorting device 1] First, an overview of the medicine sorting device 1 will be described with reference to Fig. 1 and Fig. 2. Fig. 1 is a block diagram showing the overall configuration of the medicine sorting device 1. Fig. 2 is a diagram showing an example of the configuration of the medicine sorting device 1, in which 2001 is a perspective view of the medicine sorting device 1 and 2002 is a perspective view showing the basic configuration of the medicine sorting area 2. As shown in Fig. 1 and 2001 and 2002 of Fig. 2, the medicine sorting device 1 includes the medicine sorting area 2, a touch panel 3, a print output unit 4, and a packaging mechanism 6.

[0019] The medicine sorting device 1 takes an image of each of a plurality of types of medicine, determines the type of medicine based on the image obtained as a result of the imaging, and sorts the medicines by type. Specifically, this process is performed in the medicine sorting area 2. The medicine sorting area 2 (the internal configuration of the medicine sorting device 1) will be described later. After the medicines sorted by type are visually inspected by the user, they are packaged or returned to the medicine shelf or packaging machine.

[0020] In this embodiment, the multiple types of medicines are medicines that are not contained in a container or the like, or medicines that are not packaged, and an example of such medicines will be described as tablets or capsules. Also, the multiple types of medicines will be described as returned medicines. The medicines are medicines adopted by a pharmacy or hospital that are returned to the pharmacy or hospital as "returned medicines". However, the multiple types of medicines may also be "brought-in medicines" that may include medicines issued by other pharmacies or hospitals in addition to the adopted medicines at the pharmacy or hospital. After the medicines are returned, the medicine sorting device 1 can automatically perform processes from imaging to sorting.

[0021] The touch panel 3 accepts various user inputs at the operation unit 31, and displays various images on the display unit 32 (for example, an image showing the progress of drug sorting, an image for visual inspection).

[0022] The print output unit 4 prints out a journal representing drug data (e.g., data indicating the drug name, manufacturer, or ingredients) related to the drug after visual inspection according to user input after visual inspection. The drug data may include image data indicating an image specific to the drug.

[0023] The packaging mechanism 6 packages the sorted medicines. The packaging mechanism 6 is an optional mechanism. When the packaging mechanism 6 is provided in the medicine sorting device 1, the medicine sorting device 1 can perform all processes from sorting returned medicines to packaging after visual inspection all at once. In particular, when medicines are fed into the packaging mechanism 6 by the transporting / sorting unit 12, the above processes from sorting to packaging can be performed automatically, except for visual inspection.

[0024] A conventional tablet packing machine or powder packing machine may be used as the packing mechanism 6. In this case, for example, drugs in a sorting cup 141 that have been sorted for each drug type can be packed into one or more packages.

[0025] It should be noted that throughout this specification, the term "packaging" as used at least in the description of the drug sorting device 1 includes both the meaning of "packaging drugs according to the period of administration based on the prescription data" and the meaning of "simply packaging the drugs sorted into the second storage section 14 regardless of the prescription data."

[0026] The medicine sorting device 1 also includes a first RFID (Radio Frequency Identifier) ​​reader / writer unit 5. The first RFID reader / writer unit 5 is provided on the medicine removal side of the base 19, as indicated by 2002 in FIG.

[0027] The first RFID reader / writer unit 5 reads data related to the medicines stored in each sorting cup 141, which is stored in an RFID tag (not shown) provided at the bottom of each sorting cup 141 in the second storage section 14. Examples of the data include data indicating the number of medicines stored, medicine identification data (e.g., GS1 code) for identifying the medicines, data indicating the type of the sorting cup 141, and sorting cup identification information (identification information assigned to the RFID tag) for identifying the sorting cup 141. Note that the medicine data (e.g., medicine name) of the medicines stored in the sorting cup 141, image data acquired by the imaging unit 13, etc. are stored in the storage section 80 in association with the sorting cup identification information.

[0028] The data may also include drug data determined by visual inspection (drug data after visual inspection). The drug data after visual inspection may also be written to the RFID tag. The drug data after visual inspection is used when the drug stored in the corresponding sorting cup 141 is (1) packaged by the packaging mechanism 6 or a packaging machine other than the drug sorting device 1, or (2) returned to the drug shelf. The drug data may also be stored in the memory unit 80 in association with the sorting cup identification information.

[0029] As shown in FIG. 2 at 2001, the medicine sorting device 1 is provided with an opening / closing shutter 51 and an opening / closing door 52 that enable the medicine removal side to be opened and closed.

[0030] [Basic configuration of drug sorting area 2] Next, the basic configuration of the medicine sorting area 2 (the internal configuration of the medicine sorting device 1) will be described with reference to FIG. 1 and 2002 in FIG.

[0031] 1 and 2, the medicine sorting area 2 mainly comprises, as hardware, a first storage section 11, a transport / sorting unit 12 (sorting section), an imaging unit 13, a second storage section 14, a waiting tray 15, a collection tray 16, a medicine insertion port 17, and a second RFID reader / writer unit 18. Each member except for the transport / sorting unit 12 is mounted on a base 19. The main functions of the transport / sorting unit 12, the imaging unit 13, and the second RFID reader / writer unit 18 will be described in detail in the description of each process below.

[0032] The first storage section 11 stores a mixture of multiple types of medicines returned by users. In this embodiment, the first storage section 11 is divided into multiple storage sections. In this case, for example, when all of the medicines stored in one storage section are transported by the transport / sorting unit 12, the medicines stored in the storage section adjacent to the storage section are transported. The first storage section 11 may be provided rotatable about the Z axis (center of the cylindrical shape). In this case, the control section 60a of the computer 60 (type discrimination device) may rotate the first storage section 11 so that the transport / sorting unit 12 can easily obtain the medicines, for example, when one storage section becomes empty.

[0033] The second storage section 14 includes a plurality of sorting cups 141 that store medicines sorted by type. The control section 60a determines the type of medicine based on an image of the medicine captured by the imaging unit 13, and determines the sorting cup 141 in which to store the medicine based on the determination result. The medicine is transported to the determined sorting cup 141 by the transporting / sorting unit 12 and stored therein.

[0034] The standby tray 15 is a temporary storage unit where medicines are temporarily placed. For example, when all of the sorting cups 141 are filled with medicines, medicines determined by the control unit 60a to be of a type other than those are temporarily placed on the standby tray 15. In this case, after the medicines are removed from the sorting cups 141, they may be transported from the standby tray 15 to the sorting cups 141.

[0035] In this embodiment, a suspected drug (described later) that is suspected to be a drug may be temporarily placed on the waiting tray 15. When the suspected drug is temporarily placed, the suspected drug is transported from the waiting tray 15 to a predetermined area of ​​the second container 14, for example, in accordance with the determination result of the control unit 60a.

[0036] The collection tray 16 is a storage unit that stores objects whose types cannot be determined by the control unit 60a (e.g., foreign objects other than medicines). Examples of foreign objects other than medicines include pieces of PTP (Press Through Pack) sheets. The pieces of PTP sheets may be mixed into the first storage unit 11 when medicines are returned. The control unit 60a also stores in the collection tray 16 medicines that are registered in the medicine database 81 as medicines to be discarded or medicines that the user wishes to discard (e.g., medicines with old manufacturing dates).

[0037] When the medicine sorting device 1 is provided with a packaging mechanism 6, the medicine input port 17 is provided for transporting medicines stored in the second storage section 14 to the packaging mechanism 6 by the transport / sorting unit 12. Naturally, when the medicine sorting device 1 is not provided with a packaging mechanism 6, the medicine input port 17 is not necessary.

[0038] As shown in FIG. 1, the medicine sorting device 1 includes a computer 60 that controls the above-mentioned components (hardware). The computer 60 includes a control unit 60a and a storage unit 80. The control unit 60a includes a transport control unit 61, a sorting control unit 62, an image capture control unit 63, a feature extraction unit 64, a discrimination unit 65, an operation input unit 66, a display control unit 67, an RFID control unit 68, a printout control unit 69, a registration unit 70, and a packaging control unit 71. Here, basic processing of the operation input unit 66, the display control unit 67, the RFID control unit 68, the printout control unit 69, and the packaging control unit 71 will be described. The basic processing of the transport control unit 61, the sorting control unit 62, the image capture control unit 63, the feature extraction unit 64, and the discrimination unit 65 will be described in detail in the description of each processing described later. Other processing will be described in each embodiment described later.

[0039] The operation input unit 66 and the display control unit 67 respectively control the operation unit 31 and the display unit 32 of the touch panel 3. The RFID control unit 68 controls the first RFID reader / writer unit 5 and the second RFID reader / writer unit 18. The print output control unit 69 controls the print output unit 4 in accordance with the user input received by the operation input unit 66.

[0040] The registration unit 70 registers the drug data relating to a drug for which the discrimination unit 65 has determined that no drug data corresponding to the image data exists in the drug database 81. Specifically, for a drug for which the discrimination unit 65 has determined that no corresponding drug data exists, the registration unit 70 registers the captured image 82 of the drug in the drug database 81 by linking it with the drug data specified by the user.

[0041] When the medicine sorting device 1 includes a packaging mechanism 6, the control unit 60a includes a packaging control unit 71 that controls the packaging mechanism 6. The packaging control unit 71 controls the operation of the packaging mechanism 6. The packaging control unit 71 also controls the transport / sorting unit 12 to transport the medicines stored in the sorting cup 141 to the medicine insertion port 17.

[0042] The medicine sorting device 1 may also include a barcode reader 7. The barcode reader 7 reads, for example, a barcode indicating medicine data of the medicine printed on a medicine packet (packaging paper) in which the packaging mechanism 6 packages the medicine after sorting. This allows the control unit 60a to perform processing based on the read barcode (for example, displaying the medicine data indicated by the barcode). The packaging mechanism 6 may also include a barcode printing mechanism (not shown) that prints, on the medicine packet, a barcode indicating the medicine data of the medicine packaged in the medicine packet.

[0043] The barcode reader 7 may be any reading device capable of reading information indicating drug data printed on a drug package or the like. The drug sorting device 1 does not necessarily need to include the barcode reader 7. When the control unit 60a performs processing based on the above information, the control unit 60a may obtain the above information by communicating with an external device including the barcode reader 7.

[0044] The computer 60 also includes a storage unit 80. The storage unit 80 prestores a drug database (drug master) 81 that manages drug data on a plurality of types of drugs, and also stores captured images 82 and the like as the drug sorting device 1 performs sorting. The captured image 82 is an image captured by the first camera 131. Specifically, the captured image 82 is an image of a target drug of unknown type taken out of the first container 11. The storage unit 80 also stores an extraction mark image 83 generated by the feature extraction unit 64, and a trained model 84 used by the feature extraction unit 64 to generate the extraction mark image 83.

[0045] The various data stored in the storage unit 80 may not necessarily be managed by the storage unit 80, but may be managed by, for example, an external device. In this case, the control unit 60a may obtain the various data from the external device via a communication line such as the Internet, as necessary. The drug database 81 may be updated by adding new drug data.

[0046] [Overview of processing in medicine sorting device 1] In the medicine sorting device 1, the conveying / sorting unit 12 conveys each medicine returned to the first storage section 11 to the imaging unit 13. The imaging unit 13 sequentially captures an image of each conveyed medicine. The control unit 60a determines the type of each medicine based on the captured image and determines a sorting position in the second storage section 14 for each of the determined medicines. The conveying / sorting unit 12 conveys each medicine to the determined sorting position. Then, information about the medicine stored in the second storage section 14 is written to the RFID tag of the sorting cup 141, stored in the storage section 80, or displayed on the touch panel 3. After or during the sorting of the medicines, the user operates the touch panel 3 to perform visual inspection, packaging, and other processes. Each process will be described in detail below.

[0047] [Drug Delivery Processing to Imaging Unit 13] First, the process of transporting medicine from the first container 11 to the imaging unit 13 will be described with reference to FIG. 1 and 2001 in FIG.

[0048] Specifically, the transport / sorting unit 12 transports the medicines stored in the first storage section 11 to a receiving area Ar1 (see 3002 in FIG. 3) where the imaging unit 13 receives the medicines. The transport control section 61 controls the transport process by the transport / sorting unit 12.

[0049] The transport / sorting unit 12 includes a second camera 121 , a suction / shutter mechanism 122 , and a transport mechanism 123 .

[0050] The second camera 121 sequentially captures images of the first storage unit 11 in order to identify the medicine to be transported. The imaging control unit 63 controls the imaging process of the second camera 121. The second camera 121 is provided at an end of the transport / sorting unit 12 (specifically, of a housing including at least the suction / shutter mechanism 122) facing the base 19. The second camera 121 may be provided at a tip of the suction mechanism described below. The imaging control unit 63 analyzes the captured image and determines whether or not the image contains medicine. If it is determined that the image contains medicine, the transport control unit 61, for example, brings the tip close to the first storage unit 11 and identifies the medicine included in the image captured at that time as the medicine to be transported.

[0051] The suction / shutter mechanism 122 includes a suction mechanism that suctions the medicine identified as the transport target, and a shutter mechanism that prevents the medicine suctioned by the suction mechanism from dropping. The suction mechanism is provided so as to be movable in the Z-axis direction. The shutter mechanism is provided in front of the end so as to be movable approximately parallel to the XY plane.

[0052] When acquiring a medicine, the suction mechanism extends from the end, and after suctioning the specified medicine at its tip, returns to the position of the end. In this state, the transport control unit 61 moves the shutter mechanism to a position facing the end, and maintains the position of the shutter mechanism during the medicine transport (closed state). When the transport control unit 61 moves the suction / shutter mechanism 122 to a position facing the medicine mounting stage 133a (see 3002 in FIG. 3) of the medicine holding mechanism 133 arranged in the receiving area Ar1, it moves the shutter mechanism to a position not facing the end (open state). Then, after the suction mechanism extends from the end, the suction state is released, and the medicine is mounted on the medicine mounting stage 133a.

[0053] The transport mechanism 123 moves the suction / shutter mechanism 122 in the X-axis and Y-axis directions under the control of the transport control unit 61. This transport mechanism 123 enables the movement of the suction / shutter mechanism 122 when searching for a medicine to be transported on the first container 11, or transport of a medicine from the first container 11 to the medicine placement table 133a. Also, in the medicine sorting process, it enables transport of a medicine from the medicine placement table 133a to the second container 14, the waiting tray 15, or the collection tray 16. In the medicine sorting process, the sorting control unit 62 controls the transport / sorting unit 12 to transport the medicine placed in the receiving area Ar1 to a predetermined sorting cup 141 of the second container 14 or the waiting tray 15 based on the discrimination result by the discrimination unit 65.

[0054] [Drug Imaging Processing] Next, the medicine imaging process by the imaging unit 13 will be described with reference to Fig. 1, 2002 in Fig. 2, Fig. 3, and Fig. 4. 3001 and 3002 in Fig. 3 are perspective views showing the overall configuration of the imaging unit 13, and 3003 in Fig. 3 is a perspective view showing an example of the medicine placement table 133a. 4001 and 4002 in Fig. 4 are diagrams for explaining the rotation of the imaging unit 13. The medicine imaging process is mainly performed by the imaging unit 13 and the imaging control unit 63.

[0055] Specifically, the imaging unit 13 is placed on the medicine placement table 133a, and captures an image of the medicine placed in the placement area Ar2 (imaging area) in which the medicine to be imaged is placed, as shown in 3002 in Fig. 3. The imaging control unit 63 controls the imaging process by the imaging unit 13, the pivoting movement of the first camera 131 and the illuminator 134, and the movement of the medicine holding mechanism 133. As shown in Figs. 1 and 3, the imaging unit 13 includes the first camera 131 (imaging section), the rotation mechanism 132 (rotating section), the medicine holding mechanism 133 (medicine placement table, movement mechanism), and the illuminator 134 (ultraviolet light irradiation section, visible light irradiation section).

[0056] The first camera 131 captures an image of a medicine placed in a placement area Ar2 facing the first camera 131 in order to identify the type of medicine in the discrimination unit 65 described later. The medicine holding mechanism 133 is a mechanism for holding a medicine, and includes a medicine placement table (petri dish) 133a, a rotation mechanism 133b (movement mechanism), and an axis portion 133c connecting the medicine placement table 133a and the rotation mechanism 133b, as shown in 3001 and 3002 in FIG. 3. The medicine placement table 133a is for placing a medicine to be imaged. The rotation mechanism 133b is for moving the medicine placement table 133a, and more specifically, rotates the medicine placement table 133a with respect to the XY plane and rotates the axis portion 133c in the circumferential direction of the axis portion 133c.

[0057] When the medicine transported from the first container 11 is placed on the medicine placement table 133a, the imaging control unit 63 drives the turning mechanism 133b to move the medicine placement table 133a from the receiving area Ar1 to the placement area Ar2. Thereafter, the imaging control unit 63 controls at least the first camera 131 and the illuminator 134 to capture an image of the medicine placed in the placement area Ar2. The captured image is stored in the storage unit 80 as a captured image 82. For example, after the imaging is completed, the imaging control unit 63 drives the turning mechanism 133b to move the medicine placement table 133a on which the imaged medicine is placed from the placement area Ar2 to the receiving area Ar1.

[0058] In this embodiment, two medicine placement tables 133a are provided at the tip (end) of the shaft 133c. The turning mechanism 133b turns the shaft 133c, and when one medicine placement table 133a is placed in the placement area Ar2, the other medicine placement table 133a is placed in the receiving area Ar1. When imaging medicines in the placement area Ar2, the transport / sorting unit 12 transports medicines from the first container 11 to the medicine placement table 133a present in the receiving area Ar1, thereby enabling continuous imaging of medicines. Note that it is assumed that the medicine placement table 133a is in a state where no medicine is placed thereon, such as after the medicine is sorted into the second container 14.

[0059] In this embodiment, the medicine placing stand 133a has transparency, so that the first camera 131 can capture images of the medicine placed on the medicine placing stand 133a from multiple directions through the medicine placing stand 133a.

[0060] As shown in 3003 in FIG. 3, the medicine mounting stand 133a may have a substantially V-shaped cross section with a recessed bottom. As shown in 3003 in FIG. 3 and FIG. 4, when the medicine mounting stand 133a is placed in the receiving area Ar1 and the placement area Ar2, the groove direction of the substantially V-shaped cross section (extension direction of the shaft portion 133c) is substantially parallel to the rotation axis Ay of the imaging mechanism (described later) by the rotation mechanism 132. The bottom of the medicine mounting stand 133a may not be a sharp V-shaped shape. As shown in 3003 in FIG. 3, the bottom may include a bottom surface portion 133aa and an inclined surface portion 133ab inclined from two opposing points of the bottom surface portion 133aa. The shape of the bottom portion need only be such that the information (engraved information or printed information) engraved or printed on the medicine can be recognized when viewed (imaged) from the back side of the medicine placement stand 133a, and that the medicine can be fixed in place.

[0061] In the case where the medicine is a capsule or a deformed tablet (e.g., rugby ball-shaped), if the bottom of the medicine placement table 133a is flat, the orientation of the medicine may not be uniform on the XY plane, making it difficult to obtain a clear image of the medicine (engraved information or printed information). If the cross section is approximately V-shaped, the capsule or deformed tablet is fitted into the lowest end, and the medicine can be fixed. This makes it easier to obtain a clear image of the medicine. In the case of a tablet, for example, the axis portion 133c may be rotated in the circumferential direction of the axis portion 133c to make the flat portion (inclined surface portion 133ab) of the medicine placement table 133a face the first camera 131, thereby ensuring that the medicine does not move.

[0062] In addition, the turning mechanism 133b can also vibrate (slightly move or shake) the medicine placement table 133a. In this case, for example, by vibrating and rolling the capsule placed on the medicine placement table 133a, the part of the capsule on which the print is attached can be oriented in a predetermined direction (for example, the part can be made to face the first camera 131 placed in the initial position described below). In addition, by the vibration, even if a cylindrical tablet (with a circular bottom) is placed upright on the flat surface, the tablet can be turned sideways (placed so that the bottom of the tablet faces the flat surface).

[0063] The illuminator 134 emits light to be irradiated onto the medicine when imaging the medicine under the control of the imaging control unit 63. As shown in 3001 of Fig. 3, the illuminator 134 includes a visible light irradiating unit (first irradiating unit 134a and second irradiating unit 134b) that irradiates the medicine with visible light, and an ultraviolet light irradiating unit 134c that irradiates the medicine with ultraviolet light.

[0064] The first irradiation unit 134a and the second irradiation unit 134b irradiate the medicine with white light as visible light. The first irradiation unit 134a is a bar-shaped visible light source (bar illumination), and the second irradiation unit 134b is a ring-shaped visible light source (ring illumination). The first camera 131 receives the visible light emitted from the first irradiation unit 134a or the second irradiation unit 134b and reflected by the medicine, thereby acquiring an image based on the visible light (visible light image). The imaging control unit 63 stores image data indicating the visible light image acquired by the first camera 131 in the storage unit 80 as an imaged image 82.

[0065] The ultraviolet light irradiating unit 134c irradiates the drug with ultraviolet light (e.g., light having a peak wavelength of 365 nm or more and 410 nm or less) to excite the components contained in the drug. This causes fluorescence (e.g., light having a peak wavelength of 410 nm or more and 800 nm or less) to be extracted from the drug. The first camera 131 receives the fluorescence emitted from the drug to obtain an image based on the ultraviolet light (ultraviolet light image). The imaging control unit 63 stores image data indicating the ultraviolet light image obtained by the first camera 131 in the storage unit 80 as the captured image 82.

[0066] As shown in Figs. 3 and 4, the rotation mechanism 132 rotates the first camera 131 so as to revolve around the arrangement area Ar2 (the medicine placement table 133a arranged at that position) where the medicine to be imaged is arranged. The first camera 131 images the medicine arranged in the arrangement area Ar2 from multiple positions to which the rotation mechanism 132 has rotated it. Specifically, the imaging mechanism including the first camera 131 and the illuminator 134 is rotated so as to revolve around the arrangement area Ar2. Therefore, the first camera 131 can image the medicine from multiple directions while maintaining the positional relationship of the first camera 131 and the illuminator 134 with respect to the arrangement area Ar2.

[0067] As shown in 3001 of Fig. 3, the rotation mechanism 132 includes an imaging mechanism driving unit 132a and a power transmission mechanism 132b. The imaging mechanism driving unit 132a generates power for rotating the imaging mechanism around the arrangement area Ar2. The power transmission mechanism 132b transmits the power generated by the imaging mechanism driving unit 132a to the imaging mechanism. The imaging mechanism driving unit 132a is driven under the control of the imaging control unit 63 to change the position of the imaging mechanism around the arrangement area Ar2.

[0068] The rotation mechanism 132 rotates the imaging mechanism between an initial position and a position opposite to the initial position. The initial position is a position in a direction substantially perpendicular to the arrangement area Ar2 and above the arrangement area Ar2. The position opposite to the initial position is a position in a direction substantially perpendicular to the arrangement area Ar2 and below the arrangement area Ar2. This position can also be said to be a position where the first camera 131 faces the bottom of the medicine placement table 133a present in the arrangement area Ar2.

[0069] As shown in Fig. 4, an axis passing through the center of the arrangement area Ar2 and parallel to the Z axis is defined as axis Ax0, and an axis passing through the center of the arrangement area Ar2 and the center of the imaging mechanism is defined as axis Ax1. The angle between axis Ax0 and axis Ax1 is defined as θ. In this embodiment, the rotation mechanism 132 places the imaging mechanism at any one of the positions θ=0° (initial position), 45°, 135°, and 180°. Note that 4001 in Fig. 4 shows a case where the imaging mechanism is at a position of θ=0°, and 4002 in Fig. 4 shows a case where the imaging mechanism has rotated from the initial position to a position of θ=45°.

[0070] In this way, by rotating the imaging mechanism around the arrangement area Ar2, the medicine can be imaged from multiple directions while the medicine is fixed in the arrangement area Ar2. Even if the medicine (tablet) stands upright after shaking the medicine placement table 133a, information indicated by the markings or the like affixed to the medicine can be obtained by imaging from an oblique direction (θ=45° or 135°).

[0071] It should be noted that the imaging mechanism may be fixed and the drug may be rotated to capture images of the drug from multiple directions.

[0072] (Imaging position control) Next, an example of position control of the imaging mechanism will be described. The imaging control unit 63 first sets the imaging mechanism to an initial position, and causes the first camera 131 to capture an image of the medicine placed in the placement area Ar2 at the initial position. At this time, the first camera 131 acquires a visible light image (two visible light images) based on visible light from the first irradiation unit 134a and the second irradiation unit 134b, and also acquires an ultraviolet light image based on ultraviolet light from the ultraviolet light irradiation unit 134c.

[0073] Next, the imaging control unit 63 sets the imaging mechanism at a position opposite to the initial position, and causes the first camera 131 to capture an image of the medicine placed in the placement area Ar2 at that position, thereby acquiring two visible light images and an ultraviolet light image. The discrimination unit 65 analyzes these six images to discriminate the type of medicine. If the type of medicine cannot be identified as one, the imaging control unit 63 causes the first irradiating unit 134a and the second irradiating unit 134b to emit visible light at positions θ=45° and 135°, and causes the first camera 131 to capture an image of the medicine. The discrimination unit 65 analyzes the visible light image at this time to discriminate the type of medicine.

[0074] The position control of the imaging mechanism is not limited to the above, and various methods can be used. For example, imaging may be performed from the initial position after imaging from a position opposite to the initial position. Also, a drug discrimination process based on a visible light image when imaging from a position of θ=45° may be performed, and only if the type of drug cannot be identified as one, a visible light image when imaging from a position of θ=135° may be acquired. Also, only ultraviolet light images may be acquired at the initial position and a position opposite to the initial position, and after a drug discrimination process based on the ultraviolet light image, a visible light image at the position may be acquired. Also, visible light images and ultraviolet light images may be acquired at all positions.

[0075] [Image processing / discrimination processing] Next, image processing of the image captured by the imaging unit 13 and drug discrimination processing based on the results of the image processing will be described with reference to Fig. 1 and Fig. 5 to Fig. 7. The image processing is mainly performed by the feature extraction unit 64, and the discrimination processing is mainly executed by the discrimination unit 65.

[0076] The feature extraction unit 64 generates an extracted mark image 83 by extracting a mark of a medicine shown in a captured image 82 captured by the first camera 131. More specifically, the feature extraction unit 64 generates an extracted mark image 83 by extracting a mark (more precisely, a mark area showing a mark) from the captured image 82 using a trained model 84 constructed to extract a mark formed on a medicine. That is, the feature extraction unit 64 functions as an image generation unit that generates the extracted mark image 83 using the trained model 84. The feature extraction unit 64 can extract a mark from a visible light image, and can also extract a mark from an ultraviolet light image.

[0077] The above-mentioned mark is a mark formed on the surface of the medicine. For example, the category of the above-mentioned mark includes characters (including alphabets and numbers), symbols, designs, pictures, lines (e.g., slits), and code information such as two-dimensional codes formed to indicate the type or manufacturer of the medicine. The method of forming the above-mentioned mark is not particularly limited. For example, the above-mentioned mark may be formed by engraving the surface of the medicine, or may be formed by printing (printing) on ​​the surface of the medicine.

[0078] Furthermore, the feature extraction unit 64 may also perform image processing (image analysis) on the captured image 82 (visible light image and / or ultraviolet light image) to extract features of the drug other than the mark appearing in the captured image 82. Here, the features of the drug are indices that allow the discrimination unit 65 to discriminate the type of drug. Examples of the features of the drug include the above-mentioned marks (stamps, prints, and scoring lines), as well as the size, shape, and representative color of the drug (the color of the area with the stamp or print).

[0079] The feature extraction unit 64 extracts features of the drug other than the mark by executing existing image processing on the captured image 82. The existing image processing may be any processing capable of extracting a plurality of pixel groups having pixel values ​​different from the pixel values ​​of the background, and may be, for example, a known technique such as OCR (Optical Character Recognition) or pattern matching. The feature extraction unit 64 extracts, for example, the size, shape, and representative color of the drug from the visible light image, and extracts the representative color from the ultraviolet light image.

[0080] (About trained models) In this embodiment, a semantic segmentation model (hereinafter referred to as an SS model) that is trained to distinguish between pixels that make up a mark in an image of a medicine and pixels that make up a background portion of the mark is used as an example of the trained model 84. By using the SS model as the trained model 84, it becomes possible to extract marks with irregular shapes with high accuracy.

[0081] The SS model is a model based on a Convolutional Neural Network (CNN) and has an encoder-decoder structure to generate an output image of the same size as an input image. The encoder structure is constructed, for example, by a first neural network having an input layer, a hidden layer, and an output layer, and the decoder structure is constructed by a second neural network having an inverse structure to the encoder structure. In other words, the structures of the input layer, hidden layer, and output layer of the decoder structure are the same as the structures of the output layer, hidden layer, and input layer of the encoder structure.

[0082] When a captured image 82 of an unknown type of target drug is input, the SS model calculates a probability value indicating the probability that each pixel constituting the image of the drug shown in the captured image 82 is a pixel constituting a mark. A pixel with a higher probability value is more likely to be a pixel constituting a mark, and a pixel with a lower probability value is more likely to be a pixel constituting a background portion. The SS model then outputs data in which pixels constituting marks and pixels constituting background portions are classified based on the probability values ​​(for example, data in which pixels constituting the background region are classified as 0 and pixels constituting marks are classified as 1).

[0083] Therefore, the feature extraction unit 64 can generate an extraction mark image 83 by performing image processing on the output value obtained by inputting the captured image 82 captured by the first camera 131 into the SS model. For example, the feature extraction unit 64 may set a pixel having an output value of 0 from the SS model as (R,G,B)=(255,255,255) and a pixel having an output value of 1 from the SS model as (R,G,B)=(0,0,0). This generates an extraction mark image 83 in which pixels constituting the background region are expressed in white and pixels constituting the mark are expressed in black. In this way, the feature extraction unit 64 can generate an extraction mark image 83 based on the output value of the SS model.

[0084] The trained model 84 may be a model that outputs the probability value as an output value. In this case, the feature extraction unit 64 determines whether the probability value of each pixel output from the trained model 84 is equal to or greater than a predetermined threshold, and determines the pixel value of each pixel based on the determination result. In this way, the feature extraction unit 64 generates an extracted mark image 83 in which pixels constituting the mark and pixels constituting the background are separated. The trained model 84 may also be configured to output the extracted mark image 83. In this case, the feature extraction unit 64 may use the output value of the trained model 84 as the extracted mark image 83 as it is.

[0085] 5 and 6 are diagrams showing an example of a captured image 82 and examples of extraction mark images 83 and 830 extracted from the captured image 82. The extraction mark image 83 is an image obtained by inputting the captured image 82 to a trained model 84. The extraction mark image 830 is an image obtained by performing existing image processing on the captured image 82 without using the trained model 84. FIG. 5 shows an example of a captured image 82 obtained by capturing a medicine with no pattern in the background of the marking, and FIG. 6 shows an example of a captured image 82 obtained by capturing a medicine with a pattern in the background of the marking. The "pattern" may be something that appears as a pattern due to the components of the medicine.

[0086] When extracting the marking on a medicine, depending on how the light hits the medicine, it may be difficult to distinguish a part of the marking from the background area. Such a part cannot be recognized as a marking by conventional general image processing using edge detection or binarization, and the detection result is one in which part of the marking is missing, as in extracted mark image 830 in FIG. 5. In this regard, since the trained model 84 has been trained to learn the mark, it is possible to accurately extract the entire marking, as in extracted mark image 83 in FIG. 5.

[0087] In addition, the pixel values ​​of particles of components of the medicine that are reflected in the background area of ​​the imprint (i.e., the surface of the medicine) may be close to the pixel values ​​of the imprint. In such cases, conventional general image processing may determine that part of the background area is the imprint, or may misjudge the boundary between the imprint and the background area, as in the extracted mark image 830 in FIG. 6. In this regard, the trained model 84 has been trained to learn the mark, and therefore can accurately extract the entire imprint, as in the extracted mark image 83 in FIG. 6.

[0088] The discrimination unit 65 compares the extracted mark image 83 generated by the feature extraction unit 64 with the registered mark images registered in advance for each type of medicine, and discriminates the type of the target medicine based on the comparison result. Since the registered mark images are registered in the medicine database 81, the discrimination unit 65 can make the above discrimination by referring to the medicine database 81.

[0089] In comparing the extraction mark image 83 with the registered mark image, a blurred image of the extraction mark image 83 may be used. In other words, the discrimination unit 65 may discriminate the type of the target drug based on the result of comparing the blurred image of the extraction mark image 83 with the registered mark image.

[0090] The reason for performing the blurring process is that, as a result of the study by the inventors of the present application, it has been found that performing the blurring process improves the accuracy of the type discrimination of the target drug compared to the case where the blurring process is not performed. In other words, according to the above configuration, the accuracy of the type discrimination can be improved. When performing the blurring process on the extraction mark image 83, it is desirable to perform the same blurring process on the registration mark image. In addition, the method of the blurring process is not particularly limited, and for example, the blurring process may be a process of applying a smoothing filter to the extraction mark image 83. Examples of the smoothing filter include a binomial (binomial distribution type) filter, a median filter, a Gaussian filter, and a bilateral filter. In addition, the blurring process can also be performed by simple averaging, k-nearest neighbors, gradient calculation, histogram smoothing, or the like.

[0091] The trained model 84 can also be used when generating a registered mark image. That is, an image of a drug whose type is known may be input to the trained model 84, and an extracted mark image generated based on an output value output from the trained model 84 may be used as the registered mark image of the drug.

[0092] As described above, the feature extraction unit 64 may extract features of the drug other than the mark. In this case, the features of the drug other than the mark may be registered in the drug database 81 for each type of drug as master data. The discrimination unit 65 may then compare each feature extracted by the feature extraction unit 64 with the master data to discriminate the type of the target drug.

[0093] For example, suppose that the feature extraction unit 64 analyzes the captured image 82 and extracts information indicating the size, shape, and representative color of a drug as the drug's features. In this case, the discrimination unit 65 can narrow down the types of drugs that match the features extracted by the feature extraction unit 64 from the sizes, shapes, and representative colors of various drugs registered in the master data. Then, the discrimination unit 65 may identify the type of target drug by matching the extracted mark image 83 with the registered mark image for each of the narrowed-down types. Note that it is arbitrary which features are used in what order for narrowing down.

[0094] Furthermore, the discrimination unit 65 may rank candidate types of medicine based on the degree of agreement between the extracted medicine characteristics and the medicine characteristics included in the medicine database 81. For example, the discrimination unit 65 may rank the type candidates extracted based on the representative color based on the degree of agreement between the extracted representative color and the master color data, and then discriminate the type based on other characteristics according to the ranking.

[0095] Furthermore, even if the extracted medicine feature (target feature) is not in the medicine database 81, if it is estimated to be a medicine (tablet or capsule) based on at least a part of the target feature, the discrimination unit 65 determines the type of medicine as a suspected medicine. In this case, the suspected medicine can also be sorted into the second container 14 or the waiting tray 15. In this embodiment, the suspected medicine may first be temporarily placed on the waiting tray 15.

[0096] The discrimination unit 65 outputs the discrimination result of the type of the target drug to the sorting control unit 62. For example, when the type of the target drug can be identified as one, or when the number of candidates is narrowed down to a predetermined number or less, the discrimination unit 65 outputs the drug data regarding the drug as the discrimination result. In this case, the discrimination unit 65 stores the drug data regarding the drug in the storage unit 80 in association with the captured image 82 of the drug.

[0097] When the discrimination unit 65 discriminates that the type of the target medicine is a suspected medicine, it outputs the characteristics of the medicine (the characteristics of the object presumed to be a suspected medicine) as the discrimination result. On the other hand, when the discrimination unit 65 discriminates that the medicine is registered in the medicine database 81 as a medicine to be discarded, or when the discrimination unit 65 discriminates that the object contained in the first container 11 is a foreign object other than a medicine, it outputs the fact that the medicine is not to be sorted as the discrimination result.

[0098] (Effects of image processing and discrimination processing of this embodiment) As described above, the contents of the marks formed on the medicine are diverse, and the appearance of the mark in the captured image 82 changes depending on the way the light hits the medicine when it is captured, so it is difficult to accurately identify the type of medicine based on the mark. Therefore, in order to accurately identify the type of medicine, it is required to be able to handle the variety of marks and to extract the marks formed on the medicine with high accuracy regardless of the change in the appearance of the mark in the captured image 82.

[0099] The feature extraction unit 64 uses a trained model 84 constructed to extract marks formed on a drug, thereby generating an extracted mark image 83 in which the mark formed on the target drug is extracted from the captured image 82. Therefore, the feature extraction unit 64 (1) can handle the diversity of marks, (2) can accurately extract the mark of the target drug from the captured image 82 regardless of changes in the appearance of the mark in the captured image 82, and (3) can accurately extract the mark of the target drug from the captured image 82 even if the target drug has a pattern.

[0100] In addition, since the trained model 84 is a model that has been trained on marks, even if the trained model 84 has not trained a mark, it is possible to extract the mark from the captured image 82 if the mark is similar to the trained mark. Furthermore, the feature extraction unit 64 is able to extract the mark from the captured image 82 regardless of the position or orientation of the mark in the captured image 82.

[0101] Moreover, since it is sufficient to extract marks formed on the target medicine using the trained model 84, it is not necessary to use captured images of all types of medicine that can be handled by the medicine sorting device 1 in order to construct such a trained model 84. Therefore, various marks can be extracted with high accuracy using the trained model 84 constructed without incurring a large cost.

[0102] Here, when using a trained model to distinguish the type of target drug, it is possible to construct trained models such as the following. Comparative Example 1: A trained model trained by linking drug images with drug types (classification labels). Comparative Example 2: A trained model trained with individual letters, numbers, etc. In this case, the trained model is used to extract letters or numbers, etc. attached to the drug one by one from the drug image, and the type of drug is distinguished from the combination of the extracted letters or numbers, etc.

[0103] However, in the case of Comparative Example 1, since it is necessary to prepare a large amount of training data for each type of drug and perform learning, there is a problem that it takes a lot of effort to build a model capable of determining the types of many types of drugs. In addition, since it is difficult to learn about all types of drugs, there is a possibility that an image of a type of drug that has not been learned will be input, and in such a case, it is difficult to predict what kind of discrimination result the trained model will output. In the important discrimination related to the health of patients, such as discrimination of types of drugs, the low explanation of the discrimination result is a major negative factor. In addition, it is difficult to make the trained model discriminate between drugs with only slight differences in their marks as different drugs.

[0104] Also, in Comparative Example 2, there is a possibility that an image of a medicine with a mark that has not been trained or with letters or numbers in a different font from the one that has been trained is input. In these cases, it is difficult to predict what kind of result the trained model will output. In addition, the order of letters or numbers is a feature for identifying the type of medicine. However, the position or orientation of the letters or numbers may differ for each medicine, and the orientation of the medicine shown in the captured image 82 also varies, so it may be difficult to correctly reproduce the order of the detected letters or numbers.

[0105] As such, when using the trained model of Comparative Example 1 or 2 to identify the type of target drug, there are problems such as a possibility that the basis for the discrimination results may lack explanatory power (evidence) and that the reliability of the discrimination results may not be guaranteed.

[0106] On the other hand, the discrimination unit 65 of this embodiment performs the final type discrimination of the target medicine based on the result of matching the extracted mark image 83 with the registered mark image. Specifically, the discrimination unit 65 performs the final type discrimination of the medicine by matching the mark accurately extracted using the trained model 84 and the features other than the mark extracted using existing image processing with the medicine database 81. Therefore, since the computer 60 provided in the medicine sorting device 1 uses the trained model 84 only for at least extracting the mark, the explainability of the basis of the discrimination result can be enhanced, unlike the case where the type of the target medicine is discriminated using the trained model of Comparative Example 1 or 2. In other words, according to the medicine sorting device 1, it is possible to present evidence of the discrimination result.

[0107] In addition, in particular, for the marking or the score line, the appearance of the marking or the score line in the captured image 82 is likely to change depending on the way the light hits the medicine when the medicine is captured. In particular, for medicines with a shallow marking or score line, the appearance is likely to change. Therefore, it is difficult to extract the marking or the score line from the captured image 82 with high accuracy using existing image processing. In particular, when extracting the marking or the score line from the captured image 82, the feature extraction unit 64 can extract the marking or the score line with higher accuracy by using the trained model 84 compared to the case of using existing image processing.

[0108] (Flow of discrimination process) 7 is a flowchart showing an example of the flow of the discrimination process (type discrimination method). The control unit 60a acquires the captured image 82 stored in the storage unit 80 (S1). The feature extraction unit 64 inputs the acquired captured image 82 to the trained model 84 (S2). The feature extraction unit 64 inputs the captured image 82 to the trained model 84 to generate an extraction mark image 83 (S3, image generation step). As described above, the extraction mark image 83 may be a result of performing image processing on the output value of the trained model 84, may be the output result of the trained model 84 itself, or may be generated based on the probability value output by the trained model 84.

[0109] Thereafter, the discrimination unit 65 compares the extracted mark image 83 generated by the feature extraction unit 64 with the registered mark image included in the drug database 81 (S4, discrimination step). In addition, in S4, the discrimination unit 65 may extract features other than the mark of the target drug from the captured image 82 by performing existing image processing on the acquired captured image 82, and compare the features with various master data included in the drug database 81. In this way, in S4, the type of the target drug is discriminated based on the comparison result between the extracted mark image 83 generated in S3 and the registered mark image. Thereafter, the discrimination unit 65 outputs the discrimination result of the type of the target drug based on these comparison results (S5).

[0110] (Example of building a trained model) The trained model 84 is constructed, for example, as follows. FIG. 8 is a diagram showing an example of teacher data 181. The teacher data 181 is data in which a captured image 182 of a known type of medicine is associated with correct answer data 183 of the captured image 182. The correct answer data 183 is data in which a mark is extracted from the captured image 182. The correct answer data 183 is generated by, for example, specifying the outer edge of the mark in the captured image 182 by a user input, and distinguishing the inside of the area surrounded by the specified outer edge from the outside of the area. In the example of FIG. 8, the inner area (i.e., the mark area) of the mark and the dividing line specified in the captured image 182 and the outer area (i.e., the background area) are distinguished by performing a binarization process. A plurality of captured images 182 are prepared, and correct answer data 183 is associated with each captured image 182 to form teacher data 181, thereby preparing a plurality of teacher data 181.

[0111] The trained model 84 is constructed by sequentially inputting the teacher data 181 and performing machine learning. The trained model 84 is constructed, for example, by a model generating device (not shown), but is not limited to this and may be constructed, for example, by the computer 60. In this case, the computer 60 also has a function as a learning device that constructs the trained model 84 by machine learning using the teacher data 181.

[0112] [Medicine sorting process] Next, the medicine sorting process based on the result of the above-mentioned discrimination process will be described with reference to Fig. 1. The medicine sorting process is mainly performed by the transport / sorting unit 12 and the sorting control unit 62.

[0113] The transporting and sorting unit 12 sorts the medicines by type based on the discrimination result by the discrimination section 65, and stores them in the second storage section 14 or the waiting tray 15. The sorting control section 62 controls the transporting and sorting unit 12 to transport the medicines placed in the receiving area Ar1 after the imaging and discrimination process to a predetermined sorting cup 141 in the second storage section 14 or the waiting tray 15 based on the discrimination result.

[0114] When the sorting control unit 62 receives the discrimination result of the medicine, it determines a sorting position to store the medicine, and associates the discrimination result with the determined sorting position and stores them in the memory unit 80. Specifically, the sorting control unit 62 determines whether or not a discrimination result identical to the above discrimination result is stored in the memory unit 80.

[0115] When the same discrimination result as the above discrimination result is stored, the sorting cup 141 linked to the stored discrimination result is determined as the sorting position. When the sorting position linked to the stored discrimination result (e.g., estimated drug) is the waiting tray 15, the waiting tray 15 is determined as the sorting position. On the other hand, when the same discrimination result as the above discrimination result is not stored, the sorting cup 141 that does not store a drug (the sorting cup 141 that has not been determined as the sorting position) is determined as the sorting position. When drugs are stored in all of the sorting cups 141, the waiting tray 15 is determined as the sorting position. Note that, for the estimated drug, the sorting control unit 62 may determine any of the sorting cups 141 included in a predetermined area of ​​the second storage unit 14 as the sorting position instead of the waiting tray 15.

[0116] When the sorting control unit 62 determines the sorting position, it controls the transport mechanism 123 in the same manner as the transport control unit 61 to move the transport / sorting unit 12 above the receiving area Ar1. Similarly to the transport control unit 61, the sorting control unit 62 controls the second camera 121 and the suction / shutter mechanism 122 to adsorb the medicines placed in the receiving area Ar1. Thereafter, the transport mechanism 123 transports the medicines to the determined sorting cup 141 or waiting tray 15. As described above, the shutter mechanism is in a closed state during the medicine transport, so that it is possible to prevent the medicines from falling into an area other than the determined sorting position (e.g., a sorting cup 141 other than the determined sorting cup 141). After the transport, the suction is released to store the medicines in the sorting cup 141 or waiting tray 15. In addition, the sorting control unit 62 counts the number of medicines stored in the sorting cup 141, and stores the number in the memory unit 80 in association with the sorting position.

[0117] After the sorting control section 62 transports the medicines (medicines after identification) on the medicine placement table 133a arranged in the receiving area Ar1 to the sorting position, the transport control section 61 controls the transport / sorting unit 12 to transport and place the medicines stored in the first storage section 11 on the now emptied medicine placement table 133a. This allows the medicine sorting device 1 to continuously identify the types of medicines.

[0118] In addition, if the sorting control unit 62 receives a discrimination result indicating that the type of medicine could not be identified, the object placed in the receiving area Ar1 after discrimination is a foreign object, and therefore the sorting control unit 62 transports the foreign object to the collection tray 16.

[0119] In this way, the sorting control unit 62 stores all of the items contained in the first container 11 in either the second container 14, the waiting tray 15, or the collection tray 16, regardless of the result of identifying the type of medicine. Therefore, even if the type of medicine cannot be identified or a foreign object has been mixed into the first container 11, the sorting process can be continued without being stopped for that reason.

[0120] In order to take out the medicines for which the discrimination process has been completed from the medicine placing table 133a arranged in the receiving area Ar1, the sorting control unit 62 causes the second camera 121 to capture an image of the medicine placing table 133a, thereby narrowing down the positions of the medicines. In addition, when transporting the medicines stored in the sorting cup 141 to the packaging mechanism 6, the sorting control unit 62 causes the second camera 121 to capture an image of the sorting cup 141, thereby narrowing down the medicines to be transported.

[0121] In addition, when the number of drugs stored in the sorting cup 141 reaches the upper limit, the sorting control unit 62 stores the drugs to be sorted in an empty sorting cup 141 other than the sorting cup 141, even if the type of drug to be sorted is the same as the type of drug sorted in the sorting cup 141.

[0122] Furthermore, data on the medicines stored in the sorting cup 141 by the sorting control unit 62 is stored in an RFID tag provided in the sorting cup 141 by the second RFID reader / writer unit 18.

[0123] The second RFID reader / writer unit 18 writes various data to the RFID tag or reads various data stored in the RFID tag, similar to the first RFID reader / writer unit 5. The sorting control unit 62 causes the RFID control unit 68 to write data related to the medicine every time the medicine is stored in the sorting cup 141. The second RFID reader / writer unit 18 is provided below the second storage unit 14. Specifically, the second RFID reader / writer unit 18 is provided so as to face the bottom of each sorting cup 141 when reading or writing data related to the medicine stored in the RFID tag of each sorting cup 141.

[0124] [Embodiment 2] Other embodiments of the present invention will be described below. For the sake of convenience, the same reference numerals will be used to designate components having the same functions as those described in the above embodiment, and the description thereof will not be repeated. The same applies to the following embodiments.

[0125] Among the medicines sorted by the medicine sorting device 1, there are medicines that are sensitive to heat and may discolor when affected by heat. The heat-sensitive medicines may discolor due to the heat from the packaging mechanism 6, particularly the heater roller 6b described later, during a series of steps related to the packaging process. In this embodiment, a configuration for reducing the possibility of medicines discoloring due to the heat of the heater roller 6b of the packaging mechanism 6 in the medicine sorting device 1 equipped with the packaging mechanism 6 will be described with reference to Figs. 9 to 11. In the second embodiment, for the sake of simplicity, medicines that are sensitive to heat are referred to as "medicines that require caution when heated HMD" and other medicines are referred to as "normal medicines MD". In addition, the term "medicines" is used as a general term for normal medicines MD and medicines that require caution when heated HMD.

[0126] FIG. 9 is a diagram for explaining the packaging operation of the packaging mechanism 6 when packaging a normal medicine MD. 9001 in FIG. 9 is a schematic diagram of the packaging mechanism 6. 9002 in FIG. 9 is a schematic diagram of the heater roller 6b when viewed from the direction of the white arrow R in 9001. FIG. 10 is a diagram for explaining the packaging operation of the packaging mechanism 6 when packaging a heat-sensitive medicine HMD. 10001 in FIG. 10 is a schematic diagram of the packaging mechanism 6. 10002 in FIG. 10 is a schematic diagram of the heater roller 6b when viewed from the direction of the white arrow R in 10001. FIG. 11 shows an example of packaging by the packaging mechanism 6, an example of printing, and an example of cutting the packaging sheet.

[0127] 9 and 10, the packaging mechanism 6 includes a packaging hopper 6a, a heater roller 6b, a moving passage 6c, and a shutter mechanism 6e. The heater roller 6b and the shutter mechanism 6e are controlled by a packaging control unit 71.

[0128] The packaging hopper 6a receives the medicines that have been inserted through the medicine insertion port 17 and passed (fall) through the moving passage 6c, and guides the medicines to the packaging paper PP that is set on the heater roller 6b and is at the standby position Ar4.

[0129] The heater roller 6b heat-seals a portion of the packaging paper PP to package medicines into individual packets. The heater roller 6b is a pair of rollers extending in a direction substantially perpendicular to the conveying direction of the packaging paper PP (the direction indicated by the arrow Q1) and arranged to sandwich the packaging paper. The heater roller 6b includes a horizontal fusion heater 6bw for fusing the horizontal fusion portion Cr1 and a vertical fusion heater 6bh for fusing the vertical fusion portion Cr2. As the packaging paper PP is conveyed in the conveying direction, the heater roller 6b rotates in the direction of the arrow Q2 shown in Figs. 9 and 10 to fuse the horizontal fusion portion Cr1 and also fuse the vertical fusion portions Cr2 at any intervals.

[0130] The transfer path 6c is provided between the medicine inlet 17 and the packaging hopper 6a, and guides the medicines input through the medicine inlet 17 to the packaging hopper 6a. The transfer path 6c also guides the medicines input through the medicine inlet 17 to a holding area Ar3 above the shutter 6ea, which will be described later.

[0131] The shutter mechanism 6e functions as a medicine holding section that temporarily holds medicines input from the medicine input port 17 in the holding area Ar3 until all of the medicines to be included in one package created by the packaging mechanism 6 are input from the medicine input port 17. In other words, the shutter mechanism 6e prevents medicines from being input to the packaging hopper 6a until all of the medicines to be included in one package are input from the medicine input port 17. In this embodiment, the shutter mechanism 6e is provided between the packaging hopper 6a and the moving passage 6c, but is not limited thereto, and may be provided, for example, inside the packaging hopper 6a or the moving passage 6c.

[0132] As shown by 9001 in Fig. 9 and 10001 in Fig. 10, the shutter mechanism 6e includes a shutter 6ea that can be opened and closed. The shutter mechanism 6e also includes a shutter drive unit (not shown). The shutter drive unit controls the opening and closing operation of the shutter 6ea by driving the shutter 6ea. 9001 in Fig. 9 and 10001 in Fig. 10 show a state in which the shutter 6ea is closed.

[0133] [Regarding regular drug MD packaging] First, with reference to Fig. 9, the control of the packaging control unit 71 when the medicine to be packaged is a normal medicine MD will be described. When the medicine to be packaged is a normal medicine MD, the packaging control unit 71 controls the packaging mechanism 6 so that the following operations (i) to (iii) are repeated after the last medicine of multiple medicines to be included in one package is input into the medicine input port 17. Inputting the last medicine of multiple medicines to be included in one package into the medicine input port 17 means that the last medicine of multiple medicines contained in a certain sorting cup 141 is input into the medicine input port 17. When only one medicine is contained in a certain sorting cup 141, that medicine is the last medicine.

[0134] (i) The packaging control unit 71 controls the heater roller 6b to heat-seal the packaging paper PP and feed the packaging paper PP by one packet in the direction indicated by the arrow Q1. This allows the packaging control unit 71 to move the normal medicine MD that has been waiting at the standby position Ar4 until all of the normal medicine MD to be packaged this time have been input into the medicine input port 17 from the standby position Ar4 to the fused area Ar5 while packaging them. (ii) The packaging control unit 71 opens the shutter 6ea, drops all of the normal medicine MD held in the holding area Ar3, and then closes the shutter 6ea again. (iii) After the last normal medicine MD of the normal medicine MD to be included in the next package is input into the medicine input port 17, the packaging control unit 71 returns to the process of (i). Note that when packaging the normal medicine MD to be included in the first package, the packaging control unit 71 may not perform the process of (i) and may start with the process of (ii).

[0135] When the above process is performed, as shown in Fig. 9, the medicine in the packaging paper PP at the standby position Ar4 waits at the standby position Ar4 until the medicine to be packaged next is held on the shutter 6ea. Since the standby position Ar4 is a position where the medicine is sandwiched between the pair of heater rollers 6b, the medicine at the standby position Ar4 is easily affected by the heat from the heater roller 6b. Therefore, when the medicine to be packaged is a medicine HMD that requires attention to heating, the packaging control unit 71 may perform the following control, for example.

[0136] [Regarding packaging of heat-sensitive drugs (HMD)] The control of the packaging control unit 71 when the medicine to be packaged is a heat-caution medicine HMD will be described below with reference to Fig. 10. When the medicine to be packaged is a heat-caution medicine HMD, the packaging control unit 71 controls the packaging mechanism 6 to perform the following operations after the last medicine of multiple medicines to be included in one package is input into the medicine input port 17.

[0137] (iv) In a state where the previously packaged heat-sensitive medicine HMD is in the fused area Ar5, the packaging control unit 71 controls the heater roller 6b to heat-seal the packaging paper PP while feeding the packaging paper PP by one packet in the direction indicated by the arrow Q1. This allows the packaging control unit 71 to make the next packet of the previously packaged heat-sensitive medicine HMD an empty packet that does not contain medicine.

[0138] (v) The packaging control unit 71 opens the shutter 6ea, drops all the heat-sensitive medicaments HMD held in the holding area Ar3, and then closes the shutter 6ea again. As a result, the heat-sensitive medicaments HMD to be packaged this time are inserted into the packaging paper PP, which is in the waiting position Ar4 and is to be made as the next package after the blank package.

[0139] (vi) The packaging control unit 71 controls the heater roller 6b to heat-seal the packaging paper PP containing the heat-sensitive drug HMD at the waiting position Ar4, and sends one package in the direction indicated by the arrow Q1, moving the heat-sensitive drug HMD to the fused area Ar5. This allows the heat-sensitive drug HMD inserted into the packaging paper PP at the waiting position Ar4 where the heater roller 6b is present to be sent from the waiting position Ar4 to the fused area Ar5 without waiting at the waiting position Ar4. In other words, while the heat-sensitive drug HMD to be included in the next package is being input from the drug input port 17, the heat-sensitive drug HMD to be packaged this time is packaged and present in the fused area Ar5, not in the waiting position Ar4.

[0140] (vii) In this state, after the last heat-caution drug HMD among the target heat-caution drug HMD to be included in the next packet is inserted into the drug insertion port 17, the packaging control unit 71 sends the packaging paper PP by one packet in the direction shown by arrow Q1 (i.e., returns to the process of (iv)). This allows the packaging control unit 71 to make the next packet of the heat-caution drug HMD packaged this time into an empty packet containing no drug, before dropping the next heat-caution drug HMD into the standby position Ar4.

[0141] In addition, when packaging a heat-sensitive medicine HMD to be included in the first package, or when packaging a heat-sensitive medicine HMD after a normal medicine MD has been packaged, the packaging control unit 71 may not perform the process of (iv) and may start with the process of (v). The packaging control unit 71 may create two or more blank packages, not limited to one package, or may create blank packages smaller than the dimensions of a specified package (e.g., blank packages whose length in the direction indicated by the arrow Q1 is half the length of a specified package). It is sufficient that a blank package or space large enough to allow the packaged heat-sensitive medicine HMD to move to a position where it is less susceptible to the heat of the heater roller 6b is formed between the packaged heat-sensitive medicine HMD and the heater roller 6b (standby position Ar4). The packaging control unit 71 may move the packaging paper PP in the direction indicated by the arrow Q1 so as to form the blank package or space.

[0142] As described above, the packaging control unit 71 drops the heat caution drug HMD to the standby position Ar4, and then sends the packaging paper PP for at least one packet in the direction indicated by the arrow Q1, thereby packaging the heat caution drug HMD and sending it to the fused area Ar5. After that, after all of the next heat caution drug HMD are input into the drug input port 17, the packaging control unit 71 sends the packaging paper PP for at least one packet in the direction indicated by the arrow Q1, thereby creating at least the next packet of the heat caution drug HMD previously packaged as an empty packet. After that, the packaging control unit 71 drops the heat caution drug HMD held in the holding area Ar3 to the standby position Ar4, thereby inserting the heat caution drug HMD into the next packet of the empty packet.

[0143] When the above process is performed, the packet paper PP at standby position Ar4 is empty during the standby time until the next medicine to be packaged is held on shutter 6ea, as shown in Fig. 10. Furthermore, the packet paper PP after being heat-sealed by the above-mentioned operation (iv) or (vii) of the packaging mechanism 6 is dispensed from the packaging mechanism 6 as a packet sheet including an empty packet, as shown at 11001 in Fig. 11.

[0144] In addition, the packaging control unit 71 may send at least two packets of packaging paper PP in the direction indicated by the arrow Q1 after dropping the heat caution drug HMD into the waiting position Ar4. In other words, after dropping the heat caution drug HMD into the waiting position Ar4, the packaging control unit 71 may not only package the heat caution drug HMD, but also create a blank package as the next package of the packaged heat caution drug HMD. In this case, the packaging control unit 71 can create a blank package before or while the next heat caution drug HMD is being inserted into the drug insertion port 17, rather than after the next heat caution drug HMD is inserted into the drug insertion port 17. In addition, the packaged heat caution drug HMD can wait at a position farther away from the heater roller 6b by the amount of the blank package created while the next heat caution drug HMD is being inserted into the drug insertion port 17. Therefore, the influence of heat from the heater roller 6b on the packaged heat caution drug HMD can be further reduced.

[0145] (Caution when dividing HMD packages of drugs that require heating) When the heat-sensitive medicine HMD is dispensed from the packaging mechanism 6 as a packaging sheet including a blank package as described above, the user may be alerted by using the printing on the blank package. Specifically, as shown in 11001 in Fig. 11, in the packaging sheet packaging the heat-sensitive medicine HMD, a printing mechanism (not shown) provided in the packaging mechanism 6 may print specific characters or pictures on the blank package portion. Specifically, characters such as "heat protection" or "SKIP", or pictures or symbols may be printed so that it is clear that the blank package is for heat protection purposes.

[0146] Here, it is preferable that the user carefully visually checks the heat-sensitive drug HMD for discoloration before returning it to the drug cassette of the packaging machine or to the drug shelf. By printing in this way, the user can easily understand that the drug package in front of the blank package labeled "heat countermeasure" or the like is a heat-sensitive drug HMD, and this can assist the user in the above visual check task.

[0147] (About the cutting position of the packaging sheet when packaging HMD medicines that require heating) The series of packaging sheets fused by heater roller 6b is cut into a predetermined number of packages by a cutting mechanism (not shown) of packaging mechanism 6 for subsequent work. The cutting mechanism is controlled by packaging control unit 71. 11002 and 11003 in Fig. 11 both show examples of cutting packaging sheets when the set number of packages to be cut is set to 3. The positions of the outlined arrows in 11002 and 11003 in Fig. 11 indicate the cutting positions.

[0148] In cutting example 1 shown at 11002 in Fig. 11, the cutting mechanism cuts the packaging sheet every three packets from the top. A packaging sheet cut to the set number of packets is called a cutting unit. The cutting mechanism cuts the packaging sheet just before drug B, which is the switching position between the heat-sensitive drug HMD (drug A) and the normal drug MD (drug B). In this case, a cutting unit containing drug A includes a blank packet, so the position of the drug packet containing drug A differs depending on the cutting unit.

[0149] On the other hand, in cutting example 2 shown at 11003 in FIG. 11, the cutting mechanism cuts the packaging sheet every three packets from the top. When the top of a cutting unit is an empty packet, the cutting mechanism cuts only the empty packet by one packet. Furthermore, the cutting mechanism cuts the packaging sheet just before drug B, which is the switching position between the heat-warning drug HMD (drug A) and the normal drug MD (drug B). In this case, all cutting units containing drug A are identical cutting units in which drug packets containing drug A are arranged at both ends and empty packets are included between them. By cutting as in cutting example 2, the arrangement of drug A in the cutting units is the same, improving the appearance of the cutting units dispensed from the packaging mechanism 6. In addition, the user's work efficiency can be improved in the subsequent visual inspection and / or filling into a drug shelf, etc.

[0150] Cutting example 2 shown in 11003 of FIG. 11 can be applied when the set number of cut packages is an odd number equal to or greater than 5, and in this case, the same effect can be obtained as when the set number of packages is 3 as described above.

[0151] [Embodiment 3] The medicine sorting device 1 of the first embodiment determines the type of medicine one by one for all medicines stored in the first storage unit 11, and stores them by type in the second storage unit 14. When the first storage unit 11 stores more types of medicines than the number of sorting cups 141 arranged in the second storage unit 14, some medicines cannot be stored in the second storage unit 14 even if the types are determined, and some medicines are stored in the waiting tray 15. When a medicine is stored in the waiting tray 15, the medicine sorting device 1 determines the type of the medicine again and stores it in the second storage unit 14. Then, every time a medicine that cannot be stored in the second storage unit 14 occurs, the medicine sorting device 1 determines the type of the medicine and attempts to store it in the second storage unit 14.

[0152] In the present embodiment, a medicine dispensing system 100 that can store a medicine stored in a first container 11 in a second container 14 without waiting for storage in the second container 14 will be described.

[0153] [Medicine dispensing system] The medicine dispensing system 100 of this embodiment will be described. Fig. 12 is a diagram showing a configuration example of the medicine dispensing system 100. Fig. 13 is a diagram showing a state in which a two-dimensional code is printed on a medicine packet packed by a packing machine 110.

[0154] 12, the medicine dispensing system 100 is a system that dispenses various medicines based on, for example, prescription data, and is a system installed in a medical institution such as a pharmacy or a hospital. The medicine dispensing system 100 includes, for example, a packaging machine 110 and a medicine sorting device 1A.

[0155] The packing machine 110 is a device that dispenses medicines based on, for example, prescription data. Specifically, the packing machine 110 is a device that packs medicines such as tablets or capsules. When packing medicines, the packing machine 110 prints information indicating the type of medicine to be packed as a two-dimensional code on the surface of a packing paper that contains the medicine. Specifically, as shown in FIG. 13, the packing machine 110 prints information indicating the type of medicine to be packed in the medicine packet MP1 as a two-dimensional code Co1 on a medicine packet MP1 that packages medicines in a packing unit using packing paper. As shown in FIG. 13, information indicating the type of medicine to be packed in the medicine packet MP2 is printed as a two-dimensional code Co2 on the medicine packet MP2, and information indicating the type of medicine to be packed in the medicine packet MP3 is printed as a two-dimensional code Co3 on the medicine packet MP3.

[0156] In this embodiment, the information indicating the type of medicine may be, for example, the name of the packaged medicine or a YJ code. In this embodiment, the information indicating the type of medicine is printed on the medicine package as a two-dimensional code (e.g., QR code (registered trademark)), but may be printed in other formats such as a barcode. The information indicating the type of medicine printed on the medicine package is read by the medicine sorting device 1A, as described below. Therefore, it is sufficient that the information indicating the type of medicine is printed on the medicine package in a format that can be read by the medicine sorting device 1A.

[0157] However, printing of information indicating the type of medicine on the packaging paper does not necessarily have to be performed by the packing machine 110. For example, the printing may be performed by a printing device (not shown) that is a device separate from the packing machine 110. In this case, for example, the packing machine 110 may transmit information indicating the type of medicine contained in the medicine packet to the printing device, and the printing device may print the information on the medicine packet dispensed from the packing machine 110.

[0158] The medicine sorting device 1A is a device that identifies the types of medicines inputted into the medicine sorting device 1A and sorts the medicines by type, similar to the medicine sorting device 1. A specific configuration of the medicine sorting device 1A will be described later.

[0159] In the medicine dispensing system 100, medicines dispensed by the packing machine 110 are handed over to the patient for whom the medicine has been prescribed. The medicines handed over to the patient may be returned to the medical institution equipped with the medicine dispensing system 100. The returned medicines are input into the medicine sorting device 1A by a user (e.g., a medical professional such as a pharmacist) and sorted by type in order to be returned to the packing machine 110 or a medicine shelf (not shown).

[0160] [Medicine sorting device] Fig. 14 is a block diagram showing the overall configuration of the medicine sorting device 1A. As shown in Fig. 14, the medicine sorting device 1A includes a reading unit 8 and a control unit 60Aa in addition to the components of the medicine sorting device 1. In addition to these components, the first storage unit 11, the second storage unit 14, the transport / sorting unit 12, the packaging mechanism 6, and the display unit 32 of the touch panel 3 will also be described below.

[0161] As described in the first embodiment, the first storage section 11 is a storage section capable of storing a plurality of types of medicine, and is divided into a plurality of storage sections (specifically, four storage sections). In this embodiment, the four storage sections into which the first storage section 11 is divided are respectively referred to as first sections 111a to 111d. The first sections 111a to 111d may be collectively referred to as first sections 111. The number of first sections 111 may be any number other than four, so long as it is more than one. Furthermore, the first storage section 11 is capable of storing medicine packaged by the packaging machine 110, as described above.

[0162] As described in the first embodiment, the second storage section 14 is a storage section in which a plurality of sorting cups 141 can be arranged, and each of the plurality of arranged sorting cups 141 can store medicines by type. Instead of the removable sorting cup 141, the second storage section 14 may be provided with a plurality of compartments in which medicines can be stored. The sorting cups 141 and the compartments can also be referred to as second compartments in which medicines can be stored by type. In this embodiment, the total number of sorting cups 141 (the number of second compartments; hereinafter, also simply referred to as the total number of sorting cups 141) that can be stored in the second storage section 14 is 40, but this is not limited as long as it is a plurality.

[0163] The transporting / sorting unit 12 functions as a transporting section that transports the medicines stored in the first storage section 11 to the second storage section 14 for each first section 111, and stores them in sorting cups 141 by type in the second storage section 14.

[0164] The transporting and sorting unit 12 transports all of the medicines stored in one first section 111 (e.g., first section 111a) to the second storage section 14 or the waiting tray 15 based on the discrimination result by the discrimination section 65. For medicines whose types can be discriminated, the transporting and sorting unit 12 stores them by type in the respective sorting cups 141 of the second storage section 14. For medicines whose types cannot be discriminated, the transporting and sorting unit 12 stores them in the waiting tray 15.

[0165] After completing the sorting process for all of the medicines contained in one first section 111, the transporting and sorting unit 12 transports all of the medicines contained in the sorting cups 141 of the second storage section 14 to the packaging mechanism 6. Thereafter, the transporting and sorting unit 12 starts transporting the medicines contained in another first section 111 (e.g., first section 111b) to the second storage section 14. This allows the medicines contained in the first section 111 to be transported to the second storage section 14 while there is space in the second storage section 14.

[0166] The conveying / sorting unit 12 executes the above-mentioned conveying process until all the medicines are removed from the first compartments 111. That is, in this embodiment, after the sorting process of the medicines contained in the first compartment 111a is completed and the packaging process of the medicines contained in the second container 14 is completed, the sorting process of the medicines contained in the first compartment 111b is started. After that, after the sorting process of the medicines contained in the first compartment 111b is completed and the packaging process of the medicines contained in the second container 14 is completed, the sorting process of the medicines contained in the first compartment 111c is started. After that, after the sorting process of the medicines contained in the first compartment 111c is completed and the packaging process of the medicines contained in the second container 14 is completed, the sorting process of the medicines contained in the first compartment 111d is started.

[0167] As described in the first embodiment, the packaging mechanism 6 functions as a packaging section that packages the medicines stored in the second storage section 14. The transport / sorting unit 12 transports all the medicines stored in one first section 111 to the second storage section 14 or the waiting tray 15, and then transports the medicines stored in the second storage section 14 to the medicine input port 17. Thereafter, the packaging mechanism 6 starts packaging the medicines stored in the sorting cup 141 of the second storage section 14. As a result, even if the sorting cup 141 is entirely filled with medicines, the medicine sorting device 1A can make space in the sorting cup 141 by packaging the medicines. Therefore, the medicine sorting device 1A can transport the next medicine to be sorted to the second storage section 14.

[0168] The reading unit 8 reads information indicating the type of medicine contained in the first container 11. In this embodiment, the reading unit 8 reads a two-dimensional code printed on the medicine packet. Specifically, before the user puts the medicine contained in the medicine packet into the first container 11, the reading unit 8 reads the two-dimensional code printed on the medicine packet. The reading unit 8 only needs to be able to read information indicating the type of medicine contained in the medicine packet. For example, when the information printed on the medicine packet is a barcode, the reading unit 8 may be a barcode reader.

[0169] The display unit 32 notifies the user to store the medicine in the first compartment 111 designated as the storage destination of the medicine by the compartment designation unit 72 described later. In this way, the medicine sorting device 1A can allow the user to store the medicine in the designated first compartment 111. The display unit 32 also functions as a notification unit that notifies the user to change the first compartment 111 as the storage destination of the medicine every time the total number of types of medicine counted by the counting unit 73 described later reaches the total number of sorting cups 141 (40 in this embodiment).

[0170] The notification to store medicines in the specified first section 111 does not necessarily have to be made by the display unit 32. For example, the notification may be made by a sound output unit (not shown) that outputs sound. That is, the medicine sorting device 1A only needs to have a notification unit that notifies various information.

[0171] Furthermore, after the sorting process for all the medicines contained in one first section 111 is completed, packaging by the packaging mechanism 6 may not be performed. In this case, after the sorting process is completed, the display unit 32 may notify the user to replace the sorting cup 141 with a new one containing no medicine. Furthermore, the display unit 32 may notify the user to empty the sorting cup 141 arranged in the second storage unit 14. Even in this case, it is possible to make space in the sorting cup 141 before transporting the medicines contained in the next first section 111 to the second storage unit 14.

[0172] The control unit 60Aa further includes, for example, a partition designation unit 72, a counting unit 73, and a type number determination unit 74 in addition to the configuration of the control unit 60a.

[0173] The section designation unit 72 designates one of the first sections 111a to 111d as the first section 111 to accommodate the medicine. The section designation unit 72 changes the designated first section 111 every time the type number determination unit 74 determines that the total number of types of medicine counted by the counting unit 73 (total number of types of medicine) exceeds the total number of sorting cups 141.

[0174] The first section 111 designated by the section designation unit 72 as the initial position when the medicine sorting process is started, and the designation order of the first section 111 by the section designation unit 72 are preset. Therefore, the section designation unit 72 changes the first section 111 to be used as a storage destination for the medicine, in accordance with the preset designation order, every time it is determined that the total number of types of medicine counted by the counting unit 73 exceeds the total number of sorting cups 141. The section designation unit 72 transmits information indicating the designated first section 111 to the display control unit 67, for example, every time it receives a determination result from the type number determination unit 74.

[0175] For example, the first section 111a is set as the initial location of the medicine storage destination, and the designation order of the first sections 111 is set as the first section 111a, the first section 111b, the first section 111c, and the first section 111d. In this case, in this embodiment, when the medicine sorting process is started, the section designation unit 72 designates the first section 111a as the medicine storage destination. As a result, the display control unit 67 displays an image on the display unit 32 to notify the user to store the medicine in the first section 111a. Thereafter, each time it is determined that the total number of types of medicine counted by the counting unit 73 has reached the total number of the sorting cups 141, the section designation unit 72 changes the medicine storage destination to the first section 111b, the first section 111c, and the first section 111d in that order. As a result, the display control unit 67 sequentially displays on the display unit 32 (i) an image for notifying the user to place the medicine in the first section 111b, (ii) an image for notifying the user to place the medicine in the first section 111c, and (iii) an image for notifying the user to place the medicine in the first section 111d.

[0176] Counting unit 73 counts the number of types of medicine contained in first container 11 based on the two-dimensional code read by reading unit 8. When reading unit 8 reads the two-dimensional code printed on the medicine packet, it transmits the reading result (information indicating the type of medicine indicated by the two-dimensional code) to counting unit 73. Counting unit 73 counts the number of types of medicine contained in the medicine packet by analyzing the reading result. In other words, because the two-dimensional code is printed on the medicine packet, counting unit 73 can count the number of types of medicine contained in the medicine packet.

[0177] As described above, the user causes the reading unit 8 to read the two-dimensional code printed on the medicine packet before putting the medicine contained in the medicine packet into the first container 11. Therefore, the counting unit 73 can count the number of types of medicine contained in the medicine packet, thereby counting the number of types of medicine to be contained in the first container 11.

[0178] However, if the types of medicines indicated by the acquired two-dimensional codes include medicines that match types of medicines that have already been counted, the counting unit 73 excludes the matching medicines from the counting target. For example, consider a case where the medicines to be stored are medicines ME to MG, and the medicines that have already been counted (medicines stored in one first section 111) are medicines MA to MF. In this case, the counting unit 73 excludes medicines ME and MF from the counting target among the three types of medicines ME to MG, and counts the number of types of medicines to be stored as one type.

[0179] The counting unit 73 updates the total number of types of medicine by adding the number of types of medicine counted this time to the sum of the numbers of types of medicine counted up to that point (total number of types). The counting unit 73 updates the total number of types of medicine until a reset instruction to reset the total number of types of medicine is received from the number of types determination unit 74. The counting unit 73 transmits information indicating the updated total number of types of medicine to the number of types determination unit 74. The counting unit 73 temporarily stores the total number of types of medicine.

[0180] The type number determination unit 74 determines whether the total number of types of medicines indicated by the information received from the counting unit 73 reaches the total number of sorting cups 141. The type number determination unit 74 transmits the determination result to the section designation unit 72. This enables the section designation unit 72 to determine whether or not the first section 111 needs to be changed.

[0181] In the first embodiment, the medicine sorting device 1 uses an extracted mark image 83 obtained by inputting a captured image 82 into a trained model 84 to determine the type of medicine, at least for the medicine marks. However, in the present embodiment, the medicine sorting device 1A may extract the medicine marks from the captured image 82 by using existing image processing, without using the trained model 84.

[0182] [Processing when storing medicine in the first storage section] Next, an example of the process when medicines are input into the first container 11 will be described with reference to Fig. 15. Fig. 15 is a flow chart showing an example of the flow of the process. In this example, it is assumed that the first section 111a is specified as the container of the medicines when the medicine sorting process is started. It is also assumed that the container of the medicines is changed in the order of the first section 111a, the first section 111b, the first section 111c, and the first section 111d.

[0183] In a state where the first section 111a is designated as the storage destination of the medicine, the control unit 60Aa determines whether or not the reading unit 8 has read the two-dimensional code printed on the medicine packet. That is, the control unit 60Aa determines whether or not the two-dimensional code read by the reading unit 8 has been acquired from the reading unit 8 (S11).

[0184] Before putting the medicine contained in the medicine packet into the first container 11, the user has the reading unit 8 read the two-dimensional code printed on the medicine packet. When the user has the reading unit 8 read the two-dimensional code, the control unit 60Aa acquires the two-dimensional code from the reading unit 8. The display control unit 67 may cause the display unit 32 to display an image that prompts the user to have the reading unit 8 read the two-dimensional code printed on the medicine packet before putting the medicine contained in the medicine packet into the first container 11.

[0185] When the control unit 60Aa determines that the two-dimensional code has been acquired (YES in S11), the counting unit 73 counts the number of types of medicine contained in the medicine packet based on the information indicating the type of medicine indicated by the acquired two-dimensional code (S12). That is, the counting unit 73 counts the number of types of medicine to be contained in the first container 11. Thereafter, the counting unit 73 updates the total number of types of medicine by adding the currently counted number of types of medicine to the total number of types of medicine temporarily stored. Note that the control unit 60Aa performs the process of S11 until the two-dimensional code is read by the reading unit 8 and the two-dimensional code is acquired from the reading unit 8 (NO in S11).

[0186] The type number determination unit 74 determines whether the total number of types of medicines received from the counting unit 73 (the total number of types of medicines after update) has reached the total number of sorting cups 141 (S13).

[0187] Consider a case where the type number determination unit 74 determines that the total number of types of medicines does not reach the total number of sorting cups 141 (NO in S13). In this case, the display control unit 67 displays on the display unit 32 an image for notifying the user to store medicines in the first section 111 currently designated by the section designation unit 72 (S15). When the section designation unit 72 designates the first section 111a during the processing of S15, the display control unit 67 notifies the user to store medicines in the first section 111a. After the processing of S15, the process returns to the processing of S11.

[0188] On the other hand, when the type number determination unit 74 determines that the total number of types of the medicines reaches the total number of the sorting cups 141 (YES in S13), the section designation unit 72 determines whether or not all of the first sections 111a to 111d have been designated (S14). In this embodiment, the section designation unit 72 determines whether or not the first section 111d has been designated.

[0189] When it is determined that all of the first sections 111a to 111d have not been designated (NO in S14), the section designation unit 72 changes the currently designated first section 111 to the first section 111 set as the storage destination of the next medicine. That is, the section designation unit 72 designates the first section 111 as the storage destination of the next medicine (S16). The display control unit 67 displays on the display unit 32 an image for notifying the user to store the medicine in the first section 111 as the storage destination of the next medicine designated by the section designation unit 72 (S17).

[0190] In this embodiment, when the section designation unit 72 has designated one of the first sections 111a to 111c, it designates one of the first sections 111b to 111d as the storage destination of the next medicine. For example, when the section designation unit 72 has designated the first section 111a as the storage destination of the medicine, it designates the first section 111b as the storage destination of the next medicine. Then, the display control unit 67 displays on the display unit 32 an image for notifying the user to store the medicine in the first section 111b.

[0191] Thereafter, the control unit 60Aa resets the total number of types of medicine temporarily stored in the counting unit 73 (S18). This enables the counting unit 73 to count the total number of types of medicine contained in the newly specified first section 111. After the process of S18, the process returns to S11.

[0192] On the other hand, when the section designation unit 72 determines that all of the first sections 111a to 111d have been designated (YES in S14), the control unit 60Aa ends this process. In this embodiment, when the section designation unit 72 has designated the first section 111d, the control unit 60Aa ends this process. This makes it possible to prevent the first section 111d from containing medicines in excess of the total number of sorting cups 141.

[0193] It should be noted that medicines are not necessarily stored in all of the first sections 111a to 111d. That is, the first container 11 does not necessarily store more than 160 types of medicines. Therefore, when the control unit 60Aa receives a user input to start a medicine sorting process, it may terminate this process, assuming that there are no more medicines to be stored in the first container 11. For example, if the number of types of medicines stored in the first container 11 is 40 or less, this process will terminate with medicines stored only in the first section 111a.

[0194] In this way, when the number of types of medicines to be stored in the first storage unit 11 does not exceed the total number of sorting cups 141 even when the number of types of medicines to be stored in the first storage unit 11 is added to the total number of types of medicines stored in the specified first section 111, the control unit 60Aa can cause the first section 111 to store medicines. That is, the control unit 60Aa can prompt the user to store medicines in the first section 111 until the number of medicines stored in the first section 111 reaches the total number of sorting cups 141. On the other hand, when the number of types of medicines described above exceeds the total number of sorting cups 141 when the number of types of medicines described above is added to the total number of types of medicines described above, the control unit 60Aa can cause another first section 111 (a first section 111 that has not been stored yet) to store medicines. Therefore, the control unit 60Aa can cause the first section 111 to store as many types as possible that do not exceed the total number of sorting cups 141.

[0195] Here, consider a case where a drug of the same type as the drug to be contained in the first container 11 is already contained in a first compartment 111 different from the first compartment 111 designated as the container of the drug. In this case, the compartment designation unit 72 may designate the first compartment 111 in which the same type of drug is already contained as the container of the drug to be contained in the first container 11.

[0196] For example, after acquiring the two-dimensional code in S11, the control unit 60Aa determines whether the type of medicine indicated by the two-dimensional code matches the type of medicine contained in any of the first sections 111 specified so far. If the control unit 60Aa determines that the two types of medicine match, the section designation unit 72 identifies the first section 111 that contains the same type of medicine as the type indicated by the two-dimensional code, and designates the first section 111 as the medicine storage destination. Then, the display control unit 67 notifies the display unit 32 to store the medicine in the first section 111. On the other hand, if the control unit 60Aa determines that the two types of medicine do not match, the counting unit 73 counts the types of medicine in S12.

[0197] [Medicine sorting process] Next, the medicine sorting process executed after the medicines are accommodated in the first storage unit 11 will be described with reference to FIG. 16. FIG. 16 is a flow chart showing an example of the flow of the medicine sorting process. This medicine sorting process may be executed by the control unit 60Aa, for example, when a user input for starting the medicine sorting process is received. In this example, the medicines accommodated in the first section 111 are taken out in the order of the first section 111a, the first section 111b, the first section 111c, and the first section 111d, transported to the second storage unit 14, and accommodated in the sorting cups 141 by type.

[0198] The transport control unit 61 controls the transporting and sorting unit 12 to take out one of the medicines contained in one of the first sections 111 identified as the medicine removal target (S21). The imaging control unit 63 controls the first camera 131 to capture an image of the medicine removed by the transporting and sorting unit 12 (S22). The discrimination unit 65 discriminates the type of the medicine based on the image of the medicine captured by the first camera 131 (S23). The sorting control unit 62 determines a sorting cup 141 (sorting position) that will accommodate the medicine whose type has been discriminated. Then, the sorting control unit 62 controls the transporting and sorting unit 12 to accommodate the medicine in the sorting cup 141 determined as the destination for the medicine (S24).

[0199] The transport control unit 61 determines whether removal of all the medicines from the first section 111 from which the medicines are to be removed has been completed (S25). When the transport / sorting unit 12 removes the medicines from the first section 111, the imaging control unit 63 controls the second camera 121 to capture an image of the first section 111 from which the medicines are to be removed. The imaging control unit 63 analyzes the image of the first section 111 captured by the second camera 121 to determine whether the first section 111 from which the medicines are to be removed contains medicines. When the imaging control unit 63 determines that the first section 111 does not contain medicines, the transport control unit 61 determines that all the medicines have been removed from the first section 111 from which the medicines are to be removed.

[0200] When the transport control unit 61 determines that not all of the medicines have been removed from the first section 111 from which the medicines are to be removed (NO in S25), the process of S21 is performed since the first section 111 still contains medicines. On the other hand, when the transport control unit 61 determines that all of the medicines have been removed from the first section 111 (YES in S25), the transport control unit 61 and the sorting control unit 62 temporarily suspend the transport and sorting of the medicines. In other words, the transport control unit 61 does not perform the transport process of the medicines contained in the first section 111 that contains the next medicines to be sorted.

[0201] Instead, the packaging control unit 71 controls the transport / sorting unit 12 to transport the medicines contained in the sorting cups 141 to the medicine inlet 17. Thereafter, the packaging control unit 71 controls the packaging mechanism 6 to package the medicines contained in the sorting cups 141 (S26). The packaging control unit 71 executes the process of S26 for all sorting cups 141 that contain medicines.

[0202] The sorting cup 141 containing the medicine can be identified, for example, by storing the sorting position determined by the sorting control unit 62 in the memory unit 80. Furthermore, the determination as to whether the medicine is contained in the sorting cup 141 may be performed, for example, by the imaging control unit 63 causing the second camera 121 to capture an image of the sorting cup 141 and analyzing the image of the sorting cup 141.

[0203] The packaging control unit 71 determines whether or not all of the medicines contained in the second container 14 have been packaged (S27). That is, the packaging control unit 71 determines whether or not all of the medicines contained in the sorting cups 141 have been packaged, for all of the sorting cups 141 in which medicines are contained.

[0204] The packaging control unit 71 performs the process of S26 until all of the medicines contained in the second container 14 have been packaged (NO in S27). On the other hand, when it is determined that all of the medicines contained in the second container 14 have been packaged (YES in S27), the transport control unit 61 determines whether removal of the medicines from all of the first compartments 111 in which the medicines are contained has been completed (S28).

[0205] When the transport control unit 61 determines that removal of medicines from all of the first sections 111 containing medicines has not been completed (NO in S28), the control unit 60Aa returns to the process of S21. That is, in this case, the control unit 60Aa can resume the sorting process of the medicines contained in the first section 111 by removing the medicines from the first section 111 from which medicines are to be removed next. On the other hand, when the transport control unit 61 determines that removal of medicines from all of the first sections 111 containing medicines has been completed (YES in S28), the control unit 60Aa ends this medicine sorting process.

[0206] For example, the control unit 60Aa manages the first section 111 designated by the section designation unit 72, so that the transport control unit 61 can execute the process of S28. For example, when the last first section 111 designated by the section designation unit 72 is the first section 111c, the transport control unit 61 determines in S28 whether or not removal of medicines from the first section 111c is completed. For example, when packaging processing is completed for all medicines contained in the first section 111a, the transport control unit 61 determines that removal of medicines from the first section 111c is not completed. In this case, the transport control unit 61 specifies the first section 111b as the next medicine removal target in S21, and removes the medicine from the first section 111b. Thereafter, when packaging processing is completed for all medicines contained in the first section 111c, the control unit 60Aa ends this medicine sorting process.

[0207] In this way, the control unit 60Aa causes all of the medicines contained in one first section 111 and whose types have been identified to be contained in the second storage unit 14. Then, the control unit 60Aa packages all of the medicines contained in the second storage unit 14 and empties all of the sorting cups 141, and then starts the sorting process of the medicines contained in another first section 111. As described above, the first section 111 contains medicines of a number of types equal to or less than the total number of sorting cups 141. Therefore, the control unit 60Aa can store all of the medicines whose types have been identified in the second storage unit 14 without transporting the medicines to the standby tray 15.

[0208] In this embodiment, the control unit 60Aa executes the packaging process in S26 to empty all the sorting cups 141, but this is not limited to the above. That is, the control unit 60Aa may execute the following process instead of the processes of S26 and S27. For example, the control unit 60Aa may prompt the user to replace the sorting cup 141 with a new one that does not contain medicine. The control unit 60Aa may also prompt the user to empty the sorting cup 141 placed in the second storage unit 14. Thereafter, when the control unit 60Aa receives a user input indicating that the sorting cup 141 has been emptied, it may execute the process of S28.

[0209] Furthermore, when the transport control unit 61 determines that removal of all medicines from the first section 111 has been completed (YES in S25), the section designation unit 72 may designate the first section 111 as a storage destination for the medicines. Then, the display control unit 67 may notify the user to store the medicines in the first section 111. In this case, even if the sorting process of the medicines stored in the subsequent first section 111 has not been completed, the medicines can be stored in the first section 111 that has become vacant.

[0210] [Main Effects of the Present Embodiment] As described above, the medicine sorting device 1A in this embodiment issues a notification to change the first section 111 in which the medicines are stored each time the total number of types of medicines counted by the counting unit 73 reaches the total number of sorting cups 141. Therefore, one first section 111 can store medicines of a number of types equal to or less than the total number of sorting cups 141.

[0211] Then, the medicine sorting device 1A transports the medicines stored in the first storage unit 11 to the second storage unit 14 for each first section 111, and sorts the medicines by type in the second storage unit 14. Therefore, in one sorting process, the number of medicines to be sorted does not exceed the number of types that can be stored in the second storage unit 14. Therefore, the medicine sorting device 1A can store the medicines whose types have been determined in the second storage unit 14 by type without having them wait in a waiting position (e.g., waiting tray 15) different from the second storage unit 14. In other words, the medicine sorting device 1A can reduce the time required for the medicine sorting process by the processing time that would be required if the medicines whose types have been determined were waited in a waiting position.

[0212] [Embodiment 4] In the medicine sorting device 1 of embodiment 1, when medicines are to be removed from the sorting cup 141, the imaging control unit 63 causes the second camera 121 to capture an image of the inside of the sorting cup 141. Then, the packaging control unit 71 identifies the medicine to be removed from the image captured of the inside of the sorting cup 141, and moves the suction mechanism of the suction / shutter mechanism 122 vertically downward (in the -Z axis direction).

[0213] However, the imaging control unit 63 captures an image in a planar manner only once. Therefore, the imaging control unit 63 may identify the medicine on the lower side, which is partially overlapped and stored in the sorting cup 141, as the medicine to be removed from the image. In this case, when the suction mechanism removes the medicine on the lower side, the medicine on the upper side may be splashed out of the sorting cup 141.

[0214] Furthermore, when the suction mechanism suctions the medicine, there is a possibility that the end side of the medicine may be pushed from the vertically upward direction (+Z-axis direction). In this case, there is a possibility that the medicine may fly out of the sorting cup 141. To reduce the occurrence of this possibility, the packaging control unit 71 reduces the descent speed of the suction mechanism when moving the suction mechanism vertically downward. However, the packaging control unit 71 reduces the descent speed of the suction mechanism uniformly from a certain predetermined fixed position, regardless of the amount of medicine contained in the sorting cup 141. Therefore, regardless of the amount of medicine contained in the sorting cup 141, there is a possibility that the removal speed of the medicine from the sorting cup 141 may decrease.

[0215] Therefore, in this embodiment, when medication is removed from the sorting cup 141, the second camera 121 captures images of the inside of the sorting cup 141 from multiple positions, thereby reducing the possibility of the medication at the bottom being removed first and the possibility of the removal speed being reduced.

[0216] FIG. 17 is a diagram for explaining a method of imaging the inside of the sorting cup 141. As shown in FIG. 17, the control unit 60a moves the second camera 121 to a first position Po1 that is a predetermined distance away from the center line CL of the sorting cup 141 from which the medicine is taken out. Then, the imaging control unit 63 images the inside of the sorting cup 141 at the first position Po1. Next, the control unit 60a moves the second camera 121 from the first position Po1 to a second position Po2 that is a predetermined distance away from the center line CL. Then, the imaging control unit 63 images the inside of the sorting cup 141 at the second position Po2. Note that the second camera 121 may image the inside of the sorting cup 141 at the first position Po1 after imaging the inside of the sorting cup 141 at the second position Po2. Also, the second camera 121 actually moves together with the suction / shutter mechanism 122.

[0217] The control unit 60a calculates a parallax D, which is a difference in image position between the first image and the second image, based on the first image acquired at the first position Po1 and the second image acquired at the second position Po2. A known technique can be used to calculate the parallax D.

[0218] Here, the principle of distance measurement using parallax will be described. As shown in FIG. 17, a first triangle Tr1 is formed by (i) incident light IL1 from the object to the second camera 121 located at the first position Po1, (ii) incident light IL2 from the object to the second camera 121 located at the second position Po2, and (iii) the camera-to-camera distance B. A second triangle Tr2 is also formed by (i) the incident light IL1, (ii) a straight line PL that is a parallel line of the incident light IL2 and passes through the focal position of a lens (not shown) provided in the second camera 121, and (iii) the imaging surface of the second camera 121. This imaging surface of the second camera 121 represents the parallax D. As shown in FIG. 17, the first triangle Tr1 and the second triangle Tr2 are in a similar relationship. Therefore, due to this similar relationship, the control unit 60a can calculate the distance Z by the formula of the camera-to-camera distance B x focal length F / parallax D.

[0219] The camera distance B indicates the distance between the first position Po1 and the second position Po2. The camera distance B is the moving distance of the second camera 121, and is set in advance. The focal length F is the focal length of the lens of the second camera 121, and is an inherent value of the adopted second camera 121. Therefore, the control unit 60a can calculate the distance Z from the focal position of the lens of the second camera 121 to the target (e.g., the drug MDA) by calculating the parallax D as described above and substituting the parallax D into the above formula.

[0220] As described above, the control unit 60a calculates the distance Z by moving the second camera 121 in the horizontal direction to capture images of the medicine from two positions. This allows the medicine sorting device 1 to adjust the lowering speed of the suction mechanism for each medicine contained in the sorting cup 141 before the medicine is adsorbed, based on the distance Z. This reduces the possibility that the speed at which the medicine is taken out of the sorting cup 141 decreases. In addition, the suction mechanism can appropriately adsorb the medicine contained in the sorting cup 141.

[0221] Furthermore, the control unit 60a can calculate the distance Z for each medicine contained in the sorting cup 141. Therefore, the suction mechanism can sequentially pick up the medicines from the top. Therefore, the suction mechanism can first pick up the medicines on the bottom, thereby reducing the possibility that the medicines on the top will fly out of the sorting cup 141.

[0222] In this way, the control unit 60a can reduce the above-mentioned possibility by simply capturing an image of the medicine contained in the sorting cup 141 twice and calculating the distance Z without making any mechanical changes to the medicine sorting device 1. That is, the medicine sorting device 1 can calculate the distance Z without being equipped with, for example, a distance measuring sensor or a stereo camera. Therefore, the medicine sorting device 1 can calculate the distance Z without incurring the cost of installing a distance measuring sensor or the like in order to reduce the above-mentioned possibility. Furthermore, the medicine sorting device 1 can calculate the distance Z in a space-saving and simple manner.

[0223] In this embodiment, the example of removing medicines from the sorting cup 141 has been described, but the medicine sorting device 1 can also remove medicines from the first container 11 by utilizing the above-described method of calculating the distance Z. The medicine removal method utilizing the above-described method of calculating the distance Z can also be realized by the medicine sorting device 1A. Furthermore, the medicine removal method can be applied not only to medicine sorting devices but also to picking systems that remove objects from a horizontal plane (XY stage).

[0224] [Software implementation example] The control block (particularly the control units 60a, 60Aa) of the medicine sorting device 1, 1A may be realized by a logic circuit (hardware) formed in an integrated circuit (IC chip) or the like, or may be realized by software.

[0225] In the latter case, the medicine sorting device 1, 1A includes a computer that executes instructions of a program (type discrimination program) that is software that realizes each function. This computer includes, for example, one or more processors, and a computer-readable recording medium that stores the program. In the computer, the processor reads the program from the recording medium and executes it, thereby achieving the object of the present invention. The processor can be, for example, a CPU (Central Processing Unit). The recording medium can be a "non-transient tangible medium", for example, a ROM (Read Only Memory), as well as a tape, a disk, a card, a semiconductor memory, a programmable logic circuit, etc. In addition, the device may further include a RAM (Random Access Memory) that expands the program. The program may be supplied to the computer via any transmission medium (such as a communication network or a broadcast wave) that can transmit the program. Note that one aspect of the present invention can also be realized in the form of a data signal embedded in a carrier wave in which the program is embodied by electronic transmission.

[0226] [Function to make it easier to organize packaged items] The medicine sorting device 1, 1A has a packaging mechanism 6, and the medicines that have been sorted are sequentially transported to the packaging mechanism 6, and packaging is performed for each sorting cup 141 that contains medicines of the same type. At this time, the amount of medicines contained in one package is fixed, and when a large amount of medicines are contained in the sorting cup 141, they are divided into multiple packages and packaged. The packaging process is performed automatically, and the packaged bags are discharged from the medicine sorting device 1, 1A in a strip shape, with a predetermined number of bags packaged. The discharged package wrappers are stored in a storage box or the like (not shown) provided outside the device. Therefore, the worker needs to take out the package wrappers to find which medicine is in which position in the package wrapper, which requires time and effort.

[0227] In particular, after sorting by the medicine sorting device 1, 1A, the medicines of each type packaged by the packaging mechanism 6 must be taken out without missing any of the packaging bags for each type of medicine in order to return them to a tablet packaging machine or tablet storage shelf, which is separate from the medicine sorting device 1, 1A. However, since the packaging bags dispensed by the packaging mechanism 6 are stacked in a storage box, there is a problem that all the bags must be picked up and visually checked, and the bag of the target medicine must be individually found and removed. In addition, there are cases where packaging bags of the same type of medicine do not exist in the same packaging bag, and unless a group of packaging bags is also searched for, all the packaging bags cannot be checked without missing any of them, which causes the work to be complicated.

[0228] Therefore, when the packaging operation is completed, the display unit 32 of the touch panel 3 displays the information "Packaging Completed" along with a button "Check Packaging Result", and by touching or clicking this button, the number of sachet bags packaged in the current packaging operation can be displayed for each drug. Also, the information regarding the packaging result displayed on the display unit 32 may be printed on a printed matter such as a journal that can be carried when searching for the actual sachet bags from the storage location.

[0229] Specifically, the name of the drug and the number of sachets in the package are displayed or printed on the same line, and similarly, for other drugs, the name of the drug and the number of sachets in the package are displayed or printed on the printout. This allows the worker to know the number of sachets for each drug after packaging is complete, so that when actually removing the sachets of the drug from the group of stored sachets, the worker only needs to find the number of sachets that are displayed or printed, so there is no need to worry about missing any, and as long as the displayed number of sachets is removed, it is possible to move on to the removal of the next drug sachets, and the removal work of all sachets from the storage box, etc. can be shortened compared to the conventional method.

[0230] [Another expression of this disclosure] A type discrimination device according to one embodiment of the present disclosure includes an image generation unit that generates an extracted mark image by extracting a mark appearing in an captured image of an unknown type of target drug based on an output value obtained by inputting the captured image into a trained model constructed to extract marks formed on the drug, and a discrimination unit that discriminates the type of the target drug based on a comparison result between the extracted mark image generated by the image generation unit and a registered mark image that is registered in advance for each type of drug.

[0231] A type discrimination method according to one aspect of the present disclosure is a type discrimination method executed by a type discrimination device, and includes an image generation step of generating an extracted mark image by extracting a mark appearing in an captured image of a target drug of unknown type based on an output value obtained by inputting an image of the target drug of unknown type into a trained model constructed to extract marks formed on the drug, and a discrimination step of discriminating the type of the target drug based on a comparison result between the extracted mark image generated in the image generation step and a registered mark image registered in advance for each type of drug.

[0232] A type discrimination program according to one embodiment of the present disclosure causes a computer to execute an image generation step of generating an extraction mark image by extracting a mark appearing in an image of an unknown type of target drug based on an output value obtained by inputting the image into a trained model constructed to extract marks formed on the drug, and a discrimination step of discriminating the type of the target drug based on a comparison result between the extraction mark image generated in the image generation step and a registered mark image registered in advance for each type of drug.

[0233] According to a type discrimination device, a type discrimination method, and a type discrimination program according to an aspect of the present invention, it is possible to present evidence of the discrimination result and to discriminate the type based on various marks.

[0234] [Additional Notes] The present invention is not limited to the above-described embodiments, and various modifications are possible within the scope of the claims. Embodiments obtained by appropriately combining the technical means disclosed in different embodiments are also included in the technical scope of the present invention. [Explanation of symbols]

[0235] 6 Packaging mechanism (packaging section) 8 Reading unit 11 First storage section 12 Conveying and sorting unit (conveying section) 14 Second storage section 15 Waiting tray (temporary storage area) 32 Display unit (notification unit) 60 Computer (type discrimination device) 64 Feature extraction unit (image generation unit) 65 Discrimination part 73 Counting Department 82 Captured images 83 Extraction mark image 84 trained models 111, 111a~111d Section 1 141 Sorting cup (Second section)

Claims

1. A first storage section having a plurality of first compartments and capable of storing a plurality of types of medicine; A second storage section having a plurality of second compartments, each of which can store the medicine by type; A reading unit that reads information indicating the type of medicine contained in the first container; A counting unit that counts the number of types of medicine contained in the first container based on the information read by the reading unit; a notification unit that notifies the user to change the first compartment that contains the medicine every time the total number of types of medicine counted by the counting unit reaches the number of the second compartment; A medicine sorting device comprising: a transport unit that transports the medicines contained in the first storage unit to the second storage unit for each of the first sections, and stores the medicines in the second storage unit by type.

2. The medicine sorting device according to claim 1 , wherein the information is printed on a packaging paper in which the medicines are packaged.

3. A packaging unit that packages the medicine contained in the second container; a temporary storage section for storing a medicine whose type cannot be identified among the medicines stored in the first storage section, The drug sorting device of claim 1 or 2, wherein the packaging unit starts packaging the drugs contained in the second storage unit after the transport unit has transported all of the drugs contained in one of the first compartments to the second storage unit or the temporary storage unit.

4. The medicine sorting device of claim 3, wherein the transporting unit starts transporting medicines contained in another first compartment to the second storage unit after transporting all of the medicines contained in the second storage unit to the packaging unit.

Citation Information

Patent Citations

  • Drug sorting device, sorting container, and drug return method

    WO2018190394A1

  • Verification system and verification device

    JP2020052627A