Discrimination method and generation method
The drug sorting device improves drug identification accuracy by using multiple discriminators to compare detection marks with registered marks, addressing inefficiencies and errors in existing systems.
Patent Information
- Application Number
- JP2024128221
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2018-12-27
- Filing Date
- 2024-08-02
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2039-12-11
AI Technical Summary
Existing drug sorting devices struggle to accurately identify and sort tablets or capsules due to variations in imaging quality caused by changes in imaging devices or environments, leading to inefficiencies and potential errors in drug identification.
A discrimination method using a type discrimination device that compares detection marks on drugs with registered marks in master data, employing multiple discriminators to improve accuracy through similarity determination and mark matching, and a generation method to construct discriminators based on similarity judgment accuracy.
Enhances the accuracy and efficiency of drug type identification by improving the precision of mark match determination, allowing for appropriate drug sorting and reducing the time required for identification.
Smart Images

Figure 2024149658000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to a method for automatically identifying the type of medicine. [Background technology]
[0002] Conventionally, multiple types of returned medicines were sorted by type by a pharmacist or doctor. The returned medicines are prescribed to various patients or are prescribed and dispensed medicines. Therefore, compared to the dispensing work of assembling (packaging) (one or multiple types) of medicines (tablets) for each dosing period from a group of medicines (medicine cassettes) that are previously grouped by medicine type in a dispensing device or the like based on prescription information for each patient, the types of medicines that are returned together as medicines prescribed for multiple patients are very large. Therefore, it is highly useful to automatically sort and reuse returned medicines. Note that the number of types of medicines dispensed for one dosing period is generally about 2 to 3, and at most about 10.
[0003] Some pharmacies or hospitals (or more accurately, their in-house pharmacy departments) simply dispose of returned medications to avoid the time and effort required for sorting, or the risk of misadministration due to incorrect sorting (putting medications back into the wrong medication cassette).
[0004] Patent Document 1 discloses a medicine sorting device that automatically recognizes and stores returned ampoules or vials. This medicine sorting device recognizes the orientation and posture of the ampule or vial, and the properties of the ampule or vial (e.g., shape, size, type, and expiration date). Then, the device associates the storage area set for each ampule or vial when storing according to the recognized size of the ampule or vial with the identification information of each ampule or vial, and arranges the ampule or vial individually, thereby storing each ampule or vial so that it can be removed. [Prior art documents] [Patent documents]
[0005] [Patent Document 1] International Publication No. 2015 / 170761 (Published on November 12, 2015) Summary of the Invention [Problem to be solved by the invention]
[0006] The subject of return in Patent Document 1 is ampoules or vials, not medicines not contained in containers such as tablets or capsules, or medicines themselves not packaged. Therefore, Patent Document 1 does not assume that such medicines (e.g. tablets or capsules) themselves will be identified and automatically sorted. When trying to realize a medicine sorting device that automatically sorts medicines, it is conceivable to create and store master data indicating the external characteristics of medicines whose types are known in advance, and to use the master data to determine the type of medicine to be sorted. Note that the external characteristics of the medicine to be sorted, which are used for matching with the master data, may be identified by analyzing an image of the medicine.
[0007] However, even when the same drug is imaged, if the imaging device or imaging environment is changed, the obtained image may differ. In addition, even if the imaging device and imaging environment are the same, the obtained image may differ due to deterioration over time of the device (including not only the imaging device but also peripheral devices such as lighting devices). In other words, the image obtained by imaging may change from the one assumed when the master data was created, and if such a change occurs, problems such as an increase in the time required to identify the type may occur.
[0008] One aspect of the present invention aims to realize a method for determining the type of medicine using an image of the medicine and master data, which improves the accuracy of determining whether the marks match and enables appropriate type determination. [Means for solving the problem]
[0009] In order to solve the above problems, a discrimination method according to one embodiment of the present invention is a discrimination method executed by a type discrimination device that discriminates the type of a target drug from an image of the target drug of unknown type, and includes the steps of acquiring the image, and outputting a determination result as to whether or not the detection mark, which is a mark formed on the target drug detected from the image, matches the registration mark registered in master data for drug matching, based on the result of determining, by multiple classifiers, the similarity between the detection mark and the registration mark.
[0010] In addition, a discrimination method according to one aspect of the present invention is a discrimination method executed by a type discrimination device that discriminates the type of a target drug from an image of the target drug of unknown type, and includes a match determination step of determining whether a detection mark, which is a mark formed on the target drug detected from the image, matches a registration mark registered in master data for drug matching based on a result of determination by a plurality of classifiers of similarity between the detection mark and the registration mark, and a step of outputting the result of the determination.
[0011] Furthermore, a generation method according to one aspect of the present invention is a generation method in which an information processing device generates a classifier, and includes a selection step of selecting a plurality of classifiers from a group of classifiers that determine the similarity between a detection mark detected from an image of a drug and a registered mark registered in master data for matching the drug, based on the accuracy of similarity determination, and a classifier construction step of constructing a classifier for determining whether the detection mark and the registered mark match each other, using the plurality of classifiers selected in the selection step. Effect of the Invention
[0012] According to one aspect of the present invention, whether a detected mark matches a registered mark is determined based on the similarity determination results obtained by a plurality of classifiers. This improves the accuracy of the mark match determination, and makes it possible to appropriately identify the type. Note that "appropriately" does not necessarily mean that the accuracy of type identification is high. For example, being able to identify the type in an appropriate amount of time is also included in the category of "appropriately." [Brief description of the drawings]
[0013] [Figure 1] 1 is a block diagram showing the overall configuration of a medicine sorting device. [Diagram 2] FIG. 2 is a diagram showing an example of the configuration of a medicine sorting device, where (a) is a perspective view of the medicine sorting device, and (b) is a perspective view showing the basic configuration of a medicine sorting area. [Diagram 3] 1A and 1B are perspective views showing the overall configuration of an imaging unit, and FIG. 1C is a perspective view showing an example of a medicine placing table. [Figure 4] 13(a) and 13(b) are diagrams for explaining the rotation of the imaging unit. [Diagram 5] FIG. 13 is a diagram illustrating a method for updating a drug database. [Figure 6] 11A and 11B are diagrams illustrating a method of updating weights in a color score calculation formula. [Figure 7] 10 is a flowchart showing an example of a process for storing successfully determined color data. [Figure 8] 13 is a flowchart showing an example of a process for updating a medicine database. [Figure 9] 13 is a flowchart illustrating an example of a process for updating weights in a calculation formula for a color score. [Figure 10] FIG. 11 is a block diagram showing an example of a configuration of a main part of a control unit included in a medicine sorting device according to a second embodiment of the present invention. [Figure 11] 1 is a block diagram showing an example of a main configuration of an information processing device; [Figure 12] FIG. 13 is a diagram showing an example of setting a determination region. [Figure 13]13A and 13B are diagrams illustrating an example in which a difference in threshold value causes a difference in accuracy of determining similarity. [Figure 14] 11 is a flowchart illustrating an example of a process for constructing a classifier. [Figure 15] FIG. 13 is a diagram showing a specific example of a process for constructing a classifier. [Figure 16] 13 is a flowchart showing an example of a mark matching determination process. [Figure 17] FIG. 13 is a diagram showing a specific example of a match determination of marks. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0014] [Embodiment 1] [Overview of the medicine sorting device 1] First, an overview of the medicine 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 medicine sorting device 1. Fig. 2 is a diagram showing an example of the configuration of the medicine sorting device 1, where (a) is a perspective view of the medicine sorting device 1 and (b) is a perspective view showing the basic configuration of the medicine sorting area 2. As shown in Fig. 1 and Figs. 2(a) and (b), the medicine sorting device 1 includes a medicine sorting area 2, a touch panel 3, a print output unit 4, and a packaging mechanism 6.
[0015] The medicine sorting device 1 takes an image of each of a plurality of types of medicine, determines the type of medicine based on the image obtained as a result of the imaging, and sorts the medicines by type. Specifically, this process is performed in the medicine sorting area 2. The medicine sorting area 2 (the internal configuration of the medicine sorting device 1) will be described later. After the medicines sorted by type are visually inspected by the user, they are packaged or returned to the medicine shelf or packaging machine.
[0016] In this embodiment, the multiple types of medicines are medicines that are not contained in a container or the like, or medicines that are not packaged, and an example of such medicines is a tablet or capsule. In addition, the multiple types of medicines are returned medicines. Examples of returned medicines include a case where a medicine adopted by a pharmacy or hospital is returned as a "returned medicine" at the pharmacy or hospital, and a case where a "brought-in medicine" that may include medicines issued by other pharmacies or hospitals in addition to the adopted medicine is returned at the pharmacy or hospital. In other words, the concept of a returned medicine includes at least one of the above-mentioned "returned medicine" and "brought-in medicine". After the medicine is returned, the medicine sorting device 1 can automatically perform processes from imaging to sorting.
[0017] The touch panel 3 accepts various user inputs at the operation unit 31, and displays various images on the display unit 32 (for example, an image showing the progress of drug sorting, an image for visual inspection).
[0018] The print output unit 4 prints out a journal representing drug data (e.g., data indicating the drug name, manufacturer, or ingredients) related to the drug after visual inspection according to user input after visual inspection. The drug data may include image data indicating an image specific to the drug.
[0019] The packaging mechanism 6 packages the sorted medicines. The packaging mechanism 6 is an optional mechanism. When the packaging mechanism 6 is provided in the medicine sorting device 1, the medicine sorting device 1 can perform all processes from sorting returned medicines to packaging after visual inspection all at once. In particular, when medicines are fed into the packaging mechanism 6 by the transporting / sorting unit 12, the above processes from sorting to packaging can be performed automatically, except for visual inspection.
[0020] A conventional tablet packing machine or powder packing machine may be used as the packing mechanism 6. In this case, for example, drugs in a sorting cup 141 that have been sorted for each drug type can be packed into one or more packages.
[0021] Moreover, the medicine sorting device 1 includes a first RFID (Radio Frequency Identifier) reader / writer unit 5. The first RFID reader / writer unit 5 is provided on the medicine removal side of the base 19, as shown in (b) of FIG.
[0022] The first RFID reader / writer unit 5 reads data on the medicines stored in each sorting cup 141, which is stored in an RFID tag (not shown) provided at the bottom of each sorting cup 141 in the second storage section 14. Examples of the data include the number of medicines stored, medicine data, and image data acquired by the imaging unit 13. The data may include medicine data determined by visual inspection (medicine data after visual inspection). The medicine data after visual inspection may also be written to the RFID tag. The medicine data after visual inspection is used when the medicine stored in the corresponding sorting cup 141 is (1) packaged by the packaging mechanism 6 or a packaging machine other than the medicine sorting device 1, or (2) returned to the medicine shelf. As shown in FIG. 2(a), the medicine sorting device 1 is provided with an opening / closing shutter 51 and an opening / closing door 52 that allow the medicine removal side to be opened and closed.
[0023] [Basic configuration of drug sorting area 2] Next, the basic configuration of the medicine sorting area 2 (the internal configuration of the medicine sorting device 1) will be described with reference to FIG. 1 and FIG. 2(b).
[0024] 1 and 2(b), the medicine sorting area 2 mainly comprises, as hardware, a first storage section 11, a transporting and sorting unit 12 (sorting section), an imaging unit 13, a second storage section 14, a waiting tray 15, a collection tray 16, a medicine insertion port 17, and a second RFID reader / writer unit 18. Each member except for the transporting and sorting unit 12 is mounted on a base 19. The main functions of the transporting and 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.
[0025] The first storage section 11 stores a mixture of multiple types of medicines returned by users. In this embodiment, the first storage section 11 is divided into multiple storage sections. In this case, for example, when all of the medicines stored in one storage section are transported by the transport / sorting unit 12, the medicines stored in the storage section adjacent to the storage section are transported. The first storage section 11 may be provided rotatable about the Z axis (center of the cylindrical shape). In this case, the control section 60a of the computer (type discrimination device) 60 may rotate the first storage section 11 so that the transport / sorting unit 12 can easily obtain the medicines, for example, when one storage section becomes empty.
[0026] The second storage section 14 includes a plurality of sorting cups 141 that store medicines sorted by type. The control section 60a determines the type of medicine based on an image of the medicine captured by the imaging unit 13, and determines the sorting cup 141 in which to store the medicine based on the determination result. The medicine is transported to the determined sorting cup 141 by the transporting / sorting unit 12 and stored therein.
[0027] The standby tray 15 is a storage unit where medicines are temporarily placed. For example, when all of the sorting cups 141 are filled with medicines, medicines determined by the control unit 60a to be of a type other than those are temporarily placed on the standby tray 15. In this case, after the medicines are removed from the sorting cups 141, they may be transported from the standby tray 15 to the sorting cups 141.
[0028] In this embodiment, a suspected medicine (described later) that is suspected to be a medicine may be temporarily placed on the waiting tray 15. When the suspected medicine is temporarily placed, it is transported to a predetermined area of the second container 14 according to the determination result of the control unit 60a.
[0029] The collection tray 16 is a storage unit that stores objects whose types cannot be determined by the control unit 60a (e.g., foreign objects other than medicines). Examples of foreign objects other than medicines include pieces of PTP (Press Through Pack) sheets. The pieces of PTP sheets may be mixed into the first storage unit 11 when medicines are returned. The control unit 60a also stores in the collection tray 16 medicines that are registered in the medicine database as medicines to be discarded or medicines that the user wishes to discard (e.g., medicines with old manufacturing dates).
[0030] When the medicine sorting device 1 is provided with a packaging mechanism 6, the medicine input port 17 is provided for transporting medicines stored in the second storage section 14 to the packaging mechanism 6 by the transport / sorting unit 12. Naturally, when the medicine sorting device 1 is not provided with a packaging mechanism 6, the medicine input port 17 is not necessary.
[0031] As shown in FIG. 1, the medicine sorting device 1 includes a computer 60 that controls the above-mentioned components (hardware). The computer 60 includes a control unit 60a and a storage unit 80. The control unit 60a includes a transport control unit 61, a sorting control unit 62, an imaging control unit 63, a discrimination unit 64, a discrimination success / failure determination 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, a master update unit 71, and a weight update unit (evaluation information update unit) 72. The transport control unit 61, the sorting control unit 62, the imaging control unit 63, the discrimination unit 64, the discrimination success / failure determination unit 65, the master update unit 71, and the weight update unit 72 will be described in detail in the description of each process described later. Each piece of information that is pre-stored or will be stored in the storage unit 80 will also be described later.
[0032] The operation input unit 66 and the display control unit 67 respectively control the operation unit 31 and the display unit 32 of the touch panel 3. The RFID control unit 68 controls the first RFID reader / writer unit 5 and the second RFID reader / writer unit 18. The print output control unit 69 controls the print output unit 4 in accordance with a user input received by the operation input unit 66. In addition, in the case where the medicine sorting device 1 is equipped with a packaging mechanism 6, the control unit 60a will be equipped with a packaging control unit that controls the packaging mechanism 6.
[0033] The registration unit 70 registers the drug data relating to a drug for which the discrimination unit 64 has determined that there is no drug data corresponding to the image data in the drug database 81. Specifically, for a drug for which the discrimination unit 64 has determined that there is no corresponding drug data, the registration unit 70 registers the captured image 82 of the drug in the drug database 81 by linking it with the drug data specified by the user.
[0034] The computer 60 also includes a storage unit 80. The storage unit 80 stores in advance a medicine database (medicine master) 81 that manages medicine data on a plurality of types of medicine, and stores a captured image 82 and successful discrimination color data 83 as the medicine sorting device 1 performs sorting. The captured image 82 is an image captured by the first camera 131. The various data stored in the storage unit 80 may not be managed by the storage unit 80, and may be managed by, for example, an external device. 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. The medicine database may also be updated by adding new medicine data.
[0035] [Overview of processing in medicine sorting device 1] In the medicine sorting device 1, the conveying / sorting unit 12 conveys each medicine returned to the first storage section 11 to the imaging unit 13. The imaging unit 13 sequentially captures an image of each conveyed medicine. The control unit 60a determines the type of each medicine based on the captured image and determines a sorting position in the second storage section 14 for each of the determined medicines. The conveying / sorting unit 12 conveys each medicine to the determined sorting position. Then, information about the medicine stored in the second storage section 14 is written to the RFID tag of the sorting cup 141, stored in the storage section 80, or displayed on the touch panel 3. After or during the sorting of the medicines, the user operates the touch panel 3 to perform visual inspection, packaging, and other processes. Each process will be described in detail below.
[0036] [Drug Delivery Processing to Imaging Unit 13] First, the process of transporting the medicine from the first container 11 to the imaging unit 13 will be described with reference to FIG. 1 and FIG. 2(a).
[0037] Specifically, the transport / sorting unit 12 transports the medicines stored in the first storage section 11 to a receiving area Ar1 (see FIG. 3(b)) where the imaging unit 13 receives the medicines. The transport control section 61 controls the transport process by the transport / sorting unit 12.
[0038] The transport / sorting unit 12 includes a second camera 121 , a suction / shutter mechanism 122 , and a transport mechanism 123 .
[0039] The second camera 121 sequentially captures images of the first storage unit 11 in order to identify the medicine to be transported. The imaging control unit 63 controls the imaging process of the second camera 121. The second camera 121 is provided at an end of the transport / sorting unit 12 (specifically, of a housing including at least the suction / shutter mechanism 122) facing the base 19. The second camera 121 may be provided at a tip of the suction mechanism described below. The imaging control unit 63 analyzes the captured image and determines whether or not the image contains medicine. If it is determined that the image contains medicine, the transport control unit 61, for example, brings the tip close to the first storage unit 11 and identifies the medicine included in the image captured at that time as the medicine to be transported.
[0040] The suction / shutter mechanism 122 includes a suction mechanism that suctions the medicine identified as the transport target, and a shutter mechanism that prevents the medicine suctioned by the suction mechanism from dropping. The suction mechanism is provided so as to be movable in the Z-axis direction. The shutter mechanism is provided in front of the end so as to be movable approximately parallel to the XY plane.
[0041] When acquiring a medicine, the suction mechanism extends from the end, and after suctioning the specified medicine at its tip, returns to the position of the end. In this state, the transport control unit 61 moves the shutter mechanism to a position facing the end, and maintains the position of the shutter mechanism during the medicine transport (closed state). When the transport control unit 61 moves the suction / shutter mechanism 122 to a position facing the medicine mounting stage 133a (see FIG. 3(b)) of the medicine holding mechanism 133 arranged in the receiving area Ar1, the transport control unit 61 moves the shutter mechanism to a position not facing the end (open state). Then, after the suction mechanism extends from the end, the suction state is released, and the medicine is mounted on the medicine mounting stage 133a.
[0042] The transport mechanism 123 moves the suction / shutter mechanism 122 in the X-axis and Y-axis directions under the control of the transport control unit 61. This transport mechanism 123 enables the movement of the suction / shutter mechanism 122 when searching for a medicine to be transported on the first container 11, or transport of a medicine from the first container 11 to the medicine placement table 133a. Also, in the medicine sorting process, it enables transport of a medicine from the medicine placement table 133a to the second container 14, the waiting tray 15, or the collection tray 16. In the medicine sorting process, the sorting control unit 62 controls the sorting unit 12 based on the discrimination result by the discrimination unit 64 to transport the medicine placed in the receiving area Ar1 to a predetermined sorting cup 141 of the second container 14 or the waiting tray 15.
[0043] [Drug Imaging Processing] Next, the medicine imaging process by the imaging unit 13 will be described with reference to Fig. 1, Fig. 2(b), Fig. 3, and Fig. 4. Fig. 3(a) and (b) are perspective views showing the overall configuration of the imaging unit 13, and Fig. 3(c) is a perspective view showing an example of the medicine placement table 133a. Fig. 4(a) and (b) are diagrams for explaining the rotation of the imaging unit 13. The medicine imaging process is mainly performed by the imaging unit 13 and the imaging control unit 63.
[0044] Specifically, the imaging unit 13 is placed on the medicine placement table 133a, and images the medicine placed in the placement area Ar2 (imaging area) in which the medicine to be imaged is placed as shown in (b) of Fig. 3. The imaging control unit 63 controls the imaging process by the imaging unit 13, the pivoting movement of the first camera 131 and the illuminator 134, and the movement of the medicine holding mechanism 133. As shown in Figs. 1 and 3, the imaging unit 13 includes the first camera 131 (imaging section), the rotation mechanism 132 (rotating section), the medicine holding mechanism 133 (medicine placement table, moving mechanism), and the illuminator 134 (ultraviolet light irradiation section, visible light irradiation section).
[0045] The first camera 131 captures an image of a medicine placed in a placement area Ar2 facing the first camera 131 in order to identify the type of medicine in the discrimination unit 64 described later. The medicine holding mechanism 133 is a mechanism for holding a medicine, and includes a medicine placement table (petri dish) 133a, a rotation mechanism 133b (movement mechanism), and an axis portion 133c connecting the medicine placement table 133a and the rotation mechanism 133b, as shown in (a) and (b) of FIG. 3. The medicine placement table 133a is for placing a medicine to be imaged. The rotation mechanism 133b is for moving the medicine placement table 133a, and more specifically, rotates the medicine placement table 133a with respect to the XY plane and rotates the axis portion 133c in the circumferential direction of the axis portion 133c.
[0046] When the medicine transported from the first container 11 is placed on the medicine placement table 133a, the imaging control unit 63 drives the turning mechanism 133b to move the medicine placement table 133a from the receiving area Ar1 to the placement area Ar2. Thereafter, the imaging control unit 63 controls at least the first camera 131 and the illuminator 134 to capture an image of the medicine placed in the placement area Ar2. The captured image is stored in the storage unit 80 as a captured image 82. For example, after the imaging is completed, the imaging control unit 63 drives the turning mechanism 133b to move the medicine placement table 133a on which the imaged medicine is placed from the placement area Ar2 to the receiving area Ar1.
[0047] In this embodiment, two medicine placement tables 133a are provided at the tip (end) of the shaft 133c. The turning mechanism 133b turns the shaft 133c, and when one medicine placement table 133a is placed in the placement area Ar2, the other medicine placement table 133a is placed in the receiving area Ar1. When imaging medicines in the placement area Ar2, the transport / sorting unit 12 transports medicines from the first container 11 to the medicine placement table 133a present in the receiving area Ar1, thereby enabling continuous imaging of medicines. Note that it is assumed that the medicine placement table 133a is in a state where no medicine is placed thereon, such as after the medicine is sorted into the second container 14.
[0048] In this embodiment, the medicine placing stand 133a has transparency, so that the first camera 131 can capture images of the medicine placed on the medicine placing stand 133a from multiple directions through the medicine placing stand 133a.
[0049] Also, as shown in FIG. 3(c), the medicine placing stand 133a may have a substantially V-shaped cross section with a recessed bottom. Also, as shown in FIG. 3(b) and FIG. 4, when the medicine placing stand 133a is placed in the receiving area Ar1 and the placement area Ar2, the groove direction of the substantially V-shaped cross section (extension direction of the shaft portion 133c) is substantially parallel to the rotation axis Ay of the imaging mechanism (described later) by the rotation mechanism 132. Also, the bottom of the medicine placing stand 133a may not have an acute V-shape. As shown in FIG. 3(c), the bottom may have a bottom surface portion 133aa and an inclined surface portion 133ab inclined from two opposing points of the bottom surface portion 133aa. The shape of the bottom may be such that the information (engraved information or printed information) indicated by the imprint or print of the medicine can be recognized even when viewed (imaged) from the back side of the medicine placing stand 133a, and the medicine can be fixed.
[0050] In the case where the medicine is a capsule or a deformed tablet (e.g., rugby ball-shaped), if the bottom of the medicine placement table 133a is flat, the orientation of the medicine may not be uniform on the XY plane, making it difficult to obtain a clear image of the medicine (engraved information or printed information). If the cross section is approximately V-shaped, the capsule or deformed tablet is fitted into the lowest end, and the medicine can be fixed. This makes it easier to obtain a clear image of the medicine. In the case of a tablet, for example, the axis portion 133c may be rotated in the circumferential direction of the axis portion 133c to make the flat portion (inclined surface portion 133ab) of the medicine placement table 133a face the first camera 131, thereby ensuring that the medicine does not move.
[0051] In addition, the turning mechanism 133b can also vibrate (slightly move or shake) the medicine placement table 133a. In this case, for example, by vibrating and rolling the capsule placed on the medicine placement table 133a, the part of the capsule on which the print is attached can be oriented in a predetermined direction (for example, the part can be made to face the first camera 131 placed in the initial position described below). In addition, by the vibration, even if a cylindrical tablet (with a circular bottom) is placed upright on the flat surface, the tablet can be turned sideways (placed so that the bottom of the tablet faces the flat surface).
[0052] The illuminator 134 emits light to be irradiated onto the medicine when imaging the medicine under the control of the imaging control unit 63. As shown in (a) of FIG. 3, the illuminator 134 includes a visible light irradiating unit (first irradiating unit 134a and second irradiating unit 134b) that irradiates the medicine with visible light, and an ultraviolet light irradiating unit 134c that irradiates the medicine with ultraviolet light.
[0053] The first irradiation unit 134a and the second irradiation unit 134b irradiate the medicine with white light as visible light. The first irradiation unit 134a is a bar-shaped visible light source (bar illumination), and the second irradiation unit 134b is a ring-shaped visible light source (ring illumination). The first camera 131 receives the visible light emitted from the first irradiation unit 134a or the second irradiation unit 134b and reflected by the medicine, thereby acquiring an image based on the visible light (visible light image). The imaging control unit 63 stores image data indicating the visible light image acquired by the first camera 131 in the storage unit 80 as an imaged image 82.
[0054] The ultraviolet light irradiating unit 134c irradiates the drug with ultraviolet light (e.g., light having a peak wavelength of 365 nm or more and 410 nm or less) to excite the components contained in the drug. This causes fluorescence (e.g., light having a peak wavelength of 410 nm or more and 800 nm or less) to be extracted from the drug. The first camera 131 receives the fluorescence emitted from the drug to obtain an image based on the ultraviolet light (ultraviolet light image). The imaging control unit 63 stores image data indicating the ultraviolet light image obtained by the first camera 131 in the storage unit 80 as the captured image 82.
[0055] As shown in Figs. 3 and 4, the rotation mechanism 132 rotates the first camera 131 so as to revolve around the arrangement area Ar2 (the medicine placement table 133a arranged at that position) where the medicine to be imaged is arranged. The first camera 131 images the medicine arranged in the arrangement area Ar2 from multiple positions to which the rotation mechanism 132 has rotated it. Specifically, the imaging mechanism including the first camera 131 and the illuminator 134 is rotated so as to revolve around the arrangement area Ar2. Therefore, the first camera 131 can image the medicine from multiple directions while maintaining the positional relationship of the first camera 131 and the illuminator 134 with respect to the arrangement area Ar2.
[0056] As shown in Fig. 3(a), the rotation mechanism 132 includes an imaging mechanism driving unit 132a and a power transmission mechanism 132b. The imaging mechanism driving unit 132a generates power for rotating the imaging mechanism around the arrangement area Ar2. The power transmission mechanism 132b transmits the power generated by the imaging mechanism driving unit 132a to the imaging mechanism. The imaging mechanism driving unit 132a is driven under the control of the imaging control unit 63 to change the position of the imaging mechanism around the arrangement area Ar2.
[0057] The rotation mechanism 132 rotates the imaging mechanism between an initial position and a position opposite to the initial position. The initial position is a position in a direction substantially perpendicular to the arrangement area Ar2 and above the arrangement area Ar2. The position opposite to the initial position is a position in a direction substantially perpendicular to the arrangement area Ar2 and below the arrangement area Ar2. This position can also be said to be a position where the first camera 131 faces the bottom of the medicine placement table 133a present in the arrangement area Ar2.
[0058] As shown in Fig. 4, an axis passing through the center of the arrangement area Ar2 and parallel to the Z axis is defined as axis Ax0, and an axis passing through the center of the arrangement area Ar2 and the center of the imaging mechanism is defined as axis Ax1. The angle between axis Ax0 and axis Ax1 is defined as θ. In this embodiment, the rotation mechanism 132 places the imaging mechanism at any one of the positions θ=0° (initial position), 45°, 135°, and 180°. Note that (a) of Fig. 4 shows a case where the imaging mechanism is at a position of θ=0°, and (b) of Fig. 4 shows a case where the imaging mechanism has rotated from the initial position to a position of θ=45°.
[0059] In this way, by rotating the imaging mechanism around the arrangement area Ar2, the medicine can be imaged from multiple directions while the medicine is fixed in the arrangement area Ar2. Even if the medicine (tablet) stands upright after shaking the medicine placement table 133a, information indicated by the markings or the like affixed to the medicine can be obtained by imaging from an oblique direction (θ=45° or 135°).
[0060] It should be noted that the imaging mechanism may be fixed and the drug may be rotated to capture images of the drug from multiple directions.
[0061] (Imaging position control) Next, an example of position control of the imaging mechanism will be described. The imaging control unit 63 first sets the imaging mechanism to an initial position, and causes the first camera 131 to capture an image of the medicine placed in the placement area Ar2 at the initial position. At this time, the first camera 131 acquires a visible light image (two visible light images) based on visible light from the first irradiation unit 134a and the second irradiation unit 134b, and also acquires an ultraviolet light image based on ultraviolet light from the ultraviolet light irradiation unit 134c.
[0062] Next, the imaging control unit 63 sets the imaging mechanism at a position opposite to the initial position, and causes the first camera 131 to capture an image of the medicine placed in the placement area Ar2 at that position, thereby acquiring two visible light images and an ultraviolet light image. The discrimination unit 64 analyzes these six images to discriminate the type of medicine. If the type of medicine cannot be identified as one, the imaging control unit 63 causes the first irradiating unit 134a and the second irradiating unit 134b to emit visible light at positions θ=45° and 135°, and causes the first camera 131 to capture an image of the medicine. The discrimination unit 64 analyzes the visible light image at this time to discriminate the type of medicine.
[0063] The position control of the imaging mechanism is not limited to the above, and various methods can be used. For example, imaging may be performed from the initial position after imaging from a position opposite to the initial position. Also, a drug discrimination process based on a visible light image when imaging from a position of θ=45° may be performed, and only if the type of drug cannot be identified as one, a visible light image when imaging from a position of θ=135° may be acquired. Also, only ultraviolet light images may be acquired at the initial position and a position opposite to the initial position, and after a drug discrimination process based on the ultraviolet light image, a visible light image at the position may be acquired. Also, visible light images and ultraviolet light images may be acquired at all positions.
[0064] [Image processing / discrimination processing] Next, image processing of 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 Fig. 1. The image processing is mainly performed by the imaging control unit 63, and the discrimination processing is mainly performed by the discrimination unit 64.
[0065] The discrimination unit 64 discriminates the type of drug based on the image of the drug captured by the first camera 131. Specifically, the discrimination unit 64 discriminates the type of drug based on the imaging result (visible light image) of the drug captured in a state where visible light is irradiated from the first irradiating unit 134a or the second irradiating unit 134b. The discrimination unit 64 also discriminates the type of drug based on the imaging result (ultraviolet light image) of the drug captured in a state where ultraviolet light is irradiated.
[0066] The discrimination unit 64 extracts the characteristics of the medicine contained in the visible light image and / or the ultraviolet light image by performing image analysis on each of the images. Examples of the characteristics of the medicine include size, shape, marking, print, dividing line, and representative color (color of the area with marking or print). When OCR (Optical Character Recognition) or the like is performed, other information such as the name of the medicine represented by the marking or print (e.g., identification code) or identification information indicating the manufacturer (identification information for identifying the medicine), and expiration date are extracted as the characteristics of the medicine. In the case of the ultraviolet light image, the representative color of the medicine in the image is also extracted as the characteristics of the medicine. The discrimination unit 64 stores the extracted information indicating the characteristics of each medicine in the storage unit 80 by linking it to the captured image 82 of the medicine. The extraction of the characteristics of the medicine may be performed by a known technique.
[0067] The extracted features of the medicine include the representative color of the medicine in the image as described above. Hereinafter, data indicating this representative color will be referred to as color data (data indicating the color of the medicine). Color data includes data generated from a visible light image and data generated from an ultraviolet light image. In the following description, unless otherwise specified, the term "color data" refers to both color data generated from a visible light image and color data generated from an ultraviolet light image. The color data is data indicating the color of a predetermined area (at least a part of the area in which the medicine is shown, typically an area with an inscription or print) in an image of the medicine. For example, the average value of the RGB values of each pixel included in the area may be used as the color data.
[0068] The discrimination unit 64 discriminates the type of drug by comparing the characteristics of each drug with the drug database 81. As will be described in detail later, the discrimination unit 64 ranks candidates for drug data related to the imaged drug from the drug database based on the color data. Thereafter, the discrimination unit 64 discriminates the type based on other characteristics according to the above ranking.
[0069] Furthermore, even if the drug features (target features) extracted using pattern matching or the like are not in the drug database, when the drug is estimated to be a drug (tablet or capsule) based on at least a part of the target features, the discrimination unit 64 determines the type of drug as a suspected drug. In this case, the suspected drug can also be sorted into the second container 14 or the waiting tray 15. In this embodiment, the suspected drug may first be temporarily placed on the waiting tray 15.
[0070] In this manner, the discrimination unit 64 determines whether or not there is drug data corresponding to the captured image 82 captured by the first camera 131 in the drug data (drug database 81) relating to a plurality of types of drugs registered in advance.
[0071] The discrimination unit 64 outputs the discrimination result of the type of medicine to the sorting control unit 62. For example, when the type of medicine can be identified as one, or when the number of candidates is narrowed down to a predetermined number or less, the discrimination unit 64 outputs the medicine data related to the medicine as the discrimination result. In this case, the discrimination unit 64 stores the medicine data related to the medicine in the storage unit 80 in association with the captured image 82 of the medicine.
[0072] When the discrimination unit 64 discriminates the type of medicine as a suspected medicine, it outputs the characteristics of the medicine (the characteristics of the object presumed to be a suspected medicine) as the discrimination result. On the other hand, when the discrimination unit 64 discriminates that the medicine is registered in the medicine database as a medicine to be discarded, or when the object contained in the first container 11 is a foreign object other than a medicine, it outputs the fact that the medicine is not to be sorted as the discrimination result.
[0073] [Judgment of success or failure of discrimination] The discrimination success / failure determination unit 65 determines whether the discrimination unit 64 has succeeded in discriminating the type of the medicine. For example, the discrimination success / failure determination unit 65 may determine that the discrimination is successful when the discrimination unit 64 can uniquely discriminate the type of the medicine (when the types of the medicine can be narrowed down to one). Also, for example, the discrimination success / failure determination unit 65 may make the above-mentioned determination based on the inspection result of the medicine sorted according to the judgment result of the discrimination unit 64. The inspection may be performed by an inspector (for example, a doctor or a pharmacist) visually inspecting the sorted medicine itself, or may be performed by displaying an image of the sorted medicine on the display unit 32 of the touch panel 3, for example, and having the inspector visually inspect the displayed image. Also, the inspection result may be input to the computer 60 by, for example, the inspector operating the operation unit 31 of the touch panel 3.
[0074] Furthermore, when the discrimination success / failure determination unit 65 determines that the discrimination unit 64 has made a correct discrimination, it associates the various data used by the discrimination unit 64 for the discrimination with the type discriminated by the discrimination unit 64, and stores the result as discrimination success data in the storage unit 80. In this embodiment, an example will be described in which the discrimination success data is color data (discrimination success color data 83) generated from the captured image 82 used by the discrimination unit 64 for the discrimination.
[0075] The successful discrimination data may include various data other than color data (data indicating the characteristics of the drug used by the discrimination unit 64 for the above discrimination), or the captured image 82 used by the discrimination unit 64 for the above discrimination may be stored as the successful discrimination data. However, when the captured image 82 is used as the successful discrimination data, the amount of data to be stored in the storage unit 80 increases, so that it is preferable to store the successful discrimination color data 83 as the successful discrimination data as in this embodiment.
[0076] [How to update the drug database (master data) 81] A method of updating the medicine database 81 will be described with reference to Fig. 5. Fig. 5 is a diagram for explaining a method of updating the medicine database 81. As will be described below, the updating of the medicine database 81 is performed by the master update unit 71.
[0077] In the medicine database 81, medicine data on a plurality of types of medicine is registered as master data for matching the medicine. As shown in FIG. 5, the master data for each type of medicine includes master color data, which is color data indicating the color of the medicine, as one of the data indicating the characteristics of the medicine. Specifically, in the medicine database 81 of FIG. 5, master color data 811a is registered as the master data for medicine A. Similarly, master color data 811b and 811c are registered as the master data for medicine A and B, respectively. The master color data also includes data generated from a visible light image and data generated from an ultraviolet light image.
[0078] As described above, the memory unit 80 stores successful discrimination color data 83. In the example of Fig. 5, successful discrimination color data 83a to 83c are stored for drug A. That is, in this example, it is assumed that the drug sorting device 1 has sorted an unknown type of drug as drug A and the type discrimination result in this sorting has been correct at least three times in the past. Similarly, in the example of Fig. 5, successful discrimination color data 83d to 83e and 83f to 83h are stored for drugs B and C, respectively.
[0079] The master update unit 71 updates the medicine database 81 (more specifically, the master color data included in the master data) by using the successful discrimination color data 83 as new master color data. This update is performed for each type of medicine. For example, in the example of FIG. 5, the master color data 811a to 811c are each updated.
[0080] Here, when updating, if multiple pieces of successful discrimination color data 83 are associated with and stored for one type of medicine, it is preferable that the master update unit 71 sets the latest (most recently stored) successful discrimination color data 83 as the new master color data. This makes it possible to appropriately discriminate the type of medicine even if the color of the medicine shown in the captured image 82 changes due to a change in the imaging conditions, etc. After adding the new master color data, the master color data 811a to 811c before the update may be deleted (in other words, overwritten and updated), or may be maintained as they are stored.
[0081] [How to calculate color score] The discrimination unit 64 calculates a color score indicating the similarity between the master color data and the target color data, which is color data generated from an image 82 (hereinafter referred to as a target image) capturing an image of the medicine to be sorted. Note that one target image includes a visible light image and an ultraviolet light image. The calculation formula for the color score (similarity evaluation information) may be, for example, the following calculation formula.
[0082] (Color score) = (Similarity of RGB values in visible light image) × w1 + (Similarity of CIELab values in visible light images) × w2 + (Similarity of RGB values in ultraviolet light image) × w3 + (Similarity of CIELab values in ultraviolet light images) × w4 In the above calculation formula, w1 to w4 are weights, and the sum of w1 to w4 is, for example, 1, but the sum of w1 to w4 may be less than 1 or greater than 1. By appropriately adjusting the values of the weights w1 to w4, it is possible to calculate a color score that more accurately reflects the similarity between the target color data and the master color data. For example, in the master color data of a certain medicine, the CIELab value based on an image of the medicine captured with visible light may accurately reflect the color characteristics of the medicine. In such a case, if w2 is relatively larger than the other weights, the calculated color score is strongly influenced by the similarity of the CIELab value based on the visible light captured image that accurately reflects the color characteristics of the medicine. Therefore, by using the above calculation formula in which w2 is relatively larger than the other weights, it is possible to calculate a color score that accurately reflects the actual similarity. As will be described in detail later, w1 to w4 are updated as needed by the weight update unit 72 so that a state in which a color score that accurately reflects the actual similarity can be calculated is maintained. The initial values of w1 to w4 may be determined appropriately.
[0083] In the above formula, the RGB value is a value that expresses the color of a predetermined area (at least a part of the area in which the medicine is captured) in an image of the medicine by a combination of R, G, and B values, and is typically the average value of the RGB values of each pixel included in the area. The similarity of the RGB values is the similarity between the RGB values of the target image and the RGB values indicated by the master color data. The method of calculating the similarity of the RGB values is not particularly limited. For example, the RGB values of the target image and the RGB values indicated by the master color data may be regarded as three-dimensional vectors, and the distance between these two vectors may be regarded as the similarity. In the above formula, the similarity of the RGB values and the similarity of the CIELab values are added, so that these similarities are normalized to be in a numerical range of, for example, 0 to 1.
[0084] In addition, the CIELab value in the above formula is a value that represents the color of a predetermined area (at least a part of the area in which the medicine is captured) in an image of the medicine as a combination of L*, a*, and b* values in the CIELab color space. The CIELab value can be calculated by first converting the RGB value into a value in the XYZ color space, and then converting the value into a value in the CIELab color space. The similarity of the CIELab value can be calculated in the same manner as the similarity of the RGB value described above.
[0085] [Ranking by color score] The master color data of each type of medicine is registered in the medicine database 81. The discrimination unit 64 calculates the color score of each of these master color data with the target color data as described above. Then, the discrimination unit 64 ranks the master data of each type of medicine in descending order of the calculated color score. After that, the discrimination unit 64 performs matching with the target image in descending order of the rank of the master data. That is, the discrimination unit 64 calculates a color score indicating the similarity between the target color data and each of the master color data corresponding to each type of medicine, and determines the type of the target medicine by matching information indicating the characteristics of the target image with the master data in the order of the color scores. In the matching, for example, the marking information (information indicating the contents of the marking of the medicine) included in the master data with the marking information read from the target image by OCR or the like is matched, and the type of the target medicine is identified.
[0086] The reason for such ranking is that, in general, many medicines have similar colors. In other words, there may be multiple master color data with similar color scores to the target color data, and the medicine in the master color data with the highest color score to the target color data may be a medicine different from the target medicine. For this reason, it is generally difficult to uniquely identify the type of the target medicine based on the color score alone.
[0087] Therefore, the discrimination unit 64 uses the color score for ranking in matching with the master data. Compared with reading the marking information, the color data can be generated by simple and quick information processing, so that the calculation and matching of the color score can be easily and quickly performed. Therefore, by performing ranking based on the color score, it is possible to complete the matching in a short time compared to matching with the master data without ranking. In addition, as described below, the weight update unit 72 appropriately updates the weight in the calculation formula of the color score, so that, for example, if the target drug is drug A, the master color data of drug A is likely to be ranked higher. Therefore, it is possible to complete the matching with the master data in a short time.
[0088] [How to update weights in the color score calculation formula] A method for updating the weights (w1 to w4) in the above-mentioned color score calculation formula will be described with reference to Fig. 6. Fig. 6 is a diagram for explaining a method for updating the weights in the color score calculation formula. As will be described below, the weights in the color score calculation formula are updated by the weight update unit 72.
[0089] A plurality of pieces of successful discrimination color data 83 are used to update the weights. In the example of Fig. 6, a plurality of pieces of successful discrimination color data 83 are linked to each of drugs A to Z. The weight update unit 72 uses the successful discrimination color data 83 as training data and updates the weights in the color score calculation formula to optimal ones by stochastic gradient descent. By using the stochastic gradient descent method, it is expected that the optimal solution can be reached by escaping suboptimal local solutions.
[0090] Specifically, first, the weight update unit 72 creates a predetermined number of mini-batch data from the successful discrimination color data 83. In this creation, each mini-batch data includes at least one successful discrimination color data 83 for all types of medicine, and the number of successful discrimination color data 83 included in each mini-batch data falls within a predetermined range.
[0091] 6 shows n mini-batch data B1 to Bn including one successful discrimination color data 83 for each of drugs A to Z. n may be determined according to the number of types of drugs registered in the drug database 81, the elapsed time since the previous weight update, etc., and may be, for example, about 40. Note that one successful discrimination color data 83 may be included in multiple mini-batch data.
[0092] Next, the weight update unit 72 updates the weights (w1 to w4) by the stochastic gradient descent method using the created mini-batch data. Whether the updated weights are more appropriate than the weights before the update can be determined from the color scores calculated using the updated weights. For example, it is also possible to calculate color scores for the master color data and the discrimination success color data 83 for each type of medicine and to determine from the ranking of the color scores.
[0093] For example, in the example of FIG. 6, master color data is registered for 26 types of drugs, drugs A to Z. The mini-batch data Bn includes the successful discrimination color data 83b of drug A. In updating the weights using this mini-batch data Bn, the weights may be updated so that the ranking of the color score calculated for the master color data of drug A and the successful discrimination color data 83b is increased. The specific calculation content will be described below, but in this update, the weight (w1) of the visible light RGB value is +scaled. Note that +scale is the amount of change in the weight (positive number). Similarly, the other weights (w2 to w4) are also +scaled. In this way, in the stochastic gradient descent method, a calculation is performed to search for the optimal weight while changing each weight by a predetermined amount of change (+scale).
[0094] Specifically, the gradient average is used in the above calculation. The gradient average can be calculated, for example, by the following formula. In the following formula, Z is the number of successfully discriminated color data 83 included in one mini-batch data. Σ represents the sum from the first successfully discriminated color data 83 to the Zth successfully discriminated color data 83 in one mini-batch data. The average ranking is the average value of the rankings calculated from the successfully discriminated color data 83 included in each mini-batch data, over all the mini-batch data. The ranking method is as described above in "Ranking by Color Score", and therefore will not be described again.
[0095] (Gradient average) = {Σ(average rank after shifting weights - average rank before shifting weights) / change in weights} / Z Then, the weight update unit 72 updates the weights according to the following formula: The learning rate may be set appropriately.
[0096] (Updated weights) = (Current weights) - (Learning rate x Gradient average) [Processing flow for storing successful discrimination color data 83] The flow of the process of storing successful discrimination color data 83 will be described with reference to Fig. 7. Fig. 7 is a flowchart showing an example of the process of storing successful discrimination color data 83. Fig. 7 shows the flow of the process after an image of an unknown type of target drug is captured and the captured image 82 is stored in the memory unit 80.
[0097] First, the discrimination unit 64 generates target color data from the target image (S1). Next, the discrimination unit 64 calculates color scores indicating the similarity between the target color data generated in S1 and each of the master color data registered in the drug database 81 (S2). Then, the discrimination unit 64 sets the matching order with the master data to the highest color score calculated in S2 (S3), performs matching in that matching order (S4), and discriminates the type of the target drug (S5).
[0098] Next, upon successful identification of the type of the target drug in S5, the identification success / failure determination unit 65 stores the target color data generated in S1 in the memory unit 80 as successful identification color data 83 for the type of drug identified in S5, and the processing in Figure 7 is terminated.
[0099] [Process flow for updating the drug database 81] The flow of the process of updating the medicine database 81 will be described with reference to Fig. 8. Fig. 8 is a flow chart showing an example of the process of updating the medicine database 81.
[0100] First, the master update unit 71 determines whether to update the medicine database 81, more specifically, whether to update the master color data included in the medicine database 81 (S11). The update conditions for the master color data are not particularly limited. For example, the master color data may be updated when the operation of the computer 60 is terminated (for example, at the end of a day). Also, for example, a message inquiring whether an update is necessary or not may be presented to the user every predetermined period (for example, one day), and the master color data may be updated when the user inputs an update request in response to the message. Also, for example, the average processing time (the time from imaging until the discrimination result is obtained) of the most recent several type discriminations is a predetermined time or more, the frequency of occurrence of imaging retries is a threshold or more (the frequency of failure of type discrimination is a threshold or more), etc. may be set as conditions. In addition to the above, the master color data may be updated on the condition that a predetermined period (for example, 30 days) has passed since the last update.
[0101] In S12, the master update unit 71 acquires the latest (most recently stored) successful discrimination color data 83 from among the successful discrimination color data 83 stored in the storage unit 80. Then, in S13, the master update unit 71 adds the successful discrimination color data 83 acquired in S12 to the drug database 81 as new master color data. This ends the processing in Fig. 8. Note that the processing in S12 and S13 only needs to be performed for at least one type of drug, and may be performed for all types of drugs registered in the drug database 81, for example, or may be performed for only some types of drugs.
[0102] In this way, the discrimination unit 64 compares the information indicating the external appearance characteristics of the target drug generated from the target image with the master data, and discriminates the type of the target drug based on the result of the comparison (S5 in FIG. 7). Then, when the discrimination unit 64 succeeds in discriminating the type of the target drug, the master update unit 71 sets the discrimination success color data 83 used for the discrimination as new master color data (S13 in FIG. 8).
[0103] Therefore, according to the medicine sorting device 1, even if the target image obtained by imaging the target medicine changes from that assumed when the master data was created, the type can be appropriately determined. As a result, for example, when the medicine sorting device 1 is introduced to a pharmacy, the default master data can be updated to that suited to the imaging conditions in the pharmacy. Furthermore, even if the color of the captured image changes due to deterioration over time of the imaging device, lighting device, etc. after the introduction of the medicine sorting device 1, a state in which the type can be appropriately determined can be maintained.
[0104] [Process flow for updating weights in the color score calculation formula] The flow of the process of updating the weight in the calculation formula of the color score will be described based on FIG. 9. FIG. 9 is a flowchart showing an example of the process of updating the weight in the calculation formula of the color score. The conditions for performing the process of FIG. 9 are not particularly limited. For example, when the medicine sorting device 1 presents a message to the user inquiring whether or not the date and time update is required, and the user operates to update the date and time in response to the message, the process of FIG. 9 may be started before the date and time update. The date and time update is performed as soon as the process of FIG. 9 is completed. In addition, the process of FIG. 9 may be started on the condition that a predetermined period (e.g., 30 days) has passed since the previous weight update, or the process of FIG. 9 may be started on the condition that a predetermined number of discrimination success color data 83 has been accumulated. In addition, when the master color data is updated, there is a possibility that the current weight is not an appropriate value for the updated master color data, so the process of FIG. 9 may be started on the condition that the master color data has been updated.
[0105] First, the weight update unit 72 acquires the successfully discriminated color data 83 for a predetermined period stored in the storage unit 80 (S21). For example, if the predetermined period is 30 days, the weight update unit 72 acquires all successfully discriminated color data 83 stored in the most recent 30 days. The weight update unit 72 then creates mini-batch data from the successfully discriminated color data 83 acquired in S21 (S22), and optimizes the weights in the color score calculation formula using the created mini-batch data (S23).
[0106] In addition, in S23, even if the weights have been updated in the past, it is preferable to perform the optimization calculation from the initial weight values, not the updated weight values, which makes it possible to prevent the optimized weight values from becoming values that are far from the initial weight values, thereby enabling stable optimization.
[0107] Next, the weight update unit 72 judges whether the weight calculated in S23 (optimized weight) is a more accurate value than the current weight (the weight after the most recent update if an update has been performed in the past) (S24). The accuracy of the weight may be evaluated based on the color score calculated by the calculation formula to which the weight is applied. For example, the weight update unit 72 may calculate color scores for a part or all of the successful discrimination color data 83 acquired in S21 to obtain the ranking of the color scores, and judge whether the weight is a highly accurate value based on whether the average ranking is high. The ranking of the color scores refers to the ranking of the color scores calculated using the successful discrimination color data 83 of a certain drug and the successful discrimination color data 83 of the certain drug, among the color scores calculated using the successful discrimination color data 83 of a certain drug and the master color data of each type of drug.
[0108] If it is determined in S24 that the value is highly accurate (YES in S24), the process proceeds to S25, where the weight update unit 72 applies the weight calculated in S23 instead of the current weight. As a result, the updated weight is used in subsequent sorting. On the other hand, if it is determined that the value is not highly accurate (NO in S24), the process of Fig. 9 ends. That is, in this case, the weight is not updated, and the current weight continues to be used in subsequent sorting.
[0109] As described above, the weight update unit 72 acquires a plurality of successful discrimination color data 83 as training data (S21), and updates the color score calculation formula (more specifically, the weights w1 to w4 in the color score calculation formula) using the acquired training data (S25). Therefore, according to the medicine sorting device 1, even if the target image obtained by imaging the target medicine has changed from that assumed when the master data was created, or even after the master color data has been updated, the type can be appropriately discriminated based on the appropriate color score calculated using the appropriate weight value.
[0110] [Modifications] In the above embodiment, an example of updating weights by the stochastic gradient descent method using mini-batches has been shown, but other algorithms can also be applied to update weights. For example, a stochastic gradient descent method that does not use mini-batches can be used, or if there is no need to consider the problem of local solutions, a normal gradient descent method can be used. Also, an optimization algorithm other than the gradient descent method can be applied.
[0111] At least one of the update process of the medicine database 81 and the update process of the weights may be executed by an information processing device (computer) external to the medicine sorting device 1. In this case, by setting the information processing device in a state capable of communicating with the medicine sorting device 1, the medicine database 81 used by the medicine sorting device 1 and the weights in the calculation formula for the color score can be updated from the information processing device.
[0112] [Embodiment 2] Other embodiments of the present invention will be described below. For ease of explanation, the same reference numerals are given to members having the same functions as those described in the above embodiment, and the description thereof will not be repeated.
[0113] [Configuration of the medicine sorting device] Fig. 10 is a block diagram showing an example of a main configuration of the control unit 60b included in the medicine sorting device 1 according to this embodiment. Note that Fig. 10 mainly illustrates the configuration characteristic of this embodiment, but the control unit 60b may also include other blocks included in the control unit 60a shown in Fig. 1.
[0114] The control unit 60b includes a mark detection unit 73, a similarity determination unit 74, a match determination unit 75, and a discrimination unit 64. The similarity determination unit 74 includes n classifiers 741-1 to 741-n, where n is an integer equal to or greater than 2. When it is not necessary to distinguish between the classifiers, they will simply be referred to as classifiers 741.
[0115] Like the medicine sorting device 1 of embodiment 1, the medicine sorting device 1 of this embodiment also determines the type of a target medicine from an image of the target medicine of unknown type. This determination is performed by the discrimination unit 64, as in embodiment 1. This embodiment differs from embodiment 1 in that, as one of the determination materials of the discrimination unit 64, it determines whether or not the mark of the target medicine matches a registered mark registered in master data for matching medicines, using a plurality of discriminators 741.
[0116] More specifically, the mark detection unit 73 detects a mark formed on the target drug from the captured image. Then, the similarity determination unit 74 determines the similarity between the detection mark detected by the mark detection unit 73 and a registered mark registered in master data for matching drugs using a plurality of classifiers 741. Then, the match determination unit 75 determines whether the detection mark and the registered mark match based on the results of the determination by each classifier 741.
[0117] According to the above configuration, it is determined whether the detection mark and the registered mark match based on the similarity determination results by the multiple classifiers 741. Therefore, it is possible to improve the accuracy of the mark match determination. And, since the discrimination unit 64 discriminates the type of the target drug based on the determination result of the mark detection unit 73, it is possible to improve the accuracy of the type discrimination of the target drug by appropriately considering the mark.
[0118] Generally, marks formed on medicines have a wide variety of shapes, making it difficult to identify them using OCR (optical character reader) or the like. In addition, when a mark is formed by engraving the surface of a medicine, the way the mark appears in the captured image changes depending on how the light hits the medicine when it is captured, making it difficult to improve the accuracy of the match determination. However, with the above configuration, it is possible to perform a high-precision match determination even for marks formed by engraving the surface of a medicine.
[0119] [Configuration of information processing device] The above-mentioned similarity determination section 74 and match determination section 75 are constructed by the information processing device 100. Here, the configuration of the information processing device 100 will be described with reference to Fig. 11. Fig. 11 is a block diagram showing an example of the configuration of the main parts of the information processing device 100.
[0120] The information processing device 100 includes a control unit 110 that controls each unit of the information processing device 100, and a storage unit 150 that stores various data used by the information processing device 100. The information processing device 100 also includes an input unit 130 that accepts input to the information processing device 100, and an output unit 140 that allows the information processing device 100 to output data.
[0121] The control unit 110 includes a classifier group generation unit 111, a judgment region setting unit 112, a similarity judgment unit 113, an evaluation unit 114, a selection unit 115, a weight setting unit 116, a reliability calculation unit 117, and a classifier construction unit 118. The storage unit 150 stores a classifier DB (database) 151, a registered mark DB 152, and a learning DB 153.
[0122] The classifier group generation unit 111 generates a classifier group used by the similarity determination unit 113 to determine similarity. Specifically, the classifier group generation unit 111 generates a classifier group consisting of N classifiers from 1131-1 to 1131-N by increasing the variation of thresholds used by the classifiers stored in the classifier DB 151 to determine similarity. This classifier group configures the similarity determination unit 113. Note that N is an integer equal to or greater than 2. When it is not necessary to distinguish between the classifiers, they will simply be referred to as classifier 1131.
[0123] The determination area setting unit 112 divides an area in the captured image in which the detection mark appears, and sets a plurality of determination areas in which similarity is determined by the similarity determination unit 113. The setting of the determination areas will be described later with reference to FIG.
[0124] The similarity determination unit 113 uses each classifier 1131 included in the classifier group generated by the classifier group generation unit 111 to determine the similarity between a registered mark appearing in a registered mark image stored in the registered mark DB 152 and a mark appearing in each test image included in the learning DB 153. As described above, this determination is performed for each determination area set by the determination area setting unit 112. Details of the test images will be described later with reference to FIG.
[0125] The evaluation unit 114 evaluates the similarity determination results by each classifier 1131 included in the similarity determination unit 113. The evaluation method may be any method capable of calculating an evaluation value according to the similarity determination accuracy of each classifier 1131. In this embodiment, an example will be described in which the evaluation unit 114 calculates an error rate of each classifier 1131. The error rate is a numerical value indicating the proportion of the number of times the determination result was incorrect to the total number of times similarity determination was performed, and it can be said that the lower the error rate, the higher the similarity determination accuracy.
[0126] The selection unit 115 selects a plurality of classifiers from the classifier group generated by the classifier group generation unit 111, i.e., from the classifiers 1131 included in the similarity determination unit 113, based on the similarity determination accuracy evaluated by the evaluation unit 114. In addition, the selection unit 115 takes into consideration the weights set by the weight setting unit 116 in this selection.
[0127] The weight setting unit 116 sets a weight for each test image to be subjected to similarity determination by each classifier 1131. A method of setting the weight and a method of selecting a classifier taking the weight into consideration will be described later with reference to FIG.
[0128] The reliability calculation unit 117 calculates the reliability of each classifier selected by the selection unit 115. As will be described in detail later, this reliability is used in the match determination by the medicine sorting device 1. A method of calculating the reliability will also be described later.
[0129] The classifier construction unit 118 constructs a classifier for determining whether or not the detection mark and the registered mark match, using the multiple classifiers selected by the selection unit 115. Then, the medicine sorting device 1 performs a match determination using the classifier constructed by the classifier construction unit 118.
[0130] The classifier DB 151 stores classifiers that determine the similarity between a detection mark detected from a captured image of a medicine and a registered mark registered in master data for matching the medicine. As described above, the classifier group generation unit 111 increases the variation of the thresholds of the classifiers stored in the classifier DB 151, thereby generating a classifier group to be selected by the selection unit 115. For this reason, it is sufficient that at least one type of classifier is stored in the classifier DB 151. However, if multiple types of classifiers are stored, it is preferable because a classifier with higher determination accuracy can be constructed from classifiers selected from the multiple types of classifiers. Specific examples of classifiers stored in the classifier DB 151 will be described later.
[0131] The registered mark DB 152 stores registered mark images, which are images of registered marks registered as master data for matching medicines in the medicine database 81 of embodiment 1. The registered mark images may be generated by cutting out a portion of the master image 812 stored in the medicine database 81, in which the mark is shown.
[0132] As described above, the learning DB 153 stores test images used for evaluating the similarity determination accuracy of each classifier 1131. Details of the test images will be described later with reference to FIG.
[0133] As described above, the information processing device 100 includes a selection unit 115 that selects a plurality of classifiers from the classifiers 1131-1 to 1131-N that determine the similarity between a detection mark detected from a captured image and a registered mark based on the similarity determination accuracy. The information processing device 100 also includes a classifier construction unit 118 that uses the plurality of classifiers selected by the selection unit 115 to construct a classifier for determining whether or not the detection mark and the registered mark match.
[0134] According to the above configuration, it is possible to construct a classifier for determining whether a detection mark and a registered mark match based on the judgment results by a plurality of classifiers selected based on the judgment accuracy of similarity. Then, by using the classifier constructed in this manner, the medicine sorting device 1 of the present embodiment can perform a match judgment of the marks with high accuracy, and can also perform a type discrimination of the target medicine based on the judgment result with high accuracy.
[0135] [Determination area setting] Fig. 12 is a diagram showing an example of setting judgment regions. More specifically, Fig. 12 shows an example in which a registered mark image 1521, which is master data of a registered mark, is generated from a master image 812, and M judgment regions from A2-1 to A2-M are set in this registered mark image 1521.
[0136] In the master image 812 shown in Fig. 12, a tablet T1 is shown, and a mark T11 and a number T12 are shown on the surface of the tablet T1. The registered mark image 1521 is generated by detecting an area A1 in which the mark is shown from such a master image 812 and cutting out this area. The cut-out image may be used as the registered mark image 1521 as is, or may be enlarged or reduced to a predetermined size before being used as the registered mark image 1521. The registered mark image 1521 is stored in the registered mark DB 152.
[0137] The judgment area setting unit 112 sets a number of judgment areas in the registered mark image 1521. In the example of Fig. 12, M judgment areas A2-1 to A2-M are set, where M is an integer equal to or greater than 2. When it is not necessary to distinguish between the judgment areas, the judgment area is simply referred to as judgment area A2.
[0138] It is preferable that the judgment area setting unit 112 sets the judgment area so that the entire image area of the registered mark image 1521 is included in at least one of the judgment areas A2. Also, like the judgment areas A2-1 and A2-2 in the example of Fig. 12, the judgment area setting unit 112 may set the judgment areas so that they partially overlap. Also, like the judgment areas A2-1 and A2-M in the example of Fig. 12, the judgment area setting unit 112 may set judgment areas of different sizes, or may set judgment areas of different shapes.
[0139] The number of the judgment regions 2A and the size of each judgment region 2A are not particularly limited. However, it is preferable to set the size and number of the judgment regions 2A so that the similarity judgment by the classifier 1131 is not hindered, that is, the size and number of the judgment regions 2A so that the characteristics of the mark are expressed in each judgment region 2A. As an example, the judgment region setting unit 112 may set several hundred judgment regions A2.
[0140] The judgment area setting unit 112 may automatically set the judgment area 2A. For example, the judgment area setting unit 112 may set a plurality of judgment areas 2A that cover the entire image area of the registered mark image 1521 while shifting the judgment area 2A of a predetermined size by a predetermined distance in a predetermined direction. Furthermore, the judgment area setting unit 112 may set each judgment area 2A according to a user's input via the input unit 130, for example.
[0141] The determination area setting unit 112 also sets the same determination area A2 for the test image as for the registered mark image 1521. The test image is an image to be subjected to similarity determination with the registered mark image 1521, and is stored in the learning DB 153.
[0142] The test images stored in the learning DB 153 include a test image 1531 in which the same mark as that in the registered mark image 1521 is shown, and a test image 1532 in which a mark different from that in the registered mark image 1521 is shown. It is preferable to prepare as many test images as possible, ranging from those in which the similarity is easy to determine to those in which it is difficult. This makes it possible to perform a high-precision mark matching determination for various captured images of medicines.
[0143] The similarity determination unit 113 determines the similarity between the registered mark image 1521 and the test image for each of the determination areas set as described above. Specifically, the similarity determination unit 113 determines the similarity between the determination area A2-1 of the registered mark image 1521 and the determination area A2-1 of the test image 1531. The similarity determination unit 113 also performs a similar determination for the test image 1532. The similarity determination unit 113 then performs a similar determination for the similarities between the registered mark image 1521 and the test image 1531, and between the registered mark image 1521 and the test image 1532 for the determination areas A2-2 to A2-M.
[0144] The selection unit 115 then selects a plurality of classifiers based on the accuracy of similarity judgment in each of the plurality of judgment regions. As a result, a classifier with high judgment accuracy in each judgment region is selected, and a classifier for mark coincidence judgment is constructed using the selected classifiers. The classifiers constructed in this manner can perform judgment using the right person for the right job, for example, by using a classifier with high shape judgment accuracy to judge a judgment region in which the shape characteristics of the mark appear, and using a classifier with high color judgment accuracy to judge a judgment region in which the color characteristics of the mark appear.
[0145] In addition, the similarity determination unit 74 of the medicine sorting device 1 using the classifier constructed in this manner performs similarity determination for each of a plurality of determination regions obtained by dividing the region in which the detection mark appears in the captured image, using a classifier corresponding to the determination region. This makes it possible to perform highly accurate determination taking into account the difference between regions.
[0146] [Classifier used] As described above, the similarity determination unit 74 of the medicine sorting device 1 determines the similarity using a plurality of classifiers 741. The similarity determination unit 74 may determine the similarity between the detection mark and the registered mark using a plurality of types of classifiers with different similarity determination methods. According to this configuration, the coincidence determination of the marks is performed taking into account a plurality of determination methods, so that it is possible to improve the accuracy of the determination compared to the case where the similarity is determined using one type of determination method.
[0147] Furthermore, when multiple types of classifiers are used, it is preferable that the classifiers include a classifier that judges color similarity and a classifier that judges shape similarity. With this configuration, the matching judgment of the marks is performed taking into account both color similarity and shape similarity, making it possible to improve the accuracy of the judgment.
[0148] Here, the classifier 741 is selected from the classifiers 1131-1 to 1131-N included in the similarity determination unit 113 of the information processing device 100, and these classifiers 1131 are based on the classifiers stored in the classifier DB 151.
[0149] Therefore, if there are multiple types of base classifiers, including a classifier that determines color similarity and a classifier that determines shape similarity, the medicine sorting device 1 can be expected to achieve the above-mentioned effects.
[0150] In addition, some medicines are difficult to judge the similarity by color, but for such medicines, the judgment accuracy of a classifier that judges the similarity of color is low, so such a classifier is difficult to select. Therefore, even if the classifier DB 151 includes a classifier that judges the similarity of color, it is possible to avoid using the classifier that judges the similarity of color when judging the similarity of medicines for which it is difficult to judge the similarity by color.
[0151] As an example of a classifier for determining shape similarity, a classifier can be used that calculates a value such as that shown below for the image to be subjected to similarity determination, and determines whether the images are similar or dissimilar by comparing the calculated value with a predetermined threshold value.
[0152] (1) HOG (Histograms of Oriented Gradients) feature distance (2) Distance of hash values calculated by the Average Hash method (3) Distance of hash values calculated by the Perceptual Hash method (4) Distance of HOG features in the S component image generated by HSV (H: Hue, S: Saturation / Chroma, V: Value / Brightness) conversion (5) Similarity of features obtained by extracting feature points from sharpened images (ORB: Oriented FAST and Rotated BRIEF) (6) Similarity of features obtained from Sobel filtered images using AKAZE, a feature point extraction algorithm (7) Similarity of features obtained from gradient filtered images using AKAZE, a feature point extraction algorithm (8) The distance between each feature vector obtained by inputting each image to be judged for similarity into a convolutional neural network trained to output the feature vector of numbers, etc. from an image that contains numbers, etc. In addition, as a classifier for determining color similarity, for example, a classifier that calculates the average color distance of the HSV converted image and compares the calculated value with a predetermined threshold value to determine whether the images are similar or dissimilar can be used.
[0153] [Differences in similarity judgment accuracy due to differences in thresholds] As described above, the classifier group generation unit 111 generates a classifier group having different thresholds. Here, the difference in similarity determination accuracy due to the difference in threshold will be described with reference to Fig. 13. Fig. 13 is a diagram showing an example in which a difference in similarity determination accuracy occurs due to a difference in threshold.
[0154] In this example, the similarity between area A2 in the registered mark image 1521 and the same area in the test image is determined by a first classifier, which is one of the classifiers stored in the classifier DB 151, and a second classifier in which the threshold of the first classifier is changed to a larger value. The test images include test images A to C in which the same mark as the mark in the registered mark image 1521 appears, and test images a to c in which a different mark appears.
[0155] The first and second classifiers are the same classifiers, but differ only in the threshold for determining whether they are similar or dissimilar, and therefore the similarities between the registered mark image 1521 and the test image calculated by these classifiers are the same. In the example of Fig. 13, the test image A has the highest similarity to the registered mark image 1521, followed by the test images B, a, b, C, and c in descending order of similarity.
[0156] The first classifier and the second classifier output a judgment result of similarity if the calculated similarity is equal to or greater than a threshold, and dissimilar if it is less than the threshold. In this example, the judgment result of the first classifier is that the test images A, B, a, and b are similar to the registered mark image 1521, and the test images C and c are dissimilar to the registered mark image 1521. Of these six results, the judgment results for the test images a, b, and C are incorrect judgments, so the error rate of the first classifier is 3 / 6.
[0157] On the other hand, the judgment result of the second classifier is that the test images A, B, and a are similar to the registered mark image 1521, and the test images b, C, and c are not similar to the registered mark image 1521. Of these six results, the judgment results for the test images a and C are incorrect, so the error rate of the second classifier is 2 / 6.
[0158] Even if the classifiers calculate the same similarity value, such as the first and second classifiers, the accuracy of the judgment may change if the threshold value used to judge the similarity is changed. Therefore, by increasing the variation of the threshold value used to judge the similarity, it is possible to generate a classifier group including a classifier suitable for judging the similarity of the registered mark image 1521.
[0159] The method by which the classifier group generation unit 111 determines the threshold to be set for each classifier and the number of threshold variations are not particularly limited. The more variations there are, the higher the possibility of constructing a classifier group including a classifier with an optimal threshold, but the amount of calculation required to construct the final classifier increases accordingly. For this reason, the method of determining the threshold and the number of threshold variations may be set based on the allowable amount of calculation, the required determination accuracy, and the like. For example, the classifier group generation unit 111 may set each value that divides the range of the output value of each classifier into multiple equal parts as the threshold. For example, the classifier group generation unit 111 may set nine values that divide the range of the output value into ten equal parts as the threshold. This allows one classifier to have nine variations.
[0160] [Process flow for constructing a classifier] A flow of processing (information processing method) in which the information processing device 100 constructs a classifier will be described with reference to Fig. 14 and Fig. 15. Fig. 14 is a flowchart showing an example of processing for constructing a classifier. Fig. 15 is a diagram showing a specific example of processing for constructing a classifier.
[0161] 14, the classifier group generation unit 111 generates a classifier group by increasing the variation of the thresholds of the classifiers stored in the classifier DB 151. In addition, the determination region setting unit 112 sets a determination region.
[0162] Regarding the above-mentioned classifier group, in the example of FIG. 15, the classifier group generation unit 111 generates a classifier group including N classifiers from classifiers 1131-1 to 1131-N by increasing the variations of thresholds of m types of classifiers (m is a natural number) stored in the classifier DB 151.
[0163] 15, the determination region setting unit 112 sets M determination regions from A2-1 to A2-M. As described above, the determination regions A2-1 to A2-M are used to determine the similarity between the registered mark image 1521 and the test images 1531 and 1532.
[0164] 14, the similarity determination unit 113 uses each classifier included in the above-mentioned classifier group generated by the classifier group generation unit 111 to determine the similarity between the registered mark stored in the registered mark DB 152 and the test images 1531 and 1532 stored in the learning DB 153. This determination is performed for each of the determination areas set by the determination area setting unit 112.
[0165] For example, in the example of Fig. 15, M determination regions are set, so that one classifier performs determination M times for one test image. Also, since there are a total of N classifiers, a total of M x N determinations are performed for one test image.
[0166] In S32, the evaluation unit 114 evaluates the judgment accuracy of each judgment performed in S31. As described above, the evaluation unit 114 may evaluate the judgment accuracy by calculating an error rate. This evaluation takes into account the weighting set by the weighting setting unit 116 for each test image. As will be described below, the processes of S32 to S36 are repeated a predetermined number of times, but in the first evaluation, the weighting of each test image is set to an initial value (all test images have the same weighting).
[0167] In S33, the selection unit 115 selects a classifier from the classifiers evaluated in S32 based on the result of the evaluation. For example, the selection unit 115 may select one classifier with the lowest error rate. At this time, the selection unit 115 associates the selected classifier with the judgment region of the classifier.
[0168] In S34, the reliability calculation unit 117 calculates the reliability of the classifier selected in S33. For example, the reliability calculation unit 117 may calculate the reliability by the following formula. In the following formula, "ln" stands for log e It is.
[0169] (confidence)=1 / 2·ln[{1-(error rate)} / (error rate)] In S35, the classifier construction unit 118 determines whether or not learning has been completed. For example, the classifier construction unit 118 may determine that learning has been completed if the number of times the processes of S32 to S36 have been repeated reaches a predetermined number, and may determine that learning has not been completed if the predetermined number of times has not been reached. If it is determined that learning has been completed in S35 (YES in S35), the process proceeds to S37, and if it is determined that learning has not been completed (NO in S35), the process proceeds to S36.
[0170] In S36, the weight setting unit 116 updates the weights of the test images so that the weights of the test images misclassified by the classifier selected in the most recent process of S33 are greater than the weights of the test images correctly classified by the same classifier.
[0171] After S36, the process returns to S32, and the evaluation unit 114 re-evaluates the judgment accuracy of each judgment performed in S31 using the updated weights. In this re-evaluation, the weights of the test images misjudged by the classifier selected in the most recent process of S33 are relatively large, so that the evaluation of the classifier with high judgment accuracy for this test image is relatively high.
[0172] Therefore, in the next step S33, a classifier that has high accuracy in determining the test image that was erroneously determined by the previously selected classifier is likely to be selected. By repeating such a process, classifiers that complement each other's shortcomings can be selected in sequence.
[0173] In S37, the classifier construction unit 118 constructs a classifier for determining whether the detection mark and the registered mark match, using the classifiers selected by the above repeated processes. For example, the classifier construction unit 118 may construct a classifier that outputs a value obtained by weighting the output value of the selected classifier by the reliability of the classifier, and summing the weighted value for all the selected classifiers (hereinafter referred to as the degree of match).
[0174] Further, the classifier construction unit 118 sets a threshold value for the degree of agreement. The threshold value may be set so that the judgment accuracy of the constructed classifier is at least equal to or greater than the allowable lower limit. For example, the classifier construction unit 118 may acquire the degree of agreement between the registered mark appearing in the registered mark image and the marks appearing in the multiple test images 1531 and 1532, calculated by the constructed classifier. Then, the classifier construction unit 118 may calculate a standard deviation σ of the degree of agreement from the average and variance of the acquired degrees of agreement, and set the threshold value based on this standard deviation σ. For example, the classifier construction unit 118 may set the threshold value to 5σ if the erroneous judgment rate of the constructed classifier is equal to or greater than the allowable lower limit when the threshold value is set to 5σ.
[0175] The illustrated process ends when the classifier is constructed. The classifier constructed in S37 may be stored in the storage unit 150, or may be output to the output unit 140. If the information processing device 100 and the medicine sorting device 1 have a communication function, the information processing device 100 may transmit the constructed classifier to the medicine sorting device 1 by the communication function.
[0176] As described above, the plurality of classifiers 741 included in the similarity determination unit 74 of the medicine sorting device 1 are classifiers selected based on the accuracy of similarity determination for a test image group including an image of a registered mark and an image of another mark. According to this configuration, a match determination of marks is performed based on a similarity determination result by a classifier selected based on the accuracy of similarity determination for a test image group, so that a highly accurate determination can be performed.
[0177] [Flow of mark matching determination process using the constructed classifier] A flow of a mark matching determination process (determination method) by the medicine sorting device 1 using the identifier constructed as described above will be described with reference to Fig. 16 and Fig. 17. Fig. 16 is a flow chart showing an example of the mark matching determination process. Fig. 17 is a diagram showing a specific example of the mark matching determination.
[0178] In S41, the mark detection unit 73 detects a mark formed on the target drug from a captured image 82 of the target drug. In the example of FIG. 17, the captured image 82 shows a tablet T1 with a mark T11 and a number T12 on its surface. In this example, the mark detection unit 73 detects the mark T11, cuts out a rectangular area A1 in which the detected mark T11 appears from the captured image 82, and changes it to a predetermined size to generate a mark image 84. Note that the predetermined size is the same as the registered mark image 1521.
[0179] In S42, the similarity determination unit 74 determines the similarity between the detection mark detected in S41 and the registered mark by using a plurality of classifiers 741. In the example of Fig. 17, the similarity determination unit 74 determines the similarity between the detection mark appearing in the mark image 84 and the registered mark appearing in the registered mark image 1521 by using each of the classifiers 741-1 to 741-m.
[0180] This determination is performed for each determination region A2 associated with each discriminator 741. For example, assume that the determination region associated with the discriminator 741-1 is A2-1, and the determination region associated with the discriminator 741-2 is A2-5. In this case, the determination using the discriminator 741-1 is performed for the determination region A2-1, and the determination using the discriminator 741-2 is performed for the determination region A2-5.
[0181] In S43, the match determination unit 75 calculates a determination score based on the determination result in S42. In the example of Fig. 17, each classifier 741 outputs a determination result of "1" indicating similarity or a determination result of "-1" indicating dissimilarity. Then, the match determination unit 75 multiplies the above determination result by the reliability of the classifier 741 that performed the determination and adds them together to calculate a determination score.
[0182] In S44, the match determination unit 75 determines whether the detection mark detected in S41 matches the registered mark, depending on whether the determination score calculated in S43 is equal to or greater than a threshold. In this way, the match determination unit 75 weights the results of the determination by each classifier 741 according to the reliability of each classifier 741, and then determines whether the detection mark matches the registered mark. This allows the reliability of each classifier 741 to be reflected in the match determination of the marks, making it possible to perform a highly accurate determination.
[0183] Finally, in S45, the match determination section 75 outputs the result of the determination in S45 to the discrimination section 64, and the process in Fig. 16 ends. If the result of the determination in S44 is that there is no match, the registered mark to be determined for similarity may be changed and the processes in S42 to S44 may be performed again. These processes may then be repeated until the result of the determination in S44 is that there is a match.
[0184] After the processing of Figure 16 is completed, the discrimination unit 64 receives the judgment result of S45 and discriminates the type of the target drug based on the judgment result of the mark detection unit 73 and other detection results and judgment results such as the color, shape, number, etc. of the target drug.
[0185] [Software implementation example] The control block of the medicine sorting device 1 (particularly, each unit included in the control units 60a and 60b) may be realized by a logic circuit (hardware) formed in an integrated circuit (IC chip) or the like, or may be realized by software.
[0186] In the latter case, the medicine sorting device 1 includes a computer that executes instructions of a program, which is software that realizes each function. The computer includes, for example, one or more processors, and a computer-readable recording medium that stores the program. The computer reads the program from the recording medium and executes it, thereby achieving the object of the present invention. The processor can be, for example, a CPU (Central Processing Unit). The recording medium can be a "non-transient tangible medium", such as a ROM (Read Only Memory), a tape, a disk, a card, a semiconductor memory, a programmable logic circuit, or the like. The device may further include a RAM (Random Access Memory) that expands the program. The program may be supplied to the computer via any transmission medium (such as a communication network or a broadcast wave) that can transmit the program. One aspect of the present invention may also be realized in the form of a data signal embedded in a carrier wave, in which the program is embodied by electronic transmission.
[0187] Similarly, the control blocks of the information processing device 100 (particularly, each unit included in the control unit 110) may be realized by a logic circuit (hardware) formed in an integrated circuit (IC chip) or the like. These control blocks may also be realized by software as described above.
[0188] [Additional Notes] The present invention is not limited to the above-described embodiments, and various modifications are possible within the scope of the claims. Embodiments obtained by appropriately combining the technical means disclosed in different embodiments are also included in the technical scope of the present invention. [Explanation of symbols]
[0189] 1. Drug sorting device 60 Computer (type discrimination device) 64 Discrimination part 71 Master Update Section 72 Weight update unit (evaluation information update unit) 81 Drug Database 82 Captured images 811a, 811b Master color data 73 Mark detection unit 74 Similarity determination unit 741 Classifier 75 Match determination section 100 Information processing device 115 Selection Section 118 Classifier Construction Unit
Claims
1. A method for determining the type of a target drug from an image of the target drug of unknown type, the method being performed by a type determination device, comprising: acquiring the captured image; a step of outputting a determination result as to whether or not a detection mark, which is a mark formed on the target drug detected from the captured image, matches a registration mark registered in master data for drug matching, based on the result of determining, using multiple classifiers, the similarity between the detection mark and the registration mark.
2. 2. The method according to claim 1, wherein the plurality of classifiers are different in the manner of determining similarity.
3. 3. The method according to claim 2, wherein the plurality of types of classifiers include a classifier that determines color similarity and a classifier that determines shape similarity.
4. 4. The method according to claim 1, wherein in the determination of the similarity, for each of a plurality of determination regions obtained by dividing an area in which the detection mark is captured in the captured image, a determination of the similarity is performed by a plurality of the classifiers corresponding to the determination region.
5. 5. The method according to claim 1, wherein the plurality of classifiers are classifiers selected based on accuracy of determining similarity for a test image group including images of the registered mark and images of other marks.
6. 6. The method according to claim 1, wherein whether the detection mark and the registered mark match is determined after weighting a result of the determination by each classifier according to a reliability of each classifier.
7. A method for determining the type of a target drug from an image of the target drug of unknown type, the method being performed by a type determination device, comprising: a match determination step of determining whether a detection mark, which is a mark formed on the target drug and detected from the captured image, matches a registration mark registered in master data for matching drugs, based on a result of determination by a plurality of classifiers of similarity between the detection mark and the registration mark; and outputting a result of the determination.
8. A method for generating a classifier in an information processing device, comprising: a selection step of selecting a plurality of classifiers from a group of classifiers that determine similarity between a detection mark detected from a captured image of a medicine and a registered mark registered in master data for matching the medicine, based on accuracy of similarity determination; a classifier construction step of constructing a classifier for determining whether the detection mark and the registered mark match, using the plurality of classifiers selected in the selection step.
9. 9. The generation method according to claim 8, wherein in the selection step, a plurality of classifiers are selected based on a similarity determination accuracy in each of a plurality of determination regions obtained by dividing an area in which the detection mark appears in the captured image.
Citation Information
Patent Citations
Pattern recognizing method
JP1995160822A
Drug verification apparatus, drug verification system, and drug verification method
JP2015065978A
Drug auditing device
WO2004112685A1
Drug sorting device, sorting container, and drug return method
WO2018190394A1
Drug assortment device and drug assortment method
WO2015170761A1
