[go: up one dir, main page]

WO2021182345A1 - 学習データ作成装置、方法、プログラム、学習データ及び機械学習装置 - Google Patents

学習データ作成装置、方法、プログラム、学習データ及び機械学習装置 Download PDF

Info

Publication number
WO2021182345A1
WO2021182345A1 PCT/JP2021/008791 JP2021008791W WO2021182345A1 WO 2021182345 A1 WO2021182345 A1 WO 2021182345A1 JP 2021008791 W JP2021008791 W JP 2021008791W WO 2021182345 A1 WO2021182345 A1 WO 2021182345A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
learning
drug
region
correct answer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/JP2021/008791
Other languages
English (en)
French (fr)
Inventor
一央 岩見
真司 羽田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujifilm Toyama Chemical Co Ltd
Original Assignee
Fujifilm Toyama Chemical Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujifilm Toyama Chemical Co Ltd filed Critical Fujifilm Toyama Chemical Co Ltd
Priority to JP2022507151A priority Critical patent/JP7375161B2/ja
Publication of WO2021182345A1 publication Critical patent/WO2021182345A1/ja
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis

Definitions

  • the present invention relates to a learning data creation device, a method, a program, a learning data, and a machine learning device, and particularly relates to a technique for efficiently creating a large number of learning data.
  • Patent Document 1 a visual inspection device has been proposed that learns based on a large number of teaching data stored in a teaching file, recognizes a pattern, and determines a defect.
  • This visual inspection device includes a teaching data generation device that generates new teaching data by transforming the specific teaching data for a specific teaching data having a small number of data among a large number of teaching data in the teaching file. By supplementing the teaching data generated by the teaching data generator to the teaching file and learning, it is possible to inspect defects with a small number of data.
  • the teaching data generation device performs affine transformation including enlargement, reduction, and rotation of the image, and attribute conversion including brightness, contrast, and edge strength. New teaching data is being generated.
  • the photographed image in which the drug is photographed and the photographed image are included. It is necessary to create a large number of pairs with area information (correct answer data) indicating the area of the drug, and to machine-learn the learning model using a learning data set consisting of a large number of pairs.
  • this type of correct answer data is created by displaying the captured image on the display and filling the area of the drug pixel by pixel while viewing the captured image displayed on the display, which is troublesome to create the correct answer data. There is a problem that it takes time.
  • the visual inspection apparatus described in Patent Document 1 uses a camera to image a printed matter or an object on the ground (paper, film, metal, etc.), recognizes a print defect from the captured image, and recognizes the type of defect (defect type (paper, film, metal, etc.)). It separates "holes”, “stains”, “convex”, “streaks”, etc.).
  • the teaching data generator transforms one data (image data) having a small number of data to newly generate a plurality of teaching data, it corresponds to the plurality of teaching data generated by transforming the same image data.
  • the correct answer data is data indicating the same type of defect. That is, Patent Document 1 does not describe the problem that it takes time and effort to create correct answer data for teaching data (teaching image), and does not disclose a technique for solving the problem.
  • the present invention has been made in view of such circumstances, and it is possible to efficiently create learning data for machine learning a learning model that recognizes region information corresponding to a region of a drug from a photographed image of a drug. It is an object of the present invention to provide a learning data creation device, a method, a program, a learning data, and a machine learning device capable of providing the learning data.
  • the invention according to the first aspect in order to achieve the above object is a learning data creation device including a processor and a memory, in which the processor creates learning data for machine learning, and the processor is a drug photographed.
  • the acquisition process of acquiring the captured image, the learning image generation process of generating the learning image in which the drug is arbitrarily arranged from the acquired captured image, and the second region information corresponding to the region of the drug in the generated learning image are provided.
  • Performs correct answer data generation processing that generates and uses the generated second area information as correct answer data for the learning image, and storage control that stores the pair of the generated learning image and correct answer data in the memory as learning data. ..
  • a learning image in which the drug is arbitrarily arranged is generated from the photographed image in which the drug is photographed.
  • the second region information corresponding to the region of the drug in the generated learning image is generated, and the generated second region information is used as the correct answer data for the learning image. Since the correct answer data can be generated by the correct answer data generation process by the processor, it does not require time and effort to create the correct answer data.
  • the processor acquisition process acquires the first area information corresponding to the drug area in the acquired captured image, and the correct answer data generation process is the acquired first. It is preferable to generate the second area information based on the area information.
  • the acquisition process of the processor acquires a photographed image in which a plurality of drugs are photographed or a plurality of photographed images in which the drug is photographed, and is used in a plurality of drug areas. It is preferable to acquire a plurality of corresponding first region information.
  • the first area information is the area information in which the drug area in the captured image is manually set, and the drug area in the captured image is automatically extracted by image processing. It is preferable that the area information obtained or the area of the drug in the captured image is automatically extracted by image processing and manually adjusted.
  • the correct answer data includes the correct answer image corresponding to the drug region, the bounding box information surrounding the drug region with a rectangle, and the edge information indicating the edge of the drug region. It is preferable to contain at least one of.
  • the correct image includes a mask image.
  • the learning image generation process generates a learning image by translating, inverting, rotating, or scaling the captured image
  • the correct answer data generation process is the first. It is preferable to generate correct answer data by translating, inverting, rotating, or scaling the area information according to the captured image.
  • the generation of the learning image and the generation of the correct answer data may be simultaneously generated by parallel processing, or one of the learning image and the correct answer data may be generated and then the other may be generated.
  • the learning image generation process generates a learning image by synthesizing two or more images obtained by parallel-moving, inverting, rotating, or scaling the captured image.
  • the correct answer data generation processing it is preferable to generate correct answer data by moving, inverting, rotating, or scaling the first region information corresponding to each of the two or more images in parallel corresponding to the captured image.
  • the processor includes a drug image acquisition process for acquiring a drug image obtained by cutting out a drug region from a captured image based on the acquired first region information, and includes a learning image.
  • the acquired drug image is moved in parallel, inverted, rotated, or scaled to generate a learning image
  • the correct answer data generation process the first region information is moved in parallel, inverted, rotated, or rotated in accordance with the drug image. , Or it is preferable to scale to generate correct answer data.
  • the processor includes a drug image acquisition process for acquiring a drug image obtained by cutting out a drug region from a captured image based on the acquired first region information, and includes a learning image.
  • the generation process generates a learning image by synthesizing two or more images obtained by parallel-moving, reversing, rotating, or scaling the acquired drug image, and the correct answer data generation process corresponds the first region information to the drug image. It is preferable to generate correct answer data by synthesizing two or more second region information that has been moved in parallel, inverted, rotated, or scaled. As a result, it is possible to generate a learning image composed of images of a plurality of drugs and correct answer data thereof.
  • the learning data creating apparatus in the learning image generation process, when a learning image including a plurality of agents is generated, all or a part of the plurality of agents come into contact with each other by dots or lines. It is preferable to generate a learning image.
  • the correct answer data includes an edge image showing only the points or lines of a plurality of drug images that come into contact with each other.
  • an edge image showing only a portion of the plurality of drug images in contact with points or lines can be included. This learning data is useful for separating the points of contact with points or lines of a plurality of drug images.
  • the drug is preferably a drug that is at least partially transparent.
  • a drug that is at least partially transparent is more difficult to extract than a drug that is entirely opaque, and there is less training data. Therefore, it is particularly effective to generate training data for a drug that is at least partially transparent.
  • a drug other than a transparent drug may be arbitrarily arranged.
  • a drug other than a transparent drug may be arbitrarily arranged.
  • an image in which the drug image is arbitrarily arranged and an image in which the transparent drug is arranged in the same position and photographed are different images depending on the positional relationship with the illumination light.
  • the captured image is an image of a drug handled by the own pharmacy. This is because it is only necessary to be able to create learning data for the drugs handled by the own pharmacy.
  • the invention according to the fifteenth aspect is a learning consisting of a pair of a learning image generated by arbitrarily arranging a photographed drug and correct answer data having a second region information indicating a drug region in the learning image. It is data.
  • the machine learning device includes a learning model and a learning control unit that uses the above learning data to perform machine learning of the learning model.
  • the learning model is preferably composed of a convolutional neural network.
  • the invention according to the eighteenth aspect is a learning data creation method in which a processor creates learning data for machine learning by performing the processing of each of the following steps, and includes a step of acquiring a photographed image in which a drug is photographed. , A step of generating a learning image in which a drug is arbitrarily arranged from the acquired captured image, and a second area information corresponding to a drug area in the generated learning image is generated, and the generated second area information is used for learning. It includes a step of making correct answer data for an image and a step of storing a pair of a generated learning image and correct answer data in a memory as learning data.
  • the correct answer data includes the correct answer image corresponding to the drug region, the bounding box information surrounding the drug region with a rectangle, and the edge information indicating the edge of the drug region. It is preferable to contain at least one of.
  • the learning data creation method in the step of generating a learning image, when arranging a plurality of drugs, it is preferable to bring all or a part of the plurality of drugs into contact with points or lines. ..
  • the correct answer data includes an edge image showing only the points of contact with the points or lines of a plurality of drugs.
  • the drug is a transparent drug.
  • a drug other than a transparent drug may be arbitrarily arranged. preferable.
  • the invention according to the 24th aspect has a function of acquiring a photographed image in which a drug is photographed, a function of generating a learning image in which a drug is arbitrarily arranged from the acquired photographed image, and a region of the drug in the generated learning image.
  • This is a learning data creation program that realizes with a computer.
  • the present invention it is possible to efficiently create learning data for machine learning a learning model that recognizes region information corresponding to a region of a drug from a photographed image of the drug.
  • FIG. 1 is a diagram showing a captured image input to the trained learning model and an output result desired to be acquired from the learning model.
  • FIG. 2 is a diagram showing an example of learning data.
  • FIG. 3 is a conceptual diagram showing image processing when correct answer data is automatically created.
  • FIG. 4 is a diagram showing a first embodiment in which learning data is created by simulation.
  • FIG. 5 is a diagram showing a second embodiment in which learning data is created by simulation.
  • FIG. 6 is a block diagram showing an example of the hardware configuration of the learning data creation device according to the present invention.
  • FIG. 7 is a plan view showing a drug package in which a plurality of drugs are packaged.
  • FIG. 8 is a block diagram showing a schematic configuration of the photographing apparatus shown in FIG. FIG.
  • FIG. 9 is a plan view showing a schematic configuration of the photographing apparatus.
  • FIG. 10 is a side view showing a schematic configuration of the photographing apparatus.
  • FIG. 11 is a block diagram showing an embodiment of the learning data creation device according to the present invention.
  • FIG. 12 is a diagram showing an example of the first region information showing the region of the drug in the captured image acquired by the image acquisition unit and the captured image acquired by the first region information acquisition unit.
  • FIG. 13 is a diagram showing an example of learning data generated from the captured image and the mask image shown in FIG.
  • FIG. 14 is a diagram showing an example of an edge image showing only a portion of contact with a plurality of drug points or lines.
  • FIG. 15 is a block diagram showing an embodiment of the machine learning device according to the present invention.
  • FIG. 16 is a flowchart showing an embodiment of the learning data creation method according to the present invention.
  • FIG. 1 is a diagram showing a captured image input to the trained learning model and an output result desired to be acquired from the learning model.
  • the output result of the learning model shown in FIG. 1 (B) is an inference result inferring the drug region (drug region) in the captured image shown in FIG. 1 (A).
  • the drug region and the background region are inferred. It is a mask image in which and is classified into areas.
  • the inference result is not limited to the mask image, and for example, a bounding box surrounding the drug region with a rectangular frame, coordinates of two diagonal points of the bounding box, or a combination thereof can be considered.
  • FIG. 2 is a diagram showing an example of learning data.
  • the left side is a photographed image (learning image) of the drug
  • the right side is the correct answer data for the photographed image
  • the pair of the left and right photographed images and the correct answer data is the learning data.
  • the correct answer data of this example is a mask image that distinguishes the region of each drug from the background.
  • the correct answer data when the correct answer data is automatically created, for example, it can be obtained by calculating the position and rotation angle of the drug by template matching from the captured image.
  • FIG. 3 is a conceptual diagram showing image processing when correct answer data is automatically created.
  • a template image Itpl which is an image showing the drug is prepared.
  • the shape of the drug is not circular, it is preferable to prepare a plurality of template images Itpl for each rotation angle to be searched.
  • the captured image ITP and the correct answer data may be superimposed and displayed on the display, and if there is an error in the mask image, the user may correct the mask image on a pixel-by-pixel basis.
  • FIG. 4 is a diagram showing a first embodiment in which learning data is created by simulation.
  • FIG. 4A is a diagram showing a pair of a photographed image obtained by photographing a drug and a mask image manually or automatically generated based on the photographed image.
  • the present invention creates learning data by simulation from a pair of a photographed image and a mask image (inflates the learning data).
  • FIG. 4B is a diagram showing a pair of a photographed image and a mask image in which the photographed image and the mask image shown in FIG. 4A are inverted, respectively.
  • the inverted (left-right inverted) mask image on the right side shown in FIG. 4 (B) is a mask image showing the region of the drug in the inverted photographed image on the left side shown in FIG. 4 (B). Therefore, the inverted captured image can be used as a new learning image, and the inverted mask image can be used as correct answer data for the newly generated learning image.
  • the image inversion is not limited to horizontal inversion, but also includes vertical inversion. Alternatively, the image on the left may be created first, and the image on the right may be created by detecting the region of the drug image from the image.
  • FIG. 4 (C) is a diagram showing an image obtained by adding the images shown in FIGS. 4 (A) and 4 (B).
  • the photographed image on the left side shown in FIG. 4 (C) can be created by synthesizing the photographed image shown in FIG. 4 (A) and the inverted photographed image shown in FIG. 4 (B). That is, the captured image shown in FIG. 4 (C) is an image (drug image) obtained by cutting out a region of the drug in the inverted captured image shown in FIG. 4 (B) on the captured image shown in FIG. 4 (A). It can be created by pasting. The drug image is cut out from the inverted photographed image by the process of cutting out the drug region from the photographed image shown in FIG. 4 (A) based on the inverted mask image of FIG. 4 (B). Can be done.
  • the captured image shown in FIG. 4 (C) is an image (drug image) obtained by cutting out a region of the drug in the inverted captured image shown in FIG. 4 (B) on the captured image shown in FIG. 4 (A). It can be created by pasting.
  • the drug image is cut out from the inverted photographed image by the process of cutting out the drug region
  • the method of synthesizing two or more drug images is not limited to the method of using a mask image as described above. For example, using a background image of only the background in which the drug has not been photographed, only the drug image is extracted from FIGS. 4 (A) and 4 (B), and each extracted drug image is combined with the background image. Therefore, the captured image shown in FIG. 4C can be generated.
  • the mask image on the right side shown in FIG. 4 (C) can be created by adding the mask image shown in FIG. 4 (A) and the inverted mask image shown in FIG. 4 (B).
  • the pixel value of the drug region of the inverted mask image in FIG. 4C is set to, for example, "0.5", and the background pixels. By adding the values as "0", the pixel values of the two drug regions in the generated mask image are made different.
  • the two learning data shown in FIGS. 4 (B) and 4 (C) can be created from one learning data consisting of the pair of the photographed image and the mask image shown in FIG. 4 (A). ..
  • the captured image and the mask image shown in FIG. 4 (A) are inverted, and the training data composed of the new captured image and the mask image pair shown in FIG. 4 (B) is obtained.
  • the creation is not limited to this, and the captured image and the mask image shown in FIG. 4 (A) are synchronously moved, rotated, or scaled in parallel, respectively, from a new pair of the captured image and the mask image. You may create the training data.
  • a margin is generated in the background by translating, rotating, or reducing the captured image and the mask image, respectively, it is preferable to fill the margin with the same pixel value as the background.
  • a new photographed image and a mask image are created from the photographed image and the mask image in which one drug is photographed, but a plurality of photographed images and a plurality of photographed images in which a plurality of different agents are separately photographed and A new photographed image and a mask image may be created from the mask image or the photographed image and the mask image in which a plurality of different agents are simultaneously photographed.
  • FIG. 5 is a diagram showing a second embodiment in which learning data is created by simulation.
  • FIG. 5A is a diagram showing a pair of a photographed image obtained by photographing the drug and a mask image manually or automatically generated based on the photographed image, and is the same as the pair shown in FIG. 4A. be.
  • FIG. 5 (B) is a diagram showing drug regions cut out from the photographed image and the mask image shown in FIG. 5 (A), respectively.
  • the area within the rectangular frame surrounding the drug area is defined as the area for cutting out the image (cutout area). Since the drug region is known from the mask image, the image in the rectangular frame surrounding the drug region can be cut out based on the mask image.
  • FIG. 5C shows an image of a cutout region cut out from the photographed image and the mask image shown in FIG. 5A, respectively.
  • the drug image is cut out from the captured image by a process (drug image acquisition process) of cutting out a drug region from the captured image shown in FIG. 5 (A) based on the mask image shown in FIG. 5 (A). Can be done. Since the mask image shown in FIG. 5A has information indicating the drug region (first region information), the drug region (hereinafter referred to as “drug mask image”) can be cut out from the mask image. can. Further, the drug image acquisition process may include a process of reading an image in a state after being cut out from a memory or the like.
  • FIG. 5D is a diagram showing a new captured image and mask image created by pasting the cut out drug image and drug mask image at an arbitrary position and an arbitrary rotation angle.
  • the captured image and mask image shown in FIG. 5 (D) are training data composed of a new pair of learning image and correct answer data created by the above image processing from the captured image and mask image shown in FIG. 5 (A). It becomes.
  • FIG. 5 (E) is a diagram showing a new photographed image and a mask image created by pasting the cut out drug image and the drug mask image at an arbitrary position and an arbitrary rotation angle, and in particular, a plurality of drug images. Are designed to make contact with points or lines.
  • the mask image on the left side shown in FIG. 5 (E) is preferably image-processed so that the drug regions do not come into contact with each other. Since the contact points of the drug regions are known, the contact points can be prevented from contacting each other by replacing the contact points with a background color.
  • each drug in which the drugs are in contact with each other by a point or a line is the same drug, it is preferable to make the pixel value of the drug region different for instance separation. In this case, since each drug region in the mask image can be recognized by the difference in the pixel value, it is not necessary to replace the portion where the drug region contacts with the background color.
  • a lot of learning data can be created based on the photographed image in which the drug was photographed and the first area information (mask image) indicating the area of the drug in the photographed image.
  • FIG. 6 is a block diagram showing an example of the hardware configuration of the learning data creation device according to the present invention.
  • the learning data creation device 1 shown in FIG. 6 can be configured by, for example, a computer, and is mainly composed of an image acquisition unit 22, a CPU (Central Processing Unit) 24, an operation unit 25, a RAM (Random Access Memory) 26, and a ROM (Read). It is composed of Only Memory) 27, a memory 28, and a display unit 29.
  • a computer Central Processing Unit
  • CPU Central Processing Unit
  • RAM Random Access Memory
  • ROM Read
  • the image acquisition unit 22 acquires a photographed image in which the drug is photographed by the photographing device 10 from the photographing device 10.
  • the drug photographed by the imaging device 10 is, for example, a drug for one dose or an arbitrary drug, which may be contained in a drug package or may not be contained in the drug package.
  • FIG. 7 is a plan view showing a drug package in which a plurality of drugs are packaged.
  • the drug package TP shown in FIG. 7 is a package in which a plurality of drugs to be taken at one time are stored in a transparent package and packed one by one.
  • the drug package TPs are connected in a band shape as shown in FIGS. 9 and 10, and have a cut line that enables each drug package TP to be separated.
  • six drug Ts are packaged in one package.
  • FIG. 8 is a block diagram showing a schematic configuration of the photographing apparatus shown in FIG.
  • the imaging device 10 shown in FIG. 8 includes two cameras 12A and 12B for photographing the drug, two lighting devices 16A and 16B for illuminating the drug, and a photographing control unit 13.
  • 9 and 10 are a plan view and a side view showing a schematic configuration of the photographing apparatus, respectively.
  • the medicine package TP is placed on a transparent stage 14 installed horizontally (xy plane).
  • the cameras 12A and 12B are arranged so as to face each other with the stage 14 in the direction orthogonal to the stage 14 (z direction).
  • the camera 12A faces the surface of the medicine package TP and photographs the medicine package TP from above.
  • the camera 12B faces the back surface of the medicine package TP and photographs the medicine package TP from below.
  • a lighting device 16A is provided on the side of the camera 12A and a lighting device 16B is provided on the side of the camera 12B with the stage 14 in between.
  • the lighting device 16A is arranged above the stage 14 and illuminates the medicine package TP placed on the stage 14 from above.
  • the illuminating device 16A has four light emitting units 16A1 to 16A4 arranged radially, and irradiates the illuminating light from four orthogonal directions. The light emission of each light emitting unit 16A1 to 16A4 is individually controlled.
  • the lighting device 16B is arranged below the stage 14 and illuminates the medicine package TP placed on the stage 14 from below.
  • the illuminating device 16B has four light emitting units 16B1 to 16B4 arranged radially like the illuminating device 16A, and irradiates the illuminating light from four orthogonal directions. The light emission of each light emitting unit 16B1 to 16B4 is individually controlled.
  • Shooting is done as follows. First, the medicine package TP is photographed from above using the camera 12A. At the time of shooting, the light emitting units 16A1 to 16A4 of the lighting device 16A are sequentially emitted to emit four images, and then the light emitting units 16A1 to 16A4 are simultaneously emitted to emit one image. I do. Next, each light emitting unit 16B1 to 16B4 of the lower lighting device 16B is made to emit light at the same time, a reflector (not shown) is inserted, the medicine package TP is illuminated from below through the reflector, and the medicine package is illuminated from above using the camera 12A. Take a picture of TP.
  • the four images taken by sequentially emitting light from each of the light emitting units 16A1 to 16A4 have different illumination directions, and when there is a marking (unevenness) on the surface of the drug, the appearance of the shadow due to the marking is different. Become. These four captured images are used to generate an engraved image that emphasizes the engraving on the surface side of the drug T.
  • One image taken by simultaneously emitting light of each light emitting unit 16A1 to 16A4 is an image having no uneven brightness, and is used, for example, when cutting out an image (drug image) on the surface side of the drug T, and also. It is a photographed image on which the engraved image is superimposed.
  • the image in which the medicine package TP is illuminated from below via the reflector and the medicine package TP is photographed from above using the camera 12A is a photographed image used when recognizing a plurality of drug T regions. ..
  • the medicine package TP is photographed from below.
  • the light emitting units 16B1 to 16B4 of the lighting device 16B are sequentially emitted to emit four images, and then the light emitting units 16B1 to 16B4 are simultaneously emitted to emit one image. I do.
  • the four captured images are used to generate an engraved image emphasizing the engraving on the back surface side of the drug T, and one image taken by simultaneously emitting light of each light emitting unit 16B1 to 16B4 has uneven brightness. It is a non-existent image, for example, a photographed image used when cutting out a drug image on the back surface side of the drug T, and on which an engraved image is superimposed.
  • the imaging control unit 13 shown in FIG. 8 controls the cameras 12A and 12B and the lighting devices 16A and 16B, and photographs 11 times for one medicine package TP (6 times with the camera 12A and 5 times with the camera 12B). (Shooting).
  • the photographing is performed in a dark room, and the light emitted to the medicine package TP at the time of photographing is only the illumination light from the lighting device 16A or the lighting device 16B. Therefore, of the 11 captured images taken as described above, the background is the light source of the image in which the medicine package TP is illuminated from below via the reflector and the medicine package TP is photographed from above using the camera 12A. (White), and the area of each drug T is shielded from light and becomes black. On the other hand, in the other 10 captured images, the background is black, and the region of each drug is the color of the drug.
  • the whole drug is transparent (semi-transparent), or a part or a part thereof.
  • capsules partially transparent drugs
  • light is transmitted from the area of the drug, so that it does not turn black like an opaque drug.
  • the learning data creation device 1 machine-learns a learning model that infers the drug from the captured image in which the drug is captured (particularly, infers the region of each drug T existing in the captured image). It creates learning data.
  • the image acquisition unit 22 of the learning data creation device 1 is a captured image (that is, a reflector) used when recognizing a plurality of regions of the drug T among the 11 captured images captured by the imaging device 10. It is preferable to illuminate the medicine package TP from below via the camera 12A and acquire a photographed image of the medicine package TP taken from above using the camera 12A).
  • the memory 28 is a storage portion for storing learning data, and is, for example, a non-volatile memory such as a hard disk device or a flash memory.
  • the CPU 24 uses the RAM 26 as a work area, uses various programs including a learning data creation program stored in the ROM 27 or the memory 28, and executes various processes of the present apparatus by executing the programs.
  • the operation unit 25 includes a keyboard and a pointing device (mouse, etc.), and is a part for inputting various information and instructions by the user's operation.
  • the display unit 29 displays a screen required for operation on the operation unit 25, functions as a part that realizes a GUI (Graphical User Interface), and can display a captured image or the like.
  • GUI Graphic User Interface
  • FIG. 11 is a block diagram showing an embodiment of the learning data creation device according to the present invention.
  • the learning data creating device 1 shown in FIG. 11 is a functional block diagram showing a function executed by the hardware configuration of the learning data creating device 1 shown in FIG. 6, and includes a processor 2 and a memory 28.
  • the processor 2 is composed of the image acquisition unit 22, the CPU 24, the RAM 26, the ROM 27, the memory 28, and the like shown in FIG. 6, and performs various processes shown below.
  • the processor 2 functions as an acquisition unit 20, a learning image generation unit 30, a correct answer data generation unit 32, and a memory control unit 34.
  • the acquisition unit 20 includes an image acquisition unit 22 and a first area information acquisition unit 23.
  • the image acquisition unit 22 acquires the photographed image ITP obtained by photographing the drug T from the photographing device 10 as described above (performs the acquisition process of the photographed image).
  • the first area information acquisition unit 23 acquires information (first area information) indicating the area of the drug in the captured image ITP acquired by the image acquisition unit 22.
  • This first area information is correct answer data for the inference result inferred by the learning model when the captured image is used as an input image for machine learning of the learning model.
  • the first region information which is the correct answer data, indicates a correct answer image (for example, a mask image) showing the region of the drug in the captured image, bounding box information surrounding the region of the drug with a rectangle, and an edge of the region of the drug. It is preferable to include at least one of the edge information.
  • FIG. 12 is a diagram showing an example of the first region information showing the captured image acquired by the image acquisition unit and the region of the drug in the captured image acquired by the first region information acquisition unit.
  • the photographed image ITP shown in FIG. 12 (A) is an image in which the drug package TP is illuminated from below via a reflector and the drug package TP (see FIG. 7) is photographed from above using the camera 12A.
  • Six drugs T1 to T6 are packaged in this drug package TP.
  • the agents T1 to T3 shown in FIG. 12A are opaque agents that block the illumination light from below, and thus are photographed in black. Since the drug T4 is a transparent drug, the illumination light from below is transmitted and the image is taken in white.
  • the agents T5 and T6 are capsules of the same type, and because part of the illumination light from below leaks, they are partially photographed in white.
  • FIG. 12B is first region information showing regions of each drug T1 to T6 in the captured image ITP, and is a mask image IM in this example.
  • the captured image ITP is displayed on the display unit 29, and while viewing the captured image ITP displayed on the display unit 29, the user uses a pointing device such as a mouse to display the regions of the respective agents T1 to T6.
  • a pointing device such as a mouse to display the regions of the respective agents T1 to T6.
  • a binarized mask image IM can be created by setting the pixel value of each of the filled agents T1 to T6 to "1" and the pixel value of the background area to "0".
  • the capsule-shaped agents T5 and T6 are of the same type, it is preferable that the pixel values of the regions of the two agents T5 and T6 are different for instance separation.
  • the pixel value in the region of the drug T5 can be set to "1”
  • the pixel value in the region of the drug T6 can be set to "0.5".
  • the mask image IM which is the first area information
  • the mask image IM is the area information generated when the user manually sets the areas of the respective agents T1 to T6 in the captured image ITP using the pointing device.
  • the present invention is not limited to this, and the drug region in the captured image may be automatically extracted and generated by image processing, or the drug region in the captured image may be automatically extracted by image processing and manually adjusted. It may be generated by doing.
  • the learning image generating unit 30 receives the captured image ITP taken the drug from the image acquiring unit 22, the inputted photographic image learning image ITP was arbitrarily placed medicament from (I A, I B, I C, ...) to generate a. That is, the learning image generator 30, a plurality of learning images (I A, I B, I C, ...) the learning image generation processing for generating performed based on the captured image ITP.
  • Arbitrary arrangement of the drug captured in the captured image ITP may be performed by the user instructing the position and rotation of the drug image by the pointing device, or as described with reference to FIG. It may be performed by reversing or adding. Further, the drug may be arbitrarily arranged by randomly determining the position and rotation of the drug image using a random number. In this case, it is necessary to prevent the drug images from overlapping.
  • Correct answer data generator 32 the first area information acquisition unit 23 inputs the mask image IM which is the first area information inputted mask image IM from a plurality of learning images (I A, I B, I C, ... ), A plurality of correct answer data (I a , I b , I c , ...) Are generated. That is, correct answer data generating unit 32, a plurality of learning images on the basis of the mask image IM (I A, I B, I C, ...) to generate a second area information indicating the area of the drug in the generated second performing region information several learning images (I a, I B, I C, 7) a plurality of answer data against each (I a, I b, I c, ...) the correct answer data generation processing to be.
  • a plurality of learning images (I A, I B, I C, ...), and a plurality of answer data (I a, I b, I c, ...) generated in the first to create a training data by simulation
  • the photographed image obtained by photographing the drug and the first area information (for example, a mask image) indicating the area of the drug in the photographed image are used to obtain the photographed image and the photographed image.
  • Generated by inverting, paralleling, rotating, or scaling the mask images in synchronization with each other, or by parallel-moving, rotating, scaling, or pasting the photographed image and the drug image and the drug mask image cut out from the mask image. can do.
  • the storage control unit 34 the learning image generated by the learning image generating section 30 (I A, I B, I C, ...) and correct answer data generated by the correct answer data generating unit 32 (I a, I b , I c, ...) and enter the correct answer and the corresponding pairs (learning image I a data I a, learning image I B and solution data I b, learning image I C and solution data I c, ... ,) Is stored in the memory 28.
  • the pair of the photographed image ITP and the mask image IM input to the learning image generation unit 30 and the correct answer data generation unit 32 are also stored in the memory 28 as learning data. ..
  • FIG. 13 is a diagram showing an example of learning data generated from the photographed image and the mask image shown in FIG.
  • FIG. 13 (A) shows the training data consisting of pairs of learning images I A and solution data (mask image) I a
  • FIG. 13 (B) of the learning image I B and the mask image I b The training data consisting of pairs is shown.
  • capsular drug T5, T6 is in contact with the line
  • drug T2, T3, T4 are in contact at a point with each other.
  • Mask image I a corresponding to the learning image I A, by varying the pixel values of the drug T5, T6 region of the same drug, allows for instance the separation area of the drug T5, T6, and the line
  • the boundaries of the drugs T5 and T6 that are in contact with each other are also distinguishable.
  • the mask image I a is a portion in contact with each other point of the drug T2, T3, T4, by the same as the pixel value of the background, as each drug T2, T3, T4 is not in contact with each other, The regions of each drug T2, T3, and T4 are clarified.
  • a capsule form medicament T5, T6 is in contact with the line, drug T6 and drug T3 are in contact at a point.
  • Mask image I b corresponding to the learning image I B is varied pixel values of the drug T5, T6 of the region which is the same drug (e.g., a pixel value of the region of the drug T6 to "0.5" ), It is possible to separate the instances of the regions of the drugs T5 and T6, and to distinguish the boundary between the drugs T5 and T6 which are in contact with each other by a line and the boundary between the drug T6 and the drug T3 which are in contact with each other by a point.
  • the learning data shown in FIG. 13 is an example, and drug images showing each drug T1 to T6 are arranged by arbitrarily combining translation, rotation, and the like, and drug mask images showing the regions of each drug T1 to T6 are similarly arranged. By arranging it in, a lot of training data can be created.
  • the illumination light from below is transmitted and the image is photographed white, but it is illuminated depending on the position and angle of the drug T4.
  • the light transmission status changes. That is, the drug image of the transparent drug T4 is an image in which the brightness distribution and the like differ depending on the position and angle of the transparent drug T4 in the imaging region.
  • a drug is arbitrarily arranged to generate a learning image from a photographed image of a plurality of drugs including a transparent drug
  • the transparent drug is not moved and a drug other than the transparent drug is arbitrarily arranged. It is preferable to generate an image for learning.
  • the mask image is generated as the correct answer data, but it can be used as the edge information (edge image) for each drug image indicating the edge of the area of the drug image.
  • edge information edge image
  • the drugs are in contact with each other by dots or lines, it is preferable to replace the points of contact with the dots or lines with a background color and separate the edge images for each drug.
  • an edge image showing only the points or lines of contact may be generated as correct answer data.
  • FIG. 14 is a diagram showing an example of an edge image showing only a portion of contact with a plurality of drug points or lines.
  • the edge image IE shown in FIG. 14 is an image showing only the locations E1 and E2 in which two or more drugs out of the plurality of drugs T1 to T6 are in contact with each other by a point or a line, and is an image shown by a solid line on FIG. Is.
  • the region shown by the dotted line on FIG. 14 indicates a region in which a plurality of agents T1 to T6 are present.
  • the edge image of the portion E1 in contact with the line is an image of the portion where the capsule-shaped agents T5 and T6 are in contact with the line
  • the edge image of the portion E2 in contact with the point is an image of the three agents T2 to T4. It is an image of a place where they are in contact with each other at a point.
  • the correct answer data generation unit 32 shown in FIG. 11 automatically generates an edge image (correct answer data) showing only the points or lines that come into contact with the learning image generated by the learning image generation unit 30. Can be created in.
  • Edge image IE shown in FIG. 14 may be a correct answer data corresponding to the learning image I A shown in FIG. 13 (A). That is, it is the learning data consisting of pairs of edge image IE shown in learning images I A and 14 shown in FIG. 13 (A).
  • Such learning data is used when a learning model is machine-learned in which a drug image obtained by photographing a drug in contact with a point or a line is used as an input image and an edge image of only the part in contact with the point or a line is output as an inference result. Can be used.
  • the edge image (inference result) of only the points or lines that come into contact with each other is, for example, a drug image obtained by photographing a plurality of drugs that come into contact with points or lines, and an edge image of only the points or lines that come into contact with each other.
  • FIG. 15 is a block diagram showing an embodiment of the machine learning device according to the present invention.
  • the machine learning device 50 shown in FIG. 15 is composed of a learning model (a convolutional neural network (CNN) which is one of the learning models) 52, a loss value calculation unit 54, and a parameter control unit 56. ..
  • a learning model a convolutional neural network (CNN) which is one of the learning models
  • a loss value calculation unit 54 a loss value calculation unit 52
  • a parameter control unit 56 a parameter control unit 56.
  • This machine learning device 50 is created by the learning data creating device 1 shown in FIG. 11, and uses the learning data stored in the memory 28 to machine-learn the CNN 52.
  • the CNN 52 is a part that infers the region of the drug shown in the input image when the captured image obtained by photographing the drug is used as the input image, has a plurality of layer structures, and holds a plurality of weight parameters. .. Weight parameters include the filter coefficients of a filter called the kernel used for convolution operations in the convolution layer.
  • CNN52 can change from an unlearned learning model to a learned learning model by updating the weight parameter from the initial value to the optimum value.
  • the CNN 52 includes an input layer 52A, an intermediate layer 52B having a plurality of sets composed of a convolution layer and a pooling layer, and an output layer 52C, and each layer has a structure in which a plurality of "nodes" are connected by "edges". It has become.
  • a learning image to be learned is input to the input layer 52A as an input image.
  • the learning image is a learning image in the learning data (learning data consisting of a pair of the learning image and the correct answer data) stored in the memory 28.
  • the intermediate layer 52B has a plurality of sets including a convolution layer and a pooling layer as one set, and is a portion for extracting features from an image input from the input layer 52A.
  • the convolution layer filters nearby nodes in the previous layer (performs a convolution operation using the filter) and acquires a "feature map".
  • the pooling layer reduces the feature map output from the convolution layer to a new feature map.
  • the "convolution layer” plays a role of feature extraction such as edge extraction from an image, and the “pooling layer” plays a role of imparting robustness so that the extracted features are not affected by translation or the like.
  • the intermediate layer 52B is not limited to the case where the convolution layer and the pooling layer are set as one set, but may also include the case where the convolution layers are continuous, the activation process by the activation function, and the normalization layer.
  • the output layer 52C is a part that outputs a feature map showing the features extracted by the intermediate layer 52B. Further, in the trained CNN 52, the output layer 52C outputs, for example, an inference result in which the drug region or the like shown in the input image is region-classified (segmented) in pixel units or in units of several pixels as a group.
  • Arbitrary initial values are set for the coefficient and offset value of the filter applied to each convolution layer of CNN52 before learning.
  • the loss value calculation unit 54 of the loss value calculation unit 54 and the parameter control unit 56 that function as the learning control unit is a feature map output from the output layer 52C of the CNN 52 and correct answer data for the input image (learning image).
  • a certain mask image (a mask image read from the memory 28 corresponding to the learning Yuo image) is compared, and an error (loss value which is a value of a loss function) between the two is calculated.
  • an error (loss value which is a value of a loss function) between the two is calculated.
  • a method of calculating the loss value for example, softmax cross entropy, sigmoid, etc. can be considered.
  • the parameter control unit 56 adjusts the weight parameter of the CNN 52 by the back-propagation method based on the loss value calculated by the loss value calculation unit 54.
  • the error back-propagation method the error is back-propagated in order from the final layer, the stochastic gradient descent method is performed in each layer, and the parameter update is repeated until the error converges.
  • This weight parameter adjustment process is repeated, and learning is repeated until the difference between the output of CNN52 and the mask image which is the correct answer data becomes small.
  • the machine learning device 50 repeats machine learning using the learning data stored in the memory 28, so that the CNN 52 becomes a trained model.
  • the trained CNN 52 inputs an unknown input image (captured image obtained by photographing the drug)
  • the trained CNN 52 outputs an inference result such as a mask image showing a region of the drug in the captured image.
  • R-CNN (Regions with Convolutional Neural Networks) can be applied.
  • R-CNN the bounding box of different sizes is slid in the captured image ITP to detect the area of the bounding box in which the drug enters. Then, the edge of the drug is detected by evaluating only the image portion in the bounding box (extracting the CNN feature amount).
  • R-CNN Fast R-CNN, Faster R-CNN, Mask R-CNN and the like can be used.
  • the inference result of the trained model constructed in this way can be used, for example, when an image of each drug is cut out from a photographed image of a drug package in which a plurality of drugs are packaged.
  • the image of each drug cut out is used when auditing / distinguishing each drug contained in the drug package.
  • the memory 28 stores a lot of learning data created by simulation based on the photographed image obtained by photographing the drug and the correct answer data indicating the region of the drug in the photographed image.
  • the image is preferably an image of a drug handled by the own pharmacy.
  • FIG. 16 is a flowchart showing an embodiment of the learning data creation method according to the present invention.
  • each step shown in FIG. 16 is performed by, for example, the processor 2 of the learning data creation device 1 shown in FIG.
  • the image acquisition unit 22 acquires a photographed image ITP (for example, the photographed image ITP shown in FIG. 12A) obtained by photographing the drug from the photographing apparatus 10 (step S10).
  • the photographed image ITP shown in FIG. 12 (A) is an image in which the drug package is illuminated from below via a reflector and the drug package is photographed from above the drug package. It is not limited to those taken in this way. Further, the drug to be photographed may not be contained in the drug package, or the number of drugs may be one.
  • the first region information acquisition unit 23 uses a mask image IM (for example, the mask image IM shown in FIG. 12B) as the first region information indicating the region of the drug in the captured image acquired by the image acquisition unit 22. Acquire (step S12).
  • the mask image IM is manually or automatically generated based on the captured image ITP and stored in the memory 28 or the like.
  • the learning image generation unit 30 generates a learning image in which the agents T1 to T6 are arbitrarily arranged from the captured image ITP acquired in step S10 (step S14).
  • the learning image can be generated by image processing in which a drug image showing each drug is translated, inverted, rotated, or scaled.
  • the correct answer data generation unit 32 generates correct answer data (mask image) corresponding to the learning image generated in step S14 based on the mask image IM acquired in step S12 (step S16). That is, in step S16, the region of each drug in the mask image IM is arranged in the same manner as each drug in the learning image, the second region information indicating the region of each arranged drug is generated, and the generated second region information is generated. Is used as the correct answer data (mask image) for the learning image.
  • the storage control unit 34 stores the pair of the learning image generated in step S14 and the mask image generated in step S16 in the memory 28 as learning data (step S18).
  • 13 (A) and 13 (B) show an example of learning data composed of a pair of a learning image and a mask image generated as described above and stored in the memory 28.
  • the processor 2 determines whether or not to end the generation of the training data (step S20). For example, when there is an instruction input from the user to end the generation of learning data, or when the creation of a predetermined number of learning data from one pair of captured image ITP and mask image is completed, the learning data It can be determined that the generation is completed.
  • step S14 When it is determined that the generation of the learning data has not been completed (in the case of "No"), the process returns to step S14 and step S16, and the next learning data is created in steps S14 to S20.
  • the hardware structure of the learning data creating device for example, a processing unit that executes various processes such as a CPU 24, is various processors as shown below.
  • the circuit configuration can be changed after manufacturing the CPU (Central Processing Unit), FPGA (Field Programmable Gate Array), etc., which are general-purpose processors that execute software (programs) and function as various processing units.
  • a dedicated electric circuit which is a processor having a circuit configuration specially designed to execute a specific process such as a programmable logic device (PLD), an ASIC (Application Specific Integrated Circuit), etc. Is done.
  • One 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 plurality of FPGAs or a combination of a CPU and an FPGA). You may. Further, a plurality of processing units may be configured by one processor. As an example of configuring a plurality of processing units with one processor, first, one processor is configured by a combination of one or more CPUs and software, as represented by a computer such as a client or a server. There is a form in which a processor functions as a plurality of processing units.
  • SoC System On Chip
  • a processor that realizes the functions of the entire system including a plurality of processing units with one IC (Integrated Circuit) chip is used.
  • the various processing units are configured by using one or more of the above-mentioned various processors as a hardware-like structure.
  • circuitry that combines circuit elements such as semiconductor elements.
  • the present invention includes a learning data creation program that realizes various functions as a learning data creation device according to the present invention by being installed on a computer, and a recording medium on which this learning data creation program is recorded.
  • 1 Learning data creation device 2 Processor 10 Imaging device 12A, 12B Camera 13 Imaging control unit 14 Stage 16A, 16B Lighting device 16A1 to 16A4, 16B1 to 16B4 Light emitting unit 20 Acquisition unit 22 Image acquisition unit 23 First area information acquisition unit 24 CPU 25 Operation unit 26 RAM 27 ROM 28 Memory 29 Display unit 30 Learning image generation unit 32 Correct answer data generation unit 34 Storage control unit 50 Machine learning device 52 Learning model (CNN) 52A input layer 52B intermediate layer 52C output layer 54 loss value calculation unit 56 parameter control unit I A, I B, I C learning image IE edge image IM, I a, I b, I c mask image (correct answer data) ITP photographed image Itpl template image S10-S20 Step T, T1-T6 Drug TP Drug package

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

薬剤を撮影した撮影画像から薬剤の領域を示す領域情報を認識する学習器を機械学習させるための学習データを効率よく作成することができる学習データ作成装置、方法、プログラム、学習データ及び機械学習装置を提供する。学習データ作成装置(1)は、プロセッサ(2)とメモリ(28)とを備える。プロセッサ(2)は、薬剤が撮影された撮影画像ITPを取得し、撮影画像ITPから薬剤を任意に配置した学習用画像(IA,IB,IC,…)を生成する学習用画像生成処理と、撮影画像ITP内の薬剤の領域を示すマスク画像IMに基づいて、生成した学習用画像における薬剤の領域を示す第2領域情報を生成し、生成した第2領域情報を学習用画像に対する正解データ(Ia,Ib,Ic,…)とする正解データ生成処理と、生成した学習用画像と正解データとのペアを、学習データとしてメモリ(28)に記憶させる記憶制御と、を行う。

Description

学習データ作成装置、方法、プログラム、学習データ及び機械学習装置
 本発明は学習データ作成装置、方法、プログラム、学習データ及び機械学習装置に係り、特に多数の学習データを効率よく作成する技術に関する。
 従来、教示ファイルに格納されている多数の教示データに基づいて学習し、パターン認識して欠陥判定をする外観検査装置が提案されている(特許文献1)。
 この外観検査装置は、教示ファイル中の多数の教示データのうち、データ数の少ない特定の教示データについては、その特定の教示データを変形して新たな教示データを生成する教示データ生成装置を備え、教示データ生成装置により生成された教示データを教示ファイルに補充して学習することで、データ数の少ない欠陥の検査を可能にしている。
 また、教示データ生成装置は、生成すべき教示データが画像データであるときは、画像の拡大、縮小、回転を含むアフィン変換と、明るさ、コントラスト、エッジ強度を含む属性変換を行うことにより、新たな教示データを生成している。
特開2006-48370号公報
 ところで、対象物としての薬剤が撮影された撮影画像からその撮影画像内の薬剤の領域を、学習済みの学習モデルにより精度よく認識するためには、薬剤を撮影した撮影画像と、その撮影画像内の薬剤の領域を示す領域情報(正解データ)とのペアを多数作成し、多数のペアからなる学習データセットにより学習モデルを機械学習させる必要がある。
 従来のこの種の正解データは、撮影画像をディスプレイに表示し、ディスプレイに表示された撮影画像を見ながら薬剤の領域をユーザが画素単位で塗り潰して作成しており、正解データの作成に手間と時間がかかるという問題がある。
 一方、特許文献1に記載の外観検査装置は、カメラを用いて印刷物や無地面(紙、フィルム、金属など)の対象物を撮像し、撮像した画像から印刷欠陥を認識し、欠陥の種類(「穴」、「しみ」、「凸」、「すじ」など)を分別するものである。
 したがって、教示データ生成装置により、データ数の少ない一のデータ(画像データ)を変形して新たに複数の教示データを生成する場合、同じ画像データを変形して生成した複数の教示データに対応する正解データは、同一の欠陥の種類を示すデータになる。即ち、特許文献1には、教示データ(教示画像)に対する正解データの作成に手間と時間がかかるという課題の記載がなく、それを解決する技術も開示されていない。
 本発明はこのような事情に鑑みてなされたもので、薬剤を撮影した撮影画像から薬剤の領域に対応する領域情報を認識する学習モデルを機械学習させるための学習データを効率よく作成することができる学習データ作成装置、方法、プログラム、学習データ及び機械学習装置を提供することを目的とする。
 上記目的を達成するために第1態様に係る発明は、プロセッサと、メモリとを備え、プロセッサが機械学習用の学習データを作成する学習データ作成装置であって、プロセッサは、薬剤が撮影された撮影画像を取得する取得処理と、取得した撮影画像から薬剤を任意に配置した学習用画像を生成する学習用画像生成処理と、生成した学習用画像における薬剤の領域に対応する第2領域情報を生成し、生成した第2領域情報を学習用画像に対する正解データとする正解データ生成処理と、生成した学習用画像と正解データとのペアを、学習データとしてメモリに記憶させる記憶制御と、を行う。
 本発明の第1態様によれば、薬剤が撮影された撮影画像から薬剤を任意に配置した学習用画像を生成する。また、生成した学習用画像における薬剤の領域に対応する第2領域情報を生成し、生成した第2領域情報を学習用画像に対する正解データとする。この正解データの生成は、プロセッサによる正解データ生成処理により行うことができるため、正解データの作成に手間と時間を要しない。
 このようにして生成した学習用画像と正解データとのペアを学習データとすることで、多くの学習データを生成すること(水増しすること)ができる。
 本発明の第2態様に係る学習データ作成装置において、プロセッサの取得処理は、取得した撮影画像内の薬剤の領域に対応する第1領域情報を取得し、正解データ生成処理は、取得した第1領域情報に基づいて第2領域情報を生成することが好ましい。
 本発明の第3態様に係る学習データ作成装置において、プロセッサの取得処理は、複数の薬剤が撮影された撮影画像、又は薬剤が撮影された複数の撮影画像を取得し、複数の薬剤の領域に対応する複数の第1領域情報を取得することが好ましい。
 本発明の第4態様に係る学習データ作成装置において、第1領域情報は、撮影画像内の薬剤の領域を手動で設定された領域情報、撮影画像内の薬剤の領域を画像処理により自動で抽出した領域情報、又は撮影画像内の薬剤の領域を画像処理により自動で抽出し、かつ手動で調整された領域情報であることが好ましい。
 本発明の第5態様に係る学習データ作成装置において、正解データは、薬剤の領域に対応する正解画像、薬剤の領域を矩形で囲むバウンディングボックス情報、及び薬剤の領域のエッジを示すエッジ情報のうちの少なくとも1つを含むことが好ましい。尚、正解画像は、マスク画像を含む。
 本発明の第6態様に係る学習データ作成装置において、学習用画像生成処理は、撮影画像を平行移動、反転、回転、又は拡縮させて学習用画像を生成し、正解データ生成処理は、第1領域情報を撮影画像に対応して平行移動、反転、回転、又は拡縮させて正解データを生成することが好ましい。学習用画像の生成と正解データの生成とは、並列処理にて同時に生成してもよいし、学習用画像及び正解データのうちのいずれか一方を生成してから他方を生成してもよい。
 本発明の第7態様に係る学習データ作成装置において、学習用画像生成処理は、撮影画像を平行移動、反転、回転、又は拡縮させた2以上の画像を合成して学習用画像を生成し、正解データ生成処理は、2以上の画像の各々に対応する第1領域情報を撮影画像に対応して平行移動、反転、回転、又は拡縮させて正解データを生成することが好ましい。これにより、複数の薬剤の画像からなる学習用画像とその正解データを生成することができる。
 本発明の第8態様に係る学習データ作成装置において、プロセッサは、取得した第1領域情報に基づいて撮影画像から薬剤の領域を切り出した薬剤画像を取得する薬剤画像取得処理を含み、学習用画像生成処理は、取得した薬剤画像を平行移動、反転、回転、又は拡縮させて学習用画像を生成し、正解データ生成処理は、第1領域情報を薬剤画像に対応して平行移動、反転、回転、又は拡縮させて正解データを生成することが好ましい。
 本発明の第9態様に係る学習データ作成装置において、プロセッサは、取得した第1領域情報に基づいて撮影画像から薬剤の領域を切り出した薬剤画像を取得する薬剤画像取得処理を含み、学習用画像生成処理は、取得した薬剤画像を平行移動、反転、回転、又は拡縮させた2以上の画像を合成して学習用画像を生成し、正解データ生成処理は、第1領域情報を薬剤画像に対応して平行移動、反転、回転、又は拡縮させた2以上の第2領域情報を合成して正解データを生成することが好ましい。これにより、複数の薬剤の画像からなる学習用画像とその正解データを生成することができる。
 本発明の第10態様に係る学習データ作成装置において、学習用画像生成処理は、複数の薬剤を含む学習用画像を生成する際に、複数の薬剤の全部又は一部が点又は線で接触する学習用画像を生成することが好ましい。
 本発明の第11態様に係る学習データ作成装置において、正解データは、複数の薬剤画像の点又は線で接触する箇所のみを示すエッジ画像を含むことが好ましい。複数の薬剤の全部又は一部が点又は線で接触する学習用画像に対する正解データとして、複数の薬剤画像の点又は線で接触する箇所のみを示すエッジ画像を含めることができる。この学習データは、複数の薬剤画像の点又は線で接触する箇所の分離に有用なものとなる。
 本発明の第12態様に係る学習データ作成装置において、薬剤は、少なくとも一部が透明な薬剤であることが好ましい。少なくとも一部が透明な薬剤は、全体が不透明な薬剤と比較して抽出が難しく、かつ学習データが少ないため、少なくとも一部が透明な薬剤に対する学習データの生成は特に有効である。
 本発明の第13態様に係る学習データ作成装置において、プロセッサによる学習用画像生成処理は、複数の薬剤を含む学習用画像を生成する際に、透明な薬剤以外の薬剤を任意に配置することが好ましい。少なくとも一部が透明な薬剤の場合、その薬剤画像を任意に配置したものと、透明な薬剤を同じ位置に配置して撮影したものとは、照明光との位置関係で異なる画像になるからである。
 本発明の第14態様に係る学習データ作成装置において、撮影画像は、自薬局が取り扱っている薬剤を撮影した画像であることが好ましい。自薬局が取り扱っている薬剤に対する学習データを作成できればよいからである。
 第15態様に係る発明は、撮影された薬剤を任意に配置して生成された学習用画像と、学習用画像における薬剤の領域を示す第2領域情報を有する正解データと、のペアからなる学習データである。
 本発明の第16態様に係る機械学習装置は、学習モデルと、上記の学習データを使用し、学習モデルを機械学習させる学習制御部と、を備える。
 本発明の第17態様に係る機械学習装置において、学習モデルは、畳み込みニューラルネットワークで構成されることが好ましい。
 第18態様に係る発明は、プロセッサが、以下の各ステップの処理を行うことにより機械学習用の学習データを作成する学習データ作成方法であって、薬剤が撮影された撮影画像を取得するステップと、取得した撮影画像から薬剤を任意に配置した学習用画像を生成するステップと、生成した学習用画像における薬剤の領域に対応する第2領域情報を生成し、生成した第2領域情報を学習用画像に対する正解データとするステップと、生成した学習用画像と正解データとのペアを、学習データとしてメモリに記憶させるステップと、を含む。
 本発明の第19態様に係る学習データ作成方法において、正解データは、薬剤の領域に対応する正解画像、薬剤の領域を矩形で囲むバウンディングボックス情報、及び薬剤の領域のエッジを示すエッジ情報のうちの少なくとも1つを含むことが好ましい。
 本発明の第20態様に係る学習データ作成方法において、学習用画像を生成するステップは、複数の薬剤を配置する際に、複数の薬剤の全部又は一部を点又は線で接触させることが好ましい。
 本発明の第21態様に係る学習データ作成方法において、正解データは、複数の薬剤の点又は線で接触する箇所のみを示すエッジ画像を含むことが好ましい。
 本発明の第22態様に係る学習データ作成方法において、薬剤は、少なくとも一部が透明な薬剤であることが好ましい。
 本発明の第23態様に係る学習データ作成方法において、学習用画像を生成するステップは、複数の薬剤を含む学習用画像を生成する際に、透明な薬剤以外の薬剤を任意に配置することが好ましい。
 第24態様に係る発明は、薬剤が撮影された撮影画像を取得する機能と、取得した撮影画像から薬剤を任意に配置した学習用画像を生成する機能と、生成した学習用画像における薬剤の領域に対応する第2領域情報を生成し、生成した第2領域情報を学習用画像に対する正解データとする機能と、生成した学習用画像と正解データとのペアを、学習データとしてメモリに記憶させる機能と、をコンピュータにより実現させる学習データ作成プログラムである。
 本発明によれば、薬剤を撮影した撮影画像から薬剤の領域に対応する領域情報を認識する学習モデルを機械学習させるための学習データを効率よく作成することができる。
図1は、学習済みの学習モデルに入力される撮影画像と学習モデルから取得したい出力結果とを示す図である。 図2は、学習データの一例を示す図である。 図3は、正解データを自動で作成する場合の画像処理を示す概念図である。 図4は、シミュレーションにより学習データを作成する第1実施形態を示す図である。 図5は、シミュレーションにより学習データを作成する第2実施形態を示す図である。 図6は、本発明に係る学習データ作成装置のハードウェア構成の一例を示すブロック図である。 図7は、複数の薬剤が一包化された薬包を示す平面図である。 図8は、図6に示した撮影装置の概略構成を示すブロック図である。 図9は、撮影装置の概略構成を示す平面図である。 図10は、撮影装置の概略構成を示す側面図である。 図11は、本発明に係る学習データ作成装置の実施形態を示すブロック図である。 図12は、画像取得部が取得する撮影画像及び第1領域情報取得部が取得する撮影画像内の薬剤の領域を示す第1領域情報の一例を示す図である。 図13は、図12に示した撮影画像及びマスク画像から生成した学習データの一例を示す図である。 図14は、複数の薬剤の点又は線で接触する箇所のみを示すエッジ画像の一例を示す図である。 図15は、本発明に係る機械学習装置の実施形態を示すブロック図である。 図16は、本発明に係る学習データ作成方法の実施形態を示すフローチャートである。
 以下、添付図面に従って本発明に係る学習データ作成装置、方法、プログラム、学習データ及び機械学習装置の好ましい実施形態について説明する。
 [本発明の概要]
 図1は、学習済みの学習モデルに入力される撮影画像と学習モデルから取得したい出力結果とを示す図である。
 図1(B)に示す学習モデルの出力結果は、図1(A)に示した撮影画像内の薬剤の領域(薬剤領域)を推論した推論結果であり、本例では、薬剤領域と背景領域とを領域分類したマスク画像である。尚、推論結果は、マスク画像に限らず、例えば、薬剤領域を矩形の枠で囲むバウンディングボックス、又はバウンディングボックスの対角の2点の座標、又はこれらの組み合わせが考えられる。
 学習済みの学習モデルにより、任意の入力画像から所望の出力結果(推論結果)を得るためには、未学習の学習モデルを機械学習させるための学習データを大量に準備する必要がある。
 図2は、学習データの一例を示す図である。
 図2(A)~(C)は、それぞれ左側が薬剤の撮影画像(学習用画像)であり、右側が撮影画像に対する正解データであり、左右の撮影画像と正解データとのペアが、学習データである。本例の正解データは、各薬剤の領域を背景から区別するマスク画像である。
 基本的に、学習データには、図2(A)~(C)に示した左側の撮影画像が必要であるが、例えば、新薬等、数が少ない薬剤も存在するため、多くの画像が集まらないという問題がある。
 撮影画像(学習用画像)に対する正解データの作成は、撮影画像をディスプレイに表示させ、ディスプレイに表示された撮影画像を見ながら薬剤の領域をユーザが画素単位で塗り潰して作成するのが一般的である。
 また、正解データを自動で作成する場合、例えば、撮影画像からテンプレートマッチングにより薬剤の位置、回転角を計算することで求めることができる。
 図3は、正解データを自動で作成する場合の画像処理を示す概念図である。
 薬剤を撮影した撮影画像ITPに対して、その薬剤を示す画像であるテンプレート画像Itplを用意する。薬剤の形状が円形でない場合には、探索する回転角毎の複数のテンプレート画像Itplを用意することが好ましい。
 そして、撮影画像ITPの中からテンプレート画像Itplと相関が最も高くなる位置、及び回転角のテンプレート画像を探索すること(テンプレートマッチング)により、相関が最も高い時のテンプレート画像Itplの位置、及びテンプレート画像Itplの回転角に基づいて、撮影画像ITPにおける薬剤の領域を示す正解データを作成することができる。
 また、撮影画像ITPと正解データ(例えば、マスク画像)とを重ね合わせてディスプレイに表示し、マスク画像に誤差がある場合には、ユーザがマスク画像を画素単位で修正するようにしてもよい。
 <シミュレーションにより学習データを作成する第1実施形態>
 図4は、シミュレーションにより学習データを作成する第1実施形態を示す図である。
 図4(A)は、薬剤を撮影した撮影画像と、その撮影画像に基づいて手動又は自動で生成したマスク画像とのペアを示す図である。
 本発明は、撮影画像とマスク画像とのペアから、シミュレーションにより学習データを作成する(学習データを水増しする)。
 図4(B)は、それぞれ図4(A)に示した撮影画像とマスク画像とをそれぞれ反転した撮影画像及びマスク画像のペアを示す図である。
 図4(B)に示す右側の反転(左右反転)されたマスク画像は、図4(B)に示す左側の反転された撮影画像における薬剤の領域を示すマスク画像となる。したがって、反転された撮影画像は、新たな学習用画像とすることができ、反転されたマスク画像は、新たに生成された学習用画像に対する正解データとすることができる。尚、画像の反転は、左右反転に限らず、上下反転も含む。また、先に左の画像を作っておき、そこから薬剤画像の領域を検出することによって、右の画像を作成するようにしてもよい。
 図4(C)は、図4(A)及び図4(B)に示した画像を加算した画像を示す図である。
 図4(C)に示す左側の撮影画像は、図4(A)に示した撮影画像と図4(B)に示した反転された撮影画像とを合成することで作成することができる。即ち、図4(C)に示す撮影画像は、図4(A)に示す撮影画像に、図4(B)に示す反転された撮影画像中の薬剤の領域を切り出した画像(薬剤画像)を貼り付けることで作成することができる。尚、反転された撮影画像からの薬剤画像の切り出しは、図4(B)の反転されたマスク画像に基づいて、図4(A)に示した撮影画像から薬剤の領域を切り出す処理により行うことができる。また、2以上の薬剤画像を合成する方法は、上記のようにマスク画像を使用する方法に限らない。例えば、薬剤が撮影されていない背景のみの背景画像を使用して、図4(A)及び図4(B)からそれぞれ薬剤画像のみを抽出し、抽出した各薬剤画像を背景画像に合成することで、図4(C)に示した撮影画像を生成することができる。
 また、図4(C)に示す右側のマスク画像は、図4(A)に示したマスク画像と図4(B)に示す反転されたマスク画像とを加算することで作成することができる。尚、2つのマスク画像を加算する際に、インスタンス分離のために、本例では図4(C)の反転されたマスク画像の薬剤の領域の画素値を例えば「0.5」、背景の画素値を「0」として加算することで、生成されたマスク画像における2つの薬剤の領域の画素値を異ならせる。
 このようにして、図4(A)に示した撮影画像とマスク画像のペアからなる1つの学習データから、図4(B)及び(C)に示した2つの学習データを作成することができる。
 また、上記の第1実施形態では、図4(A)に示した撮影画像及びマスク画像をそれぞれ反転し、図4(B)に示した新たな撮影画像及びマスク画像のペアからなる学習データを作成するようにしたが、これに限らず、図4(A)に示した撮影画像及びマスク画像をそれぞれ同期して平行移動、回転、又は拡縮させて、新たな撮影画像及びマスク画像のペアからなる学習データを作成してもよい。尚、撮影画像及びマスク画像をそれぞれ同期して平行移動、回転、又は縮小させることで、背景に余白が生じる場合には、背景と同様な画素値で余白を埋めることが好ましい。
 更に、上記の第1実施形態では、1つの薬剤が撮影された撮影画像及びマスク画像から新たな撮影画像及びマスク画像を作成するが、複数の異なる薬剤が別々に撮影された複数の撮影画像及びマスク画像、又は複数の異なる薬剤が同時に撮影された撮影画像及びマスク画像から、新たな撮影画像及びマスク画像を作成するようにしてもよい。
 <シミュレーションにより学習データを作成する第2実施形態>
 図5は、シミュレーションにより学習データを作成する第2実施形態を示す図である。
 図5(A)は、薬剤を撮影した撮影画像と、その撮影画像に基づいて手動又は自動で生成したマスク画像とのペアを示す図であり、図4(A)に示したペアと同一である。
 図5(B)は、それぞれ図5(A)に示した撮影画像及びマスク画像からそれぞれ切り出す薬剤領域を示す図である。
 本例では、薬剤領域を囲む矩形の枠内の領域を、画像を切り出す領域(切出領域)としている。尚、マスク画像により薬剤領域は既知であるため、マスク画像に基づいて薬剤領域を囲む矩形の枠内の画像を切り出すことができる。
 図5(C)は、それぞれ図5(A)に示した撮影画像及びマスク画像から切り出された切出領域の画像を示す。撮影画像からの薬剤画像の切り出しは、図5(A)に示したマスク画像に基づいて、図5(A)に示した撮影画像から薬剤の領域を切り出す処理(薬剤画像取得処理)により行うことができる。尚、図5(A)に示したマスク画像は、薬剤の領域を示す情報(第1領域情報)を有するため、マスク画像から薬剤の領域(以下、「薬剤マスク画像」という)を切り出すことができる。また、薬剤画像取得処理には、切り出された後の状態の画像を、メモリ等から読み出す処理が含まれていてもよい。
 図5(D)は、切り出された薬剤画像及び薬剤マスク画像を任意の位置及び任意の回転角で貼り付けて作成した、新たな撮影画像及びマスク画像を示す図である。
 図5(D)に示す撮影画像及びマスク画像は、図5(A)に示した撮影画像及びマスク画像から上記の画像処理により作成した、新たな学習用画像及び正解データのペアからなる学習データとなる。
 図5(E)は、切り出された薬剤画像及び薬剤マスク画像を任意の位置及び任意に回転角で貼り付けて作成した、新たな撮影画像及びマスク画像を示す図であり、特に複数の薬剤画像が点又は線で接触するように作成されている。
 学習モデルにおける推論結果を向上させるためには、薬剤同士が点又は線で接触している状態の学習データを大量に作成する必要がある。薬剤同士が点又は線で接触している撮影画像から、各薬剤の領域を精度よく推論するのは、各薬剤が接触せずに孤立している場合に比べて難しいからである。
 図5(E)に示す左側のマスク画像は、各薬剤領域が接しないように画像処理することが好ましい。各薬剤領域が接触する箇所は既知であるため、その接触する箇所を背景色に置換することで、各薬剤領域が接触しないようにできる。
 また、薬剤同士が点又は線で接触する各薬剤が同一薬剤の場合、インスタンス分離のために、薬剤領域の画素値を異ならせることが好ましい。この場合、マスク画像における各薬剤領域は、その画素値の違いで認識できるため、薬剤領域が接触する箇所を背景色に置換しなくてもよい。
 以上のようにして、薬剤が撮影された撮影画像とその撮影画像内の薬剤の領域を示す第1領域情報(マスク画像)とを元に、多くの学習データを作成することができる。
 [学習データ作成装置の構成]
 図6は、本発明に係る学習データ作成装置のハードウェア構成の一例を示すブロック図である。
 図6に示す学習データ作成装置1は、例えば、コンピュータにより構成することができ、主として画像取得部22、CPU(Central Processing Unit)24、操作部25、RAM(Random Access Memory)26、ROM(Read Only Memory)27、メモリ28及び表示部29から構成されている。
 画像取得部22は、撮影装置10により薬剤が撮影された撮影画像を、撮影装置10から取得する。
 撮影装置10により撮影される薬剤は、例えば、服用1回分の薬剤、又は任意の薬剤であり、薬包に入っているものでもよいし、薬包に入っていないものでもよい。
 図7は、複数の薬剤が一包化された薬包を示す平面図である。
 図7に示す薬包TPは、1回に服用される複数の薬剤が透明な包に収納され、一包ずつパッキングされたものである。薬包TPは、図9及び図10に示すように帯状に連結されており、各薬包TPを切り離し可能にする切取線が入っている。尚、図7に示す薬包TPには、6個の薬剤Tが一包化されている。
 図8は、図6に示した撮影装置の概略構成を示すブロック図である。
 図8に示す撮影装置10は、薬剤を撮影する2台のカメラ12A、12Bと、薬剤を照明する2台の照明装置16A,16Bと、撮影制御部13とから構成されている。
 図9及び図10は、それぞれ撮影装置の概略構成を示す平面図及び側面図である。
 薬包TPは、水平(x-y平面)に設置された透明なステージ14の上に載置される。
 カメラ12A、12Bは、ステージ14と直交する方向(z方向)に、ステージ14を挟んで互いに対向して配置される。カメラ12Aは、薬包TPの表面に正対し、薬包TPを上方から撮影する。カメラ12Bは、薬包TPの裏面に正対し、薬包TPを下方から撮影する。
 ステージ14を挟んで、カメラ12Aの側には、照明装置16Aが備えられ、カメラ12Bの側には、照明装置16Bが備えられる。
 照明装置16Aは、ステージ14の上方に配置され、ステージ14に載置された薬包TPを上方から照明する。照明装置16Aは、放射状に配置された4つの発光部16A1~16A4を有し、直交する4方向から照明光を照射する。各発光部16A1~16A4の発光は、個別に制御される。
 照明装置16Bは、ステージ14の下方に配置され、ステージ14に載置された薬包TPを下方から照明する。照明装置16Bは、照明装置16Aと同様に放射状に配置された4つの発光部16B1~16B4を有し、直交する4方向から照明光を照射する。各発光部16B1~16B4の発光は、個別に制御される。
 撮影は、次のように行われる。まず、カメラ12Aを用いて、薬包TPを上方から撮影する。撮影の際には、照明装置16Aの各発光部16A1~16A4を順次発光させ、4枚の画像の撮影を行い、続いて、各発光部16A1~16A4を同時に発光させ、1枚の画像の撮影を行う。次に、下方の照明装置16Bの各発光部16B1~16B4を同時に発光させるとともに、図示しないリフレクタを挿入し、リフレクタを介して薬包TPを下から照明し、カメラ12Aを用いて上方から薬包TPの撮影を行う。
 各発光部16A1~16A4を順次発光させて撮影される4枚の画像は、それぞれ照明方向が異なっており、薬剤の表面に刻印(凹凸)がある場合に刻印による影の出方が異なるものとなる。これらの4枚の撮影画像は、薬剤Tの表面側の刻印を強調した刻印画像を生成するために使用される。
 各発光部16A1~16A4を同時に発光させて撮影される1枚の画像は、輝度ムラのない画像であり、例えば、薬剤Tの表面側の画像(薬剤画像)を切り出す場合に使用され、また、刻印画像が重畳される撮影画像である。
 また、リフレクタを介して薬包TPを下方から照明し、カメラ12Aを用いて上方から薬包TPが撮影される画像は、複数の薬剤Tの領域を認識する場合に使用される撮影画像である。
 次に、カメラ12Bを用いて、薬包TPを下方から撮影する。撮影の際には、照明装置16Bの各発光部16B1~16B4を順次発光させ、4枚の画像の撮影を行い、続いて、各発光部16B1~16B4を同時に発光させ、1枚の画像の撮影を行う。
 4枚の撮影画像は、薬剤Tの裏面側の刻印を強調した刻印画像を生成するために使用され、各発光部16B1~16B4を同時に発光させて撮影される1枚の画像は、輝度ムラのない画像であり、例えば、薬剤Tの裏面側の薬剤画像を切り出す場合に使用され、また、刻印画像が重畳される撮影画像である。
 図8に示した撮影制御部13は、カメラ12A、12B、及び照明装置16A、16Bを制御し、1つの薬包TPに対して11回の撮影(カメラ12Aで6回、カメラ12Bで5回の撮影)を行わせる。
 また、撮影は暗室の状態で行われ、撮影の際に薬包TPに照射される光は、照明装置16A、又は照明装置16Bからの照明光のみである。したがって、上記のようにして撮影される11枚の撮影画像のうち、リフレクタを介して薬包TPを下方から照明し、カメラ12Aを用いて上方から薬包TPを撮影した画像は、背景が光源の色(白色)になり、各薬剤Tの領域が遮光されて黒くなる。一方、他の10枚の撮影画像は、背景が黒く、各薬剤の領域が薬剤の色になる。
 尚、リフレクタを介して薬包TPを下方から照明し、カメラ12Aを用いて上方から薬包TPを撮影した画像であっても、薬剤全体が透明(半透明)な透明薬剤、あるいは一部又は全部が透明なカプセルに粉末又は顆粒状の医薬が充填されたカプセル剤(一部が透明な薬剤)の場合、薬剤の領域から光が透過するため、不透明な薬剤のように真っ黒にならない。
 図6に戻って、学習データ作成装置1は、薬剤が撮影された撮影画像から薬剤を推論(特に撮影画像内に存在する各薬剤Tの領域を推論)する学習モデルを、機械学習させるための学習データを作成するものである。
 したがって、学習データ作成装置1の画像取得部22は、撮影装置10により撮影される11枚の撮影画像のうちの、複数の薬剤Tの領域を認識する場合に使用される撮影画像(即ち、リフレクタを介して薬包TPを下方から照明し、カメラ12Aを用いて上方から薬包TPを撮影した撮影画像)を取得することが好ましい。
 メモリ28は、学習データを記憶する記憶部分であり、例えば、ハードディスク装置、フラッシュメモリ等の不揮発性メモリである。
 CPU24は、RAM26を作業領域とし、ROM27又はメモリ28に記憶された学習データ作成プログラムを含む各種のプログラムを使用し、プログラムを実行することで本装置の各種の処理を実行する。
 操作部25は、キーボード、ポインティングデバイス(マウス等)を含み、ユーザの操作により各種の情報や指示を入力する部分である。
 表示部29は、操作部25での操作に必要な画面を表示し、GUI(Graphical User Interface)を実現する部分として機能し、また、撮影画像等を表示することができる。
 [学習データ作成装置の実施形態]
 図11は、本発明に係る学習データ作成装置の実施形態を示すブロック図である。
 図11に示す学習データ作成装置1は、図6に示した学習データ作成装置1のハードウェア構成により実行される機能を示す機能ブロック図であり、プロセッサ2とメモリ28とを備えている。
 プロセッサ2は、図6に示した画像取得部22、CPU24、RAM26、ROM27、及びメモリ28等から構成され、以下に示す各種の処理を行う。
 プロセッサ2は、取得部20、学習用画像生成部30、正解データ生成部32、及び記憶制御部34として機能する。
 取得部20は、画像取得部22及び第1領域情報取得部23を備えている。
 画像取得部22は、前述したように撮影装置10から薬剤Tを撮影した撮影画像ITPを取得する(撮影画像の取得処理を行う)。
 第1領域情報取得部23は、画像取得部22が取得した撮影画像ITP内の薬剤の領域を示す情報(第1領域情報)を取得する。この第1領域情報は、撮影画像を学習モデルの機械学習用の入力画像とした場合、学習モデルが推論する推論結果に対する正解データである。尚、正解データである第1領域情報としては、撮影画像内の薬剤の領域を示す正解画像(例えば、マスク画像)、薬剤の領域を矩形で囲むバウンディングボックス情報、及び薬剤の領域のエッジを示すエッジ情報の少なくとも1つを含むことが好ましい。
 図12は、画像取得部が取得する撮影画像及び第1領域情報取得部が取得する撮影画像内の薬剤の領域を示す第1領域情報の一例を示す図である。
 図12(A)に示す撮影画像ITPは、リフレクタを介して薬包TPを下方から照明し、カメラ12Aを用いて上方から薬包TP(図7参照)を撮影した画像である。この薬包TPには、6個の薬剤T1~T6が一包化されている。
 図12(A)に示す薬剤T1~T3は、下方からの照明光を遮光する不透明な薬剤であるため、黒く撮影されている。薬剤T4は、透明薬剤であるため、下方からの照明光が透過して白く撮影されている。薬剤T5、T6は、同一種類のカプセル剤であり、下方からの照明光の一部が漏れるため、部分的に僅かに白く撮影されている。
 図12(B)は、撮影画像ITP内の各薬剤T1~T6の領域を示す第1領域情報であり、本例ではマスク画像IMである。
 マスク画像IMは、例えば、撮影画像ITPを表示部29に表示させ、表示部29に表示された撮影画像ITPを見ながら、ユーザがマウス等のポインティングデバイスを使用して各薬剤T1~T6の領域を画素単位で塗り潰すことで作成することができる。例えば、塗り潰した各薬剤T1~T6の領域の画素値を「1」、背景の領域の画素値を「0」とすることで、2値化したマスク画像IMを作成することができる。
 尚、カプセル状の薬剤T5、T6は、同一種類であるが、インスタンス分離のために、両者の薬剤T5、T6の領域の画素値を異ならせてことが好ましい。例えば、薬剤T5の領域の画素値を「1」、薬剤T6の領域の画素値を「0.5」とすることができる。
 上記の例では、第1領域情報であるマスク画像IMは、撮影画像ITP内の各薬剤T1~T6の領域をユーザがポインティングデバイスを使用して手動で設定することで生成される領域情報であるが、これに限らず、撮影画像内の薬剤の領域を画像処理により自動で抽出して生成したものでもよいし、撮影画像内の薬剤の領域を画像処理により自動で抽出し、かつ手動で調整することで生成されたものでもよい。
 図11に戻って、学習用画像生成部30は、画像取得部22から薬剤を撮影した撮影画像ITPを入力し、入力した撮影画像ITPから薬剤を任意に配置した学習用画像(I,I,I,…)を生成する。即ち、学習用画像生成部30は、撮影画像ITPに基づいて複数の学習用画像(I,I,I,…)を生成する学習用画像生成処理を行う。
 撮影画像ITPに撮影されている薬剤の任意の配置は、ユーザがポインディンデバイスにより薬剤画像の位置や回転を指示して行うようにしてもよいし、図4を用いて説明したように撮影画像の反転や加算等により行うようにしてもよい。また、乱数を使用してランダムに薬剤画像の位置や回転を決定して、薬剤を任意に配置してもよい。この場合、薬剤画像が重ならないようにする必要がある。
 正解データ生成部32は、第1領域情報取得部23から第1領域情報であるマスク画像IMを入力し、入力したマスク画像IMから複数の学習用画像(I,I,I,…)に対応する複数の正解データ(I,I,I,…)を生成する。即ち、正解データ生成部32は、マスク画像IMに基づいて複数の学習用画像(I,I,I,…)における薬剤の領域を示す第2領域情報を生成し、生成した第2領域情報を複数の学習用画像(I,I,I,…)にそれぞれ対する複数の正解データ(I,I,I,…)とする正解データ生成処理を行う。
 尚、複数の学習用画像(I,I,I,…)、及び複数の正解データ(I,I,I,…)の生成は、シミュレーションにより学習データを作成する第1実施形態、及び第2実施形態で説明したように、薬剤を撮影した撮影画像と、その撮影画像内の薬剤の領域を示す第1領域情報(例えば、マスク画像)とを使用し、撮影画像及びマスク画像をそれぞれ同期して反転、平行移動、回転、又は拡縮等を行い、あるいは撮影画像及びマスク画像から切り出した薬剤画像及び薬剤マスク画像を平行移動、回転、又は拡縮して貼り付けることで生成することができる。
 記憶制御部34は、学習用画像生成部30により生成される学習用画像(I,I,I,…)と、正解データ生成部32により生成される正解データ(I,I,I,…)とを入力し、それぞれ対応するペア(学習用画像Iと正解データI,学習用画像Iと正解データI,学習用画像Iと正解データI,…、)からなる学習データをメモリ28に記憶させる。
 これにより、メモリ28には、多くの学習データが記憶、蓄積される。尚、図6には図示されていないが、学習用画像生成部30及び正解データ生成部32にそれぞれ入力される撮影画像ITPとマスク画像IMのペアも学習データとしてメモリ28に記憶させることが好ましい。
 図13は、図12に示した撮影画像及びマスク画像から生成した学習データの一例を示す図である。
 図13(A)は、学習用画像Iと正解データ(マスク画像)Iとのペアからなる学習データを示し、図13(B)は、学習用画像Iとマスク画像Iとのペアからなる学習データを示す。
 図13(A)に示す学習用画像Iでは、カプセル状の薬剤T5,T6が線で接触し、薬剤T2,T3,T4が互いに点で接触している。この学習用画像Iに対応するマスク画像Iは、同一の薬剤である薬剤T5,T6の領域の画素値を異ならせることで、薬剤T5,T6の領域のインスタンス分離を可能にし、かつ線で接している薬剤T5,T6の境界も区別可能にしている。
 また、マスク画像Iは、薬剤T2,T3,T4の互いに点で接触している箇所を、背景の画素値と同一とすることで、各薬剤T2,T3,T4が互いに接触しないようにし、各薬剤T2,T3,T4の領域が明確になるようにしている。
 また、図13(B)に示す学習用画像Iでは、カプセル状の薬剤T5,T6が線で接触し、薬剤T6と薬剤T3が点で接触している。この学習用画像Iに対応するマスク画像Iは、同一の薬剤である薬剤T5,T6の領域の画素値を異ならせる(例えば、薬剤T6の領域の画素値を「0.5」とする)ことで、薬剤T5,T6の領域のインスタンス分離を可能にし、かつ線で接している薬剤T5,T6の境界、及び点で接している薬剤T6と薬剤T3の境界を区別可能にしている。
 図13に示した学習データは一例であり、各薬剤T1~T6を示す薬剤画像をそれぞれ任意に平行移動及び回転等を組み合わせて配置し、各薬剤T1~T6の領域を示す薬剤マスク画像を同様に配置することで、多くの学習データを作成することができる。
 この場合、複数の薬剤画像の一部又は全部が点又は線で接触するように配置して学習データを生成することが好ましい。このような学習データにより機械学習された学習済み学習モデルが、点又は線で接触する薬剤を撮影した撮影画像を入力画像とする場合に、各薬剤の領域を正しく推論するためである。
 また、図12(A)に示した撮影画像ITPのように透明な薬剤T4が撮影されている場合、下方からの照明光が透過して白く撮影されるが、薬剤T4の位置や角度により照明光の透過状況が変化する。即ち、透明な薬剤T4の薬剤画像は、撮影領域における透明な薬剤T4の位置や角度により輝度分布等が異なる画像になる。
 したがって、透明な薬剤を含む複数の薬剤を撮影した撮影画像から、薬剤を任意に配置して学習用画像を生成する場合、透明な薬剤は移動させずに透明な薬剤以外の薬剤を任意に配置して学習用画像を生成することが好ましい。
 また、本例では、正解データとしてマスク画像を生成するようにしたが、薬剤画像の領域のエッジを示す薬剤画像毎のエッジ情報(エッジ画像)とすることができる。また、薬剤同士が点又は線で接触している場合には、点又は線で接触する箇所を背景色で置換し、薬剤毎のエッジ画像を離間させることが好ましい。
 更に、薬剤同士が点又は線で接触する場合には、点又は線で接触する箇所のみを示すエッジ画像を、正解データとして生成してもよい。
 図14は、複数の薬剤の点又は線で接触する箇所のみを示すエッジ画像の一例を示す図である。
 図14に示すエッジ画像IEは、複数の薬剤T1~T6のうちの2以上の薬剤が点又は線で接触する箇所E1、E2のみを示す画像であり、図14上で、実線で示した画像である。尚、図14上で、点線で示した領域は、複数の薬剤T1~T6が存在する領域を示す。
 線で接触する箇所E1のエッジ画像は、カプセル状の薬剤T5とT6とが線で接触している箇所の画像であり、点で接触する箇所E2のエッジ画像は、3つの薬剤T2~T4が互いに点で接触している箇所の画像である。
 学習用画像における各薬剤画像の配置は既知であるため、複数の薬剤のうちの2以上の薬剤が点又は線で接触する箇所も既知である。したがって、図11に示した正解データ生成部32は、学習用画像生成部30により生成される学習用画像に対して、点又は線で接触する箇所のみを示すエッジ画像(正解データ)を自動的に作成することができる。
 図14に示したエッジ画像IEは、図13(A)に示した学習用画像Iに対応する正解データとすることができる。即ち、図13(A)に示した学習用画像Iと図14に示したエッジ画像IEとのペアからなる学習データとするができる。
 このような学習データは、点又は線で接触する薬剤を撮影した薬剤画像を入力画像とし、その点又は線で接触する箇所のみのエッジ画像を推論結果として出力する学習モデルを機械学習させる場合に使用することができる。
 また、点又は線で接触する箇所のみのエッジ画像(推論結果)は、例えば、点又は線で接触する複数の薬剤を撮影した薬剤画像と、その点又は線で接触する箇所のみのエッジ画像とを入力画像(マルチチャンネルの入力画像)とし、複数の薬剤の領域を推論する学習モデルに使用することができる。この学習モデルによれば、入力画像に加えて、点又は線で接触する箇所の情報を入力するため、各薬剤の領域をより正確に推論することができる。
 [機械学習装置]
 図15は、本発明に係る機械学習装置の実施形態を示すブロック図である。
 図15に示す機械学習装置50は、学習モデル(学習モデルの一つである畳み込みニューラルネットワーク(CNN:Convolution Neural Network))52と、損失値算出部54と、パラメータ制御部56とから構成される。
 この機械学習装置50は、図11に示した学習データ作成装置1により作成され、メモリ28に記憶された学習データを使用し、CNN52を機械学習させる。
 CNN52は、薬剤を撮影した撮影画像を入力画像とするとき、その入力画像に写っている薬剤の領域を推論する部分であり、複数のレイヤ構造を有し、複数の重みパラメータを保持している。重みパラメータは、畳み込み層での畳み込み演算に使用されるカーネルと呼ばれるフィルタのフィルタ係数などである。
 CNN52は、重みパラメータが初期値から最適値に更新されることで、未学習の学習モデルから学習済みの学習モデルに変化しうる。
 このCNN52は、入力層52Aと、畳み込み層とプーリング層から構成された複数セットを有する中間層52Bと、出力層52Cとを備え、各層は複数の「ノード」が「エッジ」で結ばれる構造となっている。
 入力層52Aには、学習対象である学習用画像が入力画像として入力される。学習用画像は、メモリ28に記憶されている学習データ(学習用画像と正解データとのペアからなる学習データ)における学習用画像である。
 中間層52Bは、畳み込み層とプーリング層とを1セットとする複数セットを有し、入力層52Aから入力した画像から特徴を抽出する部分である。畳み込み層は、前の層で近くにあるノードにフィルタ処理し(フィルタを使用した畳み込み演算を行い)、「特徴マップ」を取得する。プーリング層は、畳み込み層から出力された特徴マップを縮小して新たな特徴マップとする。「畳み込み層」は、画像からのエッジ抽出等の特徴抽出の役割を担い、「プーリング層」は抽出された特徴が、平行移動などによる影響を受けないようにロバスト性を与える役割を担う。
 尚、中間層52Bには、畳み込み層とプーリング層とを1セットとする場合に限らず、畳み込み層が連続する場合や活性化関数による活性化プロセス、正規化層も含まれ得る。
 出力層52Cは、中間層52Bにより抽出された特徴を示す特徴マップを出力する部分である。また、出力層52Cは、学習済みCNN52では、例えば、入力画像に写っている薬剤領域等をピクセル単位、もしくはいくつかのピクセルを一塊にした単位で領域分類(セグメンテーション)した推論結果を出力する。
 学習前のCNN52の各畳み込み層に適用されるフィルタの係数やオフセット値は、任意の初期値がセットされる。
 学習制御部として機能する損失値算出部54及びパラメータ制御部56のうちの損失値算出部54は、CNN52の出力層52Cから出力される特徴マップと、入力画像(学習用画像)に対する正解データであるマスク画像(メモリ28から学習湯尾画像に対応して読み出されるマスク画像)とを比較し、両者間の誤差(損失関数の値である損失値)を計算する。損失値の計算方法は、例えばソフトマックスクロスエントロピー、シグモイドなどが考えられる。
 パラメータ制御部56は、損失値算出部54により算出された損失値を元に、誤差逆伝播法によりCNN52の重みパラメータを調整する。誤差逆伝播法では、誤差を最終レイヤから順に逆伝播させ、各レイヤにおいて確率的勾配降下法を行い、誤差が収束するまでパラメータの更新を繰り返す。
 この重みパラメータの調整処理を繰り返し行い、CNN52の出力と正解データであるマスク画像との差が小さくなるまで繰り返し学習を行う。
 機械学習装置50は、メモリ28に記憶された学習データを使用した機械学習を繰り返すことで、CNN52が学習済みモデルとなる。学習済みのCNN52は、未知の入力画像(薬剤を撮影した撮影画像)を入力すると、撮影画像内の薬剤の領域を示すマスク画像等の推論結果を出力する。
 尚、CNN52としては、R-CNN(Regions with Convolutional Neural Networks)を適用することができる。R-CNNでは、撮影画像ITP内において、大きさを変えたバウンディングボックスをスライドさせ、薬剤が入るバウンディングボックスの領域を検出する。そして、バウンディングボックスの中の画像部分だけを評価(CNN特徴量を抽出)することで、薬剤のエッジを検出する。また、R-CNNに代えて、Fast R-CNN、Faster R-CNN、Mask R-CNN等を使用することができる。
 このようにして構成される学習済モデルの推論結果は、例えば、複数の薬剤が一包化された薬包を撮影した撮影画像から、各薬剤の画像を切り出す場合に使用することができる。尚、切り出された各薬剤の画像は、薬包に入っている各薬剤の監査・鑑別を行う場合に使用される。
 ところで、メモリ28には、前述したように薬剤を撮影した撮影画像とその撮影画像内の薬剤の領域を示す正解データとに基づいて、シミュレーションにより作成した多くの学習データが記憶されるが、撮影画像は、自薬局が取り扱っている薬剤を撮影した画像であることが好ましい。自薬局が取り扱っている薬剤を撮影した撮影画像を使用して学習データを作成し、その学習データを使用して学習モデルを構成することで、自薬局で取り扱っている薬剤の監査・鑑別を行う場合に、その学習モデルを有効に使用できるからである。
 [学習データ作成方法]
 図16は、本発明に係る学習データ作成方法の実施形態を示すフローチャートである。
 図16に示す各ステップの処理は、例えば、図11に示した学習データ作成装置1のプロセッサ2により行われる。
 図16において、画像取得部22は、撮影装置10から薬剤を撮影した撮影画像ITP(例えば、図12(A)に示す撮影画像ITP)を取得する(ステップS10)。尚、図12(A)に示した撮影画像ITPは、リフレクタを介して薬包を下から照明し、薬包の上方から薬包を撮影した画像であるが、薬剤を撮影した撮影画像は上記のようにして撮影したものに限らない。また、撮影される薬剤は、薬包に入っていないものでもよいし、薬剤の個数は1個でもよい。
 また、第1領域情報取得部23は、画像取得部22が取得する撮影画像内の薬剤の領域を示す第1領域情報としてマスク画像IM(例えば、図12(B)に示すマスク画像IM)を取得する(ステップS12)。尚、マスク画像IMは、撮影画像ITPに基づいて手動又は自動で生成され、メモリ28等に記憶されたものである。
 続いて、学習用画像生成部30は、ステップS10で取得する撮影画像ITPから薬剤T1~T6を任意に配置した学習用画像を生成する(ステップS14)。学習用画像の生成は、各薬剤を示す薬剤画像を平行移動、反転、回転、又は拡縮させる画像処理により行うことができる。
 また、正解データ生成部32は、ステップS12で取得したマスク画像IMに基づいて、ステップS14で生成された学習用画像に対応する正解データ(マスク画像)を生成する(ステップS16)。即ち、ステップS16では、マスク画像IMにおける各薬剤の領域を学習用画像における各薬剤と同様に配置し、その配置した各薬剤の領域を示す第2領域情報を生成し、生成した第2領域情報を学習用画像に対する正解データ(マスク画像)とする画像処理を行う。
 記憶制御部34は、ステップS14で生成した学習用画像とステップS16で生成したマスク画像とのペアを学習データとしてメモリ28に記憶させる(ステップS18)。図13(A)及び図13(B)は、上記のようにして生成され、メモリ28に記憶される学習用画像とマスク画像のペアからなる学習データの一例を示す。
 続いて、プロセッサ2は、学習データの生成を終了するか否かを判別する(ステップS20)。例えば、ユーザからの学習データの生成終了の指示入力があった場合や、1つの撮影画像ITPとマスク画像のペアから、予め設定された規定数の学習データの作成が終了した場合を学習データの生成終了と判別することができる。
 学習データの生成を終了していないと判別されると(「No」の場合)、ステップS14、ステップS16に戻り、ステップS14~ステップS20により次の学習データを作成する。
 学習データの生成を終了すると判別されると(「Yes」の場合)、ステップS10、ステップS12で取得した撮影画像ITP,マスク画像IMに基づく学習データの作成を終了させる。
 尚、ステップS10、ステップS12において、別の撮影画像ITP,マスク画像IMが取得される場合には、その撮影画像ITP,マスク画像IMに基づく複数の学習データの作成が行われることは言うまでもない。
 [その他]
 本発明に係る学習データ作成装置の、例えば、CPU24等の各種の処理を実行する処理部(processing unit)のハードウェア的な構造は、次に示すような各種のプロセッサ(processor)である。各種のプロセッサには、ソフトウェア(プログラム)を実行して各種の処理部として機能する汎用的なプロセッサであるCPU(Central Processing Unit)、FPGA(Field Programmable Gate Array)などの製造後に回路構成を変更可能なプロセッサであるプログラマブルロジックデバイス(Programmable Logic Device:PLD)、ASIC(Application Specific Integrated Circuit)などの特定の処理を実行させるために専用に設計された回路構成を有するプロセッサである専用電気回路などが含まれる。
 1つの処理部は、これら各種のプロセッサのうちの1つで構成されていてもよいし、同種または異種の2つ以上のプロセッサ(例えば、複数のFPGA、あるいはCPUとFPGAの組み合わせ)で構成されてもよい。また、複数の処理部を1つのプロセッサで構成してもよい。複数の処理部を1つのプロセッサで構成する例としては、第1に、クライアントやサーバなどのコンピュータに代表されるように、1つ以上のCPUとソフトウェアの組合せで1つのプロセッサを構成し、このプロセッサが複数の処理部として機能する形態がある。第2に、システムオンチップ(System On Chip:SoC)などに代表されるように、複数の処理部を含むシステム全体の機能を1つのIC(Integrated Circuit)チップで実現するプロセッサを使用する形態がある。このように、各種の処理部は、ハードウェア的な構造として、上記各種のプロセッサを1つ以上用いて構成される。
 これらの各種のプロセッサのハードウェア的な構造は、より具体的には、半導体素子などの回路素子を組み合わせた電気回路(circuitry)である。
 また、本発明は、コンピュータにインストールされることにより、本発明に係る学習データ作成装置として各種の機能を実現させる学習データ作成プログラム、及びこの学習データ作成プログラムが記録された記録媒体を含む。
 更に、本発明は上述した実施形態に限定されず、本発明の精神を逸脱しない範囲で種々の変形が可能であることは言うまでもない。
1 学習データ作成装置
2 プロセッサ
10 撮影装置
12A、12B カメラ
13 撮影制御部
14 ステージ
16A、16B 照明装置
16A1~16A4,16B1~16B4 発光部
20 取得部
22 画像取得部
23 第1領域情報取得部
24 CPU
25 操作部
26 RAM
27 ROM
28 メモリ
29 表示部
30 学習用画像生成部
32 正解データ生成部
34 記憶制御部
50 機械学習装置
52 学習モデル(CNN)
52A 入力層
52B 中間層
52C 出力層
54 損失値算出部
56 パラメータ制御部
、I、I 学習用画像
IE エッジ画像
IM、I、I、I マスク画像(正解データ)
ITP 撮影画像
tpl テンプレート画像
S10~S20 ステップ
T、T1~T6 薬剤
TP 薬包

Claims (25)

  1.  プロセッサと、メモリとを備え、前記プロセッサが機械学習用の学習データを作成する学習データ作成装置であって、
     前記プロセッサは、
     薬剤が撮影された撮影画像を取得する取得処理と、
     前記取得した前記撮影画像から前記薬剤を任意に配置した学習用画像を生成する学習用画像生成処理と、
     前記生成した学習用画像における前記薬剤の領域に対応する第2領域情報を生成し、前記生成した前記第2領域情報を前記学習用画像に対する正解データとする正解データ生成処理と、
     前記生成した学習用画像と前記正解データとのペアを、学習データとして前記メモリに記憶させる記憶制御と、
     を行う学習データ作成装置。
  2.  前記プロセッサの前記取得処理は、前記取得した前記撮影画像内の薬剤の領域に対応する第1領域情報を取得し、
     前記正解データ生成処理は、前記取得した前記第1領域情報に基づいて前記第2領域情報を生成する、
     請求項1に記載の学習データ作成装置。
  3.  前記プロセッサの前記取得処理は、複数の薬剤が撮影された前記撮影画像、又は薬剤が撮影された複数の前記撮影画像を取得し、複数の薬剤の領域に対応する複数の前記第1領域情報を取得する、
     請求項2に記載の学習データ作成装置。
  4.  前記第1領域情報は、前記撮影画像内の薬剤の領域を手動で設定された領域情報、前記撮影画像内の薬剤の領域を画像処理により自動で抽出した領域情報、又は前記撮影画像内の薬剤の領域を画像処理により自動で抽出し、かつ手動で調整された領域情報である、
     請求項2又は3に記載の学習データ作成装置。
  5.  前記正解データは、前記薬剤の領域に対応する正解画像、前記薬剤の領域を矩形で囲むバウンディングボックス情報、及び前記薬剤の領域のエッジを示すエッジ情報のうちの少なくとも1つを含む、
     請求項1から4のいずれか1項に記載の学習データ作成装置。
  6.  前記学習用画像生成処理は、前記撮影画像を平行移動、反転、回転、又は拡縮させて前記学習用画像を生成し、
     前記正解データ生成処理は、前記第1領域情報を前記撮影画像に対応して平行移動、反転、回転、又は拡縮させて前記正解データを生成する、
     請求項2から4のいずれか1項に記載の学習データ作成装置。
  7.  前記学習用画像生成処理は、前記撮影画像を平行移動、反転、回転、又は拡縮させた2以上の画像を合成して前記学習用画像を生成し、
     前記正解データ生成処理は、前記2以上の画像の各々に対応する前記第1領域情報を前記撮影画像に対応して平行移動、反転、回転、又は拡縮させて前記正解データを生成する、
     請求項2から4のいずれか1項に記載の学習データ作成装置。
  8.  前記プロセッサは、前記取得した前記第1領域情報に基づいて前記撮影画像から前記薬剤の領域を切り出した薬剤画像を取得する薬剤画像取得処理を含み、
     前記学習用画像生成処理は、前記取得した薬剤画像を平行移動、反転、回転、又は拡縮させて前記学習用画像を生成し、
     前記正解データ生成処理は、前記第1領域情報を前記薬剤画像に対応して平行移動、反転、回転、又は拡縮させて前記正解データを生成する、
     請求項2から4のいずれか1項に記載の学習データ作成装置。
  9.  前記プロセッサは、前記取得した前記第1領域情報に基づいて前記撮影画像から前記薬剤の領域を切り出した薬剤画像を取得する薬剤画像取得処理を含み、
     前記学習用画像生成処理は、前記取得した薬剤画像を平行移動、反転、回転、又は拡縮させた2以上の画像を合成して前記学習用画像を生成し、
     前記正解データ生成処理は、前記第1領域情報を前記薬剤画像に対応して平行移動、反転、回転、又は拡縮させた2以上の前記第2領域情報を合成して前記正解データを生成する、
     請求項2から4、及び8のいずれか1項に記載の学習データ作成装置。
  10.  前記学習用画像生成処理は、複数の薬剤を含む前記学習用画像を生成する際に、前記複数の薬剤の全部又は一部が点又は線で接触する前記学習用画像を生成する、
     請求項1から9のいずれか1項に記載の学習データ作成装置。
  11.  前記正解データは、前記複数の薬剤画像の前記点又は線で接触する箇所のみを示すエッジ画像を含む、
     請求項10に記載の学習データ作成装置。
  12.  前記薬剤は、少なくとも一部が透明な薬剤である、
     請求項1から11のいずれか1項に記載の学習データ作成装置。
  13.  前記プロセッサによる前記学習用画像生成処理は、複数の薬剤を含む前記学習用画像を生成する際に、前記透明な薬剤以外の薬剤を任意に配置する、
     請求項12に記載の学習データ作成装置。
  14.  前記撮影画像は、自薬局が取り扱っている薬剤を撮影した画像である、
     請求項1から13のいずれか1項に記載の学習データ作成装置。
  15.  撮影された薬剤を任意に配置して生成された学習用画像と、
     前記学習用画像における前記薬剤の領域を示す第2領域情報を有する正解データと、
     のペアからなる、学習データ。
  16.  学習モデルと、
     請求項15に記載の学習データを使用し、前記学習モデルを機械学習させる学習制御部と、
     を備えた機械学習装置。
  17.  前記学習モデルは、畳み込みニューラルネットワークで構成される、
     請求項16に記載の機械学習装置。
  18.  プロセッサが、以下の各ステップの処理を行うことにより機械学習用の学習データを作成する学習データ作成方法であって、
     薬剤が撮影された撮影画像を取得するステップと、
     前記取得した前記撮影画像から前記薬剤を任意に配置した学習用画像を生成するステップと、
     前記生成した学習用画像における前記薬剤の領域に対応する第2領域情報を生成し、前記生成した前記第2領域情報を前記学習用画像に対する正解データとするステップと、
     前記生成した学習用画像と前記正解データとのペアを、学習データとしてメモリに記憶させるステップと、
     を含む学習データ作成方法。
  19.  前記正解データは、前記薬剤の領域に対応する正解画像、前記薬剤の領域を矩形で囲むバウンディングボックス情報、及び前記薬剤の領域のエッジを示すエッジ情報のうちの少なくとも1つを含む、
     請求項18に記載の学習データ作成方法。
  20.  前記学習用画像を生成するステップは、複数の薬剤を配置する際に、前記複数の薬剤の全部又は一部を点又は線で接触させる、
     請求項18又は19に記載の学習データ作成方法。
  21.  前記正解データは、前記複数の薬剤の前記点又は線で接触する箇所のみを示すエッジ画像を含む、
     請求項20に記載の学習データ作成方法。
  22.  前記薬剤は、少なくとも一部が透明な薬剤である、
     請求項18から21のいずれか1項に記載の学習データ作成方法。
  23.  前記学習用画像を生成するステップは、複数の薬剤を含む学習用画像を生成する際に、前記透明な薬剤以外の薬剤を任意に配置する、
     請求項22に記載の学習データ作成方法。
  24.  薬剤が撮影された撮影画像を取得する機能と、
     前記取得した前記撮影画像から前記薬剤を任意に配置した学習用画像を生成する機能と、
     前記生成した学習用画像における前記薬剤の領域に対応する第2領域情報を生成し、前記生成した前記第2領域情報を前記学習用画像に対する正解データとする機能と、
     前記生成した学習用画像と前記正解データとのペアを、学習データとしてメモリに記憶させる機能と、
     をコンピュータにより実現させる学習データ作成プログラム。
  25.  非一時的かつコンピュータ読取可能な記録媒体であって、請求項24に記載のプログラムが記録された記録媒体。
PCT/JP2021/008791 2020-03-13 2021-03-05 学習データ作成装置、方法、プログラム、学習データ及び機械学習装置 Ceased WO2021182345A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2022507151A JP7375161B2 (ja) 2020-03-13 2021-03-05 学習データ作成装置、方法、プログラム、及び記録媒体

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2020-044138 2020-03-13
JP2020044138 2020-03-13

Publications (1)

Publication Number Publication Date
WO2021182345A1 true WO2021182345A1 (ja) 2021-09-16

Family

ID=77671685

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2021/008791 Ceased WO2021182345A1 (ja) 2020-03-13 2021-03-05 学習データ作成装置、方法、プログラム、学習データ及び機械学習装置

Country Status (2)

Country Link
JP (1) JP7375161B2 (ja)
WO (1) WO2021182345A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPWO2023234061A1 (ja) * 2022-05-31 2023-12-07

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018027242A (ja) * 2016-08-18 2018-02-22 安川情報システム株式会社 錠剤検知方法、錠剤検知装置および錠剤検知プログラム
US20180260665A1 (en) * 2017-03-07 2018-09-13 Board Of Trustees Of Michigan State University Deep learning system for recognizing pills in images
JP2019125203A (ja) * 2018-01-17 2019-07-25 株式会社東芝 目標認識装置、目標認識方法、プログラム及び畳み込みニューラルネットワーク
JP2019207535A (ja) * 2018-05-29 2019-12-05 キヤノン株式会社 情報処理装置、情報処理方法及びプログラム
JP2019215647A (ja) * 2018-06-12 2019-12-19 キヤノンマーケティングジャパン株式会社 情報処理装置、その制御方法及びプログラム。

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018027242A (ja) * 2016-08-18 2018-02-22 安川情報システム株式会社 錠剤検知方法、錠剤検知装置および錠剤検知プログラム
US20180260665A1 (en) * 2017-03-07 2018-09-13 Board Of Trustees Of Michigan State University Deep learning system for recognizing pills in images
JP2019125203A (ja) * 2018-01-17 2019-07-25 株式会社東芝 目標認識装置、目標認識方法、プログラム及び畳み込みニューラルネットワーク
JP2019207535A (ja) * 2018-05-29 2019-12-05 キヤノン株式会社 情報処理装置、情報処理方法及びプログラム
JP2019215647A (ja) * 2018-06-12 2019-12-19 キヤノンマーケティングジャパン株式会社 情報処理装置、その制御方法及びプログラム。

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPWO2023234061A1 (ja) * 2022-05-31 2023-12-07
WO2023234061A1 (ja) * 2022-05-31 2023-12-07 京セラ株式会社 データ取得装置、データ取得方法、及びデータ取得台

Also Published As

Publication number Publication date
JPWO2021182345A1 (ja) 2021-09-16
JP7375161B2 (ja) 2023-11-07

Similar Documents

Publication Publication Date Title
CN106447721B (zh) 图像阴影检测方法和装置
US10223839B2 (en) Virtual changes to a real object
CN111144305B (zh) 训练数据生成方法、装置、电子设备和介质
US20220028089A1 (en) Machine learning feature vector generator using depth image foreground attributes
JP7083037B2 (ja) 学習装置及び学習方法
DE102018121282A1 (de) Differenzierbare rendering-pipeline für inverse graphik
KR102559021B1 (ko) 불량 이미지 생성 장치 및 방법
US20240290027A1 (en) Synthetic Images for Machine Learning
JP6823727B2 (ja) 薬剤検査支援装置、画像処理装置、画像処理方法及びプログラム
JPWO2019039302A1 (ja) 薬剤検査支援装置、画像処理装置、画像処理方法及びプログラム
CN115457206A (zh) 三维模型生成方法、装置、设备及存储介质
JP2001216518A (ja) マッチング方法および装置並びに記録媒体
JP7375161B2 (ja) 学習データ作成装置、方法、プログラム、及び記録媒体
CN112614138B (zh) 图像处理装置、方法、系统、存储介质及计算机程序产品
JP7531578B2 (ja) 学習データ作成装置、方法、プログラム、及び記録媒体
CN112633038A (zh) 数据处理方法、装置、计算机设备和计算机可读存储介质
JP7338030B2 (ja) 物体認識装置、方法及びプログラム
JP7375049B2 (ja) 画像処理装置及び方法
CN117897742A (zh) 用于提供用于训练功能的训练图像数据的方法
CN112634397A (zh) 数据处理方法、装置、计算机设备和计算机可读存储介质
CN119323526B (zh) 一种移除穿帮物体模型的训练方法
RU2831513C1 (ru) Способ, компьютерное устройство и считываемый компьютером носитель для получения изображения лица с добавленным освещением
CN114972560B (zh) 一种图像绘制方法、系统、电子设备及介质
US20240289963A1 (en) Image processing apparatus, image processing method, program, and recording medium
JP2007315777A (ja) 三次元形状計測システム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21768494

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2022507151

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21768494

Country of ref document: EP

Kind code of ref document: A1