Discrimination method
The method improves drug sorting accuracy and efficiency by using multiple classifiers to match drug images with registered marks, addressing variations in imaging devices and environments.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2026-04-02
AI Technical Summary
Existing drug sorting technologies struggle to accurately and efficiently identify and sort tablets or capsules due to variations in imaging devices and environments, leading to increased time and potential errors in drug type identification.
A discrimination method using a type discrimination device that employs multiple classifiers to determine the similarity between detection marks on drugs and registered marks, improving accuracy and efficiency in drug type identification through image analysis.
Enhances the accuracy and speed of drug type determination by utilizing multiple classifiers to match detection marks with registration marks, enabling appropriate drug sorting and reducing errors.
Smart Images

Figure 0007839420000001 
Figure 0007839420000002 
Figure 0007839420000003
Abstract
Description
Technical Field
[0001] The present invention relates to a discrimination method for automatically discriminating the types of drugs, etc.
Background Art
[0002] Conventionally, multiple types of returned drugs have been sorted by pharmacists or doctors for each type. The returned drugs are those prescribed to various patients or drugs after being dispensed according to prescriptions. Therefore, compared with the dispensing operation of collecting (sub-packaging) drugs (tablets) of one or more types from a group of drug types (drug cassettes) grouped in advance by drug type in dispensing equipment, etc., for each dosing time unit based on the prescription information per patient unit, the types of drugs that are returned together after being prescribed to multiple patients are very numerous. Therefore, the usefulness of automatically sorting and reusing the returned drugs is high. Note that the drugs dispensed for one dosing time are generally about 2 to 3 types, and at most about 10 types.
[0003] In addition, in order to avoid the risk of misadministration due to the time, labor, or sorting error (mistaken return to the drug cassette) involved in the sorting operation, there are also pharmacies or hospitals (specifically, in-hospital pharmacy departments) that discard the returned drugs as they are.
[0004] Patent Document 1 discloses a drug sorting device that automatically recognizes and stores returned ampoules or vials. This drug sorting device recognizes the orientation and posture of the ampoule or vial, and the properties of the ampoule or vial (e.g., shape, size, type, and expiration date). Then, in accordance with the recognized size of the ampoule or vial, the storage area set for each individual ampoule or vial at the time of storage is associated with the identification information of each individual ampoule or vial, and the ampoules or vials are individually arranged, thereby storing the individual ampoules or vials in a retrievable manner.
Prior Art Documents
Patent Documents
[0005] [Patent Document 1] International Publication No. 2015 / 170761 (Published November 12, 2015) [Overview of the project] [Problems that the invention aims to solve]
[0006] The items subject to return in Patent Document 1 are ampoules or vials, not drugs not contained in containers, such as tablets or capsules, or drugs themselves that are not packaged. Therefore, Patent Document 1 does not envision identifying and automatically sorting such drugs (e.g., tablets or capsules) themselves. When attempting to realize a drug sorting device that automatically sorts drugs, it is conceivable to create and store master data that shows the visual characteristics of drugs whose types are known in advance, and then use this master data to determine the type of drug to be sorted. The visual characteristics of the drug to be sorted, which are used for matching with the master data, can be identified by analyzing images taken of the drug.
[0007] However, even when imaging the same drug, differences in the imaging device or environment can result in variations in the obtained images. Furthermore, even if the imaging device and environment are the same, differences in the obtained images can occur due to the deterioration of the equipment (including not only the imaging device but also peripheral equipment such as lighting equipment) over time. In other words, the images obtained through imaging may differ from those anticipated when the master data was created, and such changes can cause problems such as an increase in the time required to identify the type of drug.
[0008] One aspect of the present invention aims to realize a discrimination method that can improve the accuracy of mark matching determination and appropriately distinguish between drug types when discriminating between drug images and master data. [Means for solving the problem]
[0009] To solve the above problems, a discrimination method according to one aspect of the present invention is a discrimination method performed by a type discrimination device that discriminates the type of a target drug from an image of a target drug of unknown type, and includes the steps of: acquiring the image; and outputting a determination result of whether 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 results of a determination by a plurality of classifiers of the similarity between the detection mark and the registration mark.
[0010] Furthermore, a discrimination method according to one aspect of the present invention is a discrimination method performed 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 matching determination step of determining whether the detection mark and the registration mark match based on the results of a determination by a plurality of classifiers of the similarity between the detection mark, which is a mark formed on the target drug detected from the image, and the registration mark registered in the master data for drug matching, and 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, comprising: 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 registration mark registered in master data for drug matching, based on the accuracy of the similarity determination; and a classifier construction step of constructing a classifier for determining whether the detection mark and the registration mark match using the plurality of classifiers selected in the selection step. [Effects of the Invention]
[0012] According to one aspect of the present invention, it is determined whether a detected mark and a registered mark match based on the similarity determination results of multiple classifiers. Therefore, the accuracy of mark matching determination can be improved, and the type can be appropriately determined. However, "appropriately" does not necessarily mean that the accuracy of type determination is high. For example, being able to determine the type in an appropriate amount of time is also included in the category of "appropriately". [Brief explanation of the drawing]
[0013] [Figure 1] This is a block diagram showing the overall configuration of a drug sorting device. [Figure 2] This diagram shows an example of the configuration of a drug sorting device; (a) is a perspective view of the drug sorting device, and (b) is a perspective view showing the basic configuration of the drug sorting area. [Figure 3] (a) and (b) are perspective views showing the overall configuration of the imaging unit, and (c) is a perspective view showing an example of a drug placement platform. [Figure 4] (a) and (b) are diagrams illustrating the rotation of the imaging unit. [Figure 5] This diagram explains how to update the drug database. [Figure 6] This diagram illustrates how the weights in the color score calculation formula are updated. [Figure 7] This flowchart shows an example of a process for storing data on successful color discrimination. [Figure 8] This flowchart shows an example of the process for updating a drug database. [Figure 9] This flowchart shows an example of the process for updating the weights in the color score calculation formula. [Figure 10] This is a block diagram showing an example of the main components of the control unit included in a drug sorting device according to Embodiment 2 of the present invention. [Figure 11] This is a block diagram showing an example of the main components of an information processing device. [Figure 12] This figure shows an example of setting the judgment area. [Figure 13]This is a diagram showing an example where the determination accuracy of similarity varies due to different threshold values. [Figure 14] This is a flowchart showing an example of the process of constructing an identifier. [Figure 15] This is a diagram showing a specific example of the process of constructing an identifier. [Figure 16] This is a flowchart showing an example of the process of determining the match of marks. [Figure 17] This is a diagram showing a specific example of the determination of the match of marks.
Mode for Carrying Out the Invention
[0014] 〔Embodiment 1〕 〔Outline of the medicine dispensing device 1〕 First, the outline of the medicine dispensing device 1 will be described using FIGS. 1 and 2. FIG. 1 is a block diagram showing the overall configuration of the medicine dispensing device 1. FIG. 2 is a diagram showing a configuration example of the medicine dispensing device 1, where (a) is a perspective view of the medicine dispensing device 1, and (b) is a perspective view showing the basic configuration of the medicine dispensing area 2. As shown in FIG. 1 and FIGS. 2(a) and (b), the medicine dispensing device 1 includes a medicine dispensing area 2, a touch panel 3, a printing output unit 4, and a packaging mechanism 6.
[0015] The medicine dispensing device 1 captures images of each of a plurality of types of medicines, discriminates the type of medicine based on the images obtained as a result of the imaging, and sorts the medicines by type. Specifically, this process is performed in the medicine dispensing area 2. The medicine dispensing area 2 (the internal configuration of the medicine dispensing device 1) will be described later. Note that the medicines sorted by type are either packaged or returned to the medicine shelf or the packaging machine after visual inspection by the user.
[0016] In this embodiment, multiple types of drugs are drugs that are not contained in containers or other packaging, and are described as being tablets or capsules, for example. Furthermore, multiple types of drugs are described as returned drugs. Returned drugs include cases where drugs adopted by a pharmacy or hospital are returned as "returned drugs" at that pharmacy or hospital, and cases where drugs brought in by the patient, which may include drugs issued at other pharmacies or hospitals in addition to the drugs adopted by the pharmacy or hospital, are returned at that pharmacy or hospital. In other words, the concept of returned drugs includes at least one of the above "returned drugs" and "medications brought in by the patient." The drug sorting device 1 can automatically perform processing from imaging to sorting after drugs have been returned.
[0017] The touch panel 3 accepts various user inputs via the operation unit 31 and displays various images (e.g., images showing the progression of drug sorting, images for visual inspection) via the display unit 32.
[0018] The printing unit 4 prints a journal containing drug data (e.g., drug name, manufacturer, or ingredient information) related to the drug after visual inspection, according to user input following the visual inspection. The drug data may include image data showing drug-specific images.
[0019] The packaging mechanism 6 packages the sorted drugs. The packaging mechanism 6 is an optional mechanism. When the packaging mechanism 6 is installed in the drug sorting device 1, the drug sorting device 1 can perform all processes from sorting returned drugs to packaging after visual inspection. In particular, when drugs are fed into the packaging mechanism 6 by the transport and sorting unit 12, the sorting and packaging processes described above can be performed automatically, excluding visual inspection.
[0020] The packaging mechanism 6 can be the packaging section of a conventional tablet packaging machine or powder packaging machine. In this case, for example, the drugs in the sorting cups 141, which have been sorted by drug type, can be packaged into one or more packets.
[0021] Furthermore, the drug sorting device 1 is equipped with a first RFID (Radio Frequency Identifier) reader / writer unit 5. As shown in Figure 2(b), the first RFID reader / writer unit 5 is located on the drug dispensing side of the base 19.
[0022] The first RFID reader / writer unit 5 reads data related to the drugs 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. This data may include, for example, the number of drugs stored, drug data, and image data acquired by the imaging unit 13. This data may also include drug data determined by visual inspection (drug data after visual inspection). Alternatively, drug data after visual inspection may be written to the RFID tag. Drug data after visual inspection is used when (1) packaging the drugs stored in the corresponding sorting cup 141 using a packaging machine different from the packaging mechanism 6 or drug sorting device 1, or (2) returning them to the drug shelf. As shown in Figure 2(a), the drug sorting device 1 is equipped with an opening / closing shutter 51 and an opening / closing door 52 that allow the drug retrieval side to be opened and closed.
[0023] [Basic structure of drug sorting area 2] Next, the basic configuration of the drug sorting area 2 (internal configuration of the drug sorting device 1) will be explained using Figures 1 and 2(b).
[0024] As shown in Figures 1 and 2(b), the drug sorting area 2 mainly comprises hardware such as a first storage unit 11, a transport / sorting unit 12 (sorting unit), an imaging unit 13, a second storage unit 14, a standby tray 15, a recovery tray 16, a drug input port 17, and a second RFID reader / writer unit 18. All components except the transport / sorting unit 12 are mounted on a base 19. The main functions of the transport / sorting unit 12, the imaging unit 13, and the second RFID reader / writer unit 18 will be described in detail in the descriptions of each process below.
[0025] The first storage unit 11 stores multiple types of drugs returned by users in a mixed state. In this embodiment, the first storage unit 11 is divided into multiple storage units. In this case, for example, when all the drugs stored in one storage unit are transported by the transport / sorting unit 12, the drugs stored in the storage unit adjacent to that unit become targets for transport. The first storage unit 11 may also be rotatable around the Z-axis (center of the cylindrical shape). In this case, the control unit 60a of the computer (type discrimination device) 60 may rotate the first storage unit 11, for example, when one storage unit becomes empty, to facilitate the transport / sorting unit 12 from acquiring the drugs.
[0026] The second storage unit 14 is equipped with multiple sorting cups 141 for storing drugs sorted by type. The control unit 60a determines the type of drug based on the image of the drug captured by the imaging unit 13, and determines which sorting cup 141 to store the drug based on the determination result. The drug is then transported and stored in the determined sorting cup 141 by the transport and sorting unit 12.
[0027] The standby tray 15 is a storage area where drugs are temporarily placed. For example, if all of the sorting cups 141 are filled with drugs, drugs that the control unit 60a has determined to be of a different type are temporarily placed in the standby tray 15. In this case, after the drugs 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, the standby tray 15 may also temporarily contain the estimated drug (described later), which is presumed to be a drug. If the estimated drug is temporarily contained, it is transported to a predetermined area of the second storage unit 14 according to the determination result of the control unit 60a.
[0029] The collection tray 16 is a storage unit for items whose type could not be identified by the control unit 60a (e.g., foreign objects other than pharmaceuticals). Examples of foreign objects other than pharmaceuticals include fragments of PTP (Press Through Pack) sheets. Fragments of PTP sheets may be mixed into the first storage unit 11 when pharmaceuticals are returned. The control unit 60a also stores pharmaceuticals registered in the pharmaceutical database as pharmaceuticals to be discarded, or pharmaceuticals that the user wishes to discard (e.g., pharmaceuticals with old manufacturing dates), in the collection tray 16.
[0030] The drug input port 17 is for transporting the drugs stored in the second storage section 14 to the packaging mechanism 6 via the transport and sorting unit 12, when the drug sorting device 1 is equipped with a packaging mechanism 6. Naturally, if the drug sorting device 1 is not equipped with a packaging mechanism 6, the drug input port 17 is unnecessary.
[0031] Furthermore, as shown in Figure 1, the drug sorting device 1 is equipped with a computer 60 that comprehensively controls all of the above-mentioned components (hardware). The computer 60 comprises 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, sorting control unit 62, imaging control unit 63, discrimination unit 64, discrimination success / failure determination unit 65, master update unit 71, and weight update unit 72 will be described in detail in the descriptions of each process described later. The information that is 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 control the operation unit 31 and the display unit 32 of the touch panel 3, respectively. The RFID control unit 68 controls the first RFID reader / writer unit 5 and the second RFID reader / writer unit 18. The print output control unit 69 controls the print output unit 4 according to the user input received by the operation input unit 66. If the drug 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 drug data for drugs for which the discrimination unit 64 has determined that no corresponding drug data exists in the drug database 81. Specifically, for drugs for which the discrimination unit 64 has determined that no corresponding drug data exists, the registration unit 70 links the captured image 82 of the drug with the drug data identified by the user and registers it in the drug database 81.
[0034] The computer 60 also includes a storage unit 80. The storage unit 80 pre-stores a drug database (drug master) 81 for managing drug data for multiple types of drugs, and as sorting is performed by the drug sorting device 1, it stores captured images 82 and successful discrimination color data 83. The captured image 82 is an image captured by the first camera 131. The various data stored in the storage unit 80 do not necessarily have to be managed by the storage unit 80; for example, they may be managed by an external device. In this case, the control unit 60a may acquire the above various data from the external device via a communication line such as the Internet, as needed. The drug database may also be updated when new drug data is added.
[0035] [Overview of processing in drug sorting device 1] In the drug sorting device 1, the transport / sorting unit 12 transports each drug returned to the first storage unit 11 to the imaging unit 13. The imaging unit 13 sequentially images each transported drug. The control unit 60a identifies the type of drug based on the captured images and determines the sorting position of each identified drug in the second storage unit 14. The transport / sorting unit 12 transports each drug to the determined sorting position. Information about the drugs stored in the second storage unit 14 is written to the RFID tag of the sorting cup 141, stored in the memory unit 80, or displayed on the touch panel 3. Furthermore, after the sorting of drugs is completed, or during the sorting process, the user can operate the touch panel 3 to perform processes such as visual inspection and packaging. The following describes each process in detail.
[0036] [Drug delivery process to imaging unit 13] First, the drug transport process from the first storage unit 11 to the imaging unit 13 will be explained using Figures 1 and 2(a).
[0037] Specifically, the transport and sorting unit 12 transports the drug stored in the first storage section 11 to the receiving area Ar1 (see Figure 3(b)) where the imaging unit 13 accepts the drug. The transport control unit 61 controls this transport process by the transport and sorting unit 12.
[0038] The transport and sorting unit 12 includes a second camera 121, a suction and shutter mechanism 122, and a transport mechanism 123.
[0039] The second camera 121 sequentially images the first storage unit 11 in order to identify the drug to be transported. The imaging control unit 63 controls the imaging process of the second camera 121. The second camera 121 is provided at the end of the transport / sorting unit 12 (specifically, at least the housing including the suction / shutter mechanism 122) on the side facing the base 19. The second camera 121 may also be provided at the tip of the suction mechanism described later. The imaging control unit 63 analyzes the captured image to determine whether or not the image contains a drug. If the transport control unit 61 determines that a drug is contained, it brings the tip closer to the first storage unit 11, for example, and identifies the drug contained in the image captured at that time as the drug to be transported.
[0040] The adsorption / shutter mechanism 122 includes an adsorption mechanism for adsorbing a drug identified as the target for transport, and a shutter mechanism for preventing the drug adsorbed by the adsorption mechanism from falling. The adsorption mechanism is provided to be movable in the Z-axis direction. The shutter mechanism is provided in front of the above end and is provided to be movable substantially parallel to the XY plane.
[0041] The adsorption mechanism extends from the end when acquiring the drug, adsorbs the specified drug at its tip, and then returns to the position of the end. In this state, the transport control unit 61 moves the shutter mechanism to a position opposite the end and maintains the position of the shutter mechanism (closed) during drug transport. When the transport control unit 61 moves the adsorption / shutter mechanism 122 to a position opposite the drug placement platform 133a (see Figure 3(b)) of the drug holding mechanism 133 located in the receiving area Ar1, it moves the shutter mechanism to a position that does not face the end (opened). Then, after extending the adsorption mechanism from the end, the adsorption state is released and the drug is placed on the drug placement platform 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 drug to be transported on the first storage unit 11, or enables the transport of drugs from the first storage unit 11 to the drug placement table 133a. In addition, during the drug sorting process, it enables the transport of drugs from the drug placement table 133a to the second storage unit 14, the standby tray 15, or the recovery tray 16. During the drug 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 drugs placed in the receiving area Ar1 to a predetermined sorting cup 141 in the second storage unit 14 or the standby tray 15.
[0043] [Drug imaging processing] Next, the drug imaging process performed by the imaging unit 13 will be explained using Figures 1, 2(b), 3, and 4. Figures 3(a) and 3(b) are perspective views showing the overall configuration of the imaging unit 13, and Figure 3(c) is a perspective view showing an example of the drug placement stage 133a. Figures 4(a) and 4(b) are diagrams illustrating the rotation of the imaging unit 13. The drug imaging process described above is mainly performed by the imaging unit 13 and the imaging control unit 63.
[0044] Specifically, the imaging unit 13 is placed on the drug placement platform 133a and images the drug placed in the placement area Ar2 (imaging area) where the drug to be imaged is placed, as shown in Figure 3(b). The imaging control unit 63 controls the imaging process by the imaging unit 13, the rotational movement of the first camera 131 and the illuminator 134, and the movement of the drug holding mechanism 133. As shown in Figures 1 and 3, the imaging unit 13 includes a first camera 131 (imaging unit), a rotation mechanism 132 (rotating unit), a drug holding mechanism 133 (drug placement platform, moving mechanism), and an illuminator 134 (ultraviolet light irradiation unit, visible light irradiation unit).
[0045] The first camera 131 images the drug placed in the arrangement area Ar2 opposite to the first camera 131 in order to determine the type of drug in the discrimination unit 64 described later. The drug holding mechanism 133 is a mechanism for holding the drug, and as shown in Figures 3(a) and (b), it comprises a drug placement table (petri dish) 133a, a rotation mechanism 133b (movement mechanism), and a shaft portion 133c connecting the drug placement table 133a and the rotation mechanism 133b. The drug placement table 133a is on which the drug to be imaged is placed. The rotation mechanism 133b moves the drug placement table 133a, and specifically rotates the drug placement table 133a with respect to the XY plane and rotates the shaft portion 133c in the circumferential direction of the shaft portion 133c.
[0046] When the drug transported from the first storage unit 11 is placed on the drug placement platform 133a, the imaging control unit 63 drives the rotation mechanism 133b to move the drug placement platform 133a from the receiving area Ar1 to the placement area Ar2. Subsequently, it controls at least the first camera 131 and the illuminator 134 to image the drug placed in the placement area Ar2. The captured image is stored in the storage unit 80 as an image captured image 82. For example, after imaging is completed, the imaging control unit 63 drives the rotation mechanism 133b to move the drug placement platform 133a, on which the imaged drug is placed, from the placement area Ar2 to the receiving area Ar1.
[0047] In this embodiment, two drug placement tables 133a are provided at the tip (end) of the shaft portion 133c. The swivel mechanism 133b rotates the shaft portion 133c so that when one drug placement table 133a is placed in the placement area Ar2, the other drug placement table 133a is placed in the receiving area Ar1. When drug imaging is performed in the placement area Ar2, the transport and sorting unit 12 transports the drug from the first storage unit 11 to the drug placement table 133a located in the receiving area Ar1, thereby enabling continuous drug imaging processing. It is assumed that the drug placement table 133a is in a state where no drug is placed on it, such as after drug sorting processing to the second storage unit 14.
[0048] Furthermore, in this embodiment, the drug placement platform 133a is transparent. Therefore, the first camera 131 can image the drug placed on the drug placement platform 133a from multiple angles through the drug placement platform 133a.
[0049] Furthermore, as shown in Figure 3(c), the drug placement platform 133a may have a roughly V-shaped cross-section with a concave bottom. Also, as shown in Figures 3(b) and 4, when the drug placement platform 133a is positioned in the receiving area Ar1 and the placement area Ar2, the groove direction of the roughly V-shaped cross-section (the extension direction of the shaft portion 133c) is roughly parallel to the rotation axis Ay of the imaging mechanism (described later) by the rotation mechanism 132. Furthermore, the bottom of the drug placement platform 133a does not have to be a sharp V-shape. As shown in Figure 3(c), the bottom may comprise a bottom surface portion 133aa and inclined surfaces 133ab that are inclined from two opposing points on the bottom surface portion 133aa. The shape of the bottom only needs to be such that the information indicated by the drug's marking or print (marking information or printed information) can be recognized even when viewed (imaged) from the back side of the drug placement platform 133a, and that the drug is fixed in place.
[0050] If the drug is in the form of a capsule or a deformed tablet (e.g., rugby ball shaped), and the bottom of the drug mounting platform 133a is flat, the orientation of the drug may not be aligned on the XY plane, making it difficult to obtain a clear image of the drug (engraving or printed information). If the cross-section is roughly V-shaped, the capsule or deformed tablet can be fitted into the lowest end, and the drug can be fixed in place. This makes it easier to obtain a clear image of the drug. In the case of a tablet, for example, the shaft portion 133c can be rotated in the circumferential direction of the shaft portion 133c so that the flat portion (inclined surface portion 133ab) of the drug mounting platform 133a faces the first camera 131, thereby ensuring that the drug does not move.
[0051] In addition, the rotation mechanism 133b can also vibrate (move, shake) the drug placement platform 133a. In this case, for example, by vibrating and rolling a capsule placed on the drug placement platform 133a, the printed portion of the capsule can be made to face a predetermined direction (e.g., this portion can be made to face the first camera 131, which is positioned in the initial position described later). Furthermore, the above vibration can cause, for example, a cylindrical tablet (with a circular base) to be placed upright on the flat surface, to be tilted sideways (positioned so that the base of the tablet faces the flat surface).
[0052] The illuminator 134 emits light to irradiate the drug when imaging the drug, under the control of the imaging control unit 63. As shown in Figure 3(a), the illuminator 134 includes a visible light irradiation unit (first irradiation unit 134a and second irradiation unit 134b) that irradiates the drug with visible light, and an ultraviolet light irradiation unit 134c that irradiates the drug with ultraviolet light.
[0053] The first irradiation unit 134a and the second irradiation unit 134b irradiate the drug with white light as visible light. The first irradiation unit 134a is a bar-shaped visible light source (bar illumination), and the second irradiation unit 134b is a ring-shaped visible light source (ring illumination). The first camera 131 receives the visible light emitted from the first irradiation unit 134a or the second irradiation unit 134b and reflected by the drug, thereby acquiring an image based on visible light (visible light image). The imaging control unit 63 stores the image data showing the visible light image acquired by the first camera 131 as an image captured image 82 in the storage unit 80.
[0054] The ultraviolet light irradiation unit 134c irradiates the drug with ultraviolet light (e.g., light with a peak wavelength between 365 nm and 410 nm) to excite components contained in the drug. This extracts fluorescence (e.g., light with a peak wavelength between 410 nm and 800 nm) from the drug. The first camera 131 receives the fluorescence emitted from the drug and acquires an image based on ultraviolet light (ultraviolet light image). The imaging control unit 63 stores the image data showing the ultraviolet light image acquired by the first camera 131 as an image captured image 82 in the storage unit 80.
[0055] As shown in Figures 3 and 4, the rotation mechanism 132 rotates the first camera 131 so that it revolves around the placement area Ar2 (the drug placement platform 133a located at that position) where the drug to be imaged is placed. The first camera 131 images the drug placed in the placement area Ar2 from multiple positions rotated by the rotation mechanism 132. Specifically, the imaging mechanism, including the first camera 131 and the illuminator 134, is rotated so that it revolves around the placement area Ar2. Therefore, the first camera 131 can image the drug from multiple directions while maintaining the positional relationship between the first camera 131 and the illuminator 134 with respect to the placement area Ar2.
[0056] As shown in Figure 3(a), the rotation mechanism 132 includes an imaging mechanism drive unit 132a and a power transmission mechanism 132b. The imaging mechanism drive unit 132a generates power to rotate the imaging mechanism around the placement area Ar2. The power transmission mechanism 132b transmits the power generated by the imaging mechanism drive unit 132a to the imaging mechanism. The imaging mechanism drive unit 132a is driven by the control of the imaging control unit 63 to change the position of the imaging mechanism around the placement area Ar2.
[0057] The rotation mechanism 132 rotates the imaging mechanism between the initial position and the position opposite the initial position. The initial position is a position approximately perpendicular to the placement area Ar2 and above the placement area Ar2. The position opposite the initial position is a position approximately perpendicular to the placement area Ar2 and below the placement area Ar2. This position can also be described as the position where the first camera 131 faces the bottom of the drug placement platform 133a located in the placement area Ar2.
[0058] As shown in Figure 4, axis Ax0 is defined as the axis passing through the center of the placement area Ar2 and parallel to the Z-axis, and axis Ax1 is defined as the axis passing through the center of the placement area Ar2 and the center of the imaging mechanism. The angle between axis Ax0 and axis Ax1 is defined as θ. In this embodiment, the rotation mechanism 132 positions the imaging mechanism at one of the following positions: θ = 0° (initial position), 45°, 135°, and 180°. Figure 4(a) shows the case where the imaging mechanism is at the θ = 0° position, and Figure 4(b) shows the case where the imaging mechanism has rotated from the initial position to the θ = 45° position.
[0059] In this way, by rotating the imaging mechanism around the placement area Ar2, the drug can be imaged from multiple directions while remaining fixed in the placement area Ar2. Furthermore, even if the drug (tablet) remains upright when the drug placement platform 133a is shaken, information indicated by markings on the drug can be obtained by imaging from an oblique direction (θ=45° or 135°).
[0060] Alternatively, the imaging mechanism may be fixed and the drug rotated to image the drug from multiple directions.
[0061] (Image 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 image the drug placed in the placement area Ar2 at that 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, as well as 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 to a position opposite to the initial position and causes the first camera 131 to image the drug placed in the placement area Ar2 at that position, acquiring two visible light images and an ultraviolet light image. The discrimination unit 64 analyzes these six images to determine the type of drug. If the type of drug cannot be identified as a single type, the imaging control unit 63 emits visible light from the first irradiation unit 134a and the second irradiation unit 134b at positions θ=45° and 135°, causing the first camera 131 to image the drug. The discrimination unit 64 analyzes the visible light image at this time to determine the type of drug.
[0063] The above are not limited to various methods for controlling the position of the imaging mechanism. For example, imaging may be performed from a position opposite the initial position, and then from the initial position. Alternatively, drug identification processing may be performed based on the visible light image acquired from the position θ=45°, and only if the type of drug cannot be identified as a single entity, a visible light image acquired from the position θ=135° may be obtained. Alternatively, only ultraviolet light images may be acquired at the initial position and the position opposite the initial position, drug identification processing may be performed based on the ultraviolet light image, and then a visible light image at that position may be acquired. Alternatively, visible light and ultraviolet light images may be acquired at all positions.
[0064] [Image processing / discrimination processing] Next, the image processing performed on the image captured by the imaging unit 13 and the drug discrimination process based on the results of the image processing will be explained using Figure 1. The image processing is mainly performed by the imaging control unit 63, and the discrimination process is mainly performed by the discrimination unit 64.
[0065] The discrimination unit 64 determines the type of drug based on the drug image captured by the first camera 131. Specifically, the discrimination unit 64 determines the type of drug based on the imaging result (visible light image) of the drug when it is irradiated with visible light from the first irradiation unit 134a or the second irradiation unit 134b. In addition, the discrimination unit 64 determines the type of drug based on the imaging result (ultraviolet light image) of the drug when it is irradiated with ultraviolet light.
[0066] The discrimination unit 64 extracts the characteristics of the drug contained in the image by performing image analysis on the visible light image and / or ultraviolet light image, respectively. Examples of drug characteristics include size, shape, markings, prints, cleavage lines, and representative color (color of the area where the marking or print is applied). If OCR (Optical Character Recognition) is performed, the drug characteristics extracted may include the drug name (e.g., identification code) or manufacturer identification information (identification information that identifies the drug), and other information such as the expiration date, as indicated by the marking or print. In the case of an ultraviolet light image, the drug characteristics may include the representative color of the drug in the image. The discrimination unit 64 stores the information indicating the characteristics of each extracted drug in the storage unit 80, linked to the captured image 82 of the drug. Note that drug characteristic extraction may be performed by known techniques.
[0067] The characteristics of the extracted drug include the representative color of the drug in the image, as described above. Below, the data indicating this representative color will be referred to as color data (data indicating the color of the drug). Color data includes data generated from visible light images and data generated from ultraviolet light images. In the following explanation, unless otherwise specified, when simply referred to as "color data," it refers to both color data generated from visible light images and color data generated from ultraviolet light images. Color data is data indicating the color of a predetermined area in the image in which the drug is captured (at least a part of the area in which the drug is visible, typically the area with an imprint or print). For example, the average value of the RGB values of each pixel in that area may be used as color data.
[0068] The discrimination unit 64 identifies 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 candidate drug data related to the imaged drug from the drug database based on the color data. Then, the discrimination unit 64 performs type identification based on other characteristics according to the above ranking.
[0069] Furthermore, even if the drug characteristics (target characteristics) extracted using pattern matching or the like are not found in the drug database, the discrimination unit 64 will identify the drug as a suspected drug if it is estimated to be a drug (tablet or capsule) based on at least a part of the target characteristics. In this case, the suspected drug can also be sorted into the second storage unit 14 or the standby tray 15. In this embodiment, the suspected drug may be temporarily placed in the standby tray 15 first.
[0070] In this way, the discrimination unit 64 determines whether or not drug data corresponding to the captured image 82 captured by the first camera 131 exists in the drug data (drug database 81) for multiple types of drugs that have been registered in advance.
[0071] The discrimination unit 64 outputs the drug type discrimination result to the sorting control unit 62. For example, if the drug type can be identified as one, or if the number of candidates is narrowed down to a predetermined number, drug data related to that drug is output as the discrimination result. In this case, the discrimination unit 64 stores the drug data related to that drug in the storage unit 80, linked to the captured image 82 of that drug.
[0072] If the discrimination unit 64 determines that the drug is a suspected drug, it outputs the characteristics of the drug (characteristics of the item suspected to be a suspected drug) as the discrimination result. On the other hand, if the discrimination unit 64 determines that the drug is registered in the drug database as a drug to be discarded, or if it determines that the item stored in the first storage unit 11 is a foreign object other than a drug, it outputs as the discrimination result that the drug is not subject to sorting.
[0073] [Determination 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 drug. For example, the discrimination success / failure determination unit 65 may determine that the discrimination was successful if the discrimination unit 64 was able to uniquely identify the type of drug (i.e., narrow down the type of drug to one). Alternatively, the discrimination success / failure determination unit 65 may make the above determination based on the inspection results of the drugs sorted according to the determination results of the discrimination unit 64. Inspection may be performed by an inspector (e.g., a doctor or pharmacist) visually inspecting the sorted drugs themselves, or by displaying an image of the sorted drugs on, for example, the display unit 32 of the touch panel 3, and having the inspector visually inspect the displayed image. The inspection results may also be input to the computer 60 by, for example, the inspector operating the operation unit 31 of the touch panel 3.
[0074] Furthermore, if the discrimination success / failure determination unit 65 determines that the discrimination unit 64 has correctly made a discrimination, it links the various data used by the discrimination unit 64 for the discrimination with the type that the discrimination unit 64 has determined and stores it in the storage unit 80 as discrimination success data. In this embodiment, an example is described in which the discrimination success data is color data (discrimination success color data 83) generated by the discrimination unit 64 from the captured image 82 used 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, if the captured image 82 is used as the successful discrimination data, the amount of data to be stored in the storage unit 80 will increase, so it is preferable to have a configuration in which the successful discrimination color data 83 is stored as the successful discrimination data, as in this embodiment.
[0076] [How to update the drug database (master data) 81] The method for updating the drug database 81 will be explained based on Figure 5. Figure 5 is a diagram illustrating the method for updating the drug database 81. As will be explained below, the drug database 81 is updated by the master update unit 71.
[0077] The drug database 81 contains drug data for multiple types of drugs, each registered as master data for drug matching. Furthermore, as shown in Figure 5, the master data for each type of drug includes master color data, which represents the color of the drug, as one of the data points indicating the drug's characteristics. Specifically, in the drug database 81 shown in Figure 5, master color data 811a is registered as the master data for drug A. Similarly, master color data 811b and 811c are registered as the master data for drugs A and B, respectively. Note that the master color data includes data generated from both visible light images and ultraviolet light images.
[0078] Furthermore, as described above, the memory unit 80 stores the successful discrimination color data 83. In the example in Figure 5, the successful discrimination color data 83a to 83c are stored for drug A. In other words, in this example, it is assumed that the drug sorting device 1 has sorted an unknown drug as drug A, and that the type discrimination result in that sorting has been correct at least three times in the past. Similarly, in the example in Figure 5, the 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 drug database 81 (more specifically, the master color data included in the master data) by using the successfully identified color data 83 as new master color data. This update is performed for each type of drug. For example, in the example in Figure 5, master color data 811a to 811c are updated respectively.
[0080] In this case, if multiple successful discrimination color data 83 are associated with and stored for a single type of drug during the update, it is preferable for the master update unit 71 to use the most recent (most recently stored) successful discrimination color data 83 as the new master color data. This makes it possible to appropriately distinguish the type of drug even if the color of the drug in the captured image 82 changes due to changes in imaging conditions, etc. After adding the new master color data, the master color data 811a to 811c from before the update may be deleted (in other words, overwritten), or they may be kept in their stored state.
[0081] [How to calculate the color score] The discrimination unit 64 calculates a color score indicating the similarity between the target color data, which is color data generated from the captured image 82 (hereinafter referred to as the target image) of the drug to be sorted, and the master color data. Note that one target image includes both a visible light image and an ultraviolet light image. The formula for calculating the color score (similarity evaluation information) may be, for example, the following formula.
[0082] (Color score) = (Similarity of RGB values in a visible light image) × w1 + (Similarity of CIELab values in visible light images) × w² + (similarity of RGB values in ultraviolet light images) × 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 drug, the CIELab value based on an image of the drug captured in visible light may accurately reflect the color characteristics of that drug. In such a case, if w2 is relatively larger than the other weights, the calculated color score will be strongly influenced by the similarity of the CIELab value based on the visible light image that accurately reflects the color characteristics of the drug. 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 can be set as appropriate.
[0083] In the above calculation formula, the RGB value is a value that represents the color of a predetermined area (at least a part of the area where the drug is visible) in an image of the drug, expressed as a combination of R, G, and B values, and is typically the average value of the RGB values of each pixel included in that area. Furthermore, the RGB value similarity is the degree of similarity between the RGB values of the target image and the RGB values shown in the master color data. The method for calculating the RGB value similarity is not particularly limited. For example, the RGB values of the target image and the RGB values shown in the master color data may each be considered as three-dimensional vectors, and the distance between these two vectors may be used as the similarity. In the above calculation formula, the RGB value similarity and the CIELab value similarity are added, so these similarities should be normalized so that they are, for example, within a numerical range of 0 to 1.
[0084] Furthermore, the CIELab value in the above calculation formula is a value that represents the color of a predetermined area (at least a part of the area where the drug is visible) in an image of the drug, expressed 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 to a value in the XYZ color space, and then converting that value to a value in the CIELab color space. The similarity of CIELab values can be calculated in the same way as the similarity of RGB values described above.
[0085] [Ranking based on color score] The drug database 81 contains master color data for each type of drug. The discrimination unit 64 calculates a color score for each of these master color data in relation to the target color data as described above. The discrimination unit 64 then ranks the master data for each type of drug in descending order of the calculated color scores. After this, the discrimination unit 64 performs a comparison with the target image, starting with the highest-ranked master data. In other words, 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 drug, and then, in the order of these color scores, compares the information indicating the characteristics of the target image with the master data to determine the type of target drug. In the comparison, for example, the type of target drug is identified by comparing the marking information (information indicating the content of the drug's markings) contained in the master data with the marking information read from the target image by OCR, etc.
[0086] The reason for this ranking is that, generally, many drugs have similar colors. In other words, there may be multiple master color data sets with similar color scores to the target color data, and the drug with the highest color score in the master color data may be a different drug from the target drug. For this reason, it is generally difficult to uniquely identify the type of drug based solely on the color score.
[0087] Therefore, the discrimination unit 64 uses the color score to rank the data when comparing it with the master data. Since the color data can be generated by simple and quick information processing compared to reading marking information, the calculation and matching of the color score can also be done simply and quickly. Thus, by ranking the data using the color score, it becomes possible to complete the matching process in a shorter time compared to when matching with the master data is done without ranking. Furthermore, as will be explained below, the weight update unit 72 appropriately updates the weights in the color score calculation formula, so for example, if the target drug is drug A, the master color data for drug A is likely to have a higher rank. Thus, it becomes possible to complete the matching process with the master data in a shorter time.
[0088] [Method for updating weights in the color score calculation formula] Based on Figure 6, the method for updating the weights (w1~w4) in the color score calculation formula described above will be explained. Figure 6 is a diagram illustrating the method for updating the weights in the color score calculation formula. As explained below, the weight update in the color score calculation formula is performed by the weight update unit 72.
[0089] Multiple successful color data points 83 are used to update the weights. In the example in Figure 6, multiple successful color data points 83 are associated with each of the drugs A to Z. The weight update unit 72 uses these successful color data points 83 as training data and updates the weights in the color score calculation formula to the optimal values using stochastic gradient descent. By using stochastic gradient descent, it is expected that the system will move past suboptimal local optima and reach the optimal solution.
[0090] Specifically, first, the weight update unit 72 creates a predetermined number of mini-batch data from the successfully discriminated color data 83. In this creation, each mini-batch data is made to contain at least one successfully discriminated color data 83 for all types of drugs, and the number of successfully discriminated color data 83 included in each mini-batch data is made to fall within a predetermined range.
[0091] Figure 6 shows n mini-batch data sets B1 to Bn, each containing one successful discrimination color data 83 for each of the drugs A to Z. n can be determined based on the number of drug types registered in the drug database 81, the time elapsed since the last weight update, etc., and may be around 40, for example. Note that one successful discrimination color data 83 may be included in multiple mini-batch data sets.
[0092] Next, the weight update unit 72 updates the weights (w1~w4) using the created mini-batch data via stochastic gradient descent. 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, the master color data and the successful discrimination color data 83 for each type of drug can be calculated, and the determination can be made based on the ranking of those color scores.
[0093] For example, in the example in Figure 6, master color data is registered for 26 types of drugs, A to Z. The mini-batch data Bn contains the successful discrimination color data 83b for drug A. When updating the weights using this mini-batch data Bn, the weights should be updated so that the rank of the color score calculated for the master color data and the successful discrimination color data 83b for drug A is higher. The specific calculation details will be explained below, but in this update, the visible light RGB value weight (w1) is increased by +scale. +scale is the amount of change in the weight (a positive number). Similarly, the other weights (w2 to w4) are also increased by +scale. In this way, stochastic gradient descent performs calculations to search for the optimal weights by changing each weight by a predetermined amount of change (+scale).
[0094] Specifically, the above calculation uses gradient averaging. Gradient averaging can be calculated, for example, using the following formula. In the formula below, Z is the number of successfully classified color data 83 contained in one mini-batch data. Also, Σ represents the sum of the first to the Zth successfully classified color data 83 in one mini-batch data. The average rank is the average value obtained by averaging the ranks calculated from the successfully classified color data 83 contained in each mini-batch data across all mini-batch data. The ranking method is as described above in "Ranking by Color Score," so it will not be explained again.
[0095] (Gradient average) = {Σ(Average rank after weight shift - Average rank before weight shift) / Change in weight} / Z The weight update unit 72 then updates the weights using the following formula. The learning rate can be set as appropriate.
[0096] (Updated weights) = (Current weights) - (Learning rate × Gradient mean) [Process flow for storing the successfully identified color data 83] The process flow for storing the successfully identified color data 83 will be explained based on Figure 7. Figure 7 is a flowchart showing an example of the process for storing the successfully identified color data 83. Note that Figure 7 shows the process flow after imaging of an unknown target drug has been performed and the captured image 82 has been stored in the storage unit 80.
[0097] First, the discrimination unit 64 generates target color data from the target image (S1). Next, the discrimination unit 64 calculates a color score indicating the similarity between the target color data generated in S1 and the master color data registered in the drug database 81 (S2). Then, the discrimination unit 64 sets the matching order with the master data in descending order of the color scores calculated in S2 (S3), performs matching in that order (S4), and determines the type of target drug (S5).
[0098] Next, upon confirming that the type of target drug was successfully identified in S5, the identification success / failure determination unit 65 stores the target color data generated in S1 in the storage unit 80 as the successfully identified color data 83 for the type of drug identified in S5, and the process shown in Figure 7 is completed.
[0099] [Process flow for updating drug database 81] The process for updating the drug database 81 will be explained based on Figure 8. Figure 8 is a flowchart showing an example of the process for updating the drug database 81.
[0100] First, the master update unit 71 determines whether or not to update the drug database 81, or more specifically, whether or not to update the master color data contained in the drug database 81 (S11). The conditions for updating the master color data are not particularly limited. For example, it may be updated when the computer 60 finishes operating (for example, at the end of the day). Alternatively, for example, a message asking whether or not an update is necessary may be presented to the user at predetermined intervals (for example, every day), and the master color data may be updated when the user inputs a response to that message indicating that an update is necessary. Furthermore, conditions may include, for example, that the average processing time for type discrimination over the past few times (the time from imaging until the discrimination result is obtained) is greater than or equal to a predetermined time, or that the frequency of imaging retries is greater than or equal to a threshold (the frequency of type discrimination failures is greater than or equal to a threshold). In addition to these, for example, the master color data may be updated on the condition that a predetermined period (for example, 30 days) has elapsed since the last update.
[0101] In S12, the master update unit 71 retrieves the most recent (most recently stored) successful discrimination color data 83 from the storage unit 80. Then, in S13, the master update unit 71 adds the successful discrimination color data 83 retrieved in S12 to the drug database 81 as new master color data. This completes the process shown in Figure 8. Note that the processes in S12 and S13 only need to be performed for at least one type of drug; for example, they may be performed for all types of drugs registered in the drug database 81, or for some types of drugs.
[0102] In this way, the discrimination unit 64 compares the information indicating the appearance characteristics of the target drug, generated from the target image, with the master data, and determines the type of the target drug based on the result of the comparison (S5 in Figure 7). Then, when the discrimination unit 64 successfully determines the type of the target drug, the master update unit 71 uses the successful discrimination color data 83 used for the discrimination as the new master color data (S13 in Figure 8).
[0103] Therefore, with the drug sorting device 1, even if the target image obtained by imaging the target drug changes from what was assumed when the master data was created, the type can be appropriately identified. This means that, for example, when the drug sorting device 1 is introduced to a pharmacy, the default master data can be updated to match the imaging conditions at that 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 drug sorting device 1, the ability to appropriately identify the type can be maintained.
[0104] [Process flow for updating weights in the color score calculation formula] The process for updating the weights in the color score calculation formula will be explained based on Figure 9. Figure 9 is a flowchart showing an example of the process for updating the weights in the color score calculation formula. Note that the conditions for performing the process in Figure 9 are not particularly limited. For example, if the drug sorting device 1 presents a message to the user asking whether a date and time update is necessary, and the user responds to that message by indicating that they will perform a date and time update, the process in Figure 9 may be started before the date and time update is performed. Note that the date and time update will be performed as soon as the process in Figure 9 is completed. Alternatively, the process in Figure 9 may be started based on the condition that a predetermined period (e.g., 30 days) has elapsed since the last weight update, or based on the condition that a predetermined number of successfully identified color data 83 have been accumulated. Furthermore, when the master color data is updated, the current weights may not be appropriate for the updated master color data, so the process in Figure 9 may be started based 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 memory unit 80 (S21). For example, if the predetermined period is 30 days, the weight update unit 72 acquires all the successfully discriminated color data 83 stored for the most recent 30 days. Then, the weight update unit 72 creates mini-batch data from the successfully discriminated color data 83 acquired in S21 (S22), and uses the created mini-batch data to optimize the weights in the color score calculation formula (S23).
[0106] Furthermore, 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 rather than the updated weight values. This makes it less likely that the optimized weight values will deviate significantly from the initial weight values, thus enabling stable optimization.
[0107] Next, the weight update unit 72 determines whether the weight calculated in S23 (optimized weight) is a more accurate value than the current weight (or the weight after the most recent update if an update has been performed in the past) (S24). The accuracy of the weight can 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 a color score for some or all of the successfully identified color data 83 acquired in S21, determine the rank of the color scores, and determine whether the weight is a highly accurate value based on whether the average rank is high or low. The rank of the color score is the rank of the color score calculated using the successfully identified color data 83 of a certain drug and the master color data of each type of drug, among the color scores calculated using the successfully identified 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 values are highly accurate (YES in S24), the process proceeds to S25, and the weight update unit 72 applies the weights calculated in S23 instead of the current weights. As a result, the updated weights are used in subsequent sorting. On the other hand, if it is determined that the values are not highly accurate (NO in S24), the process in Figure 9 ends. In other words, in this case, the weights are not updated, and the current weights continue to be used in subsequent sorting.
[0109] As described above, the weight update unit 72 acquires multiple 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, with the drug sorting device 1, even if the target image obtained by imaging the target drug changes from what was assumed when the master data was created, or even after the master color data has been updated, the type can be appropriately determined based on an appropriate color score calculated using appropriate weight values.
[0110] [Variation] In the above embodiment, an example was shown where weights are updated using stochastic gradient descent with minibatches, but other algorithms can also be applied to update the weights. For example, stochastic gradient descent without minibatches may be used, or if there is no need to consider local minima problems, ordinary gradient descent may be used. Furthermore, optimization algorithms other than gradient descent can also be applied.
[0111] Furthermore, at least one of the drug database 81 update process or the weight update process may be performed by an external information processing device (computer) of the drug sorting device 1. In this case, by keeping the information processing device in a state where it can communicate with the drug sorting device 1, the information processing device can update the drug database 81 used by the drug sorting device 1 and the weights in the color score calculation formula.
[0112] [Embodiment 2] Other embodiments of the present invention are described below. For the sake of clarity, components having the same function as those described in the above embodiments will be denoted by the same reference numerals, and their descriptions will not be repeated.
[0113] [Configuration of the drug sorting device] Figure 10 is a block diagram showing an example of the main components of the control unit 60b included in the drug sorting device 1 according to this embodiment. Although Figure 10 mainly illustrates the configuration characteristic of this embodiment, the control unit 60b may also include other blocks included in the control unit 60a shown in Figure 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 numbered from 741-1 to 741-n, where n is an integer greater than or equal to 2. When it is not necessary to distinguish between the classifiers, they are simply referred to as classifier 741.
[0115] Similar to the drug sorting device 1 of Embodiment 1, the drug sorting device 1 of this embodiment also determines the type of target drug from an image captured of the target drug of unknown type. This determination is performed by the discrimination unit 64, as in Embodiment 1. In this embodiment, one of the determination materials of the discrimination unit 64 is whether or not the mark of the target drug matches the registered mark registered in the master data for drug verification, which is determined using multiple classifiers 741.
[0116] More specifically, the mark detection unit 73 detects marks formed on the target drug from the captured image. Next, the similarity determination unit 74 uses multiple classifiers 741 to determine the similarity between the detected marks detected by the mark detection unit 73 and the registered marks registered in the master data for drug matching. Then, the match determination unit 75 determines whether the detected marks and the registered marks match based on the results of the determinations made by each classifier 741.
[0117] According to the above configuration, the detection mark and the registration mark are determined to match based on the similarity determination results from multiple classifiers 741. Therefore, it is possible to improve the accuracy of mark matching determination. Furthermore, the discrimination unit 64 determines the type of target drug based on the determination result of the mark detection unit 73, so it is possible to improve the accuracy of target drug type determination by accurately considering the marks.
[0118] Generally, marks formed on pharmaceuticals are difficult to identify using OCR (optical character reader) or similar methods due to the wide variety of shapes they can exhibit. Furthermore, when marks are formed by engraving the surface of the pharmaceutical, the way the marks appear in the captured image changes depending on how light hits the pharmaceutical during imaging, making it difficult to improve the accuracy of matching. However, with the above configuration, it is possible to perform highly accurate matching even for marks formed by engraving the surface of pharmaceuticals.
[0119] [Configuration of the information processing device] The similarity determination unit 74 and the match determination unit 75 described above are constructed by the information processing device 100. Here, the configuration of the information processing device 100 will be explained based on Figure 11. Figure 11 is a block diagram showing an example of the main components of the information processing device 100.
[0120] The information processing device 100 includes a control unit 110 that comprehensively controls each part 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 receives input to the information processing device 100, and an output unit 140 for the information processing device 100 to output data.
[0121] The control unit 110 includes a classifier group generation unit 111, a judgment area setting unit 112, a similarity determination unit 113, an evaluation unit 114, a selection unit 115, a weight setting unit 116, a confidence calculation unit 117, and a classifier construction unit 118. The storage unit 150 stores a classifier DB (database) 151, a registration mark DB 152, and a learning DB 153.
[0122] The classifier group generation unit 111 generates a group of classifiers that the similarity determination unit 113 uses to determine similarity. Specifically, the classifier group generation unit 111 generates a group of N classifiers, from 1131-1 to 1131-N, by increasing the variations in the thresholds used for similarity determination by the classifiers stored in the classifier DB 151. The similarity determination unit 113 is composed of this group of classifiers. N is an integer of 2 or greater. When it is not necessary to distinguish between each classifier, they are simply referred to as classifier 1131.
[0123] The determination area setting unit 112 divides the area in the captured image where the detection marks are visible and sets multiple determination areas for which the similarity determination unit 113 will perform similarity determination. The setting of the determination areas will be described later based on Figure 12.
[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 the registered marks in the registered mark images stored in the registered mark DB 152 and the marks in each test image included in the training 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 based on Figure 12.
[0125] The evaluation unit 114 evaluates the similarity determination results of each classifier 1131 included in the similarity determination unit 113. The evaluation method only needs to be able to calculate an evaluation value corresponding to the similarity determination accuracy of each classifier 1131. In this embodiment, an example is described in which the evaluation unit 114 calculates the error rate of each classifier 1131. The error rate is a numerical value that shows the ratio of the number of times the determination result was incorrect to the total number of times similarity determination was performed, and the lower the error rate, the higher the similarity determination accuracy.
[0126] The selection unit 115 selects multiple classifiers from the classifier group generated by the classifier group generation unit 111, i.e., the classifiers 1131 included in the similarity determination unit 113, based on the similarity determination accuracy evaluated by the evaluation unit 114. In this selection, the selection unit 115 also considers the weights set by the weight setting unit 116.
[0127] The weight setting unit 116 sets weights for each test image that is subject to similarity determination by each classifier 1131. The method for setting weights and the method for selecting classifiers that take weights into consideration will be described later based on Figure 14.
[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 matching determination by the drug sorting device 1. The method for calculating the reliability will also be described later.
[0129] The identifier construction unit 118 constructs an identifier using multiple identifiers selected by the selection unit 115 to determine whether the detection mark and the registration mark match. The drug sorting device 1 then performs the matching determination using the identifier constructed by the identifier construction unit 118.
[0130] The classifier DB151 stores classifiers that determine the similarity between detection marks detected from drug imaging images and registration marks registered in the master data for drug matching. As described above, the classifier group generation unit 111 increases the variation of thresholds of the classifiers stored in the classifier DB151, thereby generating a group of classifiers that are subject to selection by the selection unit 115. For this reason, it is sufficient for the classifier DB151 to store at least one type of classifier. However, it is preferable to store multiple types of classifiers, as this allows for the construction of a classifier with higher judgment accuracy, consisting of classifiers selected from multiple types of classifiers. Specific examples of classifiers stored in the classifier DB151 will be described later.
[0131] The registration mark DB152 stores registration mark images, which are images showing the registration marks that are registered as master data for drug matching in the drug database 81 of Embodiment 1. The registration mark images may also be generated by cutting out the portion showing the marks from the master image 812 stored in the drug database 81.
[0132] As mentioned above, the training DB153 stores test images used to evaluate the similarity determination accuracy of each classifier 1131. Details of the test images will be described later based on Figure 12.
[0133] As described above, the information processing device 100 includes a selection unit 115 that selects a plurality of classifiers from among classifiers 1131-1 to 1131-N that determine the similarity between a detection mark detected from an captured image and a registered mark, based on the accuracy of the similarity determination. The information processing device 100 also includes a classifier construction unit 118 that constructs a classifier for determining whether a detection mark and a registered mark match using the plurality of classifiers selected by the selection unit 115.
[0134] According to the above configuration, a classifier can be constructed to determine whether a detected mark and a registered mark match based on the judgment results of multiple classifiers selected based on the accuracy of similarity determination. The drug sorting device 1 of this embodiment can then use the classifier constructed in this way to perform mark matching determination with high accuracy, and can also perform identification of the type of target drug based on the determination result with high accuracy.
[0135] [Setting the judgment area] Figure 12 shows an example of setting judgment regions. More specifically, Figure 12 shows an example in which a registration mark image 1521, which is the master data of the registration mark, is generated from the master image 812, and M judgment regions from A2-1 to A2-M are set in this registration mark image 1521.
[0136] In the master image 812 shown in Figure 12, a tablet T1 is visible, along with a mark T11 and a number T12 on the surface of the tablet T1. The registration mark image 1521 is generated by detecting the area A1 in which the mark is visible from such a master image 812 and cutting out this portion. The cut-out image may be used as the registration mark image 1521 as is, or it may be processed by enlarging or reducing it to a predetermined size before being used as the registration mark image 1521. The registration mark image 1521 is stored in the registration mark DB 152.
[0137] The judgment area setting unit 112 sets multiple judgment areas in the registered mark image 1521. In the example in Figure 12, M judgment areas from A2-1 to A2-M are set. M is an integer of 2 or more. When it is not necessary to distinguish between each judgment area, it is simply written as judgment area A2.
[0138] The determination area setting unit 112 preferably sets the determination areas such that the entire image area of the registered mark image 1521 is included in at least one of the determination areas A2. Alternatively, the determination area setting unit 112 may set the determination areas so that they partially overlap, as shown in the example of determination areas A2-1 and A2-2 in Figure 12. Furthermore, the determination area setting unit 112 may set determination areas of different sizes, such as determination areas A2-1 and A2-M, or determination areas of different shapes.
[0139] The number of determination areas 2A and the size of each determination area 2A are not particularly limited. However, it is preferable that the size and number of determination areas 2A be such that they do not interfere with the similarity determination by the classifier 1131, that is, that the size and number of determination areas 2A be such that the characteristics of the mark are visible in each determination area 2A. As an example, the determination area setting unit 112 may set several hundred determination areas A2.
[0140] The determination area setting unit 112 may automatically set the determination area 2A. For example, the determination area setting unit 112 may set multiple determination areas 2A that cover the entire image area of the registered mark image 1521 by shifting a predetermined distance in a predetermined direction for each determination area 2A of a predetermined size. Alternatively, the determination area setting unit 112 may set each determination area 2A according to user input via the input unit 130, for example.
[0141] Furthermore, the judgment area setting unit 112 sets the same judgment area A2 for the test image as it does for the registered mark image 1521. The test image is an image that is subject to similarity determination with the registered mark image 1521 and is stored in the learning DB 153.
[0142] The test images stored in the training DB153 include multiple test images 1531 that show the same mark as the registered mark image 1521, and multiple test images 1532 that show a different mark than the registered mark image 1521. It is preferable to prepare as many variations as possible for test images 1531 and 1532, ranging from those where similarity is easy to determine to those where it is difficult. This makes it possible to determine the match of marks for a variety of drug images with high accuracy.
[0143] The similarity determination unit 113 determines the similarity between the registered mark image 1521 and the test image for each of the determination regions set as described above. Specifically, the similarity determination unit 113 determines the similarity between determination region A2-1 of the registered mark image 1521 and determination region A2-1 of the test image 1531. The similarity determination unit 113 also performs the same determination for the test image 1532. Then, the similarity determination unit 113 similarly determines the similarity between the registered mark image 1521 and the test image 1531, and between the registered mark image 1521 and the test image 1532, for determination regions A2-2 to A2-M.
[0144] The selection unit 115 then selects multiple classifiers based on the similarity determination accuracy in each of the multiple determination areas. This selects classifiers with high determination accuracy in each determination area, and a classifier for determining the match of marks is constructed using these selected classifiers. With the classifier constructed in this way, for example, determination areas where the shape characteristics of the mark are expressed are determined by a classifier with high shape determination accuracy, and determination areas where the color characteristics of the mark are expressed are determined by a classifier with high color determination accuracy, thus enabling appropriate determination.
[0145] Furthermore, the similarity determination unit 74 of the drug sorting device 1, which uses the classifier constructed in this manner, performs similarity determination for each of the multiple determination regions, which are defined by dividing the area in the captured image where the detection mark is visible, using a classifier corresponding to that determination region. This makes it possible to perform highly accurate determination that takes into account the differences between regions.
[0146] [Identifier to be used] As described above, the similarity determination unit 74 of the drug sorting device 1 determines similarity using multiple classifiers 741. This similarity determination unit 74 may also determine the similarity between the detection mark and the registration mark using multiple types of classifiers with different similarity determination methods. With this configuration, since the matching of marks is determined by considering multiple determination methods, it is possible to improve the accuracy of the determination compared to when similarity is determined using only one type of determination method.
[0147] Furthermore, when using multiple types of classifiers, it is preferable that these classifiers include a classifier that determines color similarity and a classifier that determines shape similarity. With this configuration, the accuracy of the determination can be improved because the matching of marks is determined by considering both color similarity and shape similarity.
[0148] Here, the classifier 741 is selected from among 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 underlying classifiers, including a classifier that determines color similarity and a classifier that determines shape similarity, the above-mentioned effects can be expected in the drug sorting device 1.
[0150] Furthermore, while it is difficult to determine the similarity of some drugs based on color, the accuracy of the color-based classifier for such drugs will be low, making it difficult to select such classifiers. Therefore, even if a color-based classifier is included in classifier DB151, it is possible to avoid using the color-based classifier to determine the similarity of drugs for which color-based similarity is difficult.
[0151] As a classifier for determining similarity in shape, for example, one can use a classifier that calculates a value for the images to be judged as described below, and then compares the calculated value with a predetermined threshold to determine whether they are similar or dissimilar.
[0152] (1) Distance of HOG (Histograms of Oriented Gradients) features (2) Distance of hash values calculated using the Average Hash method (3) Distance of hash values calculated using 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) transformation (5) Similarity of features obtained by sharpened image feature point extraction (ORB: Oriented FAST and Rotated BRIEF) (6) Similarity of features obtained from Sobel-filtered images using the AKAZE feature extraction algorithm. (7) Similarity of features obtained from gradient filtered images using the AKAZE 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 that has been trained to output feature vectors of numbers, etc. from images containing numbers, etc. Furthermore, as a classifier for determining color similarity, for example, one can use a classifier that calculates the average color distance of an HSV-converted image and compares the calculated value with a predetermined threshold to determine whether the images are similar or dissimilar.
[0153] [Differences in similarity detection accuracy due to differences in thresholds] As described above, the classifier group generation unit 111 generates a group of classifiers with different thresholds. Here, the difference in similarity determination accuracy due to the difference in thresholds will be explained based on Figure 13. Figure 13 shows an example in which a difference in similarity determination accuracy occurs due to a difference in thresholds.
[0154] In this example, the similarity between region A2 in the registered mark image 1521 and the same region 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, which is the first classifier with a larger threshold value. The test images include test images A to C that show the same mark as the mark shown in the registered mark image 1521, and test images a to c that show different marks.
[0155] The first and second classifiers are the same classifier, differing only in their similarity and dissimilarity thresholds. Therefore, the similarity scores calculated by these classifiers for the registered mark image 1521 and the test image are the same. In the example in Figure 13, test image A has the highest similarity to registered mark image 1521, followed by test images B, a, b, C, and c in descending order of similarity.
[0156] The first and second classifiers output a judgment result indicating similarity if the calculated similarity score is above a threshold, and dissimilarity if it is below the threshold. In this example, the first classifier's judgment result indicates that test images A, B, a, and b are similar to registered mark image 1521, while test images C and c are not similar to registered mark image 1521. Of these six results, the judgment results for test images a, b, and C are misclassifications, so the error rate of the first classifier is 3 / 6.
[0157] On the other hand, the second classifier's judgment results indicate that test images A, B, and a are similar to registered mark image 1521, while test images b, C, and c are not similar to registered mark image 1521. Of these six results, the judgment results for test images a and C are misclassifications, so the error rate of the second classifier is 2 / 6.
[0158] Even with classifiers that calculate the same similarity value, such as the first and second classifiers, the accuracy of the similarity determination can change if the threshold value used for similarity determination is changed. Therefore, by increasing the variations in the threshold used for similarity determination, it is possible to generate a group of classifiers that include classifiers suitable for determining the similarity of the registered mark image 1521.
[0159] The method by which the classifier group generation unit 111 determines the threshold value to be set for each classifier, and the number of threshold variations, are not particularly limited. Increasing the number of variations increases the likelihood of constructing a classifier group that includes a classifier with the optimal threshold, but it also increases the amount of computation required to construct the final classifier. Therefore, the method for determining the threshold value and the number of threshold variations should be set based on the acceptable amount of computation and the required judgment accuracy. For example, the classifier group generation unit 111 may set each value that divides the range of output values of each classifier into multiple equal parts as a threshold. For example, the classifier group generation unit 111 may set nine values that divide the range of output values into 10 equal parts as thresholds. This allows one classifier to have nine variations.
[0160] [Process flow for constructing a classifier] Based on Figures 14 and 15, the flow of the process (information processing method) by which the information processing device 100 constructs a classifier will be explained. Figure 14 is a flowchart showing an example of the process of constructing a classifier. Figure 15 is a diagram showing a specific example of the process of constructing a classifier.
[0161] Before starting the process shown in Figure 14, the classifier group generation unit 111 generates a group of classifiers by increasing the variations in the threshold values of the classifiers stored in the classifier DB 151. The determination area setting unit 112 also sets the determination area.
[0162] Regarding the above group of classifiers, in the example shown in Figure 15, the classifier group generation unit 111 generates a group of classifiers containing N classifiers, from classifier 1131-1 to 1131-N, by increasing the variations in the thresholds of the m types of classifiers (where m is a natural number) stored in the classifier DB 151.
[0163] In the example shown in Figure 15, the determination area setting unit 112 sets M determination areas from A2-1 to A2-M. As described above, determination areas 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] In S31 of Figure 14, the similarity determination unit 113 uses each of the classifiers included in the classifier group generated by the classifier group generation unit 111 to determine the similarity between the registration marks stored in the registration mark DB 152 and the test images 1531 and 1532 stored in the training 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 in Figure 15, since M judgment regions are set, one classifier performs judgment M times per test image. Also, since there are a total of N classifiers, a total of M × N judgments are performed per test image.
[0166] In S32, the evaluation unit 114 evaluates the accuracy of each judgment made in S31. As described above, the evaluation unit 114 may evaluate the accuracy by calculating the error rate. In addition, the weights set by the weight setting unit 116 for each test image are taken into consideration in this evaluation. As will be explained below, the processes in S32 to S36 are repeated a predetermined number of times, but in the first evaluation, the weights of each test image are set to their initial values (the weights of all test images are the same).
[0167] In S33, the selection unit 115 selects a classifier from among the classifiers evaluated in S32 based on the results of that evaluation. For example, the selection unit 115 may select the classifier with the lowest error rate. At this time, the selection unit 115 associates the selected classifier with the determination area of that classifier.
[0168] In S34, the confidence calculation unit 117 calculates the confidence level of the classifier selected in S33. For example, the confidence calculation unit 117 may calculate the confidence level using the following formula. In the following formula, "ln" is log e That is the case.
[0169] (Confidence level) = 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 repetitions of the processes in S32 to S36 has reached a predetermined number, and determine that learning has not been completed if the predetermined number of repetitions has not been reached. If it is determined in S35 that learning has been completed (YES in S35), the process proceeds to S37; 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. In this update, the weight setting unit 116 updates the weights of the test images that were misclassified by the classifier selected in the most recent S33 process to be greater than the weights of the test images that were correctly classified by the same classifier.
[0171] After S36, the process returns to S32, where the evaluation unit 114 re-evaluates the accuracy of each judgment made in S31 using the updated weights. In this re-evaluation, the weights of the test images that were misclassified by the classifiers selected in the most recent S33 process have become relatively larger, so the evaluation of classifiers with high accuracy in judging these test images becomes relatively higher.
[0172] Therefore, in the subsequent S33, classifiers with high accuracy in classifying test images that were misclassified by the previously selected classifier are more likely to be selected. Through this iterative process, classifiers that complement each other's shortcomings can be selected sequentially.
[0173] In S37, the classifier construction unit 118 constructs a classifier to determine whether the detection mark and the registration mark match, using the classifiers selected through the previous iterative processing. For example, the classifier construction unit 118 may construct a classifier that outputs a value obtained by summing the output values of the selected classifiers, weighted by the confidence level of the classifier (hereinafter referred to as the degree of agreement), for all selected classifiers.
[0174] Furthermore, the classifier construction unit 118 sets a threshold for the degree of agreement. The threshold should be set so that the judgment accuracy of the constructed classifier is at least equal to or greater than the acceptable lower limit. For example, the classifier construction unit 118 may obtain the degree of agreement between the registered marks in the registered mark image and the marks in the multiple test images 1531 and 1532, calculated by the constructed classifier. The classifier construction unit 118 may then calculate the standard deviation σ of the degree of agreement from the mean and variance of the obtained degree of agreement, and set the threshold based on this standard deviation σ. For example, the classifier construction unit 118 may set the threshold to 5σ if the misjudgment rate of the constructed classifier is equal to or greater than the acceptable lower limit when the threshold is set to 5σ.
[0175] The process shown in the diagram is completed once the classifier is constructed. The classifier constructed in S37 may be stored in the storage unit 150 or output to the output unit 140. Furthermore, if the information processing device 100 and the drug sorting device 1 are equipped with a communication function, the information processing device 100 may transmit the constructed classifier to the drug sorting device 1 using this communication function.
[0176] The multiple classifiers 741 included in the similarity determination unit 74 of the drug sorting device 1 are, as described above, classifiers selected based on the accuracy of similarity determination for a group of test images including images of the registered mark and images of other marks. With this configuration, since the matching of marks is determined based on the similarity determination results by classifiers selected based on the similarity determination accuracy for the group of test images, it becomes possible to perform highly accurate determination.
[0177] [Flowchart of the mark matching determination process using the constructed classifier] Based on Figures 16 and 17, the flow of the mark matching determination process (determination method) by the drug sorting device 1 using the classifier constructed as described above will be explained. Figure 16 is a flowchart of an example of the mark matching determination process. Figure 17 is a diagram showing a specific example of mark matching determination.
[0178] In S41, the mark detection unit 73 detects a mark formed on the target drug from the captured image 82 of the target drug. In the example in Figure 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 the rectangular area A1 containing the detected mark T11 from the captured image 82, resizes it to a predetermined size, and generates a mark image 84. 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 using a plurality of classifiers 741. In the example in Figure 17, the similarity determination unit 74 uses classifiers 741-1 to 741-m to determine the similarity between the detection mark shown in the mark image 84 and the registered mark shown in the registered mark image 1521.
[0180] This determination is performed for each determination area A2 associated with each classifier 741. For example, suppose the determination area associated with classifier 741-1 is A2-1, and the determination area associated with classifier 741-2 is A2-5. In this case, the determination using classifier 741-1 is performed for determination area A2-1, and the determination using classifier 741-2 is performed for determination area A2-5.
[0181] In S43, the matching unit 75 calculates a judgment score based on the judgment result in S42. In the example in Figure 17, each classifier 741 outputs either "1", indicating similarity, or "-1", indicating dissimilarity. The matching unit 75 then calculates a judgment score by multiplying the above judgment results by the confidence level of the classifier 741 that performed the judgment and adding them together.
[0182] In S44, the matching determination unit 75 determines whether the detection mark detected in S41 matches the registered mark based on whether the determination score calculated in S43 is above a threshold. In this way, the matching determination unit 75 weights the determination results of each classifier 741 according to the confidence level of each classifier 741 and then determines whether the detection mark matches the registered mark. This makes it possible to reflect the confidence level of each classifier 741 in the mark matching determination, thus enabling highly accurate determination.
[0183] Finally, in S45, the matching determination unit 75 outputs the determination result of S45 to the discrimination unit 64, and the process in Figure 16 ends. If the determination result in S44 is that there is no match, the registration mark of the item to be judged for similarity may be changed and the process in S42 to S44 may be repeated. These processes may be repeated until the determination result in S44 is that there is a match.
[0184] After the processing shown in Figure 16 is completed, the discrimination unit 64, having received the judgment result in S45, determines the type of target drug based on the judgment result from the mark detection unit 73 and other detection results and judgment results such as the color, shape, and number of the target drug.
[0185] [Examples of implementation using software] The control block of the drug sorting device 1 (in particular, the parts included in the control units 60a and 60b) may be implemented by logic circuits (hardware) formed on an integrated circuit (IC chip) or by software.
[0186] In the latter case, the drug sorting device 1 is equipped with a computer that executes instructions for a program, which is software that realizes each function. This computer is equipped with, for example, one or more processors and a computer-readable recording medium that stores the program. The object of the present invention is achieved when the processor reads the program from the recording medium and executes it in the computer. For example, a CPU (Central Processing Unit) can be used as the processor. As the recording medium, a "tangible medium that is not temporary," such as ROM (Read Only Memory), can be used, as well as tape, disk, card, semiconductor memory, programmable logic circuit, etc. It may also be further equipped with RAM (Random Access Memory) for deploying the program. Furthermore, the program may be supplied to the computer via any transmission medium capable of transmitting the program (such as a communication network or broadcast wave). In one aspect of the present invention, the program can also be realized in the form of a data signal embedded in a carrier wave, which is embodied by electronic transmission.
[0187] Similarly, the control blocks of the information processing device 100 (particularly the parts included in the control unit 110) may be implemented by logic circuits (hardware) formed on an integrated circuit (IC chip) or the like. These control blocks may also be implemented by software as described above.
[0188] [Additional Notes] The present invention is not limited to the embodiments described above, 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. Chemical sorting device 60. Computer (Type Identification Device) 64 Discrimination part 71 Master Update Department 72. Weight update unit (evaluation information update unit) 81 Drug Database 82 Acquired Images 811a, 811b Master Color Data 73 Mark detection unit 74 Similarity Judgment Unit 741 Classifier 75 Match determination section 100 Information Processing Devices 115 Selected Team 118 Identifier Construction Section
Claims
1. A method for determining the type of a target drug from an image of the target drug of unknown type, performed by a type determination device, The steps include acquiring the aforementioned captured image, The process includes outputting a determination result indicating whether the detection mark, which is a mark formed on the target drug detected from the captured image, matches the registration mark registered in the master data for drug matching, based on the results of determination by a plurality of classifiers corresponding to each of a plurality of determination regions that divide the area of the captured image in which the detection mark is visible. A discrimination method characterized in that the plurality of classifiers are classifiers selected based on the accuracy of similarity determination for a set of test images including images of the registered mark and images of other marks.
2. The discrimination method according to claim 1, characterized in that the plurality of classifiers are plurality of types of classifiers with different methods for determining similarity.
3. The discrimination method according to claim 2, characterized in that the multiple types of classifiers include a classifier for determining color similarity and a classifier for determining shape similarity.
4. The discrimination method according to any one of claims 1 to 3, characterized in that whether the detection mark and the registration mark match is determined by weighting the result of the determination by each classifier according to the reliability of each classifier.
5. A method for determining the type of a target drug from an image of the target drug of unknown type, performed by a type determination device, A matching determination step in which the detection mark, which is a mark formed on the target drug detected from the captured image, and the registration mark registered in the master data for drug matching are determined by a plurality of classifiers corresponding to each of a plurality of determination regions that divide the area of the captured image in which the detection mark is visible, and it is determined whether the detection mark and the registration mark match. The step includes outputting the result of the determination, A discrimination method characterized in that the plurality of classifiers are classifiers selected based on the accuracy of similarity determination for a set of test images including images of the registered mark and images of other marks.
Citation Information
Patent Citations
Pattern recognizing method
JP1995160822A
Drug verification apparatus, drug verification system, and drug verification method
JP2015065978A
Drug auditing device
WO2004112685A1
Drug assortment device and drug assortment method
WO2015170761A1
Drug sorting device, sorting container, and drug return method
WO2018190394A1