Drug sorting device

The drug sorting device addresses the challenges of accurate drug type discrimination and efficient processing by using a combination of compartments, image processing, and a learned model, resulting in reduced processing time and improved sorting efficiency.

JP7695596B2Active Publication Date: 2025-06-19YUYAMA MFG CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing drug sorting devices face challenges in accurately determining the type of drug based on diverse marks, which are affected by lighting conditions during imaging. Additionally, these devices struggle to efficiently handle a large number of drug types and reduce processing time when drugs are waiting at a standby position.

Method used

A drug sorting device with multiple first and second compartments, a reading unit, a counting unit, and a notification unit to manage drug types and storage efficiently. The device uses a conveying unit to move drugs from a first storage unit to second storage units for each type, and a learned model for image processing to accurately discriminate drug types.

Benefits of technology

The device effectively reduces processing time by efficiently managing drug types and storage, and provides accurate drug type discrimination even with diverse marks, enhancing the reliability of the sorting process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007695596000001
    Figure 0007695596000001
  • Figure 0007695596000002
    Figure 0007695596000002
  • Figure 0007695596000003
    Figure 0007695596000003
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 a drug using an image of the drug, and the like. The present invention also relates to a drug sorting device that sorts drugs by type.

Background Art

[0002] Conventionally, a plurality of types of returned drugs have been sorted by a pharmacist or a doctor by type. The returned drugs are drugs that have been prescribed to various patients or drugs after being prescribed and dispensed. Therefore, compared with the dispensing operation of collecting (sub-packaging) drugs (tablets) (one type or a plurality of types) for each single dosing time from a drug group (drug cassette) grouped by drug type in advance in a dispensing device or the like based on the prescription information per patient, the types of drugs that are collectively returned for a plurality of patients are very many. Therefore, the usefulness of automatically sorting and reusing the returned drugs is high.

[0003] In automatic sorting of drugs, it is necessary to discriminate the type of a drug from an image of the drug, and one of the major clues in this type discrimination is a mark formed on the drug. Note that the mark includes both a stamped one and a printed one. Also, the content of the mark varies, and examples include figures, symbols, characters, and numbers.

[0004] Note that Patent Document 2 discloses a drug sorting device that realizes automatic sorting of drugs. The drug sorting device of Patent Document 2 images a plurality of types of drugs stored in a first storage unit one by one, discriminates the type of the drug based on the captured image, and sorts them into the second storage unit by type based on the discrimination result.

Prior Art Documents

Patent Documents

[0005]

Patent Document 1

Patent Document 2

SUMMARY OF THE INVENTION

PROBLEMS TO BE SOLVED BY THE INVENTION

[0006] It is difficult to accurately determine the type of drug based on the mark. This is because, as described above, the content of the mark is diverse, and the appearance of the mark in the captured image changes depending on how the light hits the drug during imaging and the like.

[0007] Here, conventionally, image processing techniques using machine learning have been known. For example, Patent Document 1 described above describes using a learned model in the medical field such as assisting in the determination of cases based on images. More specifically, Patent Document 1 discloses a verification system for determining the validity of a discrimination result output by an output layer of a learned model based on information regarding a calculation result stored in a storage unit and a calculation result output by an intermediate layer of the learned model in response to the input of medical information to the input layer of the learned model. According to this verification system, the validity of the above discrimination result can be verified.

[0008] If a learned model is applied to the determination of the type of drug, an improvement in the determination accuracy can be expected. However, when using a learned model for determining the type of drug, there is a problem that it is difficult to explain the basis for the determination result, in other words, it is difficult to present evidence for the determination result. For example, when an image of a drug that has not been learned is input to a learned model for determining the type of drug, it is difficult to predict what determination result will be output. And when the determination result is incorrect, evidence for the determination result is required in the medical field. However, when using the above-described learned model, it is difficult to present evidence.

[0009] Also, as described above, since the content of the marks formed on the drug is diverse, there is also a problem that constructing a learned model that has learned all of them requires a great deal of costs such as expenses, labor, and time.

[0010] One aspect of the present invention is a type discrimination device for discriminating the type of a drug, and an object thereof is to realize a type discrimination device or the like that enables presentation of evidence of the discrimination result and can handle various marks.

[0011] Further, in the drug sorting device of Patent Document 2, the number of types of drugs accommodated in the first accommodating portion is not limited. On the other hand, the number of types of drugs that can be accommodated in the second accommodating portion is limited. Therefore, when a drug exceeding the number of types that can be accommodated in the second accommodating portion is accommodated in the first accommodating portion, a drug that cannot be accommodated in the second accommodating portion will be generated even if the type is discriminated. In the drug sorting device of Patent Document 2, for a drug that cannot be accommodated in the second accommodating portion, sorting into the second accommodating portion is once waited at a standby position (standby tray) different from the second accommodating portion.

[0012] In the drug sorting device of Patent Document 2, after all the drugs accommodated in the first accommodating portion are transported to the second accommodating portion or the standby position, for example, by subcontracting the drugs in the second accommodating portion, the drugs are removed from the second accommodating portion. Thereafter, the drug sorting device of Patent Document 2 discriminates the type of the drug waited at the standby position again, and accommodates it in the second accommodating portion for each type. Here, when a drug exceeding the number of types that can be accommodated in the second accommodating portion is waited at the standby position, a drug that cannot be accommodated in the second accommodating portion will be generated again even if the type is discriminated. In this case, the drug sorting device of Patent Document 2 will wait the drug at the standby position (the first accommodating portion or the standby tray) again.

[0013] As described above, when the drug sorting device of Patent Document 2 waits for a drug at the standby position, until the drug waited at the standby position disappears, the type of the drug is discriminated, and the operation of accommodating it in the second accommodating portion for each type based on the discrimination result is repeatedly executed.

[0014] Another aspect of the present invention aims to realize a drug sorting device that can reduce the processing time generated when waiting for a drug at the standby position.

Means for Solving the Problems

[0015] In order to solve the above-mentioned another problem, a drug sorting device according to an aspect of the present invention has a plurality of first compartments, a first storage unit capable of storing a plurality of types of drugs, a plurality of second compartments, and in each of the second compartments, a second storage unit capable of storing the drugs for each type, a reading unit for reading information indicating the types of drugs stored in the first storage unit, a counting unit for counting the number of types of drugs stored in the first storage unit based on the information read by the reading unit, and a notification unit for notifying to change the first compartment that is the storage destination of the drug every time the total number of types of drugs counted by the counting unit reaches the number of the second compartments, and a conveying unit for conveying the drugs stored in the first storage unit to the second storage unit for each first compartment and storing them in the second storage unit for each type.

Effect of the Invention

[0016] According to the drug sorting device according to another aspect of the present invention, it is possible to reduce the processing time generated when the drug is waiting at the standby position.

Brief Description of the Drawings

[0017]

Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6

Figure 7

Figure 8

Figure 9

Figure 10

Figure 11

Figure 12

Figure 13

Figure 14

Figure 15

Figure 16

Figure 17

Embodiments for Carrying Out the Invention

[0018] 〔Embodiment 1〕 〔Outline of the Drug Sorting Device 1〕 First, the outline of the drug sorting device 1 will be described with reference to FIGS. 1 and 2. FIG. 1 is a block diagram showing the overall configuration of the drug sorting device 1. FIG. 2 is a diagram showing a configuration example of the drug sorting device 1, 2001 is a perspective view of the drug sorting device 1, and 2002 is a perspective view showing the basic configuration of the drug sorting area 2. As shown in FIG. 1 and FIGS. 2001 and 2002 of FIG. 2, the drug sorting device 1 includes a drug sorting area 2, a touch panel 3, a printing output unit 4, and a packaging mechanism 6.

[0019] The medicine sorting device 1 images each of a plurality of types of medicines, determines the type of medicine based on the image obtained as a result of the imaging, and sorts the medicines for each 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. Note that the medicines sorted for each type are sub-packaged or returned to the medicine shelf or the sub-packaging machine after visual inspection by the user.

[0020] In the present embodiment, the plurality of types of medicines are medicines not contained in a container or the like, or medicines not subjected to packaging or the like, and as an example thereof, tablets or capsules will be described. Also, it will be described that the plurality of types of medicines are returned medicines. The said medicine is a medicine in which the adopted medicine in a pharmacy or a hospital is returned as a "returned medicine" at the said pharmacy or hospital. However, the plurality of types of medicines may be "bring-your-own medicines" that may include, in addition to the adopted medicine, medicines issued by other pharmacies or hospitals at the said pharmacy or hospital. The medicine sorting device 1 can automatically perform the processes from imaging to sorting after the medicine is returned.

[0021] The touch panel 3 receives various user inputs at the operation unit 31 and displays various images (e.g., an image showing the transition of medicine sorting, an image for visual inspection) at the display unit 32.

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

[0023] The sub-packaging mechanism 6 sub-packages the sorted medicines. The sub-packaging mechanism 6 is an optional mechanism. When the sub-packaging mechanism 6 is provided in the medicine sorting device 1, it becomes possible to perform the processes from the sorting of the returned medicine to the sub-packaging after visual inspection in a batch by the medicine sorting device 1. In particular, when the medicine is input into the sub-packaging mechanism 6 by the conveyance / sorting unit 12, the processes from the above sorting to the sub-packaging can be automatically performed except for visual inspection.

[0024] As the sub-packaging mechanism 6, it is possible to adopt the sub-packaging part of a conventionally used tablet sub-packaging machine or powder sub-packaging machine. In this case, for example, the medicine in the sorting cup 141 sorted for each same medicine type can be sub-packaged into one or a plurality of packages.

[0025] It should be noted that throughout this specification, the "sub-packaging" used at least in the description of the medicine sorting device 1 includes the meaning of "packaging the medicine separately for each taking time based on the prescription data" and the meaning of "simply packaging the medicine sorted into the second storage part 14 regardless of the prescription data".

[0026] The medicine sorting device 1 is also provided with a first RFID (Radio Frequency Identifier) reader / writer unit 5. As shown at 2002 in FIG. 2, the first RFID reader / writer unit 5 is provided on the medicine taking-out side of the pedestal 19.

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

[0028] Further, the above data may include drug data determined by visual inspection (drug data after visual inspection). Also, the drug data after visual inspection may be written to the RFID tag. The drug data after visual inspection is used when (1) subcontracting the drug stored in the corresponding sorting cup 141 by a subcontracting organization 6 or a subcontracting machine different from the drug sorting device 1, or (2) returning the drug to the drug shelf. Note that these drug data may also be stored in the storage unit 80 in association with the sorting cup identification information.

[0029] Also, as shown in 2001 of FIG. 2, the drug sorting device 1 includes an opening / closing shutter 51 and an opening / closing door 52 that enable opening and closing of the drug taking-out side.

[0030] 〔Basic Configuration of Drug Sorting Area 2〕 Next, with reference to FIGS. 1 and 2002 of FIG. 2, the basic configuration of the drug sorting area 2 (internal configuration of the drug sorting device 1) will be described.

[0031] As shown in FIGS. 1 and 2002 of FIG. 2, the drug sorting area 2 mainly includes, as hardware, a first storage unit 11, a conveying / sorting unit 12 (sorting part), an imaging unit 13, a second storage unit 14, a standby tray 15, a collection tray 16, a drug input port 17, and a second RFID reader / writer unit 18. And each member except the conveying / sorting unit 12 is provided on a pedestal 19. The main functions of the conveying / 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 unit 11 stores a plurality of types of drugs returned by the user in a mixed state. In this embodiment, the first storage unit 11 is divided into a plurality of storage units. In this case, for example, when all the drugs stored in one storage unit are conveyed by the conveying and sorting unit 12, the drugs stored in the storage unit adjacent to the said storage unit become the conveyance target. Also, the first storage unit 11 may be provided so as to be rotatable with respect to the Z-axis (the center of the cylindrical shape). In this case, the control unit 60a of the computer 60 (type discrimination device) may rotate the first storage unit 11 so that the conveying and sorting unit 12 can easily acquire the drug, for example, at the timing when one storage unit becomes empty.

[0033] The second storage unit 14 includes a plurality of sorting cups 141 that store drugs sorted by type. The control unit 60a discriminates the type of the drug based on the image of the drug captured by the imaging unit 13, and determines the sorting cup 141 for storing the drug based on the discrimination result. The said drug is conveyed and stored in the determined sorting cup 141 by the conveying and sorting unit 12.

[0034] The standby tray 15 is a temporary storage unit where the drug is temporarily placed. For example, when all of the sorting cups 141 are filled with drugs, the drugs determined to be of other types by the control unit 60a are temporarily placed on the standby tray 15. In this case, after the drug is removed from the sorting cup 141, it may be conveyed from the standby tray 15 to the said sorting cup 141.

[0035] Also, in this embodiment, a presumed drug (described later), which is presumed to be a drug, may be temporarily placed on the standby tray 15. When the presumed drug is temporarily placed, for example, according to the discrimination result of the control unit 60a, the presumed drug is conveyed from the standby tray 15 to a predetermined area of the second storage unit 14.

[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 drugs). Examples of foreign objects other than drugs include fragments of PTP (Press Through Pack) sheets. Fragments of PTP sheets may be mixed into the first storage unit 11 when drugs are returned. In addition, the control unit 60a also stores in the collection tray 16 drugs registered in the drug database 81 as drugs to be discarded, or drugs that the user desires to discard (e.g., drugs with an old manufacturing date).

[0037] When the drug sorting device 1 is equipped with the sorting mechanism 6, the drug inlet 17 is for conveying the drugs stored in the second storage unit 14 to the sorting mechanism 6 by the conveying and sorting unit 12. Naturally, when the drug sorting device 1 is not equipped with the sorting mechanism 6, the drug inlet 17 is an unnecessary configuration.

[0038] Also, as shown in FIG. 1, a computer 60 is provided for overall control of the above-mentioned respective members (hardware) of the drug sorting device 1. The computer 60 includes a control unit 60a and a storage unit 80. The control unit 60a includes a conveyance control unit 61, a sorting control unit 62, an imaging 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 print output control unit 69, a registration unit 70, and a sorting control unit 71. Here, the basic processes of the operation input unit 66, the display control unit 67, the RFID control unit 68, the print output control unit 69, and the sorting control unit 71 will be described. The basic processes of the conveyance control unit 61, the sorting control unit 62, the imaging control unit 63, the feature extraction unit 64, and the discrimination unit 65 will be described in detail in the description of each subsequent process. Other processes will be described in each of the subsequent embodiments.

[0039] The operation input unit 66 and the display control unit 67 control the operation unit 31 and the display unit 32 of the touch panel 3, respectively. 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 according to the user input received by the operation input unit 66.

[0040] When the discrimination unit 65 determines that there is no drug data corresponding to the image data for a drug, the registration unit 70 registers the drug data related to the drug in the drug database 81. Specifically, for a drug determined by the discrimination unit 65 to have no corresponding drug data, the registration unit 70 associates the captured image 82 of the drug with the drug data specified by the user and registers it in the drug database 81.

[0041] When the drug sorting device 1 is provided with the 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. Also, the packaging control unit 71 controls the conveyance / sorting unit 12 to convey the drug stored in the sorting cup 141 to the drug inlet 17.

[0042] The drug sorting device 1 may also be provided with a barcode reader 7. The barcode reader 7 reads, for example, a barcode indicating the drug data of the drug printed on the drug package (packaging paper) after the packaging mechanism 6 sorts the drug. Thereby, the control unit 60a can perform processing based on the read barcode (e.g., display of the drug data indicated by the barcode). The packaging mechanism 6 may be provided with a barcode printing mechanism (not shown) that prints a barcode indicating the drug data of the drug packaged in the drug package on the drug package.

[0043] The barcode reader 7 only needs to be a reading device capable of reading information indicating the drug data printed on a drug package or the like. Also, the drug sorting device 1 does not necessarily need to be provided with the barcode reader 7. When the control unit 60a performs processing based on the above information, the control unit 60a may acquire the above information through communication with an external device provided with the barcode reader 7.

[0044] In addition, the computer 60 includes a storage unit 80. In the storage unit 80, a drug database (drug master) 81 for managing drug data regarding a plurality of types of drugs is stored in advance, and imaging images 82 and the like are stored as the sorting by the drug sorting device 1 is performed. The imaging image 82 is an image captured by the first camera 131. Specifically, the imaging image 82 is an image of an object drug of unknown type taken out from the first storage unit 11. Further, in the storage unit 80, an extraction mark image 83 generated by the feature extraction unit 64 and a learned model 84 used by the feature extraction unit 64 to generate the extraction mark image 83 are stored.

[0045] Note that the various data stored in the storage unit 80 may not be managed by the storage unit 80 and may be managed by an external device, for example. In this case, the control unit 60a may acquire the various data from the external device through a communication line such as the Internet as necessary. Further, the drug database 81 may be updated when new drug data is added.

[0046] 〔Outline of processing in the drug sorting device 1〕 In the drug sorting device 1, the conveyance and sorting unit 12 conveys each drug returned to the first storage unit 11 to the imaging unit 13. The imaging unit 13 sequentially images each conveyed drug. The control unit 60a determines the type of each drug based on the captured image and determines the sorting position of each determined drug in the second storage unit 14. The conveyance and sorting unit 12 conveys each drug to the determined sorting position. Then, information about the drug stored in the second storage unit 14 is written to the RFID tag of the sorting cup 141, stored in the storage unit 80, or displayed on the touch panel 3. Further, after the sorting of the drugs is completed or during the sorting, the user operates the touch panel 3 to perform processes such as visual inspection and subcontracting. Hereinafter, each process will be specifically described.

[0047] 〔Drug conveyance process to the imaging unit 13〕 First, the drug conveyance process from the first storage unit 11 to the imaging unit 13 will be described with reference to 2001 in FIGS. 1 and 2.

[0048] Specifically, the conveyance and sorting unit 12 conveys the drug stored in the first storage unit 11 to the receiving area Ar1 (see 3002 in FIG. 3) where the imaging unit 13 receives the drug. The conveyance control unit 61 controls the conveyance process by the conveyance and sorting unit 12.

[0049] The conveyance and sorting unit 12 includes a second camera 121, an adsorption and shutter mechanism 122, and a conveyance mechanism 123.

[0050] The second camera 121 sequentially images the first storage unit 11 in order to identify the drug to be conveyed. The imaging control unit 63 controls the imaging process of the second camera 121. The second camera 121 is provided at the end of the conveyance and sorting unit 12 (specifically, the housing including at least the adsorption and shutter mechanism 122) on the side facing the pedestal 19. The second camera 121 may be provided at the tip of the adsorption mechanism described later. The imaging control unit 63 analyzes the captured image and determines whether the drug is included in the image. When it is determined that the drug is included, the conveyance control unit 61, for example, brings the tip closer to the first storage unit 11 and identifies the drug included in the image captured at that time as the drug to be conveyed.

[0051] The adsorption and shutter mechanism 122 includes an adsorption mechanism that adsorbs the drug identified as the conveyance target and a shutter mechanism that prevents the drug adsorbed by the adsorption mechanism from falling. The adsorption mechanism is provided so as to be movable in the Z-axis direction. The shutter mechanism is provided in front of the end portion so as to be movable substantially parallel to the XY plane.

[0052] When the suction mechanism obtains the drug, it extends from the above-mentioned end part, and at its tip part, after adsorbing the specified drug, it returns to the position of the above-mentioned end part. In this state, the conveyance control unit 61 moves the shutter mechanism to a position facing the above-mentioned end part and maintains the position of the shutter mechanism (keeps it in the closed state) during drug conveyance. When the conveyance control unit 61 moves the adsorption / shutter mechanism 122 to a position facing the drug placement table 133a (refer to 3002 in FIG. 3) of the drug holding mechanism 133 arranged in the reception area Ar1, the conveyance control unit 61 moves the shutter mechanism to a position not facing the above-mentioned end part (keeps it in the open state). Then, after extending the suction mechanism from the above-mentioned end part and releasing the suction state, the drug is placed on the drug placement table 133a.

[0053] The conveyance mechanism 123 moves the adsorption / shutter mechanism 122 in the X-axis and Y-axis directions under the control of the conveyance control unit 61. By this conveyance mechanism 123, the movement of the adsorption / shutter mechanism 122 during the search for the drug to be conveyed on the first storage unit 11 or the conveyance of the drug from the first storage unit 11 to the drug placement table 133a becomes possible. Also, in the drug sorting process, it is possible to convey the drug from the drug placement table 133a to the second storage unit 14, the standby tray 15, or the collection tray 16. In the drug sorting process, the sorting control unit 62 controls the conveyance / sorting unit 12 based on the discrimination result by the discrimination unit 65 to convey the drug arranged in the reception area Ar1 to a predetermined sorting cup 141 in the second storage unit 14 or the standby tray 15.

[0054] 〔Drug imaging process〕 Next, the drug imaging process by the imaging unit 13 will be described with reference to FIGS. 1, 2002 in FIGS. 2, 3, and 4. FIGS. 3001 and 3002 in FIG. 3 are perspective views showing the overall configuration of the imaging unit 13, and FIG. 3003 in FIG. 3 is a perspective view showing an example of the drug placement table 133a. FIGS. 4001 and 4002 in FIG. 4 are diagrams for explaining the turning of the imaging unit 13. The above-mentioned drug 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 chemical agent placement table 133a and images the chemical agent placed in the placement area Ar2 (imaging area), which is the imaging target shown at 3002 in FIG. 3. The imaging control unit 63 controls the imaging process by the imaging unit 13, the turning movement of the first camera 131 and the illuminator 134, and the movement of the chemical agent holding mechanism 133. As shown in FIGS. 1 and 3, the imaging unit 13 includes a first camera 131 (imaging unit), a rotation mechanism 132 (turning unit), a chemical agent holding mechanism 133 (chemical agent placement table, movement mechanism), and an illuminator 134 (ultraviolet light irradiation unit, visible light irradiation unit).

[0056] The first camera 131 images the chemical agent placed in the placement area Ar2 facing the first camera 131 in order to discriminate the type of the chemical agent in the discrimination unit 65 described later. The chemical agent holding mechanism 133 is a mechanism for holding the chemical agent. As shown in 3001 and 3002 in FIG. 3, it includes a chemical agent placement table (petri dish) 133a, a turning mechanism 133b (movement mechanism), and a shaft portion 133c connecting the chemical agent placement table 133a and the turning mechanism 133b. The chemical agent placement table 133a is for placing the chemical agent to be imaged. The turning mechanism 133b moves the chemical agent placement table 133a. Specifically, it turns the chemical agent placement table 133a with respect to the XY plane and turns the shaft portion 133c in the circumferential direction of the shaft portion 133c.

[0057] When the chemical agent conveyed from the first storage unit 11 is placed on the chemical agent placement table 133a, the imaging control unit 63 drives the turning mechanism 133b to move the chemical agent placement table 133a from the receiving area Ar1 to the placement area Ar2. Then, at least the first camera 131 and the illuminator 134 are controlled to image the chemical agent placed in the placement area Ar2. The captured image is stored in the storage unit 80 as the captured image 82. After the imaging is completed, for example, the imaging control unit 63 drives the turning mechanism 133b to move the chemical agent placement table 133a on which the imaged chemical agent 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 part) of the shaft part 133c. When one medicine placement table 133a is arranged in the arrangement area Ar2 by turning the shaft part 133c by the turning mechanism 133b, the other medicine placement table 133a is arranged in the receiving area Ar1. During medicine imaging in the arrangement area Ar2, the conveyance and sorting unit 12 conveys the medicine from the first storage part 11 to the medicine placement table 133a existing in the receiving area Ar1, enabling continuous medicine imaging processing. Note that it is assumed that the medicine placement table 133a is in a state where no medicine is placed, such as after the medicine sorting process to the second storage part 14.

[0059] Also, in this embodiment, the medicine placement table 133a has transparency. Therefore, the first camera 131 can image the medicine placed on the medicine placement table 133a from multiple directions through the medicine placement table 133a.

[0060] Also, as shown in 3003 of FIG. 3, the medicine placement table 133a may have a substantially V-shaped cross-section with a concave bottom. Also, as shown in 3003 of FIG. 3 and FIG. 4, when the medicine placement table 133a is arranged in the receiving area Ar1 and the arrangement area Ar2, the groove direction (the extending direction of the shaft part 133c) of the substantially V-shaped cross-section is substantially parallel to the turning axis Ay of the imaging mechanism (described later) by the turning mechanism 132. Also, the bottom of the medicine placement table 133a does not have to be an acute V shape. As shown in 3003 of FIG. 3, the bottom may include a bottom surface part 133aa and inclined surface parts 133ab inclined from two opposing locations of the bottom surface part 133aa. The shape of the bottom only needs to be such that the information (engraving information or printing information) indicated by the engraving or print of the medicine can be recognized when viewed (or imaged) from the back side of the medicine placement table 133a, and the medicine can be fixed.

[0061] When the drug is in the form of a capsule or a modified tablet (e.g., a rugby ball shape), if the bottom of the drug placement table 133a is flat, it may be difficult to obtain a clear image of the drug (engraved information or printed information) because the orientations of the drugs on the XY plane are not aligned. If it has a substantially V-shaped cross-section, the capsule or the modified tablet can be fitted to the lowermost end, and the drug can be fixed. Therefore, it becomes easier to obtain a clear image of the drug. In the case of a tablet, for example, by rotating the shaft portion 133c in the circumferential direction of the shaft portion 133c, the flat portion (inclined surface portion 133ab) of the drug placement table 133a can be opposed to the first camera 131, so that the drug can be surely prevented from moving.

[0062] In addition, the turning mechanism 133b can also vibrate (slightly move, loosen) the drug placement table 133a. In this case, for example, by applying vibration to the capsule placed on the drug placement table 133a and rolling it, the portion with the print on the capsule can be directed in a predetermined direction (e.g., the portion can be opposed to the first camera 131 arranged at the initial position described later). Also, due to the above vibration, even if a cylindrical (circular bottom) tablet is placed standing on the flat portion, the tablet can be laid down horizontally (the bottom of the tablet is arranged to face the flat portion).

[0063] The illuminator 134 emits light irradiated on the drug during imaging of the drug under the control of the imaging control unit 63. As shown in 3001 of FIG. 3, the illuminator 134 includes a visible light irradiation unit (first irradiation unit 134a and second irradiation unit 134b) that irradiates the drug with visible light, and an ultraviolet light irradiation unit 134c that irradiates the drug with ultraviolet light.

[0064] The first irradiation unit 134a and the second irradiation unit 134b irradiate the drug 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 obtains an image based on visible light (visible light image) by receiving the visible light emitted from the first irradiation unit 134a or the second irradiation unit 134b and reflected by the drug. The imaging control unit 63 stores the image data indicating the visible light image obtained by the first camera 131 in the storage unit 80 as the captured image 82.

[0065] The ultraviolet light irradiation unit 134c irradiates the drug with ultraviolet light (for example, light having a peak wavelength of 365 nm or more and 410 nm or less) to excite the components contained in the drug. As a result, fluorescence (for example, light having a peak wavelength of 410 nm or more and 800 nm or less) is extracted from the drug. The first camera 131 obtains an image based on ultraviolet light (ultraviolet light image) by receiving the fluorescence emitted from the drug. The imaging control unit 63 stores the 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 turn around the arrangement region Ar2 (the drug placement table 133a arranged at the position) where the drug to be imaged is arranged. The first camera 131 images the drug arranged in the arrangement region Ar2 from a plurality of positions rotated by the rotation mechanism 132. Specifically, the imaging mechanism including the first camera 131 and the illuminator 134 is rotated so as to turn around the arrangement region Ar2. Therefore, the first camera 131 can image the drug from a plurality of directions while maintaining the positional relationship between the first camera 131 and the illuminator 134 with respect to the arrangement region Ar2.

[0067] As shown in 3001 of FIG. 3, the rotation mechanism 132 includes an imaging mechanism drive unit 132a and a power transmission mechanism 132b. The imaging mechanism drive 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 drive unit 132a to the imaging mechanism. The imaging mechanism drive 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 the initial position and the position facing the initial position. The initial position is a position substantially perpendicular to the arrangement area Ar2 and above the arrangement area Ar2. The position facing the initial position is a position substantially perpendicular to the arrangement area Ar2 and below the arrangement area Ar2. Also, it can be said that this position is the position where the first camera 131 faces the bottom of the medicine placement table 133a existing 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. Also, the angle formed by axis Ax0 and axis Ax1 is defined as θ. In this embodiment, the rotation mechanism 132 arranges the imaging mechanism at any one of the positions of θ = 0° (initial position), 45°, 135°, and 180°. Note that 4001 in FIG. 4 shows the case where the imaging mechanism is at the position of θ = 0°, and 4002 in FIG. 4 shows the case where the imaging mechanism rotates from the initial position to the position of θ = 45°.

[0070] In this way, by rotating the imaging mechanism around the arrangement area Ar2, the medicine can be imaged from a plurality of directions while the medicine is fixed in the arrangement area Ar2. Also, even when the medicine (tablet) stands up even if the medicine placement table 133a is shaken, information indicated by a stamp or the like attached to the medicine can be obtained by imaging from an oblique direction (θ = 45° or 135°).

[0071] Note that the medicine may be imaged from a plurality of directions by fixing the imaging mechanism and rotating the medicine.

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

[0073] Next, the imaging control unit 63 sets the imaging mechanism to a position opposite to the initial position, causes the first camera 131 to image the drug placed in the placement area Ar2 at that position, and acquires two visible light images and an ultraviolet light image. The discrimination unit 65 discriminates the type of the drug by analyzing these six images. If the type of the drug cannot be specified uniquely, the imaging control unit 63 emits visible light from the first irradiation unit 134a and the second irradiation unit 134b at positions where θ = 45° and 135°, and causes the first camera 131 to image the drug. The discrimination unit 65 analyzes the visible light image at this time to discriminate the type of the drug.

[0074] Not limited to the above, various methods can be used for the position control of the imaging mechanism. For example, after imaging from the position opposite to the initial position, imaging may be performed from the initial position. Also, the discrimination process of the drug based on the visible light image when imaging from the position where θ = 45° may be performed, and the visible light image when imaging from the position where θ = 135° may be acquired only when the type of the drug cannot be specified uniquely. Also, only ultraviolet light images may be acquired at the initial position and the position opposite to the initial position, and after performing the discrimination process of the drug based on the ultraviolet light image, the visible light image at that position may be acquired. Also, visible light images and ultraviolet light images may be acquired at all positions.

[0075] 〔Image Processing and Discrimination Processing〕 Next, image processing for the image captured by the imaging unit 13 and drug discrimination processing based on the result of the image processing will be described with reference to FIGS. 1, 5 to 7. The above image processing is mainly performed by the feature extraction unit 64, and the above discrimination processing is mainly executed by the discrimination unit 65.

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

[0077] The above mark is a sign formed on the surface of the drug. For example, characters (including alphabets, numbers, etc.), symbols, patterns, pictures, lines (e.g., dividing lines), or code information such as two-dimensional codes formed to indicate the type or manufacturer of the drug are also included in the category of the above marks. Also, the method of forming the above mark is not particularly limited. For example, the above mark may be formed by engraving the surface of the drug, or may be formed by printing (marking) on the surface of the drug.

[0078] In addition, the feature extraction unit 64 may also perform processing for extracting features of the drug other than the mark shown in the captured image 82 by performing image processing (image analysis) on the captured image 82 (visible light image and / or ultraviolet light image). Here, the feature of the drug is an index for the discrimination unit 65 to discriminate the type of the drug. Examples of the features of the drug include, in addition to the above-described marks (engravings, prints, and dividing lines), the size, shape, and representative color (the color of the area with engraving or printing) of the drug.

[0079] The feature extraction unit 64 extracts features of drugs other than the mark by performing existing image processing on the captured image 82. The existing image processing may be any process that can extract a plurality of pixel groups having pixel values different from those of the background portion. For example, known techniques such as OCR (Optical Character Recognition) or pattern matching can be mentioned. 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] (Regarding the pre-trained model) In the present embodiment, as an example of the pre-trained model 84, a semantic segmentation model (hereinafter referred to as the SS model) that has been trained to distinguish between the pixels constituting the mark and the pixels constituting the background portion of the mark in the drug image is used. By using the SS model as the pre-trained model 84, it becomes possible to accurately extract marks having irregular shapes.

[0081] The SS model is a model based on a convolutional neural network (CNN) and has an encoder-decoder structure in order to generate an output image having the same size as the input image. The encoder structure is constructed by, for example, 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 a structure opposite to that of the encoder structure. That is, 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 an imaging image 82 of a target drug of unknown type is input, the SS model calculates a probability value indicating the probability that each pixel constituting the image of the drug shown in the imaging image 82 is a pixel constituting a mark. The higher the probability value of a pixel, the higher the possibility that it is a pixel constituting a mark, and the lower the probability value of a pixel, the higher the possibility that it is a pixel constituting the background portion. Then, the SS model outputs data in which pixels constituting a mark and pixels constituting the background portion are classified based on the probability value (for example, data in which pixels constituting the background area are classified as 0 and pixels constituting a mark are classified as 1).

[0083] Therefore, the feature extraction unit 64 can generate an extracted mark image 83 by performing image processing on the output value obtained by inputting the imaging image 82 captured by the first camera 131 into the SS model. For example, the feature extraction unit 64 may set a pixel with an output value of 0 of the SS model to (R, G, B) = (255, 255, 255) and a pixel with an output value of 1 of the SS model to (R, G, B) = (0, 0, 0). Thereby, an extracted mark image 83 in which pixels constituting the background area are represented in white and pixels constituting a mark are represented in black is generated. In this way, the feature extraction unit 64 can generate the extracted mark image 83 based on the output value of the SS model.

[0084] Note that the learned 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 learned model 84 is equal to or greater than a predetermined threshold, and determines the pixel value of each pixel based on the determination result. Thereby, the feature extraction unit 64 generates an extracted mark image 83 in which pixels constituting a mark and pixels constituting the background portion are classified. Also, the learned model 84 may be configured to output the extracted mark image 83. In this case, the feature extraction unit 64 may use the output value of the learned model 84 as the extracted mark image 83 as it is.

[0085] FIG. 5 and FIG. 6 are diagrams showing an example of a captured image 82 and examples of extracted mark images 83 and 830 extracted from the captured image 82. The extracted mark image 83 is an image obtained by inputting the captured image 82 into a learned model 84. The extracted mark image 830 is an image obtained as a result of performing existing image processing on the captured image 82 without using the learned model 84. Further, FIG. 5 shows an example of the captured image 82 of a drug with no pattern in the background portion of the imprint, and FIG. 6 shows an example of the captured image 82 of a drug with a pattern in the background portion of the imprint. Note that the “pattern” may be something that appears to be in a pattern due to the constituent components of the drug or the like.

[0086] When extracting the imprint of a drug, depending on the way light hits the drug, it may be difficult to distinguish between a part of the imprint and its background area. Such a part cannot be recognized as an imprint by conventional general image processing such as edge detection or binarization processing, and the detection result is such that a part of the imprint is missing as in the extracted mark image 830 of FIG. 5. In this regard, since the learned model 84 has learned the mark, the entire imprint can be accurately extracted as in the extracted mark image 83 of FIG. 5.

[0087] Also, the pixel values of particles of the constituent components of the drug reflected in the background area of the imprint (that is, the drug surface) may be close to the pixel values of the imprint. In such a case, in conventional general image processing, as in the extracted mark image 830 of FIG. 6, a part of the background area may be determined as an imprint, or the boundary between the imprint and the background area may be misjudged. In this regard, since the learned model 84 has learned the mark, the entire imprint can be accurately extracted as in the extracted mark image 83 of FIG. 6.

[0088] The discrimination unit 65 collates the extracted mark image 83 generated by the feature extraction unit 64 with a registered mark image registered in advance for each type of drug, and discriminates the type of the target drug based on the collation result. Since the registered mark image is registered in the drug database 81, the discrimination unit 65 can perform the above discrimination by referring to the drug database 81.

[0089] In the comparison between the extracted mark image 83 and the registered mark image, an image obtained by applying a blurring process to the extracted mark image 83 may be used. That is, the discrimination unit 65 may discriminate the type of the target drug based on the comparison result between the image obtained by applying the blurring process to the extracted mark image 83 and the registered mark image.

[0090] The reason for applying the blurring process is that, as a result of the study by the inventors of the present application, it has been found that by applying the blurring process, the accuracy of discriminating the type of the target drug is improved compared to the case where the blurring process is not applied. That is, according to the above configuration, the accuracy of type discrimination can be improved. When applying the blurring process to the extracted mark image 83, it is desirable that the same blurring process is also applied to the registered mark image. Further, the method of the blurring process is not particularly limited. For example, a process of applying a smoothing filter to the extracted mark image 83 may be used as the blurring process. Examples of the smoothing filter include a binomial (binomial distribution type) filter, a median filter, a Gaussian filter, and a bilateral filter. Further, the blurring process can also be performed by simple averaging, k-nearest neighbor, gradient calculation, or histogram smoothing.

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

[0092] Further, as described above, the feature extraction unit 64 may extract features of the drug other than the mark. In this case, regarding the features of the drug other than the mark, they may be registered in the drug database 81 for each type of drug and used as master data. Then, the discrimination unit 65 may discriminate the type of the target drug by comparing each feature extracted by the feature extraction unit 64 with the master data.

[0093] For example, assume that the feature extraction unit 64 analyzes the captured image 82 and extracts, as features of the drug, each piece of information indicating the size, shape, and representative color of the drug. 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 collate the extracted mark image 83 with the registered mark image for each of the narrowed-down types to identify the type of the target drug. Note that it is arbitrary which features are used for narrowing down in what order.

[0094] Further, the discrimination unit 65 may rank the candidates for the type of drug based on the degree of match between the extracted features of the drug and the features of the drugs included in the drug database 81. For example, the discrimination unit 65 may rank the candidates for the type extracted based on the representative color according to the degree of match between the extracted representative color and the master color data, and then perform discrimination of the type based on other features according to the ranking.

[0095] Also, even when the extracted features (target features) of the drug are not in the drug database 81, if it is estimated that the drug (tablet or capsule) is based on at least a part of the target features, the discrimination unit 65 discriminates the type of the drug as an estimated drug. In this case, the estimated drug can also be a sorting target for the second storage unit 14 or the standby tray 15. In the present embodiment, the estimated drug may first be temporarily placed on the standby 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 specified as one, or when the number of candidates is narrowed down to within a predetermined number, the drug data regarding the drug is output as the discrimination result. In this case, the discrimination unit 65 stores the drug data regarding the drug in the storage unit 80 linked to the captured image 82 of the drug.

[0097] When the discrimination unit 65 discriminates the type of the target drug as the estimated drug, it outputs the characteristics of the drug (the characteristics of the substance estimated as the estimated drug) as the discrimination result. On the other hand, when the discrimination unit 65 discriminates that the drug is registered in the drug database 81 as a drug to be discarded, or when it discriminates that the substance stored in the first storage unit 11 is a foreign substance other than a drug, it outputs that the drug is not subject to sorting as the discrimination result.

[0098] (Effects of the image processing and discrimination processing of the present embodiment) As described above, the content of the mark formed on the drug is diverse, and the appearance of the mark in the captured image 82 changes depending on how the light hits the drug during imaging, etc. Therefore, it is difficult to accurately discriminate the type of drug based on the mark. Therefore, in order to accurately discriminate the type of drug, it is required to accurately extract the mark formed on the drug, corresponding to the diversity of the mark and regardless of the change in the appearance of the mark in the captured image 82.

[0099] The feature extraction unit 64 generates an extracted mark image 83 in which the mark formed on the target drug is extracted from the captured image 82 by using the learned model 84 constructed to extract the mark formed on the drug. Therefore, the feature extraction unit 64 can (1) correspond to the diversity of the mark, (2) regardless of the change in the appearance of the mark in the captured image 82, and (3) 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 learned model 84 has learned the mark, it is possible to extract the mark from the captured image 82 as long as the mark is similar to the learned mark even if it is a mark that the learned model 84 has not learned. Furthermore, the feature extraction unit 64 can extract the mark from the captured image 82 regardless of the position or orientation of the mark in the captured image 82.

[0101] In addition, since it is only necessary to be able to extract the marks formed on the target drug using the learned model 84, it is not necessary to use the imaging images of all types of drugs that can be handled by the drug sorting device 1 in order to construct such a learned model 84. Therefore, using the learned model 84 constructed without requiring much cost, various marks can be accurately extracted.

[0102] Here, when using a learned model for discriminating the type of the target drug, the following types of learned models can also be considered for construction. · Comparative Example 1: A learned model that is learned by associating an image of a drug with the type of the drug (classification label). · Comparative Example 2: A learned model that learns individual characters, numbers, etc. In this case, using the learned model, the characters, numbers, etc. attached to the drug are extracted one by one from the image of the drug, and the type of the drug is discriminated from the combination of the extracted characters, numbers, etc.

[0103] However, in the case of Comparative Example 1, since it is necessary to prepare a large number of teacher data for each type of drug and perform learning, there is a problem that a great deal of effort is required to construct a model capable of determining many types of drug types. In addition, since it is difficult to learn about all types of drugs, there is a possibility that an image of a drug type that has not been learned is input. In such a case, it is difficult to predict what discrimination result the learned model will output. In an important discrimination related to the health of a patient such as the discrimination of the type of a drug, the low level of explanation of the discrimination result is a major negative factor. Also, it is difficult to cause the learned model to discriminate drugs with only slight differences in marks as different drugs.

[0104] In Comparative Example 2 as well, there is a possibility that an image of a drug with a mark that has not been learned, or characters or numbers in a font different from the learned ones, may be input. In these cases, it is difficult to predict what results the learned model will output. Also, the order of the characters or numbers is a feature for specifying the type of drug. However, the position or orientation of the characters or numbers may differ for each drug, and the orientation of the drug shown in the captured image 82 also varies, so it may be difficult to correctly reproduce the detected order of the characters or numbers.

[0105] Thus, when discriminating the type of the target drug using the learned model of Comparative Example 1 or 2, there are problems such as the possibility of lacking the explicability (evidence) of the basis of the discrimination result and the possibility of not being able to guarantee the reliability of the discrimination result.

[0106] On the other hand, the discrimination unit 65 of the present embodiment performs the final type discrimination of the target drug based on the collation result between the extracted mark image 83 and the registered mark image. Specifically, the discrimination unit 65 collates the marks accurately extracted using the learned model 84 and the features other than the marks extracted using existing image processing with the drug database 81 to perform the final drug type discrimination. Therefore, since the computer 60 included in the drug sorting device 1 uses the learned model 84 only for at least the extraction of marks, unlike the case of discriminating the type of the target drug using the learned model of Comparative Example 1 or 2, the explicability of the basis of the discrimination result can be enhanced. That is, according to the drug sorting device 1, it becomes possible to present evidence regarding the discrimination result.

[0107] In addition, regarding the engraving or scoring line, in particular, the appearance of the engraving or scoring line in the captured image 82 is likely to change depending on how the light hits the drug during imaging. For drugs with a shallow engraving or scoring line depth, the above appearance is even more likely to change. Therefore, it is difficult to accurately extract the engraving or scoring line from the captured image 82 by existing image processing. When extracting the engraving or scoring line from the captured image 82, the feature extraction unit 64 can extract the engraving or scoring line with higher accuracy by using the learned model 84 as compared with the case of using existing image processing.

[0108] (Flow of discrimination process) FIG. 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 into the learned model 84 (S2). The feature extraction unit 64 inputs the captured image 82 into the learned model 84 to generate an extraction mark image 83 (S3, image generation step). As described above, the extraction mark image 83 may be the result of performing image processing on the output value of the learned model 84, may be the output result of the learned model 84 itself, or may be generated based on the probability value output by the learned model 84.

[0109] Thereafter, the discrimination unit 65 collates the extraction mark image 83 generated by the feature extraction unit 64 with the registered mark image included in the drug database 81 (S4, discrimination step). Also, in S4, the discrimination unit 65 may perform existing image processing on the acquired captured image 82 to extract features other than the mark of the target drug from the captured image 82, and collate the features with various master data included in the drug database 81. Thus, in S4, the type of the target drug is discriminated based on the collation result between the extraction 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 collation results (S5).

[0110] (Example of constructing a learned model) The learned model 84 is constructed as follows, for example. FIG. 8 is a diagram showing an example of the teacher data 181. The teacher data 181 is data in which an imaging image 182 obtained by imaging a drug of a known type and correct answer data 183 of the imaging image 182 are associated with each other. The correct answer data 183 is data obtained by extracting marks from the imaging image 182. The correct answer data 183 is generated, for example, by specifying the outer edge of the mark in the imaging image 182 by 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 internal area (i.e., the mark area) and the external area (i.e., the background area) of the engraved and scored lines specified in the imaging image 182 are distinguished by performing binarization processing. A plurality of imaging images 182 are prepared, and a plurality of teacher data 181 are prepared by associating correct answer data 183 with each imaging image 182 to obtain the teacher data 181.

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

[0112] 〔Drug sorting process〕 Next, the drug sorting process based on the result of the above determination process will be described with reference to FIG. 1. The above drug sorting process is mainly performed by the transport and sorting unit 12 and the sorting control unit 62.

[0113] Based on the determination result by the determination unit 65, the transport and sorting unit 12 sorts the drugs by type and stores them in the second storage unit 14 or the standby tray 15. The sorting control unit 62 controls the transport and sorting unit 12 to transport the drug placed in the reception area Ar1 after the imaging and determination processes to a predetermined sorting cup 141 of the second storage unit 14 or the standby tray 15 based on the determination result.

[0114] When the sorting control unit 62 receives the discrimination result of the drug, it determines the sorting position for storing the drug, associates the discrimination result with the determined sorting position, and stores them in the storage unit 80. Specifically, the sorting control unit 62 determines whether the same discrimination result as the above discrimination result is stored in the storage unit 80.

[0115] When the same discrimination result as the above discrimination result is stored, the sorting cup 141 associated with the stored discrimination result is determined as the sorting position. Also, when the sorting position associated with the stored discrimination result (e.g., the estimated drug) is the standby tray 15, the standby 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 where the drug is not stored (the sorting cup 141 whose sorting position is undetermined) is determined as the sorting position. When all of the sorting cups 141 are storing drugs, the standby 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 the predetermined area of the second storage unit 14 as the sorting position instead of the standby 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 and sorting unit 12 above the receiving area Ar1. The sorting control unit 62 controls the second camera 121 and the suction and shutter mechanism 122 in the same manner as the transport control unit 61 to suck the drug placed in the receiving area Ar1. Then, the drug is transported to the determined sorting cup 141 or standby tray 15 by the transport mechanism 123. As described above, since the shutter mechanism is in the closed state during drug transport, it is possible to prevent the drug 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 transport, the drug is stored in the sorting cup 141 or standby tray 15 by releasing the suction. Also, the sorting control unit 62 counts the number of drugs stored in the sorting cup 141 and stores it in the storage unit 80 associated with the sorting position.

[0117] After the sorting control unit 62 transports the drug (the drug after discrimination) on the drug placement table 133a arranged in the receiving area Ar1 to the sorting position, the transport control unit 61 controls the transport and sorting unit 12 to transport and place the drug stored in the first storage unit 11 on the emptied drug placement table 133a. Thereby, the drug sorting device 1 can continuously discriminate the types of drugs.

[0118] Further, when the sorting control unit 62 receives a discrimination result indicating that the type of the drug cannot be discriminated, since the object arranged in the receiving area Ar1 after discrimination is a foreign object, the sorting control unit 62 transports the foreign object to the collection tray 16.

[0119] In this way, regardless of the discrimination result of the drug type, the sorting control unit 62 stores all the objects stored in the first storage unit 11 in any one of the second storage unit 14, the standby tray 15, or the collection tray 16. Therefore, even when the drug type cannot be specified or when foreign objects are mixed in the first storage unit 11, the sorting process can be continued without stopping for that reason.

[0120] Note that the sorting control unit 62 causes the second camera 121 to image the drug placement table 133a in order to take out the drug for which the discrimination process has been completed from the drug placement table 133a arranged in the receiving area Ar1, and narrows down the position of the drug. Further, when transporting the drug stored in the sorting cup 141 to the drug packaging mechanism 6, the sorting control unit 62 causes the second camera 121 to image the sorting cup 141 in order to take out the drug from the sorting cup 141, and narrows down the drug to be transported.

[0121] Further, when the drug is stored up to the upper limit value of the number of drugs to be stored in the sorting cup 141, even if the type of the drug to be sorted is the same as the type of the drug sorted in the sorting cup 141, the sorting control unit 62 stores the drug to be sorted in an empty sorting cup 141 different from the sorting cup 141.

[0122] In addition, data regarding the drug stored in the sorting cup 141 by the sorting control unit 62 is stored in the RFID tag provided on the sorting cup 141 by the second RFID reader / writer unit 18.

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

[0124] 〔Embodiment 2〕 Other embodiments of the present invention will be described below. For convenience of explanation, members having the same functions as the members described in the above embodiment are denoted by the same reference numerals, and the description thereof will not be repeated. The same applies to the following embodiments.

[0125] Among the drugs sorted by the drug sorting device 1, there are drugs that are vulnerable to heat and may change color when affected by heat. Such heat-sensitive drugs may change color due to the heat received 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, with reference to FIGS. 9 to 11, in the drug sorting device 1 including the packaging mechanism 6, a configuration for reducing the possibility of the drug changing color due to the heat of the heater roller 6b of the packaging mechanism 6 will be described. In Embodiment 2, for simplicity, heat-sensitive drugs are referred to as "heat-sensitive drugs HMD", and other drugs are referred to as "normal drugs MD". Also, the simple description of "drug" is used as a general term for normal drugs MD and heat-sensitive drugs HMD.

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

[0127] As shown in FIGS. 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 control of the heater roller 6b and the shutter mechanism 6e is performed by the packaging control unit 71.

[0128] The packaging hopper 6a receives the drug that is input from the drug input port 17 and passes (falls) through the moving passage 6c, and guides it to the packaging paper PP that is set on the heater roller 6b and is in the standby position Ar4.

[0129] The heater roller 6b packages the drugs one by one by heat - fusing a part of the packaging paper PP. The heater roller 6b is a pair of roller mechanisms that extends in a direction substantially perpendicular to the conveyance direction (the direction indicated by the arrow Q1) of the packaging paper PP and sandwiches the packaging paper. The heater roller 6b includes a horizontal fusing heater 6bw for fusing the horizontal fusing part Cr1 and a vertical fusing heater 6bh for fusing the vertical fusing part Cr2. As the heater roller 6b rotates in the direction of the arrow Q2 shown in FIGS. 9 and 10 as it conveys the packaging paper PP in the conveyance direction, it fuses the horizontal fusing part Cr1 and fuses the vertical fusing part Cr2 at arbitrary intervals.

[0130] The transfer path 6c is provided between the drug inlet 17 and the packaging hopper 6a, and guides the drug input from the drug inlet 17 to the packaging hopper 6a. Further, the transfer path 6c also guides the drug input into the drug inlet 17 to the holding area Ar3 on the shutter 6ea described later.

[0131] The shutter mechanism 6e functions as a drug holding part that temporarily holds the drug input from the drug inlet 17 in the holding area Ar3 until all the drugs to be included in one package created by the sub-packaging mechanism 6 are input from the drug inlet 17. In other words, the shutter mechanism 6e prevents the drug from being input into the packaging hopper 6a until all the drugs to be included in one package are input from the drug inlet 17. In this embodiment, the shutter mechanism 6e is provided between the packaging hopper 6a and the transfer path 6c, but it is not limited thereto, and it may be provided inside the packaging hopper 6a or the transfer path 6c, for example.

[0132] Further, as shown in 9001 of FIG. 9 and 10001 of FIG. 10, the shutter mechanism 6e includes an openable and closable shutter 6ea. The shutter mechanism 6e also includes a shutter drive part (not shown). The shutter drive part controls the opening and closing operation of the shutter 6ea by driving the shutter 6ea. 9001 of FIG. 9 and 10001 of FIG. 10 show the state where the shutter 6ea is closed.

[0133] 〔Regarding the sub-packaging of the normal drug MD〕 First, while referring to FIG. 9, the control of the packaging control unit 71 when the drug to be packaged is the normal drug MD will be described. When the drug to be packaged is the normal drug MD, after the last drug among the plurality of drugs to be included in one package is introduced into the drug inlet 17, the packaging control unit 71 controls the packaging mechanism 6 so that the following operations (i) to (iii) are repeatedly performed. Note that the last drug among the plurality of drugs to be included in one package being introduced into the drug inlet 17 means that the last drug among the plurality of drugs stored in a certain sorting cup 141 is introduced into the drug inlet 17. When only one drug is stored in a certain sorting cup 141, the drug is the last drug.

[0134] (i) The packaging control unit 71 controls the heater roller 6b to thermally fuse the packaging paper PP and feed the packaging paper PP for one package in the direction indicated by the arrow Q1. Thereby, the packaging control unit 71 can move the normal drug MD that has been waiting at the standby position Ar4 to the fused area Ar5 while packaging it from the standby position Ar4 until all of the normal drug MD that is the target of this packaging is introduced into the drug inlet 17. (ii) The packaging control unit 71 opens the shutter 6ea, drops all of the normal drug MD held in the holding area Ar3, and then closes the shutter 6ea again. (iii) After the last normal drug MD among the normal drug MD to be included in the next package is introduced into the drug inlet 17, the packaging control unit 71 returns to the process of (i). Note that for the case of packaging the normal drug MD to be included in the first package, the packaging control unit 71 may start from the process of (ii) without performing the process of (i).

[0135] When the above process is executed, as shown in FIG. 9, the drug in the packaging paper PP at the standby position Ar4 will wait at the standby position Ar4 until the drug to be packaged next is held on the shutter 6ea. Since the standby position Ar4 is the position sandwiched by the paired heater rollers 6b, the drug present at the standby position Ar4 is likely to be affected by the heat from the heater rollers 6b. Therefore, when the drug to be packaged is the heat-sensitive drug HMD, the packaging control unit 71 may perform control as follows, for example.

[0136] [Regarding the Sub-packaging of the Heat-Attention Agent HMD] Hereinafter, the control of the sub-packaging control unit 71 when the agent to be sub-packaged is the heat-attention agent HMD will be described with reference to FIG. 10. When the agent to be sub-packaged is the heat-attention agent HMD, after the last agent among the plurality of agents to be included in one package is introduced into the agent inlet 17, the sub-packaging control unit 71 controls the sub-packaging mechanism 6 so that the following operations are performed.

[0137] (iv) In a state where there is a heat-attention agent HMD sub-packaged in the heat-sealed area Ar5, the sub-packaging control unit 71 controls the heater roller 6b to heat-seal the sub-packaging paper PP and feed the sub-packaging paper PP for one package in the direction indicated by the arrow Q1. As a result, the sub-packaging control unit 71 can make the next package of the heat-attention agent HMD sub-packaged previously an empty package without containing the agent.

[0138] (v) The sub-packaging control unit 71 opens the shutter 6ea, drops all the heat-attention agent HMD held in the holding area Ar3, and then closes the shutter 6ea again. As a result, the heat-attention agent HMD to be sub-packaged this time is inserted into the sub-packaging paper PP created as the next package after the empty package located at the standby position Ar4.

[0139] (vi) The sub-packaging control unit 71 controls the heater roller 6b to heat-seal the sub-packaging paper PP containing the heat-attention agent HMD at the standby position Ar4 and feed it for one package in the direction indicated by the arrow Q1, moving the heat-attention agent HMD to the heat-sealed area Ar5. As a result, the heat-attention agent HMD inserted into the sub-packaging paper PP at the standby position Ar4 where the heater roller 6b exists can be sent from the standby position Ar4 to the heat-sealed area Ar5 without waiting at the standby position Ar4. That is, while the heat-attention agent HMD to be included in the next package is being introduced from the agent inlet 17, the heat-attention agent HMD to be sub-packaged this time will exist not at the standby position Ar4 but in the heat-sealed area Ar5 where it has been sub-packaged.

[0140] (vii) In this state, after the last heat - attention agent HMD among the heat - attention agents HMD to be included in the next pack is input into the agent input port 17, the sub - packaging control unit 71 feeds the sub - packaging paper PP by one pack in the direction indicated by the arrow Q1 (that is, returns to the process of (iv)). Thereby, the sub - packaging control unit 71 can make the next pack of the heat - attention agent HMD sub - packaged this time an empty pack without any agent before dropping the next heat - attention agent HMD to the standby position Ar4.

[0141] In addition, when sub - packaging the heat - attention agent HMD to be included in the first pack, or when sub - packaging the heat - attention agent HMD after the normal agent MD has been sub - packaged, the sub - packaging control unit 71 may start from the process of (v) without performing the process of (iv). Also, the sub - packaging control unit 71 may create not only one empty pack but also two or more empty packs, or may create an empty pack smaller than the dimension of one pack as specified (for example, an empty pack whose length in the direction indicated by the arrow Q1 is half of the length of one pack as specified). It is sufficient that an empty pack or space of such a size that the heat - attention agent HMD after sub - packaging can move to a position where it is less affected by the heat of the heater roller 6b is formed between the heat - attention agent HMD after sub - packaging and the heater roller 6b (standby position Ar4). The sub - packaging control unit 71 may move the sub - packaging paper PP in the direction indicated by the arrow Q1 so as to form the empty pack or space.

[0142] As described above, after dropping the heat - attention agent HMD to the standby position Ar4, the sub - packaging control unit 71 sub - packages the heat - attention agent HMD and sends it to the fused area Ar5 by feeding the sub - packaging paper PP by at least one pack in the direction indicated by the arrow Q1. After that, after all of the next heat - attention agents HMD are input into the agent input port 17, the sub - packaging control unit 71 creates at least the next pack of the heat - attention agent HMD sub - packaged previously as an empty pack by feeding the sub - packaging paper PP by at least one pack in the direction indicated by the arrow Q1. After that, the sub - packaging control unit 71 drops the heat - attention agent HMD held in the holding area Ar3 to the standby position Ar4, and inserts the heat - attention agent HMD into the next pack after the empty pack.

[0143] When the above processing is executed, as shown in FIG. 10, during the waiting time until the drug to be sub-packaged next is held on the shutter 6ea, the sub-packaging paper PP at the waiting position Ar4 is in an empty state. Further, by the operation of the above (iv) or (vii) of the sub-packaging mechanism 6, the sub-packaging paper PP after heat-sealing is discharged from the sub-packaging mechanism 6 as a sub-packaging sheet including an empty pack, as shown in 11001 of FIG. 11.

[0144] Note that the sub-packaging control unit 71 may send the sub-packaging paper PP in the direction indicated by the arrow Q1 for at least two packs after dropping the heat-sensitive drug HMD to the waiting position Ar4. That is, after dropping the heat-sensitive drug HMD to the waiting position Ar4, the sub-packaging control unit 71 may not only sub-package the heat-sensitive drug HMD but also create an empty pack as the next one pack after the sub-packaged heat-sensitive drug HMD. In this case, the sub-packaging control unit 71 can create an empty pack before all of the next heat-sensitive drug HMDs are loaded into the drug inlet 17 or while they are being loaded, rather than after all of the next heat-sensitive drug HMDs are loaded into the drug inlet 17. Further, the heat-sensitive drug HMD after sub-packaging can wait at a position farther from the heater roller 6b by the number of created empty packs while the next heat-sensitive drug HMD is being loaded into the drug inlet 17. Therefore, the influence of the heat of the heater roller 6b on the heat-sensitive drug HMD after sub-packaging can be further reduced.

[0145] (Attention call when sub-packaging the heat-sensitive drug HMD) When the heat-sensitive drug HMD is discharged from the sub-packaging mechanism 6 as a sub-packaging sheet including an empty pack as described above, the user may be alerted by using the printing on the empty pack. Specifically, as shown in 11001 of FIG. 11, in the sub-packaging sheet in which the heat-sensitive drug HMD is sub-packaged, specific characters or pictures may be printed on the empty pack portion by a printing mechanism (not shown) provided in the sub-packaging mechanism 6. Specifically, characters such as "Heat countermeasure" or "SKIP", or pictures or symbols may be printed so that it can be understood that it is an empty pack for heat countermeasures.

[0146] Here, it is preferable that the heating caution agent HMD be carefully visually inspected by the user for discoloration or the like before being returned to the chemical cassette provided in the packaging machine or the chemical shelf. By printing such information, it becomes easier for the user to recognize that the medicine packet in front of the empty packet labeled "heat countermeasure" or the like is the heating caution agent HMD, and it is possible to assist the user in the above-mentioned visual inspection work.

[0147] (Regarding the cutting position of the packaging sheet during the packaging of the heating caution agent HMD) A series of packaging sheets fused by the heater roller 6b are cut by a cutting mechanism (not shown) of the packaging mechanism 6 for each predetermined number of packages for subsequent operations. The cutting mechanism is controlled by the packaging control unit 71. 11002 and 11003 in FIG. 11 both show examples of cutting the packaging sheet when the set number of packages for cutting is set to 3. The positions of the white arrows in 11002 and 11003 in FIG. 11 are the cutting positions.

[0148] In the cutting example 1 shown in 11002 of FIG. 11, the cutting mechanism cuts the packaging sheet every three packages from the beginning. The packaging sheet cut by the set number of packages is referred to as a cut unit. Also, the cutting mechanism cuts the packaging sheet in front of the medicine B, which is the switching position between the heating caution agent HMD (medicine A) and the normal medicine MD (medicine B). In this case, since the cut unit containing medicine A includes an empty packet, the position of the medicine packet containing medicine A varies depending on the cut unit.

[0149] On the other hand, in the cutting example 2 shown in 11003 of FIG. 11, the cutting mechanism cuts the sub-packaging sheet every three packs starting from the beginning. Further, when the beginning of the cutting unit is an empty pack, the cutting mechanism cuts only one pack of the empty pack. Furthermore, the cutting mechanism cuts the sub-packaging sheet in front of the drug B, which is the switching position between the heating caution agent HMD (drug A) and the normal drug MD (drug B). In this case, all the cutting units containing drug A are the same cutting unit in which drug packs containing drug A are arranged at both ends and an empty pack is included therebetween. By cutting as in the cutting example 2, since the arrangement of drug A in the cutting unit is the same, the appearance quality of the cutting unit delivered from the sub-packaging mechanism 6 is improved. In addition, the working efficiency of the user during subsequent visual inspection and / or filling into the drug shelf or the like can be improved.

[0150] Note that the cutting example 2 shown in 11003 of FIG. 11 can be applied when the set number of packs for cutting is an odd number of 5 or more. In this case, the same effect as when the set number of packs is 3 described above can be obtained.

[0151] 〔Embodiment 3〕 For all the drugs stored in the first storage unit 11 of the drug sorting device 1 according to Embodiment 1, the type of each drug is discriminated one by one and stored by type in the second storage unit 14. When the first storage unit 11 stores more types of drugs than the number of sorting cups 141 arranged in the second storage unit 14, even if the types are discriminated, they cannot be stored in the second storage unit 14, and drugs are generated that are stored in the standby tray 15. When drugs are stored in the standby tray 15, the drug sorting device 1 discriminates the types of the drugs again and stores them in the second storage unit 14. Then, every time drugs that cannot be stored in the second storage unit 14 are generated, the drug sorting device 1 discriminates the types of the drugs and attempts to store them in the second storage unit 14.

[0152] In the present embodiment, a drug dispensing system 100 that enables storage in the second storage unit 14 without waiting for storage in the second storage unit 14 for the drugs stored in the first storage unit 11 will be described.

[0153] 〔Drug Dispensing System〕 The drug dispensing system 100 of this embodiment will be described. FIG. 12 is a diagram showing a configuration example of the drug dispensing system 100. FIG. 13 is a diagram showing a state in which a two-dimensional code is printed on a drug package packaged by the packaging machine 110.

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

[0155] The packaging machine 110 is a device that dispenses drugs based on, for example, prescription data. Specifically, the packaging machine 110 is a device that packages drugs such as tablets or capsules. When packaging the drugs, the packaging machine 110 prints information indicating the type of the drug to be contained as a two-dimensional code on the surface of the packaging paper that contains the drug. Specifically, as shown in FIG. 13, the packaging machine 110 prints information indicating the type of the drug contained in the drug package MP1, which is packaged by the packaging paper in a packaging unit, as a two-dimensional code Co1 on the drug package MP1. As shown in FIG. 13, information indicating the type of the drug contained in the drug package MP2 is printed as a two-dimensional code Co2 on the drug package MP2, and information indicating the type of the drug contained in the drug package MP3 is printed as a two-dimensional code Co3 on the drug package MP3.

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

[0157] However, it is not always necessary for the printing of the information indicating the type of drug on the wrapping paper to be executed by the packaging machine 110. For example, such printing may be executed by a printing device (not shown) which is a device different from the packaging machine 110. In this case, for example, the packaging machine 110 may transmit information indicating the type of drug contained in the drug package to the printing device, and the printing device may print on the drug package dispensed from the packaging machine 110.

[0158] Similar to the drug sorting device 1, the drug sorting device 1A is a device that discriminates the type of drug input into the drug sorting device 1A and sorts the drugs for each type. The specific configuration of the drug sorting device 1A will be described later.

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

[0160] 〔Drug Sorting Device〕 FIG. 14 is a block diagram showing the overall configuration of the drug sorting device 1A. As shown in FIG. 14, in addition to the configuration of the drug sorting device 1, the drug sorting device 1A includes a reading unit 8 and a control unit 60Aa. Hereinafter, in addition to these members, the first storage unit 11, the second storage unit 14, the conveying and sorting unit 12, the packaging mechanism 6, and the display unit 32 of the touch panel 3 will also be described.

[0161] As described in Embodiment 1, the first storage unit 11 is a storage unit capable of storing multiple types of drugs, and is divided into a plurality of storage units (specifically, four storage units). In this embodiment, the four storage units divided in the first storage unit 11 are respectively referred to as the first compartments 111a to 111d. The first compartments 111a to 111d may also be collectively referred to as the first compartment 111. If the number of the first compartments 111 is plural, it may be other than four. Further, as described above, the first storage unit 11 is capable of storing the drugs sub-packed by the sub-packaging machine 110.

[0162] As described in Embodiment 1, the second storage unit 14 is a storage unit in which a plurality of sorting cups 141 can be arranged, and each of the arranged plurality of sorting cups 141 is a storage unit capable of storing drugs for each type. Instead of the removable sorting cup 141, a plurality of compartments capable of storing drugs may be provided in the second storage unit 14. The sorting cup 141 and the compartment can also be referred to as the second compartment capable of storing drugs for each type. In this embodiment, the total number of sorting cups 141 that can be stored in the second storage unit 14 (the number of the second compartments. Hereinafter, also simply referred to as the total number of sorting cups 141) is 40, but if it is plural, it is not limited to this.

[0163] The conveying and sorting unit 12 functions as a conveying unit that conveys the drugs stored in the first storage unit 11 to the second storage unit 14 for each of the first compartments 111 and stores them in the sorting cups 141 for each type in the second storage unit 14.

[0164] For all the drugs stored in one first compartment 111 (e.g., the first compartment 111a), the conveying and sorting unit 12 conveys them to the second storage unit 14 or the standby tray 15 based on the discrimination result by the discrimination unit 65. For the drugs whose types can be discriminated, the conveying and sorting unit 12 stores them in each of the sorting cups 141 of the second storage unit 14 for each type. For the drugs whose types cannot be discriminated, the conveying and sorting unit 12 stores them in the standby tray 15.

[0165] After the sorting process for all the drugs stored in one first compartment 111 is completed, the conveying and sorting unit 12 conveys all the drugs stored in the sorting cup 141 of the second storage unit 14 to the packaging mechanism 6. Thereafter, the conveying and sorting unit 12 starts to convey the drugs stored in another first compartment 111 (e.g., the first compartment 111b) to the second storage unit 14. Thereby, with the second storage unit 14 having space, the drugs stored in the first compartment 111 can be conveyed to the second storage unit 14.

[0166] The conveying and sorting unit 12 executes the above-described conveying process until all the drugs are taken out from all the first compartments 111. That is, in the present embodiment, after the sorting process for the drugs stored in the first compartment 111a is completed and the packaging process for the drugs stored in the second storage unit 14 is completed, the sorting process for the drugs stored in the first compartment 111b is started. Thereafter, after the sorting process for the drugs stored in the first compartment 111b is completed and the packaging process for the drugs stored in the second storage unit 14 is completed, the sorting process for the drugs stored in the first compartment 111c is started. Thereafter, after the sorting process for the drugs stored in the first compartment 111c is completed and the packaging process for the drugs stored in the second storage unit 14 is completed, the sorting process for the drugs stored in the first compartment 111d is started.

[0167] As described in Embodiment 1, the packaging mechanism 6 functions as a packaging unit that packages the drugs stored in the second storage unit 14. After the conveying and sorting unit 12 conveys all the drugs stored in one first compartment 111 to the second storage unit 14 or the standby tray 15, the conveying and sorting unit 12 conveys the drugs stored in the second storage unit 14 to the drug inlet 17. Thereafter, the packaging mechanism 6 starts to package the drugs stored in the sorting cup 141 of the second storage unit 14. Thereby, even when all the sorting cups 141 are filled with drugs, the drug sorting device 1A can create space in the sorting cup 141 by packaging the drugs. Therefore, the drug sorting device 1A can convey the next drug to be sorted to the second storage unit 14.

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

[0169] The display unit 32 notifies to store the drug in the first section 111 designated as the storage destination of the drug by the section designation unit 72 described later. Thereby, the drug sorting device 1A can cause the user to store the drug in the designated first section 111. Further, the display unit 32 functions as a notification unit that notifies to change the first section 111 that is the storage destination of the drug every time the total number of types of drugs counted by the counting unit 73 described later reaches the total number of sorting cups 141 (40 in the present embodiment).

[0170] Note that the notification for storing the drug in the designated first section 111 does not necessarily have to be performed by the display unit 32. For example, the notification may be performed by a sound output unit (not shown) that outputs a sound. That is, the drug sorting device 1A only needs to have a notification unit that notifies various information.

[0171] Further, after the sorting process for all the drugs stored in one first section 111 is completed, the 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 to replace with a new sorting cup 141 in which no drug is stored. Further, the display unit 32 may notify to make the sorting cup 141 disposed in the second storage unit 14 empty. Even in this case, before transporting the drug stored in the next first section 111 to the second storage unit 14, the sorting cup 141 can be emptied.

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

[0173] The section designating unit 72 designates one of the first sections 111a to 111d as the first section 111 for accommodating the drug. Each time the type number determination unit 74 determines that the total number of types of drugs (the total number of different drug types) counted by the counting unit 73 exceeds the total number of sorting cups 141, the section designating unit 72 changes the designated first section 111.

[0174] The first section 111 designated by the section designating unit 72 as the initial position when the drug sorting process starts, and the designation order of the first section 111 by the section designating unit 72 are preset. Therefore, each time the type number determination unit 74 determines that the total number of types of drugs counted by the counting unit 73 exceeds the total number of sorting cups 141, the section designating unit 72 changes the first section 111 for accommodating the drug according to the preset designation order. For example, each time the section designating unit 72 receives the determination result from the type number determination unit 74, it transmits information indicating the designated first section 111 to the display control unit 67.

[0175] For example, assume that the first section 111a is set as the initial position for accommodating the drug, and the designation order of the first section 111 is set in the order of the first section 111a, the first section 111b, the first section 111c, and the first section 111d. In this case, in the present embodiment, when the drug sorting process starts, the section designating unit 72 designates the first section 111a as the accommodation destination for the drug. As a result, the display control unit 67 displays an image for notifying the display unit 32 to accommodate the drug in the first section 111a. After that, each time the type number determination unit 74 determines that the total number of types of drugs counted by the counting unit 73 has reached the total number of sorting cups 141, the section designating unit 72 changes the accommodation destination of the drug in the order of the first section 111b, the first section 111c, and the first section 111d. As a result, the display control unit 67 sequentially displays on the display unit 32: (i) an image for notifying to accommodate the drug in the first section 111b, (ii) an image for notifying to accommodate the drug in the first section 111c, and (iii) an image for notifying to accommodate the drug in the first section 111d.

[0176] The counting unit 73 counts the number of types of drugs stored in the first storage unit 11 based on the two-dimensional code read by the reading unit 8. When the reading unit 8 reads the two-dimensional code printed on the medicine package, it transmits the reading result (information indicating the type of drug indicated by the two-dimensional code) to the counting unit 73. The counting unit 73 counts the number of types of drugs contained in the medicine package by analyzing the reading result. That is, due to the two-dimensional code being printed on the medicine package, the counting unit 73 can count the number of types of drugs stored in the medicine package.

[0177] As described above, before the user puts the drugs stored in the medicine package into the first storage unit 11, the user causes the reading unit 8 to read the two-dimensional code printed on the medicine package. Therefore, the counting unit 73 can count the number of types of drugs to be stored in the first storage unit 11 from now on by counting the number of types of drugs stored in the medicine package.

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

[0179] The counting unit 73 updates the total number of drug types by adding the number of types of drugs counted this time to the total (total number of types) of the types of drugs counted so far. The counting unit 73 updates the total number of drug types until it receives a reset instruction to reset the total number of drug types from the type number determination unit 74. The counting unit 73 transmits information indicating the updated total number of drug types to the type number determination unit 74. Note that the counting unit 73 temporarily stores the total number of drug types.

[0180] The type number determination unit 74 determines whether the total number of types of drugs indicated by the information received from the counting unit 73 has reached the total number of sorting cups 141. The type number determination unit 74 transmits the determination result to the section designation unit 72. Thereby, the section designation unit 72 can determine whether the first section 111 needs to be changed.

[0181] In the first embodiment, the drug sorting device 1 uses the extracted mark image 83 obtained by inputting the captured image 82 into the learned model 84 for determining the type of drug, at least for the drug marks. However, in this embodiment, the drug sorting device 1A may extract the drug marks from the captured image 82 using existing image processing without using the learned model 84.

[0182] 〔Processing when storing drugs in the first storage unit〕 Next, an example of the processing when drugs are put into the first storage unit 11 will be described with reference to FIG. 15. FIG. 15 is a flowchart showing an example of the flow of this processing. In this example, it is assumed that the first section 111a is designated as the storage destination of the drug when the drug sorting process is started. Also, it is assumed that the storage destinations of the drugs are 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 drug, the control unit 60Aa determines whether the reading unit 8 has read the two-dimensional code printed on the medicine package. That is, the control unit 60Aa determines whether it has acquired the two-dimensional code read by the reading unit 8 from the reading unit 8 (S11).

[0184] Before the user puts the drug contained in the medicine package into the first storage unit 11, the user causes the reading unit 8 to read the two-dimensional code printed on the medicine package. When the user causes the reading unit 8 to 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 display an image on the display unit 32 to prompt the user to cause the reading unit 8 to read the two-dimensional code printed on the medicine package before putting the drug contained in the medicine package into the first storage unit 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 drugs contained in the medicine pack based on the information indicating the type of drug indicated by the acquired two-dimensional code (S12). That is, the counting unit 73 counts the number of types of drugs to be stored in the first storage unit 11 from now on. After that, the counting unit 73 updates the total number of types of drugs by adding the number of types of drugs counted this time to the total number of types of drugs 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 drugs received from the counting unit 73 (the updated total number of types of drugs) has reached the total number of sorting cups 141 (S13).

[0187] Consider the case where the type number determination unit 74 determines that the total number of types of drugs has not reached 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 to store drugs 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 process of S15, the display control unit 67 notifies to store drugs in the first section 111a. After the process of S15, the process returns to S11.

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

[0189] When the section specifying unit 72 determines that not all of the first sections 111a to 111d are specified (NO in S14), it changes to the first section 111 that is set as the storage destination for the next drug from the currently specified first section 111. That is, the section specifying unit 72 specifies the first section 111 that is the storage destination for the next drug (S16). The display control unit 67 displays, on the display unit 32, an image for notifying that a drug is to be stored in the first section 111 that is the storage destination for the next drug specified by the section specifying unit 72 (S17).

[0190] In the present embodiment, when the section specifying unit 72 is in a state of specifying any one of the first sections 111a to 111c, it specifies any one of the first sections 111b to 111d that is the storage destination for the next drug. For example, when the section specifying unit 72 specifies the first section 111a as the storage destination for a drug, it specifies the first section 111b as the storage destination for the next drug. Then, the display control unit 67 displays, on the display unit 32, an image for notifying that a drug is to be stored in the first section 111b.

[0191] Thereafter, the control unit 60Aa resets the total number of drug types temporarily stored by the counting unit 73 (S18). As a result, the counting unit 73 can count the total number of drug types stored in the newly specified first section 111. After the process of S18, the process returns to the process of S11.

[0192] On the other hand, when the section specifying unit 72 determines that all of the first sections 111a to 111d have been specified (YES in S14), the control unit 60Aa ends this process. In the present embodiment, when the section specifying unit 72 is in a state of specifying the first section 111d, the control unit 60Aa ends this process. Thereby, it is possible to suppress the occurrence of a possibility that a drug exceeding the total number of sorting cups 141 is stored in the first section 111d.

[0193] Note that not all of the first compartments 111a to 111d need to contain drugs. That is, the first storage unit 11 does not necessarily contain more than 160 types of drugs. Therefore, when the control unit 60Aa receives a user input to start the sorting process of the drugs, it may end this process assuming that there are no more drugs to be stored in the first storage unit 11. For example, if the number of types of drugs stored in the first storage unit 11 is 40 or less, this process will end with drugs stored only in the first compartment 111a.

[0194] In this way, when the control unit 60Aa adds the number of types of drugs to be stored in the first storage unit 11 to the total number of types of drugs stored in the designated first compartment 111 and the total number does not exceed the total number of sorting cups 141, it can store the drugs in the first compartment 111. That is, the control unit 60Aa can prompt the user to store drugs in the first compartment 111 until the number of drugs stored in the first compartment 111 reaches the total number of sorting cups 141. On the other hand, when adding the number of types of the drugs to the total number of the drugs exceeds the total number of sorting cups 141, the control unit 60Aa can store the drugs in another first compartment 111 (the first compartment 111 not yet stored). Therefore, the control unit 60Aa can store as many types as possible in the first compartment 111 without exceeding the total number of sorting cups 141.

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

[0196] For example, after the control unit 60Aa acquires the two-dimensional code in S11, it determines whether the type of drug indicated by the two-dimensional code matches the type of drug stored in any of the first compartments 111 specified so far. When the control unit 60Aa determines that the types of the two drugs match, the compartment specifying unit 72 identifies the first compartment 111 in which a drug of the same type as the drug indicated by the two-dimensional code is stored, and designates the first compartment 111 as the storage destination of the drug. Then, the display control unit 67 notifies, via the display unit 32, to store the drug in the first compartment 111. On the other hand, when the control unit 60Aa determines that the types of the two drugs do not match, the counting unit 73 counts the types of drugs in S12.

[0197] 〔Drug sorting process〕 Next, the drug sorting process executed after the drug is stored in the first storage unit 11 will be described with reference to FIG. 16. FIG. 16 is a flowchart showing an example of the flow of the drug sorting process. This drug sorting process may be executed by the control unit 60Aa, for example, when a user input for starting the drug sorting process is received. Also in this example, the drugs stored in the first compartment 111 are taken out in the order of the first compartment 111a, the first compartment 111b, the first compartment 111c, and the first compartment 111d, conveyed to the second storage unit 14, and stored in the sorting cups 141 for each type.

[0198] The conveyance control unit 61 controls the conveyance and sorting unit 12 to take out one drug stored in one first compartment 111 specified as the drug extraction target (S21). The imaging control unit 63 controls the first camera 131 to image the drug taken out by the conveyance and sorting unit 12 (S22). The discrimination unit 65 discriminates the type of the drug based on the image of the drug imaged by the first camera 131 (S23). The sorting control unit 62 determines a sorting cup 141 (sorting position) for storing the drug whose type has been discriminated. Then, the sorting control unit 62 controls the conveyance and sorting unit 12 to store the drug in the sorting cup 141 determined as the storage destination of the drug (S24).

[0199] The conveyance control unit 61 determines whether all the drugs have been taken out from the first compartment 111 targeted for drug extraction (S25). When the conveyance and sorting unit 12 takes out drugs from the first compartment 111, the imaging control unit 63 controls the second camera 121 to image the first compartment 111 that is the target for drug extraction. The imaging control unit 63 analyzes the image of the first compartment 111 captured by the second camera 121 to determine whether the first compartment 111 that is the target for drug extraction contains drugs. When the conveyance control unit 61 determines, based on the imaging control unit 63, that the first compartment 111 does not contain drugs, it determines that all the drugs have been taken out from the first compartment 111 that is the target for drug extraction.

[0200] When the conveyance control unit 61 determines that not all the drugs have been taken out from the first compartment 111 targeted for drug extraction (NO in S25), since there are still drugs stored in the first compartment 111, the process of S21 is performed. On the other hand, when the conveyance control unit 61 determines that all the drugs have been taken out from the first compartment 111 (YES in S25), the conveyance control unit 61 and the sorting control unit 62 temporarily interrupt the drug conveyance and sorting processes. That is, the conveyance control unit 61 does not execute the conveyance process for the drugs stored in the first compartment 111 that contains the next batch of drugs to be sorted.

[0201] Instead, the sub-packaging control unit 71 controls the conveyance and sorting unit 12 to convey the drugs stored in the sorting cup 141 to the drug inlet 17. Thereafter, the sub-packaging control unit 71 controls the sub-packaging mechanism 6 to sub-package the drugs stored in the sorting cup 141 (S26). The sub-packaging control unit 71 executes the process of S26 for all the sorting cups 141 that contain drugs.

[0202] Note that the sorting cup 141 that contains drugs can be identified, for example, by having the storage unit 80 store the sorting position determined by the sorting control unit 62. Also, the determination of whether the sorting cup 141 contains drugs may be performed, for example, by having the imaging control unit 63 cause the second camera 121 to image the sorting cup 141 and analyzing the image of the sorting cup 141.

[0203] The sub-packaging control unit 71 determines whether all the drugs stored in the second storage unit 14 have been sub-packaged (S27). That is, the sub-packaging control unit 71 determines whether all the drugs stored in each sorting cup 141 in which the drugs are stored have been sub-packaged.

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

[0205] When the conveyance control unit 61 determines that the extraction of drugs from all the first compartments 111 in which the drugs are stored has not been completed (NO in S28), it returns to the process of S21. That is, in this case, the control unit 60Aa can resume the sorting process of the drugs stored in the first compartment 111 by extracting drugs from the first compartment 111 to be the next drug extraction target. On the other hand, when the conveyance control unit 61 determines that the extraction of drugs from all the first compartments 111 in which the drugs are stored has been completed (YES in S28), the control unit 60Aa ends this drug sorting process.

[0206] For example, by the control unit 60Aa managing the first section 111 designated by the section designating unit 72, the conveyance control unit 61 can execute the process of S28. For example, when the last first section 111 designated by the section designating unit 72 is the first section 111c, the conveyance control unit 61 determines in S28 whether the extraction of the drug from the first section 111c has been completed. For example, when the sub-packaging process for all the drugs contained in the first section 111a has been completed, the conveyance control unit 61 determines that the extraction of the drug from the first section 111c has not been completed. In this case, the conveyance control unit 61 identifies the first section 111b as the target for extracting the next drug in S21 and extracts the drug from the first section 111b. Thereafter, when the sub-packaging process for all the drugs contained in the first section 111c has been completed, the control unit 60Aa ends this drug sorting process.

[0207] In this way, the control unit 60Aa stores all the drugs that are contained in one first section 111 and whose types can be determined in the second storage unit 14. Then, the control unit 60Aa sub-packages all the drugs stored in the second storage unit 14, makes all the sorting cups 141 empty, and then starts the sorting process for the drugs contained in another first section 111. As described above, the first section 111 contains the number of types of drugs that is less than or equal to the total number of sorting cups 141. Therefore, the control unit 60Aa can store all the drugs whose types can be determined in the second storage unit 14 without transporting them to the standby tray 15.

[0208] Note that in this embodiment, in order to make all the sorting cups 141 empty, the control unit 60Aa executes the sub-packaging process in S26, but it is not limited to this. That is, the control unit 60Aa may perform 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 any drugs. Also, the control unit 60Aa may prompt the user to make the sorting cups 141 arranged in the second storage unit 14 empty. Thereafter, when the control unit 60Aa receives a user input indicating that the sorting cups 141 have been made empty, it may execute the process of S28.

[0209] Also, when the conveyance control unit 61 determines that the extraction of all the drugs from the first compartment 111 has been completed (YES in S25), the compartment designation unit 72 may designate the first compartment 111 as the storage destination for the drugs. Then, the display control unit 67 may notify the user to store the drugs in the first compartment 111. In this case, even if the sorting process for the drugs stored in the subsequent first compartment 111 is not completed, the drugs can be stored in the emptied first compartment 111.

[0210] 〔Main effects of this embodiment〕 As described above, every time the total number of drug types counted by the counting unit 73 reaches the total number of sorting cups 141, the drug sorting device 1A in this embodiment notifies to change the first compartment 111 serving as the storage destination for the drugs. Therefore, the drugs of a number of types equal to or less than the total number of sorting cups 141 can be stored in one first compartment 111.

[0211] Then, the drug sorting device 1A conveys the drugs stored in the first storage unit 11 to the second storage unit 14 for each first compartment 111, and sorts the drugs by type in the second storage unit 14. Therefore, in one sorting process, drugs exceeding the number of types that can be stored in the second storage unit 14 are not subject to sorting. Accordingly, the drug sorting device 1A can store the drugs discriminated by type in the second storage unit 14 by type without waiting at a standby position (e.g., standby tray 15) different from the second storage unit 14. That is, the drug sorting device 1A can shorten the time required for the drug sorting process by the processing time generated when the drugs discriminated by type are waiting at the standby position.

[0212] 〔Embodiment 4〕 In the drug sorting device 1 of Embodiment 1, when the imaging control unit 63 takes out a drug from the sorting cup 141, it causes the second camera 121 to image the inside of the sorting cup 141. Then, the subcontracting control unit 71 identifies the drug to be taken out from the image of the inside of the sorting cup 141, and moves the suction mechanism of the suction / shutter mechanism 122 in the vertically downward direction (-Z axis direction).

[0213] However, the imaging control unit 63 performs only one imaging in a planar manner. Therefore, the imaging control unit 63 may identify, from the above image, the lower drug partially overlapped and stored in the sorting cup 141 as the drug to be taken out. In this case, when the suction mechanism takes out the lower drug, there is a possibility that the upper drug may be bounced out of the sorting cup 141.

[0214] In addition, when the suction mechanism sucks the drug, there is a possibility that the edge side of the drug is pushed from the vertically upward direction (+Z-axis direction). In this case, the drug may jump out of the sorting cup 141. In order to reduce the occurrence of this possibility, the packaging control unit 71 reduces the descending speed of the suction mechanism when moving the suction mechanism in the vertically downward direction. However, the packaging control unit 71 uniformly reduces the descending speed of the suction mechanism from a certain predetermined fixed position regardless of the amount of the drug stored in the sorting cup 141. Therefore, regardless of the amount of the drug stored in the sorting cup 141, the drug taking-out speed from the sorting cup 141 may decrease.

[0215] Therefore, in this embodiment, when taking out the drug from the sorting cup 141, by imaging the inside of the sorting cup 141 with the second camera 121 from a plurality of positions, the possibility of taking out the lower drug first and the possibility of the taking-out speed decreasing are reduced.

[0216] FIG. 17 is a diagram for explaining an imaging method inside the sorting cup 141. As shown in FIG. 17, the control unit 60a moves the second camera 121 to a first position Po1 at a predetermined distance from the center line CL of the sorting cup 141 from which the drug 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 at a predetermined distance 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 at the second position Po2. Also, the second camera 121 actually moves together with the adsorption / shutter mechanism 122.

[0217] Based on the first image acquired at the first position Po1 and the second image acquired at the second position Po2, the control unit 60a calculates a parallax D, which is the difference in the position of the image in the first image and the second image. As a method for calculating the parallax D, a known technique can be adopted.

[0218] Here, the ranging principle using parallax will be explained. As shown in FIG. 17, a first triangle Tr1 is formed by (i) the incident light IL1 from the object to the second camera 121 existing at the first position Po1, (ii) the incident light IL2 from the object to the second camera 121 existing at the second position Po2, and (iii) the inter-camera distance B. Also, a second triangle Tr2 is formed by (i) the incident light IL1, (ii) a straight line PL that is parallel to 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. The imaging surface of this second camera 121 represents the parallax D. And as shown in FIG. 17, the first triangle Tr1 and the second triangle Tr2 are in a similar relationship. Therefore, based on this similar relationship, the control unit 60a can calculate the distance Z using the formula of the inter-camera distance B × focal length F / parallax D.

[0219] The inter-camera distance B refers to the distance between the first position Po1 and the second position Po2. The inter-camera distance B is the moving distance of the second camera 121 and is preset. The focal length F is the focal length of the lens provided in the second camera 121 and is an inherent value of the adopted second camera 121. Therefore, the control unit 60a calculates the parallax D as described above and substitutes the parallax D into the above formula, thereby being able to calculate the distance Z from the focal position of the lens provided in the second camera 121 to the object (e.g., drug MDA).

[0220] As described above, the control unit 60a calculates the distance Z by moving the second camera 121 horizontally and imaging the drug from two positions. Thereby, the drug sorting device 1 can adjust the lowering speed of the suction mechanism before adsorbing each drug accommodated in the sorting cup 141 based on the distance Z. Therefore, the possibility of the extraction speed of the drug from the sorting cup 141 decreasing can be reduced. Also, the suction mechanism can appropriately adsorb the drugs accommodated in the sorting cup 141.

[0221] Also, the control unit 60a can calculate the distance Z for each drug accommodated in the sorting cup 141. Therefore, the suction mechanism can adsorb the drugs in order from the upper drugs. Therefore, the possibility that the upper drugs jump out of the sorting cup 141 when the suction mechanism takes out the lower drugs first can be reduced.

[0222] In this way, the control unit 60a can reduce the above-described possibilities only by imaging the drugs accommodated in the sorting cup 141 twice and calculating the distance Z without changing the drug sorting device 1 mechanically at all. That is, the drug sorting device 1 can calculate the distance Z without, for example, being equipped with a distance measuring sensor or a stereo camera. Therefore, the drug sorting device 1 can calculate the distance Z without incurring the cost of attaching a distance measuring sensor or the like in order to reduce the above-described possibilities. Also, the drug sorting device 1 can calculate the distance Z in a space-saving and simple manner.

[0223] In the present embodiment, the case of taking out the drug from the sorting cup 141 has been described as an example. However, when taking out the drug from the first storage unit 11, the drug delivery device 1 can also take out the drug by using the above-described method for calculating the distance Z. Further, the method for taking out the drug using the above-described method for calculating the distance Z can also be realized by the drug delivery device 1A. Furthermore, the method for taking out the drug is applicable not only to the drug delivery device but also to a picking system for taking out an object from a horizontal plane (XY stage).

[0224] 〔Example of Realization by Software〕 The control blocks (particularly the control units 60a and 60Aa) of the drug delivery devices 1 and 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 drug delivery devices 1 and 1A include a computer that executes instructions of a program (type discrimination program), which is software for realizing each function. This computer includes, for example, one or more processors and a computer-readable recording medium storing the above program. Then, in the above computer, when the above processor reads and executes the above program from the above recording medium, the object of the present invention is achieved. As the above processor, for example, a CPU (Central Processing Unit) can be used. As the above recording medium, a "non-transitory tangible medium" such as a ROM (Read Only Memory), a tape, a disk, a card, a semiconductor memory, a programmable logic circuit, etc. can be used. Further, it may further include a RAM (Random Access Memory) for expanding the above program. Further, the above program may be supplied to the above computer via any transmission medium (communication network, broadcast wave, etc.) capable of transmitting 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 above program is embodied by electronic transmission.

[0226] [Function to facilitate the grouping of sub-packaged items] The medicine sorting devices 1 and 1A are equipped with a sub-packaging mechanism 6. After the sorting of the medicine is completed, the sorted medicine is sequentially conveyed to the sub-packaging mechanism 6, and sub-packaging is performed for each sorting cup 141 containing the medicine of the same type. At this time, the number of medicines contained per pack is determined, and for the medicine with a large quantity contained in the sorting cup 141, sub-packaging is performed by dividing it into multiple packs. The sub-packaging process is automatically executed, and the sub-packaged bags are discharged from the medicine sorting devices 1 and 1A in a belt-like form after a predetermined number of bags are sub-packaged. The discharged sub-packaging belt is stored in a storage box or the like (not shown) provided outside the device. Therefore, it is necessary for the operator to take out and check the sub-packaging belt to find out which medicine is at which position on the sub-packaging belt, which requires time and effort.

[0227] In particular, after sorting by the medicine sorting devices 1 and 1A, it is necessary to take out the sub-packaged bags that are sub-packaged without leakage for each type of medicine by the sub-packaging mechanism 6 in order to return the medicine of each type of medicine to a tablet sub-packaging machine, a tablet storage shelf, etc., which are different from the medicine sorting devices 1 and 1A. However, since the sub-packaging belts discharged by the sub-packaging mechanism 6 are stacked in the storage box, there is a problem that all the bags must be picked up and visually checked, and the bags of the target medicine must be individually searched and taken out. In addition, there are cases where the sub-packaged bags of the same type of medicine do not exist in the same sub-packaging belt, which brings about the complexity of the operation that it is necessary to search another group of sub-packaging belts in order to finally confirm all the sub-packaged bags without omission.

[0228] Therefore, on the display unit 32 of the touch panel 3, when the sub-packaging operation is completed, in addition to displaying the information "Sub-packaging is completed", a button "Confirm sub-packaging result" is displayed. By touching or clicking this button, the number of sub-packaged bags sub-packaged in the current sub-packaging operation can be displayed for each medicine. Also, the information regarding the sub-packaging result displayed on the display unit 32 may be printed with the same information on a printed matter such as a journal that can be carried during the operation of searching from the actual storage location of the sub-packaged bags.

[0229] Specifically, the drug name and the number of sub-packaging bags are displayed or printed on the same line, and similarly for other drugs, the drug name and the number of sub-packaging bags are displayed or printed for each drug. As a result, after the sub-packaging is completed, the operator can grasp the number of sub-packaging bags for each drug. Therefore, even when taking out the sub-packaging bags of the target drug from the group of actually stored sub-packaging bands, the operator only needs to search for the number of sub-packaging bags that are displayed or printed. There is no worry about missing any, and as long as the displayed number of sub-packaging bags can be taken out, it becomes possible to move on to the operation of taking out the sub-packaging bags of the next drug. Compared with the conventional method, the operation of taking out all the sub-packaging bags from the storage box or the like can be shortened.

[0230] 〔Another Representation of the Present Disclosure〕 A type discrimination device according to an aspect of the present disclosure includes an image generation unit that generates an extracted mark image by extracting a mark captured in a captured image based on an output value obtained by inputting the captured image of a target drug of unknown type into a learned model constructed to extract marks formed on drugs, and a discrimination unit that discriminates the type of the target drug based on a collation result between the extracted mark image generated by the image generation unit and a registered mark image registered in advance for each type of drug.

[0231] A type discrimination method according to an 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 captured in the captured image based on an output value obtained by inputting the captured image of a target drug of unknown type into a learned model constructed to extract marks formed on drugs, and a discrimination step of discriminating the type of the target drug based on a collation 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 aspect of the present disclosure causes a computer to generate an extracted mark image in which a mark captured in a captured image is extracted based on an output value obtained by inputting the captured image of a target drug of unknown type into a learned model constructed to extract a mark formed on the drug. The computer also executes a discrimination step of discriminating the type of the target drug based on a collation 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.

[0233] According to one aspect of the present invention, a type discrimination device, a type discrimination method, and a type discrimination program can present evidence of a discrimination result and discriminate types based on various marks.

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

Explanation of Reference Numerals

[0235] 6 Subcontracting mechanism (subcontracting section) 8 Reading section 11 First storage section 12 Conveying and sorting unit (conveying section) 14 Second storage section 15 Waiting tray (temporary storage section) 32 Display section (notification section) 60 Computer (type discrimination device) 64 Feature extraction section (image generation section) 65 Discrimination section 73 Counting section 82 Captured image 83 Extracted mark image 84 Learned model 111, 111a~111d First section 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 section that transports the medicines contained in the first storage section to the second storage section for each of the first sections, and stores the medicines in the second storage section 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 transports all of the medicine contained in the second storage unit to the packaging unit, and then starts transporting the medicine contained in another first compartment to the second storage unit.

Citation Information

Patent Citations

  • Verification system and verification device

    JP2020052627A

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

    WO2018190394A1