Drug identification apparatus, drug identification method and program

JP2024047385A5Active Publication Date: 2024-09-12FUJIFILM MEDICAL CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2022152972
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2022-09-26
Publication Date
2024-09-12
Estimated Expiration
2042-09-26

AI Technical Summary

Technical Problem

Existing drug identification models using machine learning do not align with human perception of similarity, leading to candidates with dissimilar external features being presented as high-probability matches, causing user discomfort and doubts about reliability.

Method used

A drug identification device that incorporates a trained model to calculate a first score based on machine learning and a second score considering external attributes recognizable by humans, using a drug master to adjust scores based on attribute importance, presenting candidates that align with human perception of similarity.

Benefits of technology

The device provides highly accurate drug identification while ensuring candidates are presented in a manner that aligns with human perception of similarity, enhancing user satisfaction and confidence in the identification process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

To provide a drug identification apparatus, a drug identification method, and a program that can present reasonable candidates for a drug type even in view of human sense, while using a trained model that identifies the type of a drug from an image obtained by capturing the drug.SOLUTION: One or more processors calculate a first score indicating likelihood of being a type of an identification target drug with respect to each of a plurality of drug types from an image by using a first trained model trained to identify the type of the identification target drug from an image obtained by capturing the identification target drug, identify one or more appearance attributes of the identification target drug from the image, acquire information on drug types matching the attributes of the identification target drug from a drug master including information on one or more appearance attributes regarding each of a plurality of types of drugs identifiable by the first trained model, calculate a second score by using a first score value and a value being set for the attribute, and present a candidate for the type of the identification target drug based on a second score value.SELECTED DRAWING: Figure 4
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present disclosure relates to a drug identification device, a drug identification method, and a program, and in particular to image recognition technology and machine learning technology for identifying the type of drug from an image of the drug. [Background technology]

[0002] As one technology to streamline tasks such as pharmacy audits and identification of medications brought in by patients, development is underway of artificial intelligence (AI) that can identify the type of medication from images of the medication. Patent Document 1 describes a tablet detection method including an imaging step of capturing a reflected light image and a transmitted light image of a packaging paper in which one or more tablets for one dose are packaged and the tablets are divided tablets, an extraction step of extracting a tablet region in the reflected light image that corresponds to the tablet based on the reflected light image and the transmitted light image, a first identification step of outputting an identification value that uniquely identifies each of the tablets by comparing the dimensions and color of each of the tablet regions extracted in the extraction step with model information on the shape and color of the tablet, and a second identification step of outputting the identification value for the tablet that was incorrectly detected in the first identification step when there are multiple reference data whose features almost match the extracted tablet region or when the features do not match any of the reference data and an incorrectly detected identification value is output in the first identification step, using a learning model generated by machine learning based on learning data including images of similar tablets that are multiple tablets with similar features.

[0003] Patent document 2 describes a type discrimination device that includes an image generation unit that generates an extracted mark image by extracting a mark appearing in an image of an unknown type of target drug based on an output value obtained by inputting the image into a trained model constructed to extract marks formed on the drug, and a discrimination unit that discriminates the type of the target drug based on the result of matching the extracted mark image generated by the image generation unit with a registered mark image that is registered in advance for each type of drug. [Prior art documents] [Patent documents]

[0004] [Patent Document 1] Patent No. 6742859 [Patent Document 2] International Publication No. 2022 / 092130 Summary of the Invention [Problem to be solved by the invention]

[0005] A drug identification model, which is a machine learning model (AI model) that receives an input of an image of a drug and identifies the type of drug, is generated by applying machine learning such as deep learning using multiple learning (training) data including a data set of an image of the drug and the correct drug type for that drug. Such a drug identification model automatically learns features from the learning data and is capable of identifying the type of drug with high accuracy for the input image.

[0006] For example, a drug identification model trained to identify N types of drug takes an image of a drug to be identified as an input, and calculates a score value indicating the likelihood (certainty) that the drug is the type of drug to be identified for each of the N types of drug types that have been trained. Then, the top drug types are presented as candidates for the type of drug to be identified in order of the magnitude of the score value for each drug type output from the drug identification model, that is, in order of the highest likelihood. For one drug to be identified, multiple top candidates are presented as estimation results based on the score value for each drug type output by the drug identification model, and finally the user determines the correct drug type and performs an operation to confirm the type of drug to be identified.

[0007] However, in general, the feature amount learned by the drug identification model does not match human sense. Therefore, the top candidates presented based on the score value output by the drug identification model do not necessarily match human similarity sense. For example, among the multiple candidates with the top scores presented as the identification result by the drug identification model, there are cases where candidates of drugs with dissimilar external features (completely different external attributes) that are judged to be clearly different from the identification target drug by the human eye are included. Therefore, the user may feel uncomfortable with the drug type candidates presented by the drug identification device, and may have doubts about the reliability of the identification performance of the drug identification device.

[0008] The present disclosure has been made in consideration of these circumstances, and aims to provide a drug identification device, drug identification method, and program that can present candidate drug types that are convincing to humans, while using a trained machine learning model that identifies the type of drug from an image of the drug. [Means for solving the problem]

[0009] A drug identification device according to a first aspect of the present disclosure comprises one or more processors and one or more storage devices, wherein the one or more storage devices store a first trained model trained to identify the type of drug to be identified from an image of the drug to be identified, and a drug master including information on one or more appearance attributes for each of a plurality of types of drug, and the one or more processors calculate a first score indicating the likelihood that each of a plurality of drug types that can be identified from the image using the first trained model is the type of drug to be identified, identify the one or more appearance attributes of the drug to be identified from the image, obtain information on the drug type that matches the attributes of the drug to be identified from the drug master, calculate a second score using the first score value and a value set for the attribute, and present candidate types of the drug to be identified based on the second score value.

[0010] According to the drug identification device of the first aspect, a second score is calculated from the first score value of each drug type calculated by the first trained model, further taking into account the external attributes of the drug to be identified, and candidates for the type of drug to be identified are presented based on this second score value. The external attributes of the drug are attributes that can be visually recognized by humans. Humans have the impression that multiple drugs are similar or dissimilar to each other through visual recognition. The first score value calculated by the first trained model does not necessarily match the human sense of similarity, but the second score value is calculated taking into account the external attributes of the drug to be identified, and therefore may be closer to the human sense of similarity.

[0011] According to the first aspect, it is possible to perform highly accurate identification of a drug to be identified using a first trained model, while presenting drug type candidates that are convincing to a human being for the drug to be identified. The term "identification" includes concepts such as discrimination, determination, estimation, inference, and prediction.

[0012] The process of identifying the external attributes of a drug to be identified from an image of the drug to be identified may be performed using a trained model generated by machine learning, or may be performed by applying an image processing technique using a method other than machine learning, such as pattern matching.

[0013] The drug identification device of the second aspect may be configured in such a way that, in the drug identification device of the first aspect, the one or more storage devices store a second trained model trained to identify one or more appearance attributes of the drug to be identified from an image, and the one or more processors use the second trained model to identify whether the drug to be identified falls into a category corresponding to the one or more appearance attributes.

[0014] In the drug identification device according to the third aspect, in the drug identification device according to the first or second aspect, the value set for the attribute may be a value according to the importance of the attribute. For example, the higher the importance, the larger the value set.

[0015] A drug identification device according to a fourth aspect may be configured in the drug identification device according to the third aspect, wherein the one or more processors receive an instruction to change the setting of the importance level, and set a value according to the importance level of the attribute based on the received instruction.

[0016] A drug identification device according to a fifth aspect, in the drug identification device according to the fourth aspect, may be configured such that the value according to the importance is settable for each user.

[0017] The drug identification device according to a sixth aspect may be such that, in the drug identification device according to the fourth or fifth aspect, the value according to the importance can be set at a timing desired by a user.

[0018] The drug identification device according to the seventh aspect may be configured to include an input device in the drug identification device according to any one of the third to sixth aspects, and the one or more processors may be configured to receive input of instructions regarding the setting of the importance from the input device.

[0019] A drug identification device according to an eighth aspect may be configured such that, in a drug identification device according to any one of the third to seventh aspects, the drug master includes information relating to a plurality of appearance attributes including attributes relating to the drug's shape and attributes relating to its color, and the one or more processors receive an instruction specifying whether to emphasize the attributes relating to the shape or the attributes relating to the color in calculating the second score, and change the importance of at least one of the attributes relating to the shape and the attributes relating to the color based on the received instruction.

[0020] A drug identification device according to a 9th aspect may be configured such that, in the drug identification device according to any one of the 3rd to 8th aspects, the one or more processors calculate a second score by adding a value corresponding to the importance of the attribute to a first score value for a drug type that matches an attribute of the drug to be identified.

[0021] A drug identification device according to a tenth aspect may be configured in a drug identification device according to any one of the first to ninth aspects, wherein one or more processors calculate a second score by modifying a first score value for a drug type that matches an attribute of the drug to be identified using a value set for the attribute.

[0022] A drug identification device according to an 11th aspect is a drug identification device according to any one of the first to tenth aspects, wherein the drug master includes information relating to a plurality of appearance attributes including attributes relating to at least one of the shape and color of the drug, and the one or more processors are configured to identify whether the drug to be identified matches the plurality of appearance attributes.

[0023] A drug identification device according to a twelfth aspect may be configured in such a way that, in the drug identification device according to any one of the first to eleventh aspects, the one or more processors present a drug candidate list in which multiple candidates are arranged in order of the magnitude of the second score value.

[0024] The drug identification device according to a thirteenth aspect may be configured to include a display that displays candidates for the type of drug to be identified in the drug identification device according to any one of the first to twelfth aspects.

[0025] The drug identification device according to a fourteenth aspect may be configured such that the drug identification device according to any one of the first to thirteenth aspects further includes a camera that captures an image of the drug to be identified.

[0026] A drug identification method according to a fifteenth aspect of the present disclosure includes one or more processors: calculating a first score indicating the likelihood that each of a plurality of drug types from the image is the type of drug to be identified using a first trained model trained to identify the type of drug to be identified from an image of the drug to be identified; identifying one or more appearance attributes of the drug to be identified from the image; obtaining information on a drug type that matches the attributes of the drug to be identified from a drug master including information on one or more appearance attributes for each of a plurality of types of drugs that can be identified by the first trained model; calculating a second score based on the information on the drug type that matches the attributes of the drug to be identified using the first score value and a value determined for the attribute; and presenting candidate types of the drug to be identified based on the second score value.

[0027] The medicine identifying method according to the fifteenth aspect may have a configuration including the same specific aspects as the medicine identifying device according to any one of the second to fourteenth aspects.

[0028] A program according to a sixteenth aspect of the present disclosure enables a computer to implement the following functions: calculate a first score indicating the likelihood that each of a plurality of drug types from the image is the type of drug to be identified using a first trained model trained to identify the type of drug to be identified from an image of the drug to be identified; identify one or more appearance attributes of the drug to be identified from the image; acquire information on a drug type that matches the attributes of the drug to be identified from a drug master including information on one or more appearance attributes for each of a plurality of types of drugs that can be identified by the first trained model; calculate a second score based on the information on the drug type that matches the attributes of the drug to be identified using the first score value and a value determined for the attribute; and present candidate types of the drug to be identified based on the second score value.

[0029] The program according to the sixteenth aspect may be configured to include the same specific aspect as the drug identification device according to any one of the second to fourteenth aspects. Effect of the Invention

[0030] According to the present disclosure, it is possible to perform highly accurate drug type identification using a first trained model that has been trained to identify the type of drug from an image of the drug, and to present candidates that are convincing to a human. [Brief description of the drawings]

[0031] [Figure 1] FIG. 1 is a front perspective view of a smartphone. [Diagram 2] FIG. 2 is a rear perspective view of the smartphone. [Diagram 3] FIG. 3 is a block diagram showing the electrical configuration of the smartphone. [Figure 4] FIG. 4 is a block diagram showing a functional configuration of the drug identification device according to the embodiment. [Diagram 5] FIG. 5 is a chart showing an example of information included in the medicine master and the settings of the importance. [Figure 6]FIG. 6 is an explanatory diagram showing an example of a process executed by the drug identification device according to the embodiment. [Figure 7] FIG. 7 is a flowchart showing an example of a drug identification method executed by the drug identification device according to the embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0032] Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings.

[0033] [Overview of the drug identification device according to the embodiment] The drug identification device according to the embodiment of the present disclosure uses a drug identification model, which is a learned machine learning model that has been trained to identify the type of drug from an image of the drug, an attribute classification model, which is a learned machine learning model that has been trained to identify multiple external attributes of the drug that can be recognized by humans from an image of the drug, and a drug master that records information on multiple external attributes for each of multiple types of drugs, and by inputting an image of the drug to be identified into the drug identification model, the drug identification model outputs a score value for each of the multiple drug types, and by referring to the drug master using the output of the attribute classification model, the score value is corrected by taking into account the external attributes of the drug to be identified, and it is possible to present candidates that are close to human similarity based on the corrected score value. Note that each of the drug identification model and the attribute classification model is essentially a program.

[0034] The drug identification device is mounted on a mobile terminal device as an example. The mobile terminal device includes at least one of a smartphone, a mobile phone, a PHS (Personal Handy-phone System), a PDA (Personal Digital Assistant), a tablet computer terminal, a notebook personal computer terminal, a wearable terminal, and a portable game machine. In the following, a drug identification device realized by the hardware and software of a smartphone is taken as an example and described in detail with reference to the drawings.

[0035] [Appearance of the smartphone] Fig. 1 is a front perspective view of a smartphone 10 that functions as a drug identification device according to an embodiment. As shown in Fig. 1, 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 side of the housing 12.

[0036] The touch panel display 14 includes a display unit that displays images and the like, and a touch panel unit that is disposed in front of the display unit and receives touch inputs. The display unit is, for example, a color LCD (Liquid Crystal Display) panel or a color organic EL (organic electro-luminescence) panel.

[0037] The touch panel unit is, for example, a capacitive touch panel provided in a planar shape on a light-transmitting substrate body, and has a light-transmitting position detection electrode and an insulating layer provided on the position detection electrode. The touch panel unit generates and outputs two-dimensional position coordinate information corresponding to a touch operation by a user. The touch operation includes 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.

[0038] The speaker 16 is an audio output unit that outputs audio during a call and when playing back a video. The microphone 18 is an audio input unit to which audio is input during a call and when shooting a video. The front camera 20 is an imaging device that shoots videos and still images.

[0039] Fig. 2 is a rear perspective view of the smartphone 10. As shown in Fig. 2, 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 moving images and still images. The light 24 is a light source that emits illumination light when the outer camera 22 captures images, and is formed of, for example, an LED (Light Emitting Diode).

[0040] 1 and 2, the smartphone 10 is provided with switches 26 on the front and side of the housing 12. The switches 26 are input members that accept instructions from a user. The switches 26 are push-button switches that are turned on when pressed with a finger or the like and turned off by the restoring force of a spring or the like when the finger is released.

[0041] 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.

[0042] [Smartphone electrical configuration] The smartphone 10 has, as its main function, a wireless communication function for performing mobile wireless communication between a base station device and a mobile communication network.

[0043] Fig. 3 is a block diagram showing the electrical configuration of the smartphone 10. As shown in Fig. 3, the smartphone 10 has 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 receiver 42, and a power supply unit 44 in addition to the above-mentioned touch panel display 14, speaker 16, microphone 18, front camera 20, rear camera 22, light 24, and switch 26.

[0044] The CPU 28 is an example of a processor that executes instructions stored in the memory 34. The CPU 28 operates according to the control program and control data stored in the memory 34, and controls each unit of the smartphone 10. The CPU 28 has a mobile communication control function that controls each unit of the communication system to perform voice communication and data communication through the wireless communication unit 30, and an application processing function.

[0045] 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 allows information such as still images, moving images, and text to be visually conveyed 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 section of the touch panel display 14. The CPU 28 also acquires an input signal from the switch 26.

[0046] The in-camera 20 and the out-camera 22 each have a photographing lens, an aperture, an image sensor, an AFE (Analog Front End), an A / D (Analog to Digital) converter, a lens driving unit, etc. The in-camera 20 and the out-camera 22 capture moving images and still images according to instructions from the CPU 28.

[0047] The CPU 28 may convert the moving images and still images captured by the in-camera 20 and the out-camera 22 into compressed image data using MPEG (Moving Picture Experts Group) and JPEG (Joint Photographic Experts Group) formats, for example.

[0048] 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.

[0049] Furthermore, the CPU 28 displays the moving images 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 moving images and still images captured by the in-camera 20 and the out-camera 22 in application software.

[0050] The CPU 28 may illuminate the subject with auxiliary 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 an operation of the switch 26 by the user.

[0051] The wireless communication unit 30 performs wireless communication with a base station device compatible with a mobile communication network of a standard such as 4G (4th Generation) or 5G (5th Generation) in accordance with an instruction from the CPU 28. The smartphone 10 uses this wireless communication to transmit and receive various file data such as audio data and image data, e-mail data, and the like, and to receive Web (abbreviation for World Wide Web) data, streaming data, and the like.

[0052] The speaker 16 and the microphone 18 are connected to the communication unit 32. The communication unit 32 decodes the voice data received by the wireless communication unit 30 and outputs the decoded voice data from the speaker 16. The communication unit 32 converts the user's voice input through the microphone 18 into voice data that can be processed by the CPU 28 and outputs the voice data to the CPU 28.

[0053] 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.

[0054] 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 sent and received e-mails, Web data downloaded by Web browsing, downloaded content data, etc. The memory 34 may also temporarily store streaming data, etc.

[0055] The external input / output unit 40 serves as an interface with an external device connected to the smartphone 10. The smartphone 10 is directly or indirectly connected to another external device by communication or the like via the external input / output unit 40. The external input / output unit 40 transmits data received from an external device to each component inside the smartphone 10, and transmits data inside the smartphone 10 to the external device.

[0056] Examples of the communication means include a Universal Serial Bus (USB), IEEE (Institute of Electrical and Electronics Engineers) 1394, the Internet, a wireless LAN (Local Area Network), Bluetooth (registered trademark), RFID (Radio Frequency Identification), and infrared communication. Examples of the external device include a headset, an external charger, a data port, an audio device, a video device, a smartphone, a PDA, a personal computer, and an earphone.

[0057] The GPS receiver 42 detects the position of the smartphone 10 based on positioning information from GPS satellites ST1, ST2, . . . , STn.

[0058] The power supply unit 44 is a power supply source that supplies power to each unit 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 include an AC / DC conversion unit that generates a DC voltage from an external AC power source.

[0059] The smartphone 10 configured in this manner is set to a shooting mode in response to an instruction input from a user using the touch panel display 14 or the like, and can capture videos and still images using the in-camera 20 and the out-camera 22.

[0060] When the smartphone 10 is set to the shooting mode, it enters a shooting standby state, a moving image is captured by the inner camera 20 or the outer camera 22, and the captured moving image is displayed on the touch panel display 14 as a live view image.

[0061] A user can visually confirm the live view image displayed on the touch panel display 14 to determine the composition, confirm the subject that the user wants to photograph, and set the photographing conditions.

[0062] When the smartphone 10 is instructed to take a picture by a user inputting an instruction using the touch panel display 14 or the like in a shooting standby state, the smartphone 10 performs AF (Autofocus) and AE (Auto Exposure) control, and takes and stores a moving image and a still image.

[0063] The memory 34 is an example of a "storage device" in this disclosure. The touch panel display 14 is an example of an "input device" and a "display" in this disclosure. Each of the in-camera 20 and the out-camera 22 is an example of a "camera" in this disclosure.

[0064] [Functional configuration of the drug identification device] Fig. 4 is a block diagram showing a 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 program stored in the memory 34. As shown in Fig. 4, the drug identification device 100 includes an image acquisition unit 102, a drug identification model 104, an attribute classification model 106, a drug master 108, a compatible drug extraction unit 110, an importance setting unit 112, a score correction unit 114, a candidate presentation unit 116, and a drug determination unit 118.

[0065] The image acquisition unit 102 acquires a captured image, which is a still image of the drug to be identified. The captured image may be an image captured by the in-camera 20 or the out-camera 22, for example. The captured image may be an image acquired from another device via the wireless communication unit 30, the external memory unit 38, or the external input / output unit 40. The captured image may include multiple drugs to be identified. The multiple drugs to be identified are not limited to drugs to be identified of the same drug type, and may be drugs to be identified of different drug types. The captured image may be an image of the drug to be identified stored in a sachet. The sachet may be entirely or partially transparent or translucent.

[0066] In this embodiment, an example is described in which an image IM showing only one drug to be identified is processed. However, when processing an image in which different types of drugs are mixed and multiple drugs are photographed together at once (as one image), individual drug areas are detected from the photographed image containing multiple drugs, and the images in which the drug area is cut out for each drug (cut-out images for each drug) are processed separately.

[0067] The captured image may be an image of the drug to be identified and the marker. In this case, the marker functions as a reference when standardizing the shooting distance and the shooting viewpoint. The marker may be composed of a plurality of markers of the same shape, with the representative point of each marker being the reference point for standardization, or may be composed of a single marker, with a plurality of feature points included in the marker being the reference point for standardization. In the case of a method composed of a plurality of markers of the same shape, each marker may be, for example, an ArUco marker, a circular marker, or a rectangular marker. The plurality of markers are arranged, for example, at the four corners of a rectangular area in the drug placement range. The captured image may be an image of the drug to be identified and a reference gray color. On the other hand, in the case of a method composed of a single marker, the marker may be a square or U-shaped (a shape in which one side of a rectangle is missing, so-called U-shaped). The single marker is arranged so as to surround the rectangular area in the drug placement range. In this case, each point of the four corners of the square or U-shaped is the reference point for standardization.

[0068] The photographed image may be an image photographed at a standard photographing distance and a standard photographing viewpoint. The photographing distance can be expressed by the distance between the identification target drug and the photographing lens and the focal length of the photographing lens. The photographing viewpoint can be expressed by the angle between the marker print surface and the optical axis of the photographing lens.

[0069] The image acquisition unit 102 includes an image correction unit (not shown). When a captured image includes a marker, the image correction unit standardizes the shooting distance and shooting viewpoint of the captured image based on the marker to acquire a standardized image. The standardized image may be an image obtained by cutting out an area inside a rectangle having markers at the four corners as vertices after a standardization process is performed on the captured image. For example, the image correction unit specifies the coordinates of the four vertices of a rectangle whose coordinates are specified by the markers after standardization of the shooting distance and shooting viewpoint. The image correction unit obtains a perspective transformation matrix that transforms these four vertices into the positions of the specified coordinates. Such a perspective transformation matrix is ​​uniquely determined if there are four points. For example, a transformation matrix can be obtained by the getPerspectiveTransform function of OpenCV (Open Source Computer Vision Library) if there is a correspondence between the four points.

[0070] The image correction unit performs perspective transformation on the entire original captured image using the obtained perspective transformation matrix, and obtains a transformed image. Such perspective transformation can be performed using the warpPerspective function of OpenCV. This transformed image may be a standardized image in which the shooting distance and shooting viewpoint are standardized.

[0071] Furthermore, when the captured image includes an area of ​​a reference gray color, the image correction section may perform color correction on the captured image based on the reference gray color.

[0072] The drug identification model 104 is a learned AI model trained by machine learning to perform the task of identifying the type of drug from an input image IM, that is, so-called object recognition. The type of drug identified by the drug identification model 104 is, for example, a drug type that can be specified by identification information such as a YJ code (individual drug code) or a drug name. Drug identification in this embodiment can be defined as an act of determining which YJ code the drug to be identified is. This is an example of the definition of drug identification, and for example, the identification code may be defined using a type other than the YJ code.

[0073] The drug identification model 104 functions as a multi-class classifier that receives an input of an image IM obtained by photographing a drug to be identified, identifies the type of the drug to be identified in the image IM, and classifies it into N types of drug types (classes) that have been learned. That is, when an image IM is input, the drug identification model 104 calculates a score value indicating the likelihood (certainty) that the drug to be identified is drug i for all N types of drugs i that have been learned. In the notation "drug i," "i" is an index that distinguishes the N types of drugs that have been learned. The drug identification model 104 calculates a score value for each drug i that is an index for determining whether the drug to be identified is drug i.

[0074] The drug identification model 104 is configured using, for example, a neural network. As a machine learning model suitable for image recognition, for example, a convolution neural network (CNN) can be used. The image IM input to the drug identification model 104 may be a region image of the drug to be identified cut out from the captured image. In addition to the image IM, the drug identification model 104 may also be input with imprint information extracted from the image IM.

[0075] The drug identification model 104 may be a model that has been trained to receive an image of one side of a drug to be identified (from one direction) and to identify the type of the drug to be identified and even the front and back of the drug to be identified (whether it is the front side or the back side). The drug identification model 104 is an example of a "first trained model" in the present disclosure.

[0076] The attribute classification model 106 is a learned AI model trained by machine learning so that it can receive an input of an image IM, identify the external attributes of a drug to be identified in the image IM, and determine whether the drug belongs to a category j corresponding to each of a plurality of attributes that a human can visually recognize from the appearance. In the notation "category j," "j" is an index that distinguishes between a plurality of categories corresponding to each of a plurality of attributes that a human can recognize from the appearance. The attribute classification model 106 is an example of a "second trained model" in the present disclosure.

[0077] Examples of categories that the attribute classification model 106 may learn include, for example, circle, triangle, square, pentagon, non-transparent capsule, transparent capsule, two-color capsule, single-color capsule, red, blue, yellow, and white.

[0078] The attribute classification model 106 outputs category information indicating the external attributes of the drug to be identified in the image IM from the input image IM. The output of the attribute classification model 106 may be a score value that definitively determines whether or not the drug belongs to each category j, or may be a score value that indicates the likelihood (certainty) of belonging to each category j. In other words, the score value output by the attribute classification model 106 may be a discrete value of "0" or "1", or may be a continuous value. In addition, the score value may be used as a definitively determined score value by setting a threshold value for the continuous score value and binarizing it.

[0079] The attribute classification model 106 functions as a multi-class classifier that classifies drugs to be identified into multiple categories (classes), but the fineness (granularity) of classification is different from that of the drug identification model 104. The number of drug types identified by the drug identification model 104 is, for example, on the order of several thousands to several tens of thousands, whereas the number of categories identified by the attribute classification model 106 is, for example, on the order of several tens, and the granularity of classification is significantly different. One drug may belong to multiple categories.

[0080] The drug master 108 is a database of master data including information on whether each of N types of drugs i belongs to a category j (see FIG. 5). The drug master 108 includes information indicating a plurality of appearance attributes for all N types of drugs i that can be identified by the drug identification model 104. The drug master 108 may be stored not only in the memory 34 of the smartphone 10 but also in an external device on a network that is communicably connected to the smartphone 10, such as a cloud server (not shown).

[0081] The compatible drug extraction unit 110 refers to the drug master 108 based on the category information output by the attribute classification model 106, and acquires from the drug master 108 information on drug types that belong to the same category as the drug to be identified.

[0082] The importance setting unit 112 sets an importance for each category j. The value according to the importance may be a fixed value determined in advance, but it is preferable that the importance setting can be customized for each user or at a timing desired by the user. For example, the importance setting may be changed for each user or each time a drug type is determined by accepting an input of an instruction to change the importance setting from a user via a user interface and having the user select an option such as "color-oriented" or "shape-oriented" from a GUI (Graphical User Interface) button or a setting screen of an application. When "color-oriented" is selected, the importance of the category related to "color" is set to a value that relatively increases the importance, and when "shape-oriented" is selected, the importance of the category related to "shape" is set to a value that relatively increases the importance.

[0083] Furthermore, the CPU 28 can store setting information related to importance in the memory 34 in association with user information, and can read out the stored setting information for each user based on the user information to reproduce the settings for each user. It is preferable that the CPU 28 provides a GUI that accepts an instruction to change the setting related to importance regardless of the time, such as before acquiring the image IM, after acquiring the image IM, or while the candidates presented by the candidate presentation unit 116 are being displayed, and changes the setting at any time at the timing instructed by the user.

[0084] The score correction unit 114 corrects the score value s for each drug i output from the drug identification model 104. i For the identification target drug, the score value of the drug type having the same external attribute as the drug to be identified from the drug master 108 is corrected using the output of the attribute classification model 106. The score correction unit 114 corrects the score value s i and the corrected score value s ci Calculate.

[0085]

number

[0086]

number

[0087] k j is the weighting factor for category j. j corresponds to the importance of the information belonging to category j.

[0088] N j is the number of drug types that belong to category j. N j The smaller the value of,, the rarer the attribute of the category j is.,N jThe larger the value of,, it indicates that the category j is a common attribute.

[0089] α is a constant that represents the degree to which the rarity of drugs in a category is reflected in the score. The reason for considering α is based on the idea that information about belonging to a rare category is more useful for identifying the type of drug. Note that when α=0, rarity is not reflected in the modified score.

[0090] δ ij is a value (discrete value) that is “1” if drug i belongs to category j on the drug master 108 and is determined to belong to category j when the image IM of the drug to be identified is input into the attribute classification model 106, and is “0” otherwise.

[0091] c ij is a score value or confidence (continuous value) regarding whether or not a drug to be identified belongs to category j, which is output from the attribute classification model 106 when drug i belongs to category j on the drug master 108 and an image IM of the drug to be identified is input to the attribute classification model 106.

[0092] A continuous value c indicating the likelihood (certainty) of each category j calculated by the attribute classification model 106 ij The binarized result is δ ij It could be.

[0093] The score value s output by the drug identification model 104 i is an example of a "first score value" in the present disclosure. k indicates the importance of category j. j is an example of a "value set for an attribute" in this disclosure. j The corrected score value s ci is an example of a "second score value" in this disclosure.

[0094] The candidate presentation unit 116 displays the corrected score value s ciThe candidate presentation unit 116 presents final drug candidates according to the magnitude of the corrected score value s ci The top candidates are displayed on the touch panel display 14 in descending order of importance. If a user inputs an instruction to change the importance setting while the candidates are being displayed, the score correction unit 114 corrects the score value s based on the changed setting. ci The candidate presentation unit 116 recalculates the score value s ci In this way, the list of drug candidates is updated in conjunction with changes to the importance settings.

[0095] The drug determination unit 118 receives an instruction from the user to determine the type of drug to be identified, and performs processing to determine the type of the identified drug in accordance with the received instruction.

[0096] [Explanation of the operation of the drug identification device 100] FIG. 5 is a diagram that shows an outline of an example of information registered in the drug master 108. The drug master 108 records information on color (white and yellow are exemplified in FIG. 5) and shape (circle and ellipse are exemplified in FIG. 5), which are appearance attributes of multiple types of drug i. FIG. 5 shows records of four types of drugs, drug 1 to drug 4, but the drug master 108 records information on all drug types that can be identified by the drug identification model 104. The categories of "white", "yellow", "circle", and "ellipse" shown in FIG. 5 are examples of appearance attributes that humans can visually recognize from the appearance of the drug.

[0097] The "1" or "0" information shown in each cell in the column corresponding to each category indicates whether or not the drug falls into the respective category, with the value being "1" if it falls into the respective category and "0" if it does not. An importance (k1, k2, k3, k4) is set for each category. In the example of FIG. 5, k1=0.4, k2=0.4, k3=0.03, and k4=0.03 are set, and it can be seen that the importance of the attribute related to "color" is set high among multiple attributes of appearance. Here, the score value s output by the drug identification model 104 is iAs an example of a simple case when correcting, we will explain the case of α=0 in equation (1).

[0098] Although FIG. 5 shows the inscribed characters affixed to each medicine and an image of each medicine, the medicine master 108 does not need to include information on the inscribed characters.

[0099] The operation of the drug identification device 100 according to this embodiment will be specifically described using the example shown in Fig. 5. As shown in Fig. 6, when an image IM of a drug to be identified having a mark "AA11" is input to the drug identification model 104, the drug identification model 104 obtains the following scores: a score value of 0.5 for drug 1 with the mark "AA11", a score value of 0.4 for drug 2 with the mark "AA12", a score value of 0.3 for drug 4 with the mark "AA222", and a score value of 0.01 for drug 3 with the mark "BB98". It is presumed that the drug identification model 104 that outputs such scores places importance on the similarity of the appearance of the "marked characters" that are not included in the drug master 108.

[0100] If top candidates were presented based on these score values, drug 2 marked with the letters "AA12" would be presented as the second-highest candidate. However, to the human senses, drug 2 (AA12) is a yellow, oval tablet, and appears to be clearly different from the drug to be identified (a white, round tablet).

[0101] In the drug identification device 100 according to this embodiment, the score value output by the drug identification model 104 is corrected as follows: That is, when a captured image IMa of a drug to be identified having an inscription "AA11" is input to the attribute classification model 106, the attribute classification model 106 obtains a result that the drug to be identified belongs to two categories, "white" and "circular".

[0102] Based on the output of the attribute classification model 106, the compatible drug extraction unit 110 extracts drugs that belong to at least one of the categories of "white" and "circular" from all drug types registered in the drug master 108. The score correction unit 114 calculates the importance of white k1=0.4 and the importance of circular k3=0.03 for the drugs extracted by the compatible drug extraction unit 110 as score values ​​s i Add to.

[0103] In the example shown in FIG. 6, Drug 1 (stamp: AA11), Drug 3 (stamp: BB98), and Drug 4 (stamp: AA22) belong to the categories of “white” and “circular”, so the score values ​​s i "0.4+0.03" is added to each score value to correct the respective scores. In this way, the scores of the drugs that fall into the "white" and "round" categories identified by the attribute classification model 106 are inflated. On the other hand, since drug 2 (stamped letters: AA12) does not belong to either the "white" or "round" category, the score value of drug 2 is not corrected and the original score value (0.40) is maintained.

[0104] Therefore, the corrected score values ​​are "0.93" for drug 1 (stamped letters: AA11), "0.40" (uncorrected) for drug 2 (stamped letters: AA12), "0.44" for drug 3 (stamped letters: BB98), and "0.73" for drug 4 (stamped letters: AA22). If the corrected scores are rearranged from largest to smallest, the order is drug 1 (0.93), drug 4 (0.73), drug 3 (0.44), and drug 2 (0.40), and drug 2, which is a different color from the drug to be identified, can be ranked lower. This makes it possible to reflect the previously set policy of "emphasizing color in judgment."

[0105] The touch panel display 14 displays the corrected score value s ci A list of drug candidates is displayed, with the top candidates sorted by the magnitude of the modified score s ciThe order of the top candidates presented based on this is close to human perception (sensation of similarity), and is expected to be more convincing to users.

[0106] The numerical values ​​of the importance and the like described in FIG. 6 are merely examples for the purpose of explanation. The calculated modified score value changes depending on the setting of the importance parameter. The importance parameter for each attribute is set to an appropriate value so that the modified score value is close to the human similarity sense. For example, the appropriate value or range of the importance parameter may be determined by trial and error, or may be determined by performing an automatic optimization search by increasing or decreasing the parameter.

[0107] [Examples of drug identification methods] Fig. 7 is a flowchart showing an example of a drug identification method executed by the drug identification device 100 according to the embodiment. The drug identification method including the steps shown in Fig. 7 is realized by the CPU 28 reading and executing a program from the memory 34. The program for executing the drug identification method may be provided via the wireless communication unit 30 or the external input / output unit 40.

[0108] In step S1, the CPU 28 acquires an image of the drug to be identified. For example, the CPU 28 acquires an image captured by the outer camera 22. The acquired image may include a plurality of drugs to be identified. When the acquired image includes a marker, the CPU 28 may standardize the shooting distance and shooting viewpoint of the captured image based on the marker to generate a standardized image. The CPU 28 may also perform correction processing such as color correction on the acquired image.

[0109] In step S2, the CPU 28 detects the area of ​​the medicine from the acquired image. The process of detecting the medicine area is executed, for example, using a trained model trained to extract the area of ​​the medicine from within the image. The CPU 28 may cut out each area of ​​the medicine detected from within the image and obtain an area image for each medicine (hereinafter, referred to as a medicine image). The image IM described in FIG. 4 and FIG. 6 may be a medicine image cut out on a medicine-by-medicine basis.

[0110] In step S3, CPU 28 extracts the marking and / or printing of the drug to be identified from the drug image, and generates a marking extraction image. The marking extraction image is an image in which the brightness of the marking or printing part of the drug to be identified is relatively higher than the brightness of the part other than the marking or printing part. The term "marking extraction image" is not limited to markings, but also includes images extracted from printing on tablets or capsules. The marking extraction image may be referred to as a character symbol extraction image. The term "marking" includes concepts such as "marking", "printing", "printed symbol", "identification symbol" or "character symbol" for tablets or capsule drugs.

[0111] In step S4, the CPU 28 identifies the type of drug to be identified from the drug image using the drug identification model 104. By inputting the drug image to the drug identification model 104, the drug identification model 104 calculates a score value s for all drug types that can be identified. i The medicine identification model 104 receives a combination of the medicine image and the image of the extracted mark, and outputs a score value s for all medicine types. i may be output.

[0112] In parallel with the processes of steps S3 and S4, in step S5, CPU 28 identifies the external attributes of the drug to be identified from the drug image using attribute classification model 106. By inputting the drug image to attribute classification model 106, information on the category to which the drug to be identified belongs is output from attribute classification model 106.

[0113] In step S6, the CPU 28 inquires of the medicine master 108 about medicines that belong to the same category as the category of the medicine to be identified output from the attribute classification model 106, and acquires from the medicine master 108 medicines that belong to the same category as the medicine to be identified.

[0114] Then, in step S7, the CPU 28 assigns a score value s to drugs that belong to the same category as the drug to be identified according to the importance level set for each category. i The CPU 28 corrects the corrected score value s for all drug types using the above-mentioned formula (1) or formula (2). ci Calculate.

[0115] In step S8, the CPU 28 calculates the modified score value s ci The top candidates are obtained in descending order, and a list of drug candidates is generated in descending order.

[0116] In step S9, the CPU 28 outputs the top candidates obtained in step S8 as candidates for the type of the drug to be identified. The CPU 28 causes the top candidates based on the magnitude of the correction score value to be selectably displayed on the touch panel display 14. The user can input an instruction to select the correct drug type from the multiple candidates displayed on the touch panel display 14 and confirm the type of the drug to be identified.

[0117] Furthermore, the CPU 28 may accept input of various instructions, such as an instruction to correct the display of the candidate drug types or an instruction to move to other processing such as a text search by engraving, from a user interface such as the touch panel display 14. The user can confirm the presented candidate drug types and input an instruction to confirm the drug type from the user interface of the touch panel display 14, or input an instruction to correct the display of the candidates or move to a text search.

[0118] In step S10, the CPU 28 receives an instruction to confirm the type of drug to be identified via the touch panel display 14 or voice input, and performs processing to confirm the type of drug to be identified in accordance with the received instruction.

[0119] When the processes of steps S3 to S10 have been performed for all of the drugs to be identified that are included in the image acquired in step S1, the CPU 28 ends the flow chart of FIG.

[0120] According to the drug identification device 100 of this embodiment, the score value s calculated by the drug identification model 104 i Based on the output of the attribute classification model 106, the score value s is calculated by taking into account the appearance attribute. i The corrected score value s ci Candidates are presented based on this, so they can present candidates that are convincing even to humans.

[0121] [Hardware configuration of each processing unit] The hardware structure of the processing unit that executes various processes such as the image acquisition unit 102, the compatible drug extraction unit 110, the importance setting unit 112, the score correction unit 114, the candidate presentation unit 116, and the drug determination unit 118 described in Figure 4 is various processors as shown below.

[0122] Various types of processors include a CPU (Central Processing Unit), which is a general-purpose processor that executes programs and functions as various processing units, a GPU (Graphics Processing Unit), which is a processor specialized for image processing, a Programmable Logic Device (PLD), 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 to execute a specific process, such as an ASIC (Application Specific Integrated Circuit).

[0123] A processing unit may be composed of one of these various processors, or may be composed of two or more processors of the same type or different types. For example, a processing unit may be composed of multiple FPGAs, or a combination of a CPU and an FPGA, or a combination of a CPU and a GPU. Also, multiple processing units may be composed of one processor. As an example of multiple processing units being composed of one processor, first, as represented by a computer such as a client or a server, there is a form in which one processor is composed of a combination of one or more CPUs and software, and this processor functions as multiple processing units. Second, as represented by a system on chip (SoC), there is a form in which a processor that realizes the functions of the entire system including multiple processing units is used in one IC (Integrated Circuit) chip. In this way, the various processing units are composed of one or more of the above various processors as a hardware structure.

[0124] Furthermore, the hardware structure of these various processors is, more specifically, an electric circuit that combines circuit elements such as semiconductor elements.

[0125] <Regarding the program that realizes the functions of the drug identification device 100> The processing function of the drug identification device 100 is not limited to the smartphone 10, and can be realized using various types of information processing devices such as a tablet computer, a personal computer, a workstation, or a server. The processing function of the drug identification device 100 may be realized by a computer system including multiple computers.

[0126] A program that causes a computer to realize some or all of the processing functions of the drug identification device 100 described in the above embodiment can be recorded on a computer-readable medium that is a non-transient information storage medium such as an optical disk, a magnetic disk, or a semiconductor memory, and the program can be provided through this information storage medium. In addition, instead of providing the program by storing it on such a non-transient information storage medium that is a tangible object, it is also possible to provide a program signal as a download service using an electric communication line such as the Internet.

[0127] It is also possible to provide a part or all of the processing functions of the drug identification device 100 as an application server, and to provide a service that provides the processing functions via an electric communication line.

[0128] <Effects of the embodiment> According to the drug identification device 100 according to the embodiment, the following effects can be obtained.

[0129] [1] Score value s of drug candidates output by the machine learning-based drug identification model 104 i However, by retroactively modifying the candidates to match human sense of similarity, it is possible to present candidates in an order that is acceptable to humans.

[0130] [2] The external characteristics (features) that you want to emphasize can be customized for each user or each drug type.

[0131] [3] After the drug identification model 104 is trained, a mechanism (attribute classification model 106, drug master 108, and score correction unit 114) for considering appearance attributes to be emphasized can be added independently of the drug identification model 104, and the candidates to be presented can be controlled. Although training the drug identification model 104 requires high cost, the attribute classification model 106 can be generated at a relatively low cost. According to this embodiment, by combining additional configurations (attribute classification model 106, drug master 108, and score correction unit 114) without recreating the high-cost drug identification model 104, it is possible to present candidates that are close to human similarity sense.

[0132] [4] For example, by assigning a high importance to unusual (rare) attributes such as “pentagonal” or “triangular” regarding the shape of a drug, when such an unusual attribute is identified by the attribute classification model 106, the score value can be modified to present candidates only for drug types that have the same attribute.

[0133] [5] Even if a drug has not been trained in the drug identification model 104 and the attribute classification model 106, if certain external attributes are known and the drug has been trained in the attribute classification model 106, the drug may be able to be made a candidate if it is simply registered in the drug master 108.

[0134] [Variation 1] The means for identifying the external attributes of the drug to be identified from the image is not limited to an AI model such as the attribute classification model 106. It is sufficient to capture one or more external attributes from the input image and classify the image according to the attributes, and various image processing technologies other than AI, such as an image recognizer using a template matching method, can be applied.

[0135] [Modification 2] Instead of or in addition to the category information output by the attribute classification model 106, a numerical value such as a continuous value corresponding to the external attribute of the drug to be identified (for example, a numerical value indicating the size of the drug to be identified) is calculated from the image, and a score value s is calculated according to this continuous value. imay be modified.

[0136] [Modification 3] In the above embodiment, the score value s of the drug type that matches the appearance attribute of the drug to be identified is i The score s is calculated by adding a value according to the importance of the corresponding attribute to i However, the score correction calculation is not limited to "addition" and various calculation formulas including multiplication can be applied. i For example, by defining a negative value for kj, which indicates the importance, the score value after correction can be increased by s i There could also be revisions that are lower than this.

[0137] Score value s of drug types that match the external attributes of the drug to be identified i Instead of correcting for , the score value s of drug types that do not match the external attributes of the drug to be identified (non-matching) are i By making a correction to reduce the rank of the non-matching drug type, the drug master 108 can be queried using the category information output by the attribute classification model 106, and information on drug types that match the external attributes of the drug to be identified can be extracted from the drug master 108, and information on non-matching drug types can also be extracted.

[0138] [Modification 4] In the above embodiment, an example of identifying medicines has been described, but the technology of the present disclosure can also be applied to a case of inspecting medicines.

[0139] 〔others〕 The technical scope of the present invention is not limited to the scope of the above-mentioned embodiment and modified examples. The configurations and the like in the embodiment and modified examples can be changed without departing from the spirit of the present invention, and the embodiment and modified examples can be appropriately combined. [Explanation of symbols]

[0140] 10. Smartphones 12. Chassis 14 Touch panel display 16 Speakers 18 Microphones 20 In-camera 22 Rear camera 24 Light 26 Switch 30 Wireless Communication Section 32 Telephone section 34 Memory 36 Internal storage 38 External memory unit 40 External input / output section 42 GPS receiver 44 Power supply section 100 Drug Identification Device 102 Image acquisition unit 104 Drug Identification Model 106 Attribute Classification Model 108 Drug Master 110 Compatible Drug Extraction Section 112 Importance setting part 114 Score Correction Section 116 Candidate presentation section 118 Drug Confirmation Department IM Image ST1, ST2, STn GPS satellite S1-S10 Steps of the drug identification method

Claims

1. One or more processors, It comprises one or more storage devices, The one or more of the storage devices are A first trained model that has been trained to identify the type of drug to be identified from an image in which the drug to be identified is captured, A drug master containing information about one or more external attributes for each of several types of drugs is stored. The one or more processors described above are From the aforementioned image, a first score value is calculated for each of the multiple drug types that can be identified using the first trained model, indicating the likelihood that it is the type of drug to be identified. From the aforementioned image, one or more external attributes of the target drug are identified, Information on drug types that match the attributes of the identified drug is obtained from the drug master, and a second score value is calculated using the first score value and the value set for the attribute. Based on the second score value, candidate types of the drug to be identified are presented. Drug identification device.

2. The one or more of the storage devices are A second trained model, which has been trained to identify one or more external attributes of the target drug from the aforementioned image, is stored. The one or more processors described above are Using the second trained model, it is determined whether the drug to be identified belongs to one or more categories corresponding to the aforementioned appearance attributes. The drug identification device according to claim 1.

3. The value set for the aforementioned attribute is a value corresponding to the importance of the attribute. The drug identification device according to claim 1.

4. The one or more processors described above are Upon receiving an instruction to change the aforementioned importance setting, Based on the instructions received, a value corresponding to the importance of the attribute is set. The drug identification device according to claim 3.

5. The value corresponding to the aforementioned importance can be set for each user. The drug identification device according to claim 4.

6. The aforementioned value corresponding to importance can be set by the user at any time they wish. The drug identification device according to claim 4 or 5.

7. Equipped with an input device, The one or more processors receive input from the input device for instructions regarding the setting of importance. The drug identification device according to claim 3.

8. The drug master includes information on multiple appearance attributes, including attributes relating to the shape and color of the drug. The one or more processors described above are In calculating the second score value, the system accepts instructions to specify whether to prioritize the attribute related to the shape or the attribute related to the color. Based on the instructions received, the importance of at least one of the attributes relating to the shape and the attributes relating to the color is changed. The drug identification device according to claim 3.

9. The one or more processors described above are The second score value is calculated by adding a value corresponding to the importance of the attribute to the first score value for the drug type that matches the attribute of the identified drug. The drug identification device according to claim 3.

10. The one or more processors described above are The second score value is calculated by modifying the first score value for drug types that match the attribute of the identified drug using the value set for the attribute. The drug identification device according to claim 1.

11. The drug master includes information on a plurality of appearance attributes, including attributes relating to at least one of the shape and color of the drug. The one or more processors described above are To identify whether the target drug conforms to the plurality of appearance attributes, The drug identification device according to claim 1.

12. The one or more processors described above are A list of drug candidates is presented, in which multiple candidates are arranged in order of the magnitude of the second score value. The drug identification device according to claim 1.

13. The system includes a display that shows the candidate types of the drug to be identified. The drug identification device according to claim 1.

14. The system includes a camera for photographing the drug to be identified. The drug identification device according to claim 1.

15. One or more processors, Using a first trained model that has been trained to identify the type of drug to be identified from an image in which the drug to be identified is captured, a first score value is calculated from the image to indicate the likelihood that each of several drug types is the type of drug to be identified. Identifying one or more external attributes of the target drug from the aforementioned image, Obtaining information on drug types that match the attributes of the drug to be identified from a drug master containing information on one or more outward attributes for each of several types of drugs that the first trained model can identify, Based on the information of drug types that match the attribute of the identified drug, a second score value is calculated using the first score value and a value determined for the attribute. Based on the second score value, candidates for the type of drug to be identified are presented, A drug identification method that performs the following actions.

16. On the computer, A function that uses a first trained model, which has been trained to identify the type of drug to be identified from an image in which the drug to be identified is captured, to calculate a first score value from the image indicating the likelihood that each of several drug types is the type of drug to be identified. The function of identifying one or more external attributes of the target drug from the aforementioned image, A function to obtain information on drug types that match the attributes of the drug to be identified from a drug master containing information on one or more outward attributes for each of several types of drugs that the first trained model can identify, A function to calculate a second score value using the first score value and a value determined for the attribute, based on information of drug types that match the attribute of the identified drug, A function that presents candidate types of the drug to be identified based on the second score value, A program that makes this possible.