Drug identification device, drug identification method, and program, trained model, and learning device
The drug identification device employs a trained model to extract and process stamp and print information from images of partial drugs, addressing the challenges of varying orientations and information availability, resulting in improved accuracy and reduced data collection efforts.
Patent Information
- Application Number
- PCT/JP2024/007289
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-10
- Filing Date
- 2024-02-28
- Publication Date
- 2024-09-19
AI Technical Summary
Current drug identification technologies face challenges in accurately identifying partial drugs due to variations in cutting lines, rotation directions, and limited identification information, leading to reduced accuracy and increased effort in data collection for training AI models.
A drug identification device and method that uses a trained model to process images of partial drugs by extracting stamp and print information, incorporating machine learning techniques to handle variations in orientation, position, and rotation, and excluding images with insufficient information from training data.
The solution enables high-accuracy identification of partial drugs by robustly processing images with arbitrary orientations and positions, improving identification accuracy and reducing the need for extensive data collection.
Smart Images

Figure JP2024007289_19092024_PF_FP_ABST
Abstract
Description
Drug identification device, drug identification method and program, trained model, and learning device
[0001] The present invention relates to a drug identification device, a drug identification method and program, a trained model, and a learning device, and in particular to a technology for identifying divided drugs.
[0002] In hospitals, pharmacies, and other facilities, medication audits and identification of medications brought in by patients are carried out. Visual inspections and identification impose a heavy workload on pharmacists. For this reason, technologies are being used that automatically identify the type of medication from photographed images of the medication.
[0003] Depending on the conditions of the prescription, etc., medicines such as tablets may be divided. For this reason, a technique for identifying divided medicine portions from a photographed image is known.
[0004] For example, Patent Document 1 describes a trained model capable of identifying divided tablets, such as 1 / 2 tablet or 1 / 4 tablet. Also, Patent Document 2 describes a technology for performing image matching processing using a master image of a half tablet obtained by dividing a medicine into two.
[0005] JP 2018-027242 A International Publication No. 2014 / 080966
[0006] Because partial medicines are not divided exactly in the middle, they can have a variety of appearances. Furthermore, because the cutting line is not necessarily a straight line but can have a stepped shape, they can have a variety of appearances. Furthermore, partial medicines may have the same or very similar appearances even if they are different medicines. For this reason, the techniques described in Patent Documents 1 and 2 may not be able to identify partial medicines, and there is a need for more accurate identification of partial medicines.
[0007] The present invention has been made in consideration of the above circumstances, and aims to provide a drug identification device, a drug identification method and program, a trained model, and a learning device that can identify partial drugs with high accuracy.
[0008] To achieve the above object, a drug identification device according to a first aspect of the present disclosure includes at least one processor and at least one memory that stores instructions to be executed by the at least one processor, wherein the at least one processor acquires a captured image of a drug to be identified having a mark and / or printing affixed thereto, the captured image being a partial drug that is a part of an undivided full drug that has been divided into multiple pieces, detects an area of the partial drug from the captured image, processes at least the area of the partial drug in the captured image to obtain an image of the partial drug that extracts the mark and / or printing of the partial drug, inputs the image of the mark and / or printing affixed to a first trained model to infer a drug type of the partial drug, obtains multiple candidate drug types for the partial drug, and presents the multiple candidate drug types, the first trained model being trained using a first image of the full drug that has the mark and / or printing affixed thereto. According to the first aspect, partial drugs can be identified with high accuracy.
[0009] A drug identification device according to a second aspect of the present disclosure is the drug identification device according to the first aspect, wherein the first trained model is preferably trained using second images that are portions of the first image divided at any orientation and position, and that contain more than a certain amount of information about the markings and / or printing. According to the second aspect, second images that become noise during training because the amount of information is less than the certain standard can be excluded from the training data.
[0010] A drug identification device according to a third aspect of the present disclosure is the drug identification device according to the second aspect, wherein the second image is preferably a portion obtained by dividing the first image after rotating and / or translating the first image. According to the third aspect, the first trained model can be made robust against arbitrariness in the rotation direction and parallel position of the cutting axis.
[0011] A drug identification device according to a fourth aspect of the present disclosure is the drug identification device according to any one of the first to third aspects, wherein the first trained model is trained using a first image and a second image that is a portion of the first image divided at an arbitrary orientation and position, the second image including an amount of marking and / or printing information greater than a certain standard. According to the fourth aspect, both full drugs and partial drugs can be identified.
[0012] A drug identification device according to a fifth aspect of the present disclosure is the drug identification device according to any one of the first to fourth aspects, wherein at least one processor acquires a captured image of a plurality of drugs, detects regions of the plurality of drugs from the captured image, and detects regions of partial drugs from the regions of the plurality of drugs. According to the fifth aspect, partial drugs contained in the plurality of drugs can be identified.
[0013] A sixth aspect of the present disclosure is a drug identification device according to any one of the first to fifth aspects, wherein at least one processor acquires a first captured image of a first partial drug, which is a divided portion of a first drug, acquires a second captured image of a second partial drug, which is a divided portion of the first drug and is different from the first partial drug, acquires a composite image in which an area of the first partial drug in the first captured image and an area of the second partial drug in the second captured image are aligned, detects the area of the first drug from the composite image, processes at least the area of the first drug in the composite image to acquire a first imprint / print extracted image in which the imprint and / or printing of the first drug is extracted, inputs the first imprint / print extracted image into a first trained model to infer the drug type of the first drug, and acquires candidate drug types for the first drug.
[0014] A seventh aspect of the present disclosure is a drug identification device according to any one of the first to fifth aspects, wherein at least one processor acquires a third captured image of a first partial drug, which is a divided portion of the first drug, and a second partial drug, which is a divided portion of the first drug but different from the first partial drug, detects an area of the first partial drug and an area of the second partial drug from the third captured image, processes at least the areas of the first partial drug and the second partial drug in the third captured image to acquire a second imprint / print extraction image in which the imprint and / or printing of the first partial drug and the second partial drug are extracted, and inputs the second imprint / print extraction image into a first trained model to infer the drug type of the first drug and acquire candidate drug types for the first drug.
[0015] A drug identification device according to an eighth aspect of the present disclosure is the drug identification device according to any one of the first to seventh aspects, wherein at least one processor acquires multiple drug type candidates for which the first trained model outputs a relatively high score. According to the eighth aspect, an interface can be provided that allows a user to select a correct drug from the multiple candidates.
[0016] To achieve the above object, a trained model according to a ninth aspect of the present disclosure is a trained model that has undergone machine learning using second images that are portions of a first image from which the imprint and / or printing of a medicine to which the imprint and / or printing has been added is extracted, the second images being portions that are divided in an arbitrary orientation and position, and the second images containing more information about the imprint and / or printing than a certain standard. According to the ninth aspect, it is possible to identify partial medicines divided in an arbitrary rotational direction and parallel position.
[0017] In order to achieve the above object, a learning device according to a tenth aspect of the present disclosure includes at least one processor and at least one memory that stores instructions to be executed by the at least one processor, wherein the at least one processor is configured to train a first trained model using second images obtained by dividing a first image, from which the imprint and / or printing of a medicine to which the imprint and / or printing has been added, into two at an arbitrary orientation and position, the second images including an amount of information of the imprint and / or printing greater than a certain standard. According to the tenth aspect, a first trained model that is robust to arbitrary rotational directions and arbitrary parallel positions of the cutting axis can be trained.
[0018] To achieve the above object, a drug identification method according to an eleventh aspect of the present disclosure is a drug identification method including: at least one processor acquiring a photographed image of a drug to be identified having an imprint and / or printing affixed thereto, the photographed image being a partial drug that is a part of an undivided full drug that has been divided into multiple pieces; detecting an area of the partial drug from the photographed image; processing at least the area of the partial drug in the photographed image to obtain an imprint-extracted image in which the imprint and / or printing of the partial drug is extracted; inputting the imprint-extracted image into a first trained model to infer a drug type of the partial drug; acquiring multiple candidate drug types for the partial drug; and presenting the multiple candidate drug types; the first trained model has been trained based on the first image in which the imprint and / or printing of the undivided full drug to which the imprint and / or printing has been affixed has been extracted. According to the eleventh aspect, partial drugs can be identified with high accuracy.
[0019] To achieve the above object, a program according to a twelfth aspect of the present disclosure is a program that causes a computer to execute the drug identification method of the eleventh aspect. According to this aspect, partial drugs can be identified with high accuracy. The present disclosure also includes a non-transitory computer-readable recording medium, such as a CD-ROM (Compact Disk-Read Only Memory), that stores the program according to the twelfth aspect.
[0020] According to the present invention, partial drugs can be identified with high accuracy.
[0021] FIG. 1 is a diagram for explaining identification of half tablets. FIG. 2 is a front perspective view of a smartphone. FIG. 3 is a rear perspective view of the smartphone. FIG. 4 is a block diagram showing the electrical configuration of the smartphone. FIG. 5 is a block diagram showing the functional configuration of a drug identification device. FIG. 6 is a block diagram showing the electrical configuration of a learning device. FIG. 7 is a diagram showing an example of a training dataset for generating a trained model. FIG. 8 is a block diagram showing the functional configuration of a learning device. FIG. 9 is a flowchart showing a training method for a trained model according to the first embodiment. FIG. 10 is a flowchart showing a drug identification method according to the first embodiment. FIG. 11 is a block diagram showing the functional configuration of a training data acquisition unit according to the second embodiment. FIG. 12 is a diagram for explaining generation of images of training data according to the second embodiment. FIG. 13 is a diagram for explaining generation of images of training data according to the second embodiment. FIG. 14 is a diagram for explaining another example of generation of images of training data of an oval tablet. FIG. 15 is a flowchart showing a training method for a trained model according to the second embodiment. FIG. 16 is a flowchart showing a drug identification method according to the second embodiment. FIG. 17 is a flowchart showing a training method for a trained model according to the third embodiment. FIG. 18 is a flowchart showing a drug identification method according to the third embodiment. Fig. 19 is a flowchart showing a training method for a trained model according to the fourth embodiment. Fig. 20 is a flowchart showing a medicine identification method according to the fourth embodiment. Fig. 21 is a diagram for explaining an example of a captured image of a half tablet according to the fourth embodiment. Fig. 22 is a diagram for explaining another example of a captured image of a half tablet according to the fourth embodiment.
[0022] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0023] <Definition of Terms> In this specification, a "full drug" refers to a drug that is not divided in its shipping state. An example of a full drug is a "full tablet" that is not divided. In this specification, a "tablet" refers to a solid drug that is molded into a certain shape by compression molding. In this specification, a "round tablet" refers to a full tablet that is circular in plan view. In this specification, an "oval tablet" refers to a full tablet that is oval in plan view. It does not have to be a mathematically strict oval shape.
[0024] In this specification, a "partial drug" refers to a portion of a drug obtained by dividing a full drug into multiple pieces. An example of a partial drug is a "half tablet," which is one of two halves of a full tablet. A "half tablet" is not limited to a full tablet divided into two equal halves, but may be one of two halves of a full tablet. A "half tablet" is sometimes written as "1 / 2 tablet."
[0025] Another example of a partial drug is a "quarter tablet," which is one of four pieces of a full tablet divided into four. A "quarter tablet" is not limited to a full tablet divided into four equal parts, but may be any one of four pieces of a full tablet divided into four. A "quarter tablet" is sometimes written as "1 / 4 tablet."
[0026] The means for dividing the tablets is not limited. The tablets may be divided manually using scissors, a cutter, a multi-tablet half-tablet cutter, etc. The tablets may also be divided automatically using a dividing function installed in a packaging machine.
[0027] As used herein, "marked" means that identification information is formed by forming a groove, which is a recessed area, on the surface of the drug. The groove is not limited to being formed by digging into the surface, but may also be formed by pressing the surface. In addition, the marking may include a mark that does not have an identification function, such as a dividing line.
[0028] As used herein, "printed" means that identification information is formed by applying edible ink or the like to the surface of the medicine with or without contact. Here, "applied by printing" is synonymous with "applied by printing."
[0029] In this specification, "engraving and / or printing" means "either engraving or printing" or "both engraving and printing." In this specification, "engraving and / or printing" may be abbreviated to "engraving and printing."
[0030] <Identification of Half Tablets> Figure 1 is a diagram for explaining the identification of half tablets. F1A in Figure 1 shows the front surface of a full tablet TF with the stamped print oriented upright. The full tablet TF is, for example, a circular tablet with a diameter of 7.0 mm and a thickness of 2.4 mm. The front surface of the full tablet TF is stamped with "FF111".
[0031] F1B in Fig. 1 shows the front surface of half tablet TH1. Half tablet TH1 is the upper part when full tablet TF is divided into two parts, top and bottom, along a straight line in the state shown in Fig. 1. "FF" is stamped on the front surface of half tablet TH1.
[0032] Drug type identification according to this embodiment includes identifying the drug type of the full tablet TF from only the photographed image of the half tablet TH1.
[0033] F1C in Fig. 1 shows the front surface of half tablet TH2. Half tablet TH2 is the lower part when full tablet TF is divided into two parts, top and bottom, along a straight line in the state shown in Fig. 1. The front surface of half tablet TH2 is stamped with "111".
[0034] Drug type identification according to this embodiment includes identifying the drug type of the full tablet TF by combining a photographed image of the half tablet TH1 and a photographed image of the half tablet TH2. Drug type identification according to this embodiment also includes identifying the drug type of the full tablet TF from a photographed image in which the half tablet TH1 and the half tablet TH2 are arranged side by side.
[0035] The half tablet is not limited to one divided into two halves, one above and one below. Furthermore, the half tablet is not limited to one divided into two halves in a straight line. F1D in FIG. 1 shows the front surface of half tablet TH3. Half tablet TH3 is the right part when full tablet TF is divided into two halves nonlinearly left and right in the state shown in FIG. 1. F1E in FIG. 1 shows the front surface of half tablet TH4. Half tablet TH4 is the left part when full tablet TF is divided into two halves nonlinearly left and right in the state shown in FIG. 1. F1E in FIG. 1 shows the front surface of half tablet TH5. Half tablet TH5 is the upper left part when full tablet TF is divided into two halves nonlinearly diagonally in the state shown in FIG. 1. F1G in FIG. 1 shows the front surface of half tablet TH6. Half tablet TH6 is the lower right part when full tablet TF is divided into two halves nonlinearly diagonally in the state shown in FIG. 1. In this way, the half tablet may be divided into two in any direction or at any position.
[0036] The tablet may have a score line, and the half tablet is not limited to one divided into two along the score line.
[0037] <Difficulties in identifying drug types of half tablets> For example, there are many white, round tablets of the same size. Therefore, to identify these, identification information from the markings / printing is required. In addition, due to the limitations of Issues 1 to 5 below, it is necessary to identify the tablets from only partial information from the markings / printing.
[0038] (Problem 1) When cutting, the cut is not made exactly in the center, so various appearances may occur.
[0039] (Problem 2) The cutting line is not necessarily a straight line, but may have a stepped shape, which may result in a variety of appearances.
[0040] (Problem 3) In the case of circular tablets, the rotation direction of the cutting axis is arbitrary, which can result in a variety of different ways of looking at the engraving / printing.
[0041] (Problem 4) The design of the markings / printing on the medicine and the way it is cut can combine to produce half tablets with very little or no identifying information, such as markings / printing, that can serve as clues for drug type identification. Furthermore, images of half tablets with very little or no identifying information become noise in the training data, so if such data is included in the training data for drug type identification AI (Artificial Intelligence), the identification accuracy of the drug type identification AI will decrease.
[0042] (Problem 5) There are cases where half tablets of a drug to be identified and half tablets of a different drug have the same or very similar appearance.
[0043] Furthermore, to identify drugs using drug type identification AI, it is necessary to prepare learning data of various appearances for each of the approximately 10,000 drug types used as pharmaceuticals, which poses the problem of requiring a huge amount of time and effort to collect the data.
[0044] <Configuration of drug identification device and learning device> The drug identification device according to this embodiment is a device that identifies the drug type of a drug to be identified from a captured image of the drug to be identified that has been marked and / or printed, and identifies the correct drug. The drug to be identified includes partial drugs that are parts of a full drug divided into multiple parts.
[0045] The drug identification device is mounted on a portable terminal device, for example. The portable terminal device includes at least one of a mobile phone, a PHS (Personal Handyphone System), a smartphone, a PDA (Personal Digital Assistant), a tablet computer terminal, a notebook personal computer terminal, and a portable game console. Below, a drug identification device configured as a smartphone will be used as an example and described in detail with reference to the drawings.
[0046] [Appearance of Smartphone] Fig. 2 is a front perspective view of a smartphone 10, which is a camera-equipped mobile terminal device according to this embodiment. As shown in Fig. 2, the smartphone 10 has a flat housing 12. The smartphone 10 has a touch panel display 14, a speaker 16, a microphone 18, and an in-camera 20 on the front of the housing 12.
[0047] The touch panel display 14 includes a display unit that displays images, etc., and a touch panel unit that is disposed in front of the display unit and that accepts touch inputs. The display unit is, for example, a color LCD (Liquid Crystal Display) panel.
[0048] The touch panel unit is, for example, a capacitive touch panel provided in a planar form on a light-transmitting substrate body, and includes light-transmitting position detection electrodes and an insulating layer provided on the position detection electrodes. The touch panel unit generates and outputs two-dimensional position coordinate information corresponding to a user's touch operation. Touch operations include a tap operation, a double tap operation, a flick operation, a swipe operation, a drag operation, a pinch-in operation, and a pinch-out operation.
[0049] The speaker 16 is an audio output unit that outputs audio during a call or when playing back a video. The microphone 18 is an audio input unit that inputs audio during a call or when shooting a video. The front camera 20 is an imaging device that captures videos and still images.
[0050] Fig. 3 is a rear perspective view of the smartphone 10. As shown in Fig. 3, the smartphone 10 includes an outer camera 22 and a light 24 on the rear surface of the housing 12. The outer camera 22 is an imaging device that captures videos and still images. The light 24 is a light source that emits illumination light when capturing images with the outer camera 22, and is configured, for example, by an LED (Light Emitting Diode).
[0051] 2 and 3 , the smartphone 10 is further provided with switches 26 on the front and side of the housing 12. The switches 26 are input members that accept instructions from the user. The switches 26 are push-button switches that turn on when pressed with a finger or the like and turn off when the finger is released due to the restoring force of a spring or the like.
[0052] The configuration of the housing 12 is not limited to this, and a configuration having a folding structure or a sliding mechanism may be adopted.
[0053] [Electrical Configuration of Smartphone] The smartphone 10 has, as its main function, a wireless communication function for performing mobile wireless communication via a base station device and a mobile communication network.
[0054] Fig. 4 is a block diagram showing the electrical configuration of the smartphone 10. As shown in Fig. 4, the smartphone 10 includes the touch panel display 14, speaker 16, microphone 18, in-camera 20, out-camera 22, light 24, and switch 26 described above, as well as a CPU (Central Processing Unit) 28, a wireless communication unit 30, a call unit 32, a memory 34, an external input / output unit 40, a GPS receiving unit 42, and a power supply unit 44.
[0055] The CPU 28 is an example of a processor that executes instructions stored in the memory 34. The CPU 28 operates in accordance with the control program and control data stored in the memory 34, and controls all the components of the smartphone 10. The CPU 28 has a mobile communication control function that controls all the components of the communication system to perform voice communication and data communication via the wireless communication unit 30, and an application processing function.
[0056] The CPU 28 also has an image processing function for displaying moving images, still images, text, etc. on the touch panel display 14. This image processing function visually conveys information such as still images, moving images, and text to the user. The CPU 28 also acquires two-dimensional position coordinate information corresponding to a touch operation by the user from the touch panel portion of the touch panel display 14. The CPU 28 also acquires an input signal from the switch 26.
[0057] The hardware structure of the CPU 28 is made up of various processors as follows: The various processors include a CPU (Central Processing Unit), which is a general-purpose processor that executes software (programs) and functions as various functional units, a GPU (Graphics Processing Unit), which is a processor specialized for image processing, a PLD (Programmable Logic Device), which is a processor whose circuit configuration can be changed after manufacture such as an FPGA (Field Programmable Gate Array), and a dedicated electrical circuit, which is a processor having a circuit configuration designed specifically for executing specific processing such as an ASIC (Application Specific Integrated Circuit).
[0058] A single processing unit may be configured with one of these various processors, or may be configured with two or more processors of the same or different types (e.g., multiple FPGAs, a combination of a CPU and an FPGA, or a combination of a CPU and a GPU). Multiple functional units may also be configured with a single processor. Examples of multiple functional units configured with a single processor include: a first configuration, as typified by a client or server computer, in which a single processor is configured with a combination of one or more CPUs and software, and this processor operates as multiple functional units; and a second configuration, as typified by a SoC (System on Chip), in which a processor is used to realize the functions of an entire system including multiple functional units on a single IC (Integrated Circuit) chip. In this way, the various functional units are configured with one or more of the above-mentioned various processors as a hardware structure.
[0059] Furthermore, the hardware structure of these various processors is, more specifically, an electric circuit made up of a combination of circuit elements such as semiconductor elements.
[0060] The in-camera 20 and the out-camera 22 capture moving images and still images in accordance with instructions from the CPU 28. The in-camera 20 and the out-camera 22 have the same internal configuration. The in-camera 20 and the out-camera 22 each have a photographing lens, an image sensor, and an image processing unit (not shown).
[0061] The in-camera 20 and the out-camera 22 each receive subject light passing through a photographing lens with an image sensor. The image sensor is a photoelectric conversion element such as a CMOS (Complementary Metal-Oxide Semiconductor) or a CCD (Charge-Coupled Device), and has R (red), G (green), and B (blue) color filters (not shown) provided on its light-receiving surface. The subject light forms an image on the light-receiving surface of the image sensor, which then converts the subject light imaged on the light-receiving surface into an electrical signal based on the R, G, and B color signals. The image processing unit performs predetermined processing on the analog image signal output from the image sensor to convert it into a digital image signal.
[0062] The in-camera 20 and the out-camera 22 may convert the image data of the captured moving images and still images into compressed image data using MPEG (Moving Picture Experts Group) or JPEG (Joint Photographic Experts Group) formats.
[0063] The CPU 28 stores the video and still images captured by the in-camera 20 and the out-camera 22 in the memory 34. The CPU 28 may also output the video and still images captured by the in-camera 20 and the out-camera 22 to the outside of the smartphone 10 via the wireless communication unit 30 or the external input / output unit 40.
[0064] Furthermore, the CPU 28 displays the video and still images captured by the in-camera 20 and the out-camera 22 on the touch panel display 14. The CPU 28 may use the video and still images captured by the in-camera 20 and the out-camera 22 in application software.
[0065] The CPU 28 may illuminate the subject with fill light by turning on the light 24 when capturing an image with the outer camera 22. The light 24 may be turned on and off by a touch operation on the touch panel display 14 or by operating the switch 26 by the user.
[0066] The wireless communication unit 30 performs wireless communication with a base station device included in the mobile communication network in accordance with instructions from the CPU 28. Using this wireless communication, the smartphone 10 transmits and receives various file data such as audio data and image data, e-mail data, and the like, and receives Web (abbreviation for World Wide Web) data, streaming data, and the like.
[0067] The speaker 16 and the microphone 18 are connected to the communication unit 32. The communication unit 32 decodes the audio data received by the wireless communication unit 30 and outputs it from the speaker 16. The communication unit 32 converts the user's voice input through the microphone 18 into audio data that can be processed by the CPU 28 and outputs it to the CPU 28.
[0068] The memory 34 stores instructions to be executed by the CPU 28. The memory 34 is composed of an internal storage unit 36 built into the smartphone 10 and an external storage unit 38 that is detachable from the smartphone 10. The internal storage unit 36 and the external storage unit 38 are realized using known storage media.
[0069] The memory 34 stores the control program of the CPU 28, control data, application software, address data associated with names and telephone numbers of communication partners, data of emails sent and received, web data downloaded by web browsing, downloaded content data, etc. The memory 34 may also temporarily store streaming data, etc.
[0070] The external input / output unit 40 serves as an interface with external devices connected to the smartphone 10. The smartphone 10 is directly or indirectly connected to other external devices by communication or the like via the external input / output unit 40. The external input / output unit 40 transmits data received from the external devices to each component within the smartphone 10 and transmits data within the smartphone 10 to the external devices.
[0071] Examples of communication means include a Universal Serial Bus (USB), Institute of Electrical and Electronics Engineers (IEEE) 1394, the Internet, a wireless local area network (LAN), Bluetooth (registered trademark), RFID (Radio Frequency Identification), and infrared communication. Examples of external devices include a headset, an external charger, a data port, an audio device, a video device, a smartphone, a PDA, a personal computer, and earphones.
[0072] The GPS receiver 42 detects the position of the smartphone 10 based on positioning information from GPS satellites ST1, ST2, . . . , STn.
[0073] The power supply unit 44 is a power supply source that supplies power to each component of the smartphone 10 via a power supply circuit (not shown). The power supply unit 44 includes a lithium-ion secondary battery. The power supply unit 44 may also include an A / D converter that generates a DC voltage from an external AC power supply.
[0074] The smartphone 10 configured in this manner is set to a shooting mode by a user's instruction input using the touch panel display 14 or the like, and can take videos and still images using the in-camera 20 and the out-camera 22.
[0075] When the smartphone 10 is set to the shooting mode, it enters a shooting standby state, a video is shot by the in-camera 20 or the out-camera 22, and the shot video is displayed on the touch panel display 14 as a live view image.
[0076] The user can visually check the live view image displayed on the touch panel display 14 to determine the composition, confirm the subject they want to photograph, and set the photographing conditions.
[0077] When the smartphone 10 is in a standby state for shooting and is instructed to take a photo by a user inputting an instruction using the touch panel display 14 or the like, the smartphone 10 performs AF (Autofocus) and AE (Auto Exposure) control, and takes and stores video and still images.
[0078] [Functional Configuration of Drug Identification Device] Figure 5 is a block diagram showing the functional configuration of the drug identification device 100 realized by the smartphone 10. Each function of the drug identification device 100 is realized by the CPU 28 executing a drug identification program stored in the memory 34. As shown in Figure 5, the drug identification device 100 includes an image acquisition unit 102, a drug detection unit 104, an imprinted character extraction unit 106, a drug type recognition unit 108, a candidate output unit 110, and a determination unit 112.
[0079] The image acquisition unit 102 acquires a captured image of the drug to be identified with the imprinted mark. The captured image is, for example, an image captured by the in-camera 20 or the out-camera 22. The captured image may be an image acquired from another device via the wireless communication unit 30, the external storage unit 38, or the external input / output unit 40.
[0080] The captured image may be an image of the drug to be identified and a marker. The marker may be multiple, or may be an ArUco marker. The captured image may be an image of the drug to be identified and a reference gray color.
[0081] The captured image may be an image captured at a standard shooting distance and shooting viewpoint. The shooting distance can be expressed by the distance between the drug to be identified and the shooting lens and the focal length of the shooting lens. The shooting viewpoint can be expressed by the angle between the marker printed surface and the optical axis of the shooting lens.
[0082] The captured image may include multiple target drugs. The multiple target drugs are not limited to target drugs of the same drug type, but may be target drugs of different drug types. The target drugs may include full drugs or partial drugs.
[0083] When the captured image includes a marker, the image acquisition unit 102 may standardize the shooting distance and the shooting viewpoint of the captured image based on the marker to acquire a standardized image. Furthermore, when the captured image includes a reference gray area, the image acquisition unit 102 may perform color correction on the captured image based on the reference gray color.
[0084] The drug detection unit 104 detects a region of the drug to be identified from the captured image acquired by the image acquisition unit 102. When a standardized image is acquired by the image acquisition unit 102, the drug detection unit 104 detects a region of the drug to be identified from the standardized image, and when the captured image includes multiple drugs to be identified, the drug detection unit 104 detects the regions of each of the multiple drugs to be identified.
[0085] The imprint extraction unit 106 processes at least the area of the drug to be identified in the captured image, removes contour edge information of the drug to be identified that may become noise in drug identification, and obtains an imprint extraction image from which the imprint has been extracted. Here, the imprint extraction image is an image in which the imprint portion (hereinafter referred to as the imprint portion) is displayed with a relatively higher brightness than the brightness of the portion other than the imprint portion, thereby emphasizing the imprint. The imprint extraction image may be an image in which the imprint portion is white and the portion other than the imprint portion is black.
[0086] When the medicine detection unit 104 detects the regions of the plurality of target medicines, the mark extraction unit 106 acquires a plurality of mark extraction images corresponding to the plurality of target medicines, respectively.
[0087] The imprint extraction unit 106 may include a trained model that, when an image of a drug with imprint added thereto is given as input, outputs an image from which the imprint of the drug has been extracted.
[0088] The drug type recognition unit 108 receives the extracted image of the inscription mark, infers the drug type of the drug to be identified, and acquires candidate drug types for the drug to be identified. The candidate drug types include drug identification information consisting of drug name, trade name, abbreviation, or a combination thereof. When multiple extracted images of the inscription mark, each corresponding to a plurality of drugs to be identified, are received, the drug type recognition unit 108 acquires candidate drug types for each of the drugs to be identified.
[0089] The drug type recognition unit 108 includes a trained model 108A (an example of a "first trained model"). The trained model 108A is a trained model that, when an image from which a drug's imprint is extracted is given as input, outputs the drug type of the drug corresponding to the imprint. The trained model 108A may output multiple drug types. The trained model 108A may output, together with the drug type, a score or probability indicating the likelihood that the drug corresponds to that drug type.
[0090] The trained model 108A is obtained by machine learning using an image in which the imprinting of a full drug has been extracted. For example, the trained model 108A is a training data set of a plurality of different drugs in which the imprinting has been added, and machine learning is performed using a training data set that is a set of a first image of the drug in which the imprinting has been extracted and the drug type corresponding to the imprinting. The first image is, for example, an image in which the imprinting of a full drug has been extracted. The first image may be an image obtained by processing an image in which the imprinting of a full drug has been extracted. The trained model 108A can apply a convolutional neural network (CNN).
[0091] In this way, the drug type recognition unit 108 performs recognition based on the information of the inscription and print without using color information, and is therefore robust against the influence of the imaging environment.
[0092] The candidate output unit 110 outputs candidate drug types of the drug to be identified acquired by the drug type recognition unit 108. The candidate output unit 110 may output multiple candidate drug types for which the trained model 108A has a relatively high score. The candidate output unit 110, for example, displays multiple candidate drug types of the drug to be identified on the touch panel display 14 in a selectable manner.
[0093] The confirmation unit 112 confirms the correct drug for the drug to be identified from the candidate drug types for the drug to be identified. The confirmation unit 112 confirms, as the correct drug, a candidate drug type selected by the user from multiple candidate drug types for the drug to be identified displayed on the touch panel display 14, for example. When there is only one candidate drug type for the drug to be identified output by the candidate output unit 110, the confirmation unit 112 may confirm that candidate drug type as the correct drug.
[0094] 6 is a block diagram showing the electrical configuration of the learning device 120 that generates the trained model 108 A. The learning device 120 can be a personal computer or a workstation.
[0095] As shown in FIG. 6, the learning device 120 includes a learning data acquisition unit 122, a database 124, an operation unit 126, a display unit 128, a CPU 130, a RAM (Random Access Memory) 132, and a ROM (Read Only Memory) 134.
[0096] The training data acquisition unit 122 is an interface that acquires the training data set stored in the database 124, and includes wired and wireless communication interfaces.
[0097] The database 124 is a storage unit that stores a training data set, and is configured by a large-capacity storage device. The training data set will be described later.
[0098] Operation unit 126 is a user interface that allows the user to control study device 120, and is composed of a keyboard and a pointing device.
[0099] Display unit 128 is an output interface that visually displays the state of study device 120, and is configured with a display panel.
[0100] The CPU 130 is a processor that executes instructions stored in the RAM 132 and the ROM 134, and has the same hardware structure as the CPU 28. The RAM 132 is a memory device that temporarily stores data used by the CPU 130 for various calculations, and is made up of a semiconductor memory. The ROM 134 is a memory device that stores programs to be executed by the CPU 130, and is made up of a hard disk.
[0101] FIG. 7 is a diagram showing an example of a training dataset input to the learning device 120 and used to generate the trained model 108A. The training dataset is stored in the database 124. The training dataset includes a set of stamped-print extracted images of multiple different drugs, and correct data indicating the drug type and the front and back sides of the stamped-print extracted images. The stamped-print extracted images included in the training dataset have a fixed size corresponding to the trained model 108A. In the example shown in FIG. 7, the stamped-print extracted image I01 and the information indicating the drug type D01 and the front side of the stamped-print extracted image I01 constitute one training dataset. Similarly, the stamped-print extracted image I02 and the information indicating the drug type D02 and the front side of the stamped-print extracted image I02 constitute one training dataset, and the stamped-print extracted image I03 and the information indicating the drug type D03 and the back side of the stamped-print extracted image I03 constitute one training dataset.
[0102] 8 is a block diagram showing the functional configuration of the learning device 120. As shown in FIG. 8, the learning device 120 includes a recognizer 140, an error calculation unit 142, and a parameter control unit 144.
[0103] A CNN is applied to the recognizer 140. The recognizer 140 changes from an untrained model to a trained model by updating parameters from initial values to optimal values. The initial values of the parameters of the recognizer 140 may be any values, or parameters of an existing trained model may be applied.
[0104] The recognizer 140 includes an input layer 140A, an intermediate layer 140B, and an output layer 140C. The input layer 140A, the intermediate layer 140B, and the output layer 140C each have a structure in which a plurality of nodes are connected by edges.
[0105] In the learning phase, the input layer 140A receives a fixed size of extracted images of the engraving print from the learning data set.
[0106] The intermediate layer 140B is a layer that extracts features from the engraved and printed extracted image input from the input layer 140A. The intermediate layer 140B has multiple sets of convolutional layers and pooling layers, and a fully connected layer. The fully connected layer connects all of the nodes in the previous layer (here, the pooling layer).
[0107] The output layer 140C is a layer that outputs the drug type of the drug, which is the recognition result of the recognizer 140.
[0108] The error calculation unit 142 obtains the recognition result output from the output layer 140C of the recognizer 140 and the drug type of the drug in the learning dataset of the imprinted and printed extracted image input to the input layer 140A, and calculates the error between them. Possible methods for calculating the error include, for example, softmax cross entropy or least squared error (MSE).
[0109] The parameter control unit 144 adjusts the parameters of the recognizer 140 by backpropagation based on the error calculated by the error calculation unit 142. The parameters include, for example, coefficients of the filters of the convolution layer.
[0110] This parameter adjustment process is repeated, and learning is repeated until the difference between the output of the recognizer 140 and the correct data becomes small.
[0111] The learning device 120 performs learning in this manner and generates a trained recognizer 140 with optimized parameters as the trained model 108A. Note that appropriate noise may be artificially added to the extracted images of the medicine imprints in the training data set. This allows the generation of a trained model 108A that is robust to fluctuations in the imaging environment.
[0112] Here, the input image is an extracted image of the imprint on one side (single side) of the medicine, but a set of extracted images of the imprint on both sides may also be used as the input image. In this case, the amount of information is greater than when only one side is used, so improved accuracy can be expected, but usability is reduced because both sides must be photographed consecutively.
[0113] In the utilization phase, when an extracted image of a drug's imprint is input, the recognizer 140, which is the trained model 108A, outputs the drug type corresponding to the imprint.
[0114] 9 is a flowchart showing a training method for the trained model 108A according to the first embodiment in the training device 120. The training method is realized by the CPU 130 reading and executing a training program from the ROM 134. The training program may be provided to the training device 120 via an input interface (not shown).
[0115] In step S1, the learning device 120 prepares a training dataset. The training dataset includes extracted images of the imprinted text of drugs, and information on the drug type and the front and back of the extracted images of the imprinted text, which are the correct answer data. Here, the learning device 120 prepares extracted images of the imprinted text of a large number of full tablets linked to drug type information from the database 124.
[0116] In step S2, the learning device 120 inputs the image of the imprinted and printed extract from the full tablet and outputs the drug type to train the recognizer 140. That is, the learning device 120 calculates the error between the output result of the output layer 140C when the image of the imprinted and printed extract from the training data set is input to the input layer 140A and the drug type of the training data set in the error calculation unit 142, and adjusts the parameters of the recognizer 140 in the parameter control unit 144 based on the calculated error.
[0117] By repeatedly learning until the difference between the output of the recognizer 140 and the correct data becomes small, a trained recognizer 140 with optimized parameters is generated. As a result, in step S3, a trained model 108A, which is a drug type identification AI that identifies the drug type of a full tablet, is completed.
[0118] 10 is a flowchart showing the drug identification method according to the first embodiment in the drug identification device 100. The drug identification method is realized by the CPU 28 reading and executing a drug identification program from the memory 34. The drug identification program may be provided via the wireless communication unit 30 or the external input / output unit 40. Here, the process of identifying half tablets will be described.
[0119] In step S11, the drug identification device 100 photographs a plurality of tablets with the outer camera 22. The plurality of tablets may be individually packaged in a sachet. The image acquisition unit 102 acquires a photographed image of the plurality of tablets.
[0120] In step S12, the medicine detection unit 104 detects areas of a plurality of tablets from the captured image taken in step S11.
[0121] The processes of steps S13 to S16 are repeated for each area of the tablet detected in step S12.
[0122] In step S13, the medicine detection unit 104 extracts one tablet image to be identified from the captured image taken in step S11. The tablet image is an image in which the regions of individual tablets are extracted from the captured image.
[0123] In step S14, the drug detection unit 104 determines whether the tablet in the image is a half tablet from the tablet image extracted in step S13. If it is determined to be a full tablet in step S14, that is, if the determination is No in step S14, the processing for this tablet ends and proceeds to the processing of step S13 for a different tablet. If it is determined to be a half tablet in step S14, that is, if the determination is Yes in step S14, the processing proceeds to step S15.
[0124] In step S15, the imprint extraction unit 106 acquires an imprint extraction image from the tablet image extracted in step S13.
[0125] In step S16, the drug type recognition unit 108 inputs the imprinted and printed extracted image acquired in step S15 into the trained model 108A generated in steps S1 to S3, and acquires multiple drug type candidates for the half tablet in the image. The candidate output unit 110 displays on the touch panel display 14 multiple drug type candidates for the half tablet acquired by the drug type recognition unit 108 that have relatively high scores.
[0126] The confirmation unit 112 confirms the drug type candidate selected by the user from the displayed drug type candidates as the correct drug.
[0127] When the drug identification device 100 has performed the processes of steps S13 to S16 for all the tablets detected in step S12, it ends the process of this flowchart.
[0128] [Operations and Effects] The first embodiment has the following features.
[0129] (Feature A1) This is a machine learning-based identification method that uses an engraving extraction image as the input image.
[0130] (Feature A2) When training the trained model 108A, an extracted image of the full drug imprint is used, while partial information is input during inference, but the nature of deep learning is utilized, which allows the correct drug type to be inferred.
[0131] (Feature A3) Presents multiple drug candidates with scores or probabilities above a certain level.
[0132] According to the first embodiment, the above problems 1 and 2 can be solved by features A1 and A2, problems 3 and 4 can be solved by features A2 and the subsequent stages of A2, and problem 5 can be solved by feature A3.
[0133] <Second embodiment> [Generation of learning data] <Functional configuration of learning device> Fig. 11 is a block diagram showing the functional configuration of the learning data acquisition unit 122 according to the second embodiment. Here, an example in which learning data is generated in the learning data acquisition unit 122 of the learning device 120 will be described, but the learning data may be generated in a device different from the learning device 120. The learning data acquisition unit 122 artificially generates an extracted image of the imprinted mark on a pseudo half tablet as learning data.
[0134] As shown in FIG. 11 , the learning data acquisition unit 122 includes a marking / printing extraction image acquisition unit 152 , a random rotation unit 154 , a random translation unit 156 , a cutting unit 158 , a determination unit 160 , and a placement unit 162 .
[0135] The stamped print extracted image acquisition unit 152 acquires the stamped print extracted image of the full tablet from the database 124. The stamped print extracted image acquisition unit 152 may acquire the stamped print extracted image of the full tablet by acquiring a photographed image of the full tablet, detecting the area of the full tablet from the acquired photographed image, and extracting the stamped print from the detected area.
[0136] The random rotation unit 154 performs a rotation process to rotate the stamped and printed extracted image acquired by the stamped and printed extracted image acquisition unit 152 at a random angle around the center of the image as an axis.
[0137] The random translation unit 156 performs translation processing to translate the extracted imprinted print image rotated by the random rotation unit 154 by a random amount of translation.
[0138] The cutting unit 158 cuts the engraved print extracted image translated by the random translation unit 156 along a cutting axis whose orientation and position are fixed in advance, dividing it into two, and generates two divided engraved print extracted images.
[0139] The generation of the divided engraved print extracted image is not limited to the example of rotating and translating the engraved print extracted image and then cutting it along a fixed cutting axis, as long as the relationship between the engraved print extracted image and the cutting axis involves rotation and translation. For example, the cutting axis may be rotated at a random angle by the random rotation unit 154 and then translated by the random translation unit 156. In this case, the fixed engraved print extracted image is cut along the cutting axis after rotation and translation.
[0140] The determination unit 160 determines whether to adopt a divided printed / printed extracted image as learning data. For example, the determination unit 160 determines whether to adopt a divided printed / printed extracted image containing more printed / printed information than a certain standard as learning data. The certain standard is 20%, preferably 30%, and more preferably 40%, assuming that the printed / printed information amount of the pre-split printed / printed extracted image is 100%. The total pixel value of the printed / printed image is used as the information amount. For example, if the total pixel value of the printed / printed image in the divided printed / printed extracted image is more than 30% of the total pixel value of the printed / printed image in the pre-split printed / printed extracted image, the determination unit 160 determines to adopt the divided printed / printed extracted image as learning data. On the other hand, if the total pixel value of the printed / printed image in the divided printed / printed extracted image is 30% or less of the total pixel value of the printed / printed image in the pre-split printed / printed extracted image, the determination unit 160 determines to exclude the divided printed / printed extracted image from the learning data.
[0141] The determining unit 160 determines whether or not to use each of the two divided stamped print extracted images generated by the cutting unit 158 as learning data.
[0142] The arrangement unit 162 generates a training image having the input size of the trained model 108A. The training image is an image in which the divided stamped and printed extracted image determined by the determination unit 160 to be used as training data is arranged at the center. In the training image, the background area other than the area in which the divided stamped and printed extracted image is arranged has the same brightness as the brightness of the part other than the stamped and printed part of the divided stamped and printed extracted image. For example, if the part other than the stamped and printed part of the divided stamped and printed extracted image is black, the background area of the training image will be black.
[0143] 12 is a diagram for explaining generation of images of training data according to the second embodiment, showing the case of a circular lock. In the case of a circular lock, the image of the training data is generated by rotating and translating the captured image.
[0144] F12A in Figure 12 shows the front surface of the circular tablet TC with the engraved print oriented upright. The front surface of the circular tablet TC is engraved with the word "FF111." F12B in Figure 12 shows the engraved print extracted image I11 of the front surface of the circular tablet TC. The engraved print extracted image I11 is obtained by extracting the engraved print from the captured image of the front surface of the circular tablet TC by the engraved print extraction process P1 in the engraved print extraction image acquisition unit 152. Here, the center of the engraved print extracted image I11 coincides with the center of the circular tablet TC.
[0145] F12C in FIG. 12 shows the stamped / printed extraction image I12. The stamped / printed extraction image I12 is obtained by rotating the stamped / printed extraction image I11 using the random rotation process P2 in the random rotation unit 154. Here, the stamped / printed extraction image I12 is an image obtained by rotating the stamped / printed extraction image I11 clockwise by an angle θ. The random rotation unit 154 may set the angle θ to any value greater than or equal to 0 degrees and less than 360 degrees. Note that the background region BG1 of the stamped / printed extraction image I12 shown in F12C is an area used for image processing, and the target stamped / printed extraction image is rotated and translated within the background region BG1. In F12C, the center of the background region BG1 is located at the same position as the center of the stamped / printed extraction image I11.
[0146] F12D in Fig. 12 shows the stamp print extraction image I13. The stamp print extraction image I13 is obtained by translating the stamp print extraction image I12 in the random translation process P3 in the random translation unit 156. The background region BG1 is fixed and is not translated in the random translation process P3. Here, the stamp print extraction image I13 is an image obtained by translating the stamp print extraction image I12 in the horizontal direction by Δx and in the vertical direction by Δy in Fig. 12. The random translation unit 156 may determine Δx and Δy to be any values including 0.
[0147] 12 shows how the stamped print extracted image I13 is cut along the center line LC, which is the cutting axis, by the cutting process P4 in the cutting unit 158. The center line LC is a straight line parallel to the vertical direction in FIG. 12 and passes through the center of the background region BG1.
[0148] F12F in Fig. 12 shows the divided stamp / print extraction image I14, which is one of the images separated from the stamp / print extraction image I13 by cutting using the cutting process P4. F12G in Fig. 12 shows the divided stamp / print extraction image I15, which is the other of the images separated from the stamp / print extraction image I13 by cutting using the cutting process P4. The divided stamp / print extraction images I14 and I15 each correspond to a portion of the stamp / print extraction image I13 separated in an arbitrary direction and position.
[0149] F12H in Figure 12 shows the result RT1 of the divided stamped print extracted image I14 judged by the judgment process P5 in the judgment unit 160. The judgment process P5 is a process for determining that the divided stamped print extracted image containing more stamped print information than a certain standard should be adopted as learning data. The result RT1 is adopted as learning data. In other words, the divided stamped print extracted image I14 is an image obtained by dividing the stamped print extracted image I13 in an arbitrary direction and position, and corresponds to an image containing more stamped print information than a certain standard.
[0150] 12 shows the result RT2 of the divided stamp print extraction image I15 judged by the judgment process P5. The result RT2 is not adopted (excluded) as learning data.
[0151] F12J in Figure 12 shows a training image I16 generated from the divided stamp and print extracted image I14 (an example of a "second image"). The training image I16 is generated by arranging the stamp and print portion of the divided stamp and print extracted image I14 at the center by the arrangement process P6 in the arrangement unit 162. Alternatively, for the purpose of data augmentation, the stamp and print portion of the divided stamp and print extracted image I14 may be arranged by randomly shifting it from the center. The training image I16 has the input size of the trained model 108A.
[0152] 13 is a diagram for explaining generation of training data images according to the second embodiment, showing the case of an oval tablet. In the case of an oval tablet, the region of the oval tablet is divided in half along the minor axis direction to generate training data images.
[0153] F13A in FIG. 13 shows the front surface of the oval tablet TE1, with the major axis direction parallel to the horizontal direction in FIG. 13. The front surface of the oval tablet TE1 is inscribed with "FF222." F13B in FIG. 13 shows an inscription extraction image I21 of the front surface of the oval tablet TE1. The inscription extraction image I21 is obtained by extracting the inscription from the captured image of the front surface of the oval tablet TE1 by the inscription extraction process P1 in the inscription extraction image acquisition unit 152. Here, the horizontal center of the inscription extraction image I21 in FIG. 13 coincides with the major axis center of the oval tablet TE1.
[0154] F13C in Fig. 13 shows divided stamp print extracted images I22 and I23. The divided stamp print extracted images I22 and I23 are obtained by cutting the stamp print extracted image I21 along a center line LC parallel to the minor axis direction of the oval tablet TE1 by cutting process P4 in the cutting unit 158. Also, F13C in Fig. 13 shows the results RT11 and RT12 obtained by judging the divided stamp print extracted images I22 and I23, respectively, by judgment process P5 in the judgment unit 160. The results RT11 and RT12 are each used as learning data.
[0155] F13D in FIG. 13 shows the divided stamp / print extracted image I22. F13E in FIG. 13 shows the training image I24 generated from the divided stamp / print extracted image I22. The training image I24 is generated by arranging the stamp / print portion of the divided stamp / print extracted image I22 at the center using the arrangement process P6 in the arrangement unit 162. Alternatively, for the purpose of data augmentation, the stamp / print portion of the divided stamp / print extracted image I22 may be arranged by randomly shifting it from the center. The training image I24 has the input size of the trained model 108A. Although not described here, the arrangement process P6 also generates training images from the divided stamp / print extracted image I23.
[0156] F13F in FIG. 13 shows the front surface of oval tablet TE2, which has a similar stamped print to oval tablet TE1. The front surface of oval tablet TE2 is stamped "FF333." Oval tablets TE1 and TE2 share the stamp "FF." Therefore, the split stamped print extracted image I22 can also be generated from the stamped print extracted image of oval tablet TE2. By training the stamped print extracted image (or split stamped print extracted image) of oval tablet TE1 and the stamped print extracted image (or split stamped print extracted image) of oval tablet TE2, respectively, it is expected that the drugs of both oval tablets TE1 and TE2 will be output as candidates. Therefore, although it is not possible to automatically identify the drug type, it has the effect of narrowing down the candidates and presenting them to the user.
[0157] FIG. 14 is a diagram for explaining another example of generating an image of learning data of an oval tablet.
[0158] F14A in Fig. 14 shows the front surface of the oval tablet TE3. The marking "qq" is added to the front surface of the oval tablet TE3. F14B in Fig. 14 shows the stamp print extraction image I31. The stamp print extraction image I31 is obtained by extracting the stamp print from the captured image of the front surface of the oval tablet TE3 by the stamp print extraction process P1 in the stamp print extraction image acquisition unit 152.
[0159] F14C in Fig. 14 shows divided stamp print extracted images I32 and I33. Divided stamp print extracted images I32 and I33 are obtained by cutting stamp print extracted image I31 along center line LC by cutting process P4 in cutting unit 158. Also, F14C in Fig. 14 shows results RT21 and RT22 obtained by judging divided stamp print extracted images I32 and I33, respectively, by judgment process P5 in judgment unit 160. Result RT21 is adopted as learning data, and result RT22 is not adopted as learning data.
[0160] In this way, the mark information of the divided mark print extracted image I33 is insufficient for drug type identification, and is therefore excluded from the training data. The certain criteria used in the judgment process P5 in the judgment unit 160 may be the same as those for circular tablets.
[0161] [Learning Phase] FIG. 15 is a flowchart showing a learning method for the trained model 108A according to the second embodiment in the learning device 120.
[0162] In step S21, the learning device 120 prepares extracted images of imprinted and printed information of a large number of full tablets linked to drug type information from the database 124.
[0163] In step S22, the learning device 120 trains the recognizer 140 using the pseudo half tablet imprinted / printed extracted image as input and the drug type as output. The pseudo half tablet imprinted / printed extracted image is, for example, a divided imprinted / printed extracted image obtained by randomly dividing the imprinted / printed extracted image of a full tablet into two using image processing to generate various patterns of appearance. Furthermore, the divided imprinted / printed extracted image is used as learning data in the judgment process P5 in the judgment unit 160, as described using Figures 12 to 14.
[0164] By repeatedly learning until the difference between the output of the recognizer 140 and the correct data becomes small, a trained recognizer 140 with optimized parameters is generated. As a result, in step S23, a trained model 108A, which is a drug type identification AI, is completed. The trained model 108A trained in this way becomes a drug type identification AI dedicated to half tablets and is a different model from the drug type identification AI for full tablets.
[0165] [Utilization Phase] FIG. 16 is a flowchart showing the drug identification method according to the second embodiment in the drug identification device 100.
[0166] In step S31, the drug identification device 100 photographs a plurality of tablets with the outer camera 22. The plurality of tablets may be individually packaged in a sachet. The image acquisition unit 102 acquires a photographed image of the plurality of tablets.
[0167] In step S32, the medicine detection unit 104 detects areas of a plurality of tablets from the captured image taken in step S31.
[0168] The processes of steps S33 to S36 are repeated for each area of the tablet detected in step S32.
[0169] In step S33, the medicine detection unit 104 extracts one tablet image to be identified from the captured image taken in step S31.
[0170] In step S34, the drug detection unit 104 determines whether the tablet in the image is a half tablet from the tablet image extracted in step S33. If it is determined to be a full tablet in step S34, that is, if the determination is No in step S34, the processing for this tablet ends and proceeds to the processing of step S33 for a different tablet. If it is determined to be a half tablet in step S34, that is, if the determination is Yes in step S34, the processing proceeds to step S35.
[0171] In step S35, the imprint extraction unit 106 acquires an imprint extraction image from the tablet image extracted in step S33.
[0172] In step S36, the drug type recognition unit 108 inputs the imprinted and printed extracted image acquired in step S35 into the trained model 108A generated in steps S21 to S23, and acquires multiple drug type candidates for the half tablet. The candidate output unit 110 displays on the touch panel display 14 multiple drug type candidates for the half tablet acquired by the drug type recognition unit 108 that have relatively high scores.
[0173] The confirmation unit 112 confirms the drug type candidate selected by the user from the displayed drug type candidates as the correct drug.
[0174] When the drug identification device 100 has performed the processes of steps S33 to S36 for all the tablets detected in step S32, it ends the process of this flowchart.
[0175] [Actions and Effects] As described above, the second embodiment is similar to the first embodiment in that full tablet images are used for learning, but the learning method is devised to improve the accuracy of identifying half tablets. The second embodiment has the following features.
[0176] (Feature B1) This is a machine learning-based identification method that uses an engraving extraction image as the input image.
[0177] (Feature B2) The trained model 108A is trained using an image of the full medicine stamp extracted from the full medicine stamp. However, during training, the trained model 108A is trained using an image of the half-tablet stamp extracted from the full medicine stamp extracted from the full medicine stamp.
[0178] (Feature B3) For images generated by feature B2, if the amount of information is small based on pixel values, the image is automatically excluded from the learning data.
[0179] (Feature B4) Present multiple drug candidates with scores or probabilities above a certain level.
[0180] According to the second embodiment, the above-mentioned problems 1 and 2 can be solved by feature B1, and problem 3 can be solved by feature B2. Furthermore, according to the second embodiment, the above-mentioned problem 3 can be solved by feature B2 and feature B3, and problem 5 can be solved by feature B4.
[0181] Third Embodiment [Learning Phase] FIG. 17 is a flowchart showing a learning method for a trained model 108A according to a third embodiment in a learning device 120.
[0182] In step S41, the learning device 120 prepares extracted images of imprinted and printed information of a large number of full tablets linked to drug type information from the database 124.
[0183] In step S42, the learning device 120 inputs an extracted image of the imprinted and printed markings of a full tablet similar to that in the first embodiment and an extracted image of the imprinted and printed markings of a pseudo half tablet similar to that in the second embodiment, and outputs the drug type to train the recognizer 140.
[0184] By repeatedly learning until the difference between the output of the recognizer 140 and the correct data becomes small, a trained recognizer 140 with optimized parameters is generated. As a result, in step S43, the trained model 108A, which is a drug type identification AI, is completed. The trained model 108A trained in this way becomes a drug type identification AI that can identify both full tablets and partial drugs.
[0185] [Utilization Phase] FIG. 18 is a flowchart showing a drug identification method according to the third embodiment in the drug identification device 100.
[0186] In step S51, the drug identification device 100 photographs a plurality of tablets with the outer camera 22. The plurality of tablets may be individually packaged in a sachet. The image acquisition unit 102 acquires a photographed image of the plurality of tablets.
[0187] In step S52, the medicine detection unit 104 detects areas of a plurality of tablets from the captured image taken in step S51.
[0188] The processes of steps S53 to S55 are repeated for each area of the tablet detected in step S52.
[0189] In step S53, the medicine detection unit 104 extracts one tablet image to be identified from the captured image taken in step S51.
[0190] In step S54, the imprint extraction unit 106 acquires an imprint extraction image from the tablet image extracted in step S53.
[0191] In step S55, the drug type recognition unit 108 inputs the imprinted and printed extracted image acquired in step S54 into the trained model 108A generated in steps S41 to S43, and acquires multiple drug type candidates for the tablet. The candidate output unit 110 displays on the touch panel display 14 multiple drug type candidates for the tablet acquired by the drug type recognition unit 108 that have relatively high scores.
[0192] The confirmation unit 112 confirms the drug type candidate selected by the user from the displayed drug type candidates as the correct drug.
[0193] When the drug identification device 100 has performed the processes of steps S53 to S55 for all the tablets detected in step S52, it ends the process of this flowchart.
[0194] [Actions and Effects] In this way, in the third embodiment, a learning method is devised to improve the accuracy of identifying half tablets. According to the third embodiment, a drug type identification AI can be used for both full tablets and half tablets, and there is no need to classify each tablet cut image as a full drug or a partial drug, or to separate processing for full drugs from processing for partial drugs. The third embodiment has the following features.
[0195] (Feature C1) This is a machine learning-based identification method that uses an engraving extraction image as the input image.
[0196] (Feature C2) When training the trained model 108A, in addition to the full drug imprint extraction image, a pseudo half-tablet imprint extraction image generated from the full drug imprint extraction image is mixed and trained simultaneously.
[0197] (Feature C3) For images generated by feature C2, if the amount of information is small based on pixel values, the image is automatically excluded from the learning data.
[0198] (Feature C4) Present multiple drug candidates with scores or probabilities above a certain level.
[0199] According to the third embodiment, the above-mentioned problems 1 and 2 can be solved by feature C1, and problem 3 can be solved by feature C2. Furthermore, according to the third embodiment, the above-mentioned problem 3 can be solved by feature C2 and feature C3, and problem 5 can be solved by feature C4.
[0200] Fourth Embodiment [Learning Phase] FIG. 19 is a flowchart showing a learning method for a trained model 108A according to a fourth embodiment in a learning device 120.
[0201] In step S61, the learning device 120 prepares extracted images of imprinted and printed information of a large number of full tablets linked to drug type information from the database 124.
[0202] In step S62, the learning device 120 trains the recognizer 140 using the extracted image of the imprinted and printed characters of the full tablet as input and the drug type as output, as in the first embodiment.
[0203] By repeatedly learning until the difference between the output of the recognizer 140 and the correct data becomes small, a trained recognizer 140 with optimized parameters is generated. As a result, in step S63, a trained model 108A, which is a drug type identification AI that identifies the drug type of a full tablet, is completed.
[0204] [Utilization Phase] FIG. 20 is a flowchart showing a drug identification method according to the fourth embodiment in the drug identification device 100.
[0205] In step S71, the medicine identification device 100 photographs the half tablet with the outer camera 22. The image acquisition unit 102 acquires a photographed image of the half tablet.
[0206] FIG. 21 is a diagram illustrating an example of a photographed image of a half tablet acquired in step S71. F21A in FIG. 21 shows a state in which half tablet TH11 (an example of a "first partial drug") and half tablet TH12 (an example of a "second partial drug"), which were originally one full tablet TF (see FIG. 1, an example of a "first drug"), are arranged with their respective division lines physically close together to reproduce the full tablet TF before division. Also, F21B in FIG. 21 shows a photographed image I41 (an example of a "third photographed image") in which half tablet TH11 and half tablet TH12 are arranged as shown in F21A. In step S71, the image acquisition unit 102 acquires the photographed image I41.
[0207] Returning to the explanation of FIG. 20, in step S72, the medicine detection unit 104 detects the area of the half tablet TH11 and the area of the half tablet TH12 from the photographed image I41 acquired in step S71.
[0208] The processes of steps S73 to S75 are repeated for each full tablet region detected in step S72.
[0209] In step S73, the medicine detection unit 104 extracts one tablet image to be identified from the photographed image I41 acquired in step S71.
[0210] In step S74, the stamp print extraction unit 106 processes at least the half tablet TH11 area and the half tablet TH12 area of the tablet image extracted in step S73 to obtain a stamp print extraction image (an example of a ``second stamp print extraction image'').
[0211] In step S75, the drug type recognition unit 108 inputs the stamped and printed extracted image acquired in step S74 into the trained model 108A generated in steps S51 to S53, and acquires multiple drug type candidates for the original full tablet TF before it was divided into half tablet TH11 and half tablet TH12. The candidate output unit 110 displays on the touch panel display 14 the multiple drug type candidates for the full tablet TF acquired by the drug type recognition unit 108, which have relatively high scores.
[0212] The confirmation unit 112 confirms the drug type candidate selected by the user from the displayed drug type candidates as the correct drug.
[0213] The processes of steps S73 to S75 are performed for all reproduced full tablets detected in step S72, and the drug identification device 100 ends the process of this flowchart.
[0214] FIG. 22 is a diagram illustrating another example of a photographed image of a half tablet acquired in step S71. F22A in FIG. 22 shows a photographed image I42 of a half tablet TH11 (an example of a "first photographed image") and a photographed image I43 of a half tablet TH12 (an example of a "second photographed image"), which were photographed separately. F22B in FIG. 22 shows a composite image I44 obtained by arranging the area of the half tablet TH11 in the photographed image I42 and the area of the half tablet TH12 in the photographed image I43 so that their dividing lines approach each other to reproduce the original full tablet TF. In step S71, the image acquisition unit 102 acquires the composite image I44 thus synthesized. The image acquisition unit 102 may acquire the composite image I44 by combining the photographed image I42 and the photographed image I43 using a dedicated GUI (Graphical User Interface).
[0215] In step S72, the medicine detection unit 104 detects the region of the full tablet TF from the composite image I44 acquired in step S71. In addition, in step S73, the medicine detection unit 104 extracts a tablet image to be identified from the composite image I44 acquired in step S71.
[0216] In the following step S74, the stamped print extraction unit 106 processes at least the region of the full tablet TF of the tablet image extracted in step S73 to obtain a stamped print extraction image (an example of a "first stamped print extraction image"). It is preferable that the stamped print extraction unit 106 processes the region of the dividing line so as not to extract the stamped print.
[0217] Finally, in step S75, the drug type recognition unit 108 inputs the imprinted and printed extracted image acquired in step S74 into the trained model 108A to acquire multiple drug type candidates for the full tablet TF. The candidate output unit 110 displays multiple drug type candidates for the full tablet TF acquired by the drug type recognition unit 108, which have relatively high scores, on the touch panel display 14. The confirmation unit 112 confirms the drug type candidate selected by the user from the displayed multiple drug type candidates as the correct drug.
[0218] [Functions and Effects] In this way, in the fourth embodiment, half tablets can be identified in the drug type identification AI for full tablets. The fourth embodiment has the following features.
[0219] (Feature D1) This is a machine learning-based identification method that uses an engraving extraction image as the input image.
[0220] (Feature D2) When training the trained model 108A, an extracted image of the full tablet's imprint is used, while during inference, partial information is input, but the nature of deep learning is utilized, which allows the correct drug type to be inferred.
[0221] (Feature D3) Present multiple drug candidates with scores or probabilities above a certain level.
[0222] (Feature D4) The input image is either (1) an image in which multiple divided tablets that were originally one full tablet are photographed separately and then arranged on a dedicated GUI to resemble a single full tablet, or (2) an image in which multiple divided tablets that were originally one full tablet are physically arranged and photographed to resemble a single full tablet.
[0223] According to the fourth embodiment, the above-mentioned problems 1 and 2 can be solved by features D1, D2, and D4, and problem 3 can be solved by features D2 and D4. Furthermore, according to the fourth embodiment, the above-mentioned problem 4 can be solved by feature D4, and problem 5 can be solved by features D3 and D4.
[0224] <Others> So far, we have explained the identification of half tablets as an example of identifying partial medicines, but it is also possible to similarly identify quarter tablets by training a trained model and using the trained model to identify them.
[0225] So far, we have explained an example of configuring the drug identification device 100 in which the smartphone 10 alone identifies the correct drug among the drugs to be identified that have imprinted characters attached, but the drug identification device 100 may also be configured as a smartphone 10 and a server that can communicate with the smartphone 10, or as a server alone.
[0226] The drug identification program and the learning program can also be provided in a state stored on a non-transitory recording medium such as a CD-ROM (Compact Disk-Read Only Memory).
[0227] The technical scope of the present invention is not limited to the scope described in the above embodiments. The configurations and the like in each embodiment can be appropriately combined with each other within the scope that does not deviate from the spirit of the present invention.
[0228] DESCRIPTION OF SYMBOLS 10...Smartphone 12...Housing 14...Touch panel display 16...Speaker 18...Microphone 20...In-camera 22...Out-camera 24...Light 26...Switch 28...CPU 30...Wireless communication unit 32...Call unit 34...Memory 36...Internal storage unit 38...External storage unit 40...External input / output unit 42...GPS receiving unit 44...Power supply unit 100...Drug identification device 102...Image acquisition unit 104...Drug detection unit 106...Imprinted character extraction unit 108...Drug type recognition unit 108A...Trained model 110...Candidate output unit 112...Determination unit 120...Learning device 122...Learning data acquisition unit 124...Database 126...Operation unit 128...Display unit 130...CPU 132...RAM 134...ROM 140...Recognizer 140A...Input layer 140B...Intermediate layer 140C...Output layer 142...Error calculation section 144...Parameter control section 152...Engraved printing extracted image acquisition section 154...Random rotation section 156...Random parallel movement section 158...Cutting section 160...Determination section 162...Layout section BG1...Background region I01...Engraved printing extracted image I02...Engraved printing extracted image I03...Engraved printing extracted image I11...Engraved printing extracted image I12...Engraved printing extracted image I13...Engraved printing extracted image I14...Divided engraved printing extracted image I15...Divided engraved printing extracted image I16...Learning image I21...Engraved printing extracted image I22...Divided engraved printing extracted image I23...Divided engraved printing extracted image I24...Learning image I31...Engraved printing extracted image I32...Divided engraving print extracted image I33...Divided engraving print extracted image I41...Photographed image I42...Photographed image I43...Photographed image I44...Synthesized image LC...Center line P1...Stamp print extraction process P2...Random rotation process P3...Random parallel movement process P4...Cutting process P5...Determination process P6...Placement process RT1...Result RT2...Result RT11...Result RT12...Result RT21...Result RT22...Result S1-S3...Learning method steps S11-S16...Drug identification method steps S21-S23...Learning method steps S31-S36...Drug identification method steps S41-S43...Learning method steps S51-S55...Drug identification method steps S61-S63...Learning method steps S71-S75...Drug identification method steps ST1...GPS satellite ST2...GPS satellite TC...Circular tablet TE1...Oval tabletTE2...oval tablet TE3...oval tablet TF...full tablet TH1...half tablet TH2...half tablet TH3...half tablet TH4...half tablet TH5...half tablet TH6...half tablet TH11...half tablet TH12...half tablet
Claims
1. A drug identification device comprising: at least one processor; and at least one memory storing instructions to be executed by the at least one processor, wherein the at least one processor: acquires an image of a drug to be identified having an imprint and / or printing added thereto, the image being a partial drug which is a part of an undivided full drug which has been divided into multiple pieces; detects an area of the partial drug from the captured image; processes at least the area of the partial drug in the captured image to acquire an imprint and / or print extracted image in which the imprint and / or print of the partial drug is extracted; inputs the imprint and print extracted image into a first trained model to infer a drug type of the partial drug, acquires multiple candidate drug types of the partial drug, and presents the multiple candidate drug types; the first trained model is trained using a first image in which the imprint and / or print of a full drug to which an imprint and / or print has been added has been extracted.
2. The drug identification device described in claim 1, wherein the first trained model is trained using a second image that is a portion of the first image divided at an arbitrary orientation and position, and contains an amount of information of the marking and / or printing that is greater than a certain standard.
3. The drug identification device according to claim 2, wherein the second image is a portion of the first image that has been divided after the first image has been rotated and / or translated.
4. The drug identification device described in claim 1, wherein the first trained model is trained using the first image and a second image which is a portion of the first image divided at an arbitrary orientation and position, and which contains an amount of information of the marking and / or printing that is greater than a certain standard.
5. The drug identification device of claim 1, wherein the at least one processor acquires an image in which multiple drugs are photographed, detects areas of the multiple drugs from the image, and detects an area of the partial drug from the areas of the multiple drugs.
6. The drug identification device of claim 1, wherein the at least one processor: acquires a first captured image of a first partial drug, which is a portion of a first drug divided into the first drug; acquires a second captured image of a second partial drug, which is a portion of the first drug divided into the first drug, the second partial drug being different from the first partial drug; acquires a composite image in which an area of the first partial drug in the first captured image and an area of the second partial drug in the second captured image are arranged side by side; detects the area of the first drug from the composite image; acquires a first imprint-print extraction image in which the imprint and / or printing of the first drug is extracted by processing at least the area of the first drug in the composite image; and inputs the first imprint-print extraction image into a first trained model to infer the drug type of the first drug and acquire candidates for the drug type of the first drug.
7. The drug identification device according to claim 1, wherein the at least one processor: acquires a third captured image in which a first partial drug, which is a portion into which a first drug is divided, and a second partial drug, which is a portion into which the first drug is divided and is different from the first partial drug, are captured side by side; detects an area of the first partial drug and an area of the second partial drug from the third captured image; acquires a second imprint-print extraction image in which the imprints and / or prints of the first partial drug and the second partial drug are extracted by processing at least the area of the first partial drug and the area of the second partial drug in the third captured image; and inputs the second imprint-print extraction image into a first trained model to infer the drug type of the first drug, and acquires candidates for the drug type of the first drug.
8. The drug identification device according to any one of claims 1 to 7, wherein the at least one processor acquires a plurality of drug type candidates for which the scores output by the first trained model are relatively high.
9. A trained model in which machine learning has been performed using a second image that is a part of a first image, from which the engraving and / or printing of a drug to which the engraving and / or printing has been added is divided at an arbitrary orientation and position, and the second image contains more information about the engraving and / or printing than a certain standard.
10. A learning device comprising: at least one processor; and at least one memory for storing instructions to be executed by the at least one processor, wherein the at least one processor trains a first trained model using a second image obtained by dividing a first image, from which the imprint and / or printing of a drug to which the imprint and / or printing has been added, into two at an arbitrary orientation and position, the second image including an amount of information of the imprint and / or printing greater than a certain standard.
11. A drug identification method, comprising: at least one processor: acquiring an image of a drug to be identified having an engraving and / or printing added thereto, the image being a partial drug that is a part of an undivided full drug that has been divided into multiple pieces; detecting an area of the partial drug from the acquired image; processing at least the area of the partial drug in the acquired image to acquire an engraving and / or printing extracted image in which the engraving and / or printing of the partial drug is extracted; inputting the engraving and printing extracted image into a first trained model to infer the drug type of the partial drug, acquiring multiple candidate drug types of the partial drug, and presenting the multiple candidate drug types; the first trained model is trained based on a first image in which the engraving and / or printing of an undivided full drug to which an engraving and / or printing has been added has been extracted.
12. A program for causing a computer to execute the drug identification method according to claim 11.
13. A non-transitory computer-readable recording medium having the program according to claim 12 recorded thereon.
Citation Information
Patent Citations
Medicine checking device and apparatus for separately packaging medicines
JP2013144101A
Drug verification apparatus, drug verification system, and drug verification method
JP2015065978A
Tablet detection method, tablet detection device, and table detection program
JP2018027242A
Object comparison device and object comparison method
WO2020044933A1
Image processing device, portable terminal, image processing method, and program
WO2021039437A1
