WO2023175870A1 - 機械学習装置、特徴抽出装置、及び制御装置 - Google Patents

機械学習装置、特徴抽出装置、及び制御装置 Download PDF

Info

Publication number
WO2023175870A1
WO2023175870A1 PCT/JP2022/012453 JP2022012453W WO2023175870A1 WO 2023175870 A1 WO2023175870 A1 WO 2023175870A1 JP 2022012453 W JP2022012453 W JP 2022012453W WO 2023175870 A1 WO2023175870 A1 WO 2023175870A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
model
learning
filter
filters
Prior art date
Application number
PCT/JP2022/012453
Other languages
English (en)
French (fr)
Inventor
大雅 佐藤
Original Assignee
ファナック株式会社
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 ファナック株式会社 filed Critical ファナック株式会社
Priority to PCT/JP2022/012453 priority Critical patent/WO2023175870A1/ja
Publication of WO2023175870A1 publication Critical patent/WO2023175870A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining

Definitions

  • the present invention relates to image processing technology, and particularly to a machine learning device, a feature extraction device, and a control device.
  • the position and orientation of the object may be detected using an image of the object. For example, a model feature representing a specific part of the object is extracted from a model image captured of an object whose position and orientation are known, and the model feature of the object is registered together with the position and orientation of the object. Next, from an image of an object whose position and orientation are unknown, features representing specific parts of the object are extracted in the same way, and the features of the object are determined by comparing them with the model features registered in advance. The amount of change in position and orientation is calculated to detect the position and orientation of an object whose position and orientation are unknown.
  • the outline of the object that is, the edges and corners of the object that captures the brightness change (gradient) in the image is often used as the object feature used for feature matching.
  • the features of the object used for feature matching vary greatly depending on the type and size of the applied image filter (also referred to as spatial filtering).
  • Types of filters include noise removal filters, contour extraction filters, etc. as application types, and noise removal filters as algorithm types include mean value filters, median filters, Gaussian filters, expansion/shrinkage filters, etc.
  • Extraction filters include edge detection filters such as Prewitt filters, Sobel filters, and Laplacian filters, and corner detection filters such as Harris operators.
  • a small-sized contour extraction filter is effective for extracting relatively fine contours such as letters printed on an object, but it is effective for extracting relatively coarse contours such as rounded corners of castings. If you do, you are not good at it.
  • a large-sized contour extraction filter is effective for rounded corners. Therefore, it is necessary to specify an appropriate filter type, size, etc. for each predetermined section depending on the detection target and imaging conditions. Background technologies related to the present application include those described below.
  • Patent Document 1 describes distances (differences in feature amounts) from an image containing a target object and a target image to each of feature amounts (image feature amounts regarding the center of gravity, edges, and pixels) of a plurality of different images. ) is detected and weighted, the weighted distances are summed for all image features, the result is generated as a control signal, and one or both of the position and orientation of the object is changed based on the control signal. It is stated that the action is performed.
  • Patent Document 2 discloses that edge detection is performed from an image using an edge detection filter consisting of multiple sizes, a region that is not an edge is extracted as a flat region, and the value of the pixel of interest and the edge are detected for the extracted flat region.
  • a transmittance map is created by calculating the relative ratio of the values of surrounding pixels in the pixel range corresponding to the size of the detection filter to the average value, and the created transmittance map is used to correct the image of the flat area. It states that it removes dust shadows, etc.
  • the image area used for feature matching is not necessarily a location suitable for extracting features of the object, there may be locations where the filter response is weak depending on the filter type, size, etc.
  • a low threshold value in threshold processing after filter processing it is possible to extract contours from areas where the response is weak, but since unnecessary noise is also extracted, the time required for feature matching increases. Further, a slight change in the imaging conditions may cause the characteristics of the object to not be extracted.
  • an object of the present invention is to provide a technique that can stably extract the characteristics of an object from an image of the object in a short time.
  • One aspect of the present disclosure provides data regarding a plurality of different filters applied to an image of a target object, and data indicating a state of each predetermined section of a plurality of filtered images processed by the plurality of filters.
  • a learning data acquisition unit that acquires a learning data set, and a learning unit that uses the learning data set to generate a learning model that outputs synthesis parameters for synthesizing a plurality of filtered images for each corresponding section.
  • a machine learning device comprising: Another aspect of the present disclosure is a feature extraction device that extracts features of an object from an image of the object, the device performing multiple filter processing by processing the image of the object with a plurality of different filters.
  • a multiple filter processing unit that generates an image, and a feature extraction image that generates and outputs a feature extraction image of the object by combining multiple filter processed images based on the combination ratio of each corresponding section of the multiple filter processed images.
  • a feature extraction device comprising a generation unit.
  • Another aspect of the present disclosure is a control device that controls the operation of a machine based on at least one of the position and orientation of a target object detected from an image of the target object, the control device comprising: A feature that generates multiple filtered images by processing with multiple different filters, synthesizes the multiple filtered images based on the composition ratio of each corresponding section of the multiple filtered images, and extracts the features of the object.
  • the extraction unit compares the extracted object features with model features extracted from a model image of an object whose position and/or orientation are known, and determines whether at least one of the position or orientation is unknown.
  • a control device comprising a feature matching unit that detects at least one of the position and orientation of an object, and a control unit that controls the operation of the machine based on at least one of the detected position and orientation of the object.
  • FIG. 1 is a configuration diagram of a mechanical system according to an embodiment.
  • 1 is a block diagram of a mechanical system of one embodiment.
  • FIG. FIG. 1 is a block diagram of a feature extraction device according to an embodiment.
  • 3 is a flowchart showing an execution procedure of the mechanical system at the time of model registration. It is a flowchart showing the execution procedure of the mechanical system when the system is in operation.
  • FIG. 1 is a block diagram of a machine learning device according to an embodiment. It is a schematic diagram which shows an example of the type and size of a filter.
  • FIG. 3 is a schematic diagram showing a method of acquiring label data. It is a scatter diagram which shows an example of the learning data set of a composition ratio.
  • FIG. 2 is a schematic diagram showing a decision tree model.
  • FIG. 2 is a schematic diagram showing a neuron model.
  • FIG. 2 is a schematic diagram showing a neural network model.
  • FIG. 2 is a schematic diagram showing the configuration of reinforcement learning.
  • FIG. 3 is a schematic diagram showing reactions for each predetermined section of a plurality of filtered images.
  • 12 is a table showing an example of a learning data set for a set of a specified number of filters. It is a tree diagram showing a model of unsupervised learning (hierarchical clustering). It is a flowchart which shows the execution procedure of a machine learning method.
  • FIG. 2 is a schematic diagram showing an example of a user interface (UI) for setting synthesis parameters.
  • UI user interface
  • FIG. 1 is a configuration diagram of a mechanical system 1 according to one embodiment
  • FIG. 2 is a block diagram of the mechanical system 1 according to one embodiment.
  • the mechanical system 1 is a mechanical system that controls the operation of the machine 2 based on at least one of the position and orientation of the object W detected from an image of the object W.
  • the mechanical system 1 is a robot system, it may be configured as a mechanical system including other machines such as machine tools, construction machines, vehicles, and aircraft.
  • the mechanical system 1 includes a machine 2, a control device 3 that controls the operation of the machine 2, a teaching device 4 that teaches the machine 2 how to operate, and a visual sensor 5.
  • the machine 2 is composed of an articulated robot, but may be composed of other types of robots such as a parallel link type robot or a humanoid robot. In other embodiments, the machine 2 may be configured with other types of machines such as machine tools, construction machines, vehicles, and aircraft.
  • the machine 2 includes a mechanism section 21 made up of a plurality of mechanical elements that are movable relative to each other, and an end effector 22 that can be detachably connected to the mechanism section 21.
  • the mechanical elements are composed of links such as a base, a rotating trunk, an upper arm, a forearm, and a wrist, and each link rotates around predetermined axes J1 to J6.
  • the mechanism section 21 is composed of an electric actuator 23 including an electric motor for driving mechanical elements, a detector, a speed reducer, etc., but in other embodiments, a hydraulic or pneumatic cylinder, a pump, a control valve, etc. It may be configured with a fluid-type actuator including, for example.
  • the end effector 22 is a hand that takes out and delivers the object W, but in other embodiments, it may be configured with tools such as a welding tool, a cutting tool, and a polishing tool.
  • the control device 3 is communicatively connected to the machine 2 via a wire.
  • the control device 3 includes a computer including a processor (PLC, CPU, GPU, etc.), memory (RAM, ROM, etc.), and input/output interface (A/D converter, D/A converter, etc.), and an actuator of the machine 2. It is equipped with a drive circuit that drives the. In other embodiments, the control device 3 may not include a drive circuit and the machine 2 may include a drive circuit.
  • the teaching device 4 is communicably connected to the control device 3 via wire or wirelessly.
  • the teaching device 4 includes a processor (CPU, MPU, etc.), memory (RAM, ROM, etc.), a computer including an input/output interface, a display, an emergency stop switch, an enable switch, and the like.
  • the teaching device 4 includes, for example, an operation panel directly assembled to the control device 3, a teach pendant, a tablet, a PC, a server, etc. that are communicably connected to the control device 3 by wire or wirelessly.
  • the teaching device 4 has various coordinate systems, such as a reference coordinate system C1 fixed at a reference position, a tool coordinate system C2 fixed to the end effector 22 which is a part to be controlled, and a workpiece coordinate system C3 fixed to the target object W.
  • a reference coordinate system C1 fixed at a reference position
  • a tool coordinate system C2 fixed to the end effector 22 which is a part to be controlled
  • a workpiece coordinate system C3 fixed to the target object W.
  • the position and orientation of the end effector 22 are expressed as the position and orientation of the tool coordinate system C2 in the reference coordinate system C1.
  • the teaching device 4 further sets a camera coordinate system fixed to the visual sensor 5, and changes the position and orientation of the object W in the camera coordinate system to the position and orientation of the object W in the reference coordinate system C1. Convert to posture.
  • the position and orientation of the object W are expressed as the position and orientation of the workpiece coordinate system C3 in the reference coordinate system C1.
  • the teaching device 4 has an online teaching function such as a playback method or a direct teaching method that teaches the position and posture of a control target part by actually moving the machine 2, or a virtual model of the machine 2 in a virtual space generated by a computer. It is equipped with an offline teaching function that teaches the position and posture of the controlled area by moving it.
  • the teaching device 4 generates an operating program for the machine 2 by associating the taught position, orientation, operating speed, etc. of the controlled region with various operating commands.
  • the operation commands include various commands such as linear movement, circular arc movement, and movement of each axis.
  • the control device 3 receives the operation program from the teaching device 4 and controls the operation of the machine 2 according to the operation program.
  • the teaching device 4 also receives the state of the machine 2 from the control device 3 and displays the state of the machine 2 on a display or the like.
  • the visual sensor 5 is composed of a two-dimensional camera that outputs a two-dimensional image, a three-dimensional camera that outputs a three-dimensional image, and the like.
  • the visual sensor 5 is mounted near the end effector 22, but in other embodiments it may be fixedly installed at a different location from the machine 2.
  • the control device 3 acquires an image of the object W using the visual sensor 5, extracts features of the object W from the image of the object W, and determines the extracted features of the object W and its position. At least one of the position and orientation of the target object W is detected by comparing the model features of the target object W extracted from a model image taken of the target object W, of which at least one of the position and orientation is known.
  • position and orientation of the object W in this book refers to the position and orientation of the object W converted from the camera coordinate system to the reference coordinate system C1, but simply the position and orientation of the object W in the camera coordinate system. It may be.
  • the control device 3 includes a storage section 31 that stores various data, and a control section 32 that controls the operation of the machine 2 according to an operation program.
  • the storage unit 31 includes memory (RAM, ROM, etc.).
  • the control unit 32 includes a processor (PLC, CPU, etc.) and a drive circuit that drives the actuator 23, but the drive circuit may be placed inside the machine 2 and the control unit 32 may include only the processor. be.
  • the storage unit 31 stores operation programs for the machine 2, various image data, and the like.
  • the control unit 32 drives and controls the actuator 23 of the machine 2 according to the operation program generated by the teaching device 4 and the position and orientation of the object W detected using the visual sensor 5.
  • the actuator 23 includes one or more electric motors and one or more motion detection sections.
  • the control unit 32 controls the position, speed, acceleration, etc. of the electric motor according to the command value of the operation program and the detected value of the operation detection unit.
  • the control device 3 further includes an object detection unit 33 that detects at least one of the position and orientation of the target object W using the visual sensor 5.
  • the object detection unit 33 may be configured as an object detection device that is placed outside the control device 3 and can communicate with the control device 3.
  • the object detection section 33 includes a feature extraction section 34 that extracts the features of the object W from an image of the object W, and an object detection section 34 that extracts the features of the object W from an image taken of the object W, and an object detection section 34 that extracts the features of the object W from an image of the object W.
  • the feature matching unit 35 detects at least one of the position and orientation of an object W whose position and orientation are unknown by comparing model features extracted from a model image obtained by capturing W. .
  • the feature extraction unit 34 may be configured as a feature extraction device that is placed outside the control device 3 and can communicate with the control device 3.
  • the feature matching unit 35 may be configured as a feature matching device that is placed outside the control device 3 and can communicate with the control device 3.
  • the control unit 32 corrects at least one of the position and orientation of the control target part of the machine 2 based on at least one of the position and orientation of the detected object W.
  • the control unit 32 may correct data on the position and orientation of the control target part used in the operation program of the machine 2, or may correct data on the position and orientation of the control target part during the operation of the machine 2.
  • Visual feedback may be provided by calculating the position deviation, speed deviation, acceleration deviation, etc. of one or more electric motors based on inverse kinematics.
  • the mechanical system 1 detects at least one of the position and orientation of the object W to be inspected from an image taken of the object W using the visual sensor 5, and based on at least one of the position and orientation of the object W. to control the operation of machine 2.
  • the image area used by the feature matching unit 35 to match the features of the object W with the model features is not necessarily a location suitable for extracting the features of the object W. Due to the type, size, etc. of the filter F used in the feature extracting section 34, there may occur locations where the response of the filter F is weak. By setting a low threshold in threshold processing after filter processing, it is possible to extract contours from areas with weak responses, but unnecessary noise is also extracted, which increases the time required for feature matching. Furthermore, the features of the object W may not be extracted due to slight changes in the imaging conditions.
  • the feature extraction unit 34 processes the captured image of the object W using a plurality of different filters F, and synthesizes the plurality of filtered images based on the synthesis ratio C for each corresponding section of the plurality of filtered images. , generate and output a feature extraction image. It is desirable that the feature extraction unit 34 executes multiple filter processes in parallel in order to increase speed.
  • a plurality of different filters F means a set of filters F in which at least one of the type and size of the filters F is changed.
  • the plurality of different filters F are three of different sizes: an 8-neighborhood Prewitt filter (first filter), a 24-neighborhood Previtt filter (second filter), and a 48-neighborhood Previtt filter (third filter). It consists of a filter F.
  • the plurality of different filters F may be a set of filters F that is a combination of a plurality of filters F with different algorithms.
  • the different filters F include an 8-neighbor Sobel filter (first filter), a 24-neighbor Sobel filter (second filter), an 8-neighbor Laplacian filter (third filter), and a 24-neighbor Laplacian filter ( It consists of a set of four filters F with different algorithms and different sizes.
  • the plurality of different filters F may be a set of filters F in which filters F for different purposes are combined in series and/or in parallel.
  • the different filters F include an 8-neighborhood noise removal filter (first filter), a 48-neighborhood noise removal filter (second filter), an 8-neighborhood contour extraction filter (third filter), and a 48neighborhood contour extraction filter. It is composed of a set of four filters F of different uses and different sizes called filters (fourth filter).
  • the plurality of different filters F may be a plurality of filters for different purposes, such as a noise removal filter for 8 neighborhoods + a contour extraction filter for 24 neighborhoods (first filter), and a noise removal filter for 48 neighborhoods + a contour extraction filter for 80 neighborhoods (second filter).
  • the plurality of different filters F are different, such as an edge detection filter with 8 neighborhoods + a corner detection filter with 8 neighborhoods (first filter), and an edge detection filter with 24 neighborhoods + corner detection filter with 24 neighborhoods (second filter). It may be composed of a set of two filters F of different sizes, which are a series combination of a plurality of filters F for different purposes.
  • a "section” generally corresponds to one pixel, but it also refers to a group of nearby pixels such as a group of pixels in the 8 neighborhood, a pixel group in the 12 neighborhood, a pixel group in the 24 neighborhood, a pixel group in the 48 neighborhood, and a pixel group in the 80 neighborhood. It may also be a structured compartment.
  • the "sections" may be respective sections of an image divided by various image segmentation techniques. Examples of image segmentation methods include deep learning and the k-means method. When using the k-means method, image segmentation may be performed based on the output result of filter F instead of performing image segmentation based on RGB space.
  • the combination ratio C for each predetermined section and the set of different filters F are set manually or automatically.
  • composition ratio C for each predetermined section, even if different features such as fine features such as letters and coarse features such as rounded corners coexist in one image, the desired It is possible to accurately extract the characteristics of
  • the teaching device 4 includes an image receiving unit 36 that receives a model image of an object W whose position and/or orientation are known in association with the position and orientation of the object W.
  • the image reception unit 36 displays a UI for accepting a model image of the object W in association with the position and orientation of the object W on the display.
  • the feature extraction unit 34 extracts and outputs model features of the object W from the received model image, and the storage unit 31 stores the output model features of the object W in association with the position and orientation of the object W. do. Thereby, the model features used by the feature matching unit 35 are registered in advance.
  • the image reception unit 36 adds one or more changes to the received model image, such as brightness, enlargement or reduction, shearing, translation, rotation, etc., to produce one or more changed model images. may be accepted.
  • the feature extraction unit 34 extracts and outputs one or more model features of the object W from the one or more modified model images, and the storage unit 31 extracts and outputs the one or more model features of the object W that have been output. It is stored in association with the position and orientation of the target object W.
  • the feature matching unit 35 converts the features extracted from the captured image of the object W, whose position and/or orientation are unknown, into one or more model features. Since verification is possible, at least one of the position and orientation of the object W can be stably detected.
  • the image receiving unit 36 may receive an adjusted image for automatically adjusting the combination ratio C of each corresponding section of a plurality of filter-processed images or the set of a plurality of designated filters F.
  • the adjusted image may be a model image of an object W whose position and/or orientation are known, or may be an image of an object W whose position and/or orientation are unknown.
  • the feature extraction unit 34 generates a plurality of filtered images by processing the received adjusted image with a plurality of different filters F, and synthesizes each predetermined section based on the state S of each predetermined section of the plurality of filtered images. At least one of the ratio C and the specified number of filters F is set manually or automatically.
  • the state S of each predetermined section of the plurality of filtered images is based on the characteristics of the object W (fine features such as letters, rough features such as rounded corners, strong reflection due to the color and material of the object W, etc.) , since it changes depending on the imaging conditions (illuminance of reference light, exposure time, etc.), the combination ratio C for each predetermined section and the set of different filters F can be automatically adjusted using machine learning, which will be described later. is desirable.
  • FIG. 3 is a block diagram of the feature extraction device 34 (feature extraction unit) of one embodiment.
  • the feature extraction device 34 includes a computer including a processor (CPU, GPU, etc.), memory (RAM, ROM, etc.), and input/output interface (A/D converter, D/A converter, etc.).
  • the processor reads and executes the feature extraction program stored in the memory, processes the image input via the input/output interface with a plurality of different filters F, generates a plurality of filtered images, and performs the plurality of filter processing.
  • a plurality of filtered images are combined based on a combination ratio C for each corresponding section of the image, and a feature extraction image of the object W is generated.
  • the processor outputs the feature extraction image to the outside of the feature extraction device 34 via the input/output interface.
  • the feature extraction device 34 includes a multi-filter processing unit 41 that processes an image of the object W using a plurality of different filters F to generate a plurality of filter-processed images, and a plurality of filter-processed images for each corresponding section of the plurality of filter-processed images.
  • a feature extraction image generation unit 42 that synthesizes a plurality of filtered images based on a synthesis ratio C of , generates and outputs a feature extraction image of the object W.
  • the feature extraction image generation section 42 includes an image composition section 42a that composes a plurality of filtered images, and a threshold processing section 42b that performs threshold processing on a plurality of filtered images or composite images.
  • the feature extraction image generation unit 42 may execute the processing in the order of the threshold processing unit 42b and the image synthesis unit 42a, instead of the processing in the order of the image synthesis unit 42a and the threshold processing unit 42b. good.
  • the image synthesis section 42a is not arranged before the threshold processing section 42b, but may be arranged after the threshold processing section 42b.
  • the feature extraction unit 34 also includes a filter set setting unit 43 that sets a set of different designated numbers of filters F, and a combination ratio setting unit 44 that sets a combination ratio C for each corresponding section of the plurality of filtered images. It also has:
  • the filter set setting unit 43 provides a function of manually or automatically setting a set of different designated numbers of filters F.
  • the composition ratio setting unit 44 provides a function of manually or automatically setting the composition ratio C for each corresponding section of a plurality of filtered images.
  • the time of model registration means the scene in which model features used in feature matching for detecting the position and orientation of the object W are registered in advance
  • the time of system operation means the scene when the machine 2 is actually in operation. This refers to a scene in which a predetermined work is performed on the object W.
  • FIG. 4 is a flowchart showing the execution procedure of the mechanical system 1 at the time of model registration.
  • the image receiving unit 36 receives a model image of an object W whose position and/or orientation are known, in association with at least one of the position and/or orientation of the object W.
  • step S11 the multiple filter processing unit 41 generates a plurality of filtered images obtained by processing a model image of the object W using a plurality of different filters F.
  • the filter set setting unit 43 may manually set a specified number of different sets of filters F.
  • the filter set setting unit 43 automatically sets an optimal set of a different specified number of filters F based on the state S of each predetermined section of the plurality of filter-processed images, and then the step S11 is performed again. After returning to S11 and repeating the process of generating a plurality of filter-processed images and converging on the optimal set of the specified number of filters F, the process may proceed to Step S12.
  • step S12 the composition ratio setting unit 44 manually sets the composition ratio C for each corresponding section of the plurality of filtered images based on the state S of each predetermined section of the plurality of filtered images.
  • the composition ratio setting unit 44 may automatically set the composition ratio C for each corresponding section of the plurality of filtered images based on the state S of each predetermined section of the plurality of filtered images.
  • step S13 the feature extraction image generation unit 42 synthesizes a plurality of filtered images based on the set composition ratio C, and generates and outputs a model feature extraction image (target image).
  • step S14 the storage unit 31 stores the model feature extraction image in association with at least one of the position and orientation of the object W, so that the model features of the object W are registered in advance.
  • the image receiving unit 36 further receives adjusted images of the object W, and the filter set setting unit 43 manually or automatically sets a designated number of filters F based on the received adjusted images.
  • the composition ratio setting unit 44 may manually or automatically reset the composition ratio C for each predetermined section based on the received adjusted image.
  • FIG. 5 is a flowchart showing the execution procedure of the mechanical system 1 when the system is in operation.
  • the feature extraction device 34 receives from the visual sensor 5 an actual image of an object W whose position and/or orientation are unknown.
  • step S21 the multiple filter processing unit 41 generates a plurality of filtered images obtained by processing the actual image of the object W using a plurality of different filters F.
  • the filter set setting unit 43 automatically resets the optimal set of different designated numbers of filters F based on the state S of each predetermined section of the plurality of filter-processed images. It is also possible to return to step S11 and repeat the process of generating a plurality of filter-processed images, and then proceed to step S22 after the optimal set of the designated number of filters F has converged.
  • step S22 the composition ratio setting unit 44 automatically resets the composition ratio C for each corresponding section of the plurality of filtered images based on the state S of each predetermined section of the plurality of filtered images.
  • the process may proceed to step S23 without performing the process in step S22, and use a predetermined combination ratio C for each section that is set in advance before the system starts operating.
  • step S23 the feature extraction image generation unit 42 synthesizes a plurality of filtered images based on the set composition ratio C, generates and outputs a feature extraction image.
  • step S24 the feature matching unit 35 matches the generated feature extraction image with a model feature extraction image (target image) registered in advance, and identifies objects whose position and/or orientation are unknown. At least one of the position and orientation of W is detected.
  • step S25 the control unit 32 corrects the operation of the machine 2 based on at least one of the position and orientation of the object W.
  • the image receiving unit 36 further receives an adjusted image of the target object W and sets the filter.
  • the setting unit 43 may manually or automatically reset the set of a specified number of filters F based on the received adjusted image, or the combination ratio setting unit 44 may reset a specified number of filters F based on the received adjusted image.
  • the composition ratio C for each section may be reset manually or automatically.
  • the feature extraction device 34 further includes a machine learning unit 45 that learns the state S for each predetermined section of the plurality of filtered images.
  • the machine learning unit 45 is configured as a machine learning device that is placed outside the feature extraction device 34 (feature extraction unit) or the control device 3 and can communicate with the feature extraction device 34 or the control device 3. Good too.
  • FIG. 6 is a block diagram of the machine learning device 45 (machine learning section) of one embodiment.
  • the machine learning device 45 includes a computer including a processor (CPU, GPU, etc.), memory (RAM, ROM, etc.), and input/output interface (A/D converter, D/A converter, etc.).
  • the processor reads and executes the machine learning program stored in the memory, and generates a synthesis parameter P for synthesizing the plurality of filtered images for each corresponding section based on the input data input via the input/output interface.
  • a learning model LM that outputs is generated.
  • the processor transforms the state of the learning model LM in accordance with learning based on the new input data.
  • the learning model LM is optimized.
  • the processor outputs the learned learning model LM to the outside of the machine learning device 45 via the input/output interface.
  • the machine learning device 45 includes a learning data acquisition unit 51 that acquires data regarding a plurality of different filters F and data indicating a state S for each predetermined section of a plurality of filtered images as a learning data set DS;
  • the learning unit 52 uses the set DS to generate a learning model LM that outputs a synthesis parameter P for synthesizing a plurality of filtered images.
  • the learning unit 52 converts the state of the learning model LM in accordance with learning based on the new learning data set DS. In other words, the learning model LM is optimized.
  • the learning unit 52 outputs the generated learned learning model LM to the outside of the machine learning device 45.
  • the learning model LM includes at least one of a learning model LM1 that outputs a synthesis ratio C for each corresponding section of a plurality of filtered images, and a learning model LM2 that outputs a set of a specified number of filters F. That is, the synthesis parameter P output by the learning model LM1 is a synthesis ratio C for each predetermined section, and the synthesis parameter P output by the learning model LM2 is a set of a specified number of filters F.
  • ⁇ Learning model LM1 of composition ratio C a prediction model (learning model LM1) for the synthesis ratio C for each corresponding section of a plurality of filtered images will be described. Since the prediction of the composite ratio C is a continuous value prediction problem called the composite ratio (that is, a regression problem), the learning method for the learning model LM1 that outputs the composite ratio may be supervised learning, reinforcement learning, deep reinforcement learning, etc. Can be used. Further, as the learning model LM1, models such as a decision tree, a neuron, a neural network, etc. can be used.
  • the learning data acquisition unit 51 acquires data regarding a plurality of different filters F as a learning data set DS, and the data regarding the plurality of filters F includes at least one of the types and sizes of the plurality of filters F.
  • FIG. 7 is a schematic diagram showing an example of the type and size of the filter F.
  • Types of filter F include noise removal filters (average filter, median filter, Gaussian filter, expansion/deflation filter, etc.), contour extraction filters (edge detection filters such as Prewitt filter, Sobel filter, Laplacian filter, etc.), and Harris operator. corner detection filters).
  • the size of the filter F includes various sizes such as 4 neighborhoods, 8 neighborhoods, 12 neighborhoods, 24 neighborhoods, 28 neighborhoods, 36 neighborhoods, 48 neighborhoods, 60 neighborhoods, and 80 neighborhoods.
  • the filter F may be square as in 8-neighborhood, 24-neighborhood, 48-neighborhood, 80-neighborhood, etc., it may be cross-shaped as in 4-neighborhood, it may be diamond-shaped as in 12-neighborhood, or it may be in the shape of 28neighborhood, 36neighborhood, etc. , around 60, or the like.
  • setting the size of filter F means setting the shape of filter F.
  • One section of the filter F generally corresponds to one pixel of an image, but it may also correspond to a section made up of a group of adjacent pixels, such as 4 adjacent pixels, 9 adjacent pixels, or 16 adjacent pixels.
  • one section of filter F may correspond to each section of an image segmented by various image segmentation techniques. Examples of image segmentation methods include deep learning and the k-means method. When using the k-means method, image segmentation may be performed based on the output result of filter F instead of performing image segmentation based on RGB space.
  • Each section of filter F includes coefficients or weights depending on the type of filter F.
  • the value of the section of the image corresponding to the center section of the filter F is determined by the coefficients or weights of the surrounding sections surrounding the center section of the filter F, and the values of the surrounding sections of the filter F. is replaced with a value calculated based on the values of the surrounding sections of the image corresponding to the image.
  • the data regarding the plurality of filters F includes at least one of the types and sizes of the plurality of filters F.
  • the data related to the plurality of filters F include a 4-neighbor Sobel filter (first filter), an 8-neighbor Sobel filter (second filter), a 12-neighbor Sobel filter (third filter), and a 24-neighbor Sobel filter (third filter).
  • the learning data acquisition unit 51 acquires data indicating the state S of each predetermined section of the plurality of filter-processed images as a learning data set DS, which indicates the state S of each predetermined section of the plurality of filter-processed images.
  • the data includes variations in values of surrounding sections of a predetermined section of the filtered image. "Variation in values of surrounding sections” includes the variance value or standard deviation value of values of surrounding pixel groups, such as, for example, 8 neighboring pixel groups, 12 neighboring pixel groups, and 24 neighboring pixel groups.
  • the data indicating the state S of each predetermined section of the plurality of filtered images include variations in values of surrounding sections for each predetermined section.
  • the data indicating the state S may include reactions for each predetermined section after threshold processing of a plurality of filtered images.
  • reaction for each predetermined section is the number of pixels that is equal to or greater than a threshold in a predetermined pixel group, such as a pixel group of 8 neighborhoods, a 12 neighborhood pixel group, or a 24 neighborhood pixel group, for example.
  • the data indicating the state S of each predetermined section of a plurality of filtered images is It further includes label data L indicating the degree from the normal state to the abnormal state.
  • the label data L approaches 1 (normal state) as the value of a predetermined section of the filtered image approaches the value of the corresponding section of the model feature extraction image (target image).
  • the label data L is normalized so as to approach 0 (abnormal state) as the value of the section becomes farther from the value of the corresponding section of the model feature extraction image (target image).
  • the synthesized image can be made closer to the target image by increasing the synthesis ratio of filter images close to the target image. For example, by learning a prediction model for estimating the label data L set in this way and determining the synthesis ratio according to the labels predicted by the prediction model, a synthesized image close to the target image can be obtained.
  • FIG. 8 is a schematic diagram showing a method for acquiring label data L.
  • the upper part of FIG. 8 shows the execution procedure when registering a model
  • the lower part of FIG. 8 shows the execution procedure when acquiring label data.
  • the image receiving unit 36 first receives a model image 61 including an object W whose position and/or orientation are known. At this time, the image receiving unit 36 adds one or more changes (brightness, enlargement or reduction, shearing, parallel movement, rotation, etc.) to the received model image 61, and generates one or more changed model images 62. may be accepted.
  • the one or more changes added to the received model image 61 may be one or more changes used during feature matching.
  • the feature extraction device 34 performs filter processing on the model image 62 according to a set of a plurality of manually set filters F as a process at the time of model registration described with reference to FIG.
  • a filtered image and composing a plurality of filtered images according to a manually set composition ratio C one or more model features 63 of the target object W are extracted from one or more model images 62, and the target object W is extracted from one or more model images 62.
  • One or more model feature extraction images 64 including model features 63 of W are generated and output.
  • the storage unit 31 registers the model feature extraction images 64 by storing one or more output model feature extraction images 64 (target images). At this time, if the user's trial and error or manual setting of the composition ratio increases, the user can manually specify the model features 63 (edges and corners) from the model image 62.
  • the model feature extraction image 64 may be generated manually.
  • the learning data acquisition unit 51 obtains each of a plurality of filter-processed images 71 obtained by processing an image of the object W using a plurality of different filters F, and the stored model characteristics.
  • label data L indicating the degree from a normal state to an abnormal state for each predetermined section of the plurality of filtered images is obtained.
  • the set of filters F and the synthesis ratio that are manually set at the time of model registration are set manually through trial and error so that the model features 63 are extracted from the model image 62, and the system can be operated as is. Even if applied to the image of the object W at the time, the characteristics of the object W may not be extracted appropriately depending on changes in the state of the object W or changes in the imaging conditions. Note that machine learning of the set of F is required.
  • the learning data acquisition unit 51 determines that the closer the value of the predetermined section after the difference is to 0 (that is, the closer to the value of the corresponding section of the target image), the closer the label data L is to 1 (normal state), The label data L is normalized so that the further the value of a predetermined section after the difference is from 0 (that is, the farther it is from the value of the corresponding section of the target image), the closer the label data L is to 0 (abnormal state).
  • the learning data acquisition unit 51 calculates a difference between one filter processed image 71 and each of the plurality of model feature extraction images 64. , the normalized difference image with the most label data L close to the normal state is adopted as the final label data L.
  • the learning data acquisition unit 51 acquires data regarding a plurality of different filters F and data indicating the state S of each predetermined section of a plurality of filtered images as a learning data set DS.
  • FIG. 9 is a scatter diagram showing an example of the learning data set DS of the synthesis ratio C.
  • the horizontal axis of the scatter diagram shows the type and size of the filter F (explanatory variable x1), and the vertical axis shows the variation in values of surrounding sections of a predetermined section of the filtered image (explanatory variable x2).
  • the explanatory variable x1 includes 4 neighboring Sobel filters (first filter) to 80 neighboring Sobel filters (9th filter).
  • the explanatory variable x2 includes variations in values of neighboring sections of a predetermined section of a plurality of filtered images processed by the first to ninth filters (indicated by circles).
  • the label data L (the numerical value shown on the right shoulder of the circle) indicates the degree of the predetermined section from the normal state "1" to the abnormal state "0".
  • the learning unit 52 uses a learning data set DS as shown in FIG. 9 to generate a learning model LM1 that outputs a synthesis ratio C for each corresponding section of a plurality of filtered images.
  • FIG. 10 is a schematic diagram showing a decision tree model.
  • the prediction of the composite ratio C is a continuous value prediction problem of the composite ratio C (that is, a regression problem)
  • the decision tree is a so-called regression tree.
  • the learning unit 52 calculates the objective variable y (y1 to y5 in the example of FIG. 10), which is the synthesis ratio, from the explanatory variable x1, which is the type and size of the filter F, and the explanatory variable x2, which is the variation in the values of surrounding sections. Generate a regression tree model to output.
  • the learning unit 52 divides the data using Gini impurity, entropy, etc. so that the information gain is maximized (that is, divides the data so that it is most clearly classified), and constructs a regression tree. Generate the model.
  • the learning unit 52 automatically sets the threshold t1 of the explanatory variable x1 (type and size of the filter F) in the first branch of the decision tree to "28 neighbors.”
  • the learning unit 52 automatically sets the threshold t2 of the explanatory variable x1 (type and size of filter F) to "near 60" in the second branch of the decision tree.
  • the learning section 52 automatically sets "98" to the threshold t3 of the explanatory variable x2 (variation in values of surrounding sections) in the third branch of the decision tree.
  • the objective variables y1 to y5 are determined based on the label data L and the appearance probability in the regions divided by the thresholds t1 to t4. For example, in the example of the learning data set DS shown in FIG. 9, the objective variable y1 is approximately 0.89, the objective variable y2 is approximately 0.02, the objective variable y3 is approximately 0.02, and the objective variable y4 is approximately 0.89. 05, and the objective variable y5 is approximately 0.02. Note that, depending on the learning data set DS, the synthesis ratio (objective variables y1 to y5) may be 1 for a specific filtered image and 0 for other filtered images.
  • the learning unit 52 generates a decision tree model as shown in FIG. 10 by learning the learning data set DS. Furthermore, each time the learning data acquisition unit 51 acquires a new learning data set DS, the learning unit 52 converts the state of the decision tree model in accordance with learning using the new learning data set DS. That is, the decision tree model is optimized by further adjusting the threshold t. The learning unit 52 outputs the generated learned decision tree model to the outside of the machine learning device 45.
  • the combination ratio setting unit 44 shown in FIG. 3 uses the trained decision tree model output from the machine learning device 45 (machine learning unit) to set the combination ratio C for each corresponding section of the plurality of filtered images. Set. For example, according to the decision tree model shown in FIG. 10 generated with the learning data set DS in FIG. If the variation in values of surrounding sections of a predetermined section of the processed image exceeds 98 (x2>t3), 0.89 (y1) is output as the synthesis ratio of the Sobel filter in that section, so the synthesis ratio setting The unit 44 automatically sets the synthesis ratio of the Sobel filter in the section to 0.89.
  • the synthesis ratio setting unit 44 automatically sets the synthesis ratio of the Sobel filter in the section to 0.05.
  • the combination ratio setting unit 44 automatically sets the combination ratio using the output trained decision tree model.
  • the decision tree model described above is a relatively simple model, but in industrial applications, the imaging conditions and the state of the object W are limited to a certain extent, so by learning with conditions tailored to the system, feature extraction is possible. Even if the processing is simple, extremely high performance can be obtained, leading to a significant reduction in processing time. Furthermore, it is possible to provide an improved feature extraction technique that allows features of the object W to be extracted stably in a short time.
  • FIG. 11 is a schematic diagram showing a neuron model.
  • the neuron outputs one output y for a plurality of inputs x (inputs x1 to x3 in the example of FIG. 11).
  • the individual inputs x1, x2, and x3 are each multiplied by a weight w (in the example of FIG. 11, weights w1, w2, and w3).
  • a neuron model can be constructed using arithmetic circuits and memory circuits that imitate neurons.
  • the relationship between input x and output y can be expressed by the following equation. In the following equation, ⁇ is the bias and f k is the activation function.
  • the inputs x1, x2, and x3 are explanatory variables regarding at least one of the type and size of the filter F, and the output y is an objective variable regarding the synthesis ratio.
  • inputs x4, x5, x6, . . . and corresponding weights w4, w5, w6, . . . may be added as necessary.
  • the inputs x4, x5, and x6 are explanatory variables related to variations in values of peripheral sections of the filtered image and reactions of the filtered image.
  • multiple neurons are parallelized to form one layer, and multiple inputs x1, x2, x3, ... are multiplied by their respective weights w and input to each neuron.
  • the outputs y1, y2, y3, . . . can be obtained.
  • the learning unit 52 uses the learning data set DS to generate a neuron model by adjusting the weight w using a learning algorithm such as a support vector machine. Further, the learning unit 52 converts the state of the neuron model in accordance with learning using the new learning data set DS. In other words, the neuron model is optimized by further adjusting the weight w. The learning unit 52 outputs the generated trained neuron model to the outside of the machine learning device 45.
  • a learning algorithm such as a support vector machine.
  • the synthesis ratio setting unit 44 shown in FIG. 3 automatically sets the synthesis ratio C for each corresponding section of the plurality of filtered images using the learned neuron model output from the machine learning device 45 (machine learning unit). Set with .
  • the neuron model described above is a relatively simple model, but in industrial applications, the imaging conditions and the state of the object W are limited to a certain extent, so by learning under conditions tailored to the system, feature extraction processing is possible. Even if it is simple, very high performance can be obtained, leading to a significant reduction in processing time. Furthermore, it is possible to provide an improved feature extraction technique that allows features of the object W to be extracted stably in a short time.
  • FIG. 12 is a schematic diagram showing a neural network model.
  • the neural network includes an input layer L1, intermediate layers L2 and L3 (also referred to as hidden layers), and an output layer L4.
  • L1 input layer
  • L2 and L3 intermediate layers
  • L4 output layer
  • the neural network in FIG. 12 includes two hidden layers L2 and L3, more hidden layers may be added.
  • the individual inputs x1, x2, x3, . . . of the input layer L1 are multiplied by respective weights w (generally expressed as weight W1) and input to the respective neurons N11, N12, N13.
  • the individual outputs of the neurons N11, N12, and N13 are input to the intermediate layer L2 as feature quantities.
  • each input feature quantity is multiplied by a respective weight w (generally expressed as a weight W2) and is input to each neuron N21, N22, and N23.
  • each input feature quantity is multiplied by a respective weight w (generally expressed as a weight W3) and is input to each neuron N31, N32, and N33.
  • the individual outputs of the neurons N31, N32, and N33 are input to the output layer L4 as feature quantities.
  • the input individual feature quantities are multiplied by respective weights w (generally expressed as weight W4) and input to the respective neurons N41, N42, and N43.
  • the individual outputs y1, y2, y3, . . . of the neurons N41, N42, N43 are output as target variables.
  • Neural networks can be constructed by combining arithmetic circuits and memory circuits that mimic neurons.
  • a neural network model can be constructed from a multilayer perceptron. For example, the input layer L1 multiplies multiple inputs x1, x2, x3, ..., which are explanatory variables related to the type of filter F, by their respective weights w and outputs one or more feature quantities, and the intermediate layer L2 outputs one or more features. A plurality of inputs, which are explanatory variables regarding the feature values and the size of the filter F, are multiplied by respective weights w to output one or more feature values.
  • One or more inputs which are explanatory variables regarding the variation in values of surrounding sections or the response of a predetermined section after thresholding the filtered image, are multiplied by respective weights w to output one or more feature quantities, and the output layer L4 outputs a plurality of outputs y1, y2, y3, . . . which are objective variables regarding the composition ratio of the input feature amount and a predetermined section of the filtered image.
  • the neural network model may be a model using a convolutional neural network (CNN).
  • CNN convolutional neural network
  • a neural network consists of an input layer that inputs filtered images, one or more convolution layers that extract features, one or more pooling layers that aggregate information, a fully connected layer, and software that outputs the synthesis ratio for each predetermined section. It may also include a max layer.
  • the learning unit 52 performs deep learning using a learning algorithm such as backpropagation (error backpropagation method) using the learning data set DS, adjusts the weights W1 to W4 of the neural network, and generates a neural network model.
  • a learning algorithm such as backpropagation (error backpropagation method) using the learning data set DS
  • the learning unit 52 may perform error backpropagation by comparing the individual outputs y1, y2, y3, . is desirable.
  • the learning unit 52 may perform regularization (dropout) as necessary to simplify the neural network model.
  • the learning unit 52 converts the state of the neural network model in accordance with learning using the new learning data set DS. In other words, the weight w is further adjusted to optimize the neural network model.
  • the learning unit 52 outputs the generated trained neural network model to the outside of the machine learning device 45.
  • the synthesis ratio setting unit 44 shown in FIG. 3 uses the learned neural network model output from the machine learning device 45 (machine learning unit) to set the synthesis ratio C for each corresponding section of the plurality of filtered images. Set automatically.
  • the neural network model described above can collectively handle more explanatory variables (dimensions) that have a correlation with the composition ratio of a predetermined section. Further, when CNN is used, the feature amount having a correlation with the synthesis ratio of a predetermined section is automatically extracted from the state S of the filtered image, so there is no need to design explanatory variables.
  • the learning unit 52 calculates the object W extracted from a composite image obtained by combining a plurality of filtered images based on a synthesis ratio C for each corresponding section.
  • a learning model that outputs a synthesis ratio C for each predetermined section so that the features of the object W approach the model features of the object W extracted from a model image of the object W whose position and/or orientation are known.
  • FIG. 13 is a schematic diagram showing the configuration of reinforcement learning.
  • Reinforcement learning consists of a learning subject called an agent and an environment that is controlled by the agent.
  • an agent performs some action A
  • a state S in the environment changes, and as a result, a reward R is fed back to the agent.
  • the learning unit 52 searches for the optimal action A through trial and error so as to maximize the total future reward R rather than the immediate reward R.
  • the agent is the learning unit 52
  • the environment is the object detection device 33 (object detection unit).
  • the action A by the agent is the setting of the synthesis ratio C for each corresponding section of a plurality of filtered images processed by a plurality of different filters F.
  • the state S in the environment is the state of a feature extraction image generated by combining a plurality of filtered images at a predetermined combination ratio for each section.
  • the reward R is a score obtained as a result of detecting at least one of the position and orientation of the object W by comparing the feature extraction image in a certain state S with the model feature extraction image.
  • the reward R is 100 points, and if neither the position nor the orientation of the target object W can be detected, the reward R is 0 points. .
  • the reward R may be a score corresponding to the time taken to detect at least one of the position and orientation of the object W, for example.
  • the learning unit 52 executes a certain action A (setting the synthesis ratio for each predetermined section), the state S (the state of the feature extraction image) in the object detection device 33 changes, and the learning data acquisition unit 51 determines the change.
  • the state S and its result are acquired as a reward R, and the reward R is fed back to the learning section 52.
  • the learning unit 52 searches for the optimal action A (setting the optimal combination ratio for each predetermined section) through trial and error so as to maximize the total future reward R rather than the immediate reward R. .
  • Reinforcement learning algorithms include Q-learning, Salsa, Monte Carlo method, etc.
  • Q learning is a method of learning the value Q(S, A) for selecting action A under a certain environmental state S. That is, in a certain state S, the action A with the highest value Q(S, A) is selected as the optimal action A.
  • the correct value of the value Q(S, A) for the combination of state S and action A is not known at all. Therefore, the agent selects various actions A under a certain state S, and is given a reward R for the action A at that time. As a result, the agent learns to choose a better action, that is, the correct value Q(S,A).
  • Q(S, A) E[ ⁇ t R t ] (expected discount value of reward. ⁇ : discount rate, R: reward, t: time) (expected The value is taken when the state changes according to the optimal action (of course, the optimal action is not known, so it must be learned while exploring).
  • An update formula for such value Q(S,A) can be expressed, for example, by the following formula.
  • S t represents the state of the environment at time t
  • a t represents the behavior at time t. Due to the action A t , the state changes to S t+1 .
  • R t+1 represents the reward that can be obtained by changing the state.
  • the term with max is the Q value when action A with the highest Q value known at that time is selected under state S t+1 multiplied by the discount rate ⁇ .
  • the discount rate ⁇ is a parameter satisfying 0 ⁇ 1.
  • is a learning coefficient, which is in the range of 0 ⁇ 1.
  • This formula represents a method of updating the evaluation value Q(S t , A t ) of the action A t in the state S t based on the reward R t+1 returned as a result of the tried action A t. If the evaluation value Q (S t +1 , maxA t+ 1 ) of the best action maxA in the next state based on reward R t+1 + action A is greater than the evaluation value Q (S t , A t ) of action A in state S, then , Q(S t , A t ) is increased, and conversely, if it is small, Q(S t , A t ) is also decreased. In other words, the value of a certain action in a certain state is brought closer to the resulting immediate reward and the value of the best action in the next state resulting from that action.
  • the learning unit 52 generates a reinforcement learning model that outputs the synthesis ratio C for each corresponding section of the plurality of filtered images. Further, the learning unit 52 converts the state of the reinforcement learning model in accordance with learning using the new learning data set DS. In other words, the reinforcement learning model is optimized by further adjusting the optimal action A that maximizes the total future reward R. The learning unit 52 outputs the generated trained reinforcement learning model to the outside of the machine learning device 45.
  • the combination ratio setting unit 44 shown in FIG. 3 uses the learned reinforcement learning model output from the machine learning device 45 (machine learning unit) to set the combination ratio C for each corresponding section of the plurality of filter-processed images. Set automatically.
  • Classification of a set of a specified number of filters F is an unsupervised problem because a set of filters F exceeding a specified number is prepared in advance and the optimal set of a specified number of filters F is classified into groups. Learning is preferred. Alternatively, reinforcement learning may be performed to select an optimal set of filters F of a specified number from among sets of filters F exceeding a specified number.
  • a reinforcement learning model is used as the learning model LM2 that outputs a set of a specified number of filters F.
  • the agent is the learning unit 52
  • the environment is the object detection device 33 (object detection unit).
  • Action A by the agent is selection of a set of a specified number of filters F (that is, selection of a specified number of filters F in which at least one of the type and size of the filters F is changed).
  • the state S in the environment is the state of each corresponding section of a plurality of filtered images processed by the specified number of selected filters F.
  • the reward R is a score corresponding to label data L indicating the degree from a normal state to an abnormal state for each predetermined section of a plurality of filtered images in a certain state S.
  • the learning unit 52 executes a certain action A (selecting a set of a specified number of filters F), the state S (the state of each predetermined section of a plurality of filtered images) in the object detection device 33 changes, and the learning data
  • the acquisition unit 51 acquires the changed state S and its result as a reward R, and feeds back the reward R to the learning unit 52.
  • the learning unit 52 searches for the optimal action A (selection of the optimal set of specified number of filters F) through trial and error so as to maximize the total future reward R, not the immediate reward R. .
  • the learning unit 52 generates a reinforcement learning model that outputs a set of a specified number of filters F. Further, the learning unit 52 converts the state of the reinforcement learning model in accordance with learning using the new learning data set DS. In other words, the reinforcement learning model is optimized by further adjusting the optimal action A that maximizes the total future reward R. The learning unit 52 outputs the generated trained reinforcement learning model to the outside of the machine learning device 45.
  • the filter set setting unit 43 shown in FIG. 3 automatically sets a specified number of filters F using the trained reinforcement learning model output from the machine learning device 45 (machine learning unit).
  • an unsupervised learning model is used as the learning model LM2 that outputs a set of a specified number of filters F.
  • a clustering model (hierarchical clustering, non-hierarchical clustering, etc.) can be used.
  • the learning data acquisition unit 51 acquires data regarding a plurality of different filters F and data indicating a state S for each predetermined section of a plurality of filter-processed images as a learning data set DS.
  • the data regarding the plurality of filters F includes data on at least one of the types and sizes of the plurality of filters F exceeding the specified number.
  • the data indicating the state S of each predetermined section of a plurality of filtered images is the reaction of each predetermined section after threshold processing of a plurality of filtered images, in other embodiments, the state S of each predetermined section of the plurality of filtered images is It may also be a variation in the values of the surrounding sections.
  • FIG. 14 is a schematic diagram showing reactions for each predetermined section of a plurality of filtered images.
  • FIG. 14 shows reactions 81 for each predetermined section 80 after threshold processing of the first to nth filtered images processed by the first to nth filters F (n is an integer) exceeding the specified number.
  • the reaction 81 for each predetermined section 80 is the number of pixels that is equal to or greater than a threshold in a predetermined pixel group, such as a pixel group in the 8 neighborhood, a pixel group in the 24 neighborhood, or a pixel group in the 48 neighborhood, for example.
  • a learning model LM2 is generated that classifies a set of a specified number of filters F so that the response for each section 80 is maximum among the first to nth filtered images.
  • the first filter is a small-sized Prewitt filter
  • the second filter is a medium-sized Previtt filter
  • the third filter is a large-sized Previtt filter
  • the fourth filter is a small-sized Laplacian filter.
  • the fifth filter is a medium-sized Laplacian filter
  • the sixth filter is a large-sized Laplacian filter.
  • FIG. 15 is a table showing an example of a learning data set of a specified number of filters F.
  • FIG. 15 shows the reactions in the first to ninth sections (number of pixels equal to or higher than the threshold) after threshold processing of the first to sixth filtered images processed by the first to sixth filters, respectively. It is shown. Additionally, the data showing the greatest response in each section are highlighted in bold and underlined.
  • the first to sixth filters are first classified into groups based on data showing the reactions of each section.
  • the learning unit 52 calculates a distance D between data between filters as a classification criterion.
  • the distance D for example, the Euclidean distance of the following formula can be used. Note that F a and F b are arbitrary two filters, F ai and F bi are data of each filter, i is a partition number, and n is the number of partitions.
  • the distance D between the data of the first filter and the second filter is approximately 18.
  • the learning unit 52 calculates the distance D between data between arbitrary filters by round robin.
  • the learning unit 52 classifies the filters with the closest distance D between data into the cluster CL1, classifies the next closest filters into the cluster CL2, and so on.
  • a simple connection method, a group average method, a Ward method, a centroid method, a median method, etc. can be used.
  • FIG. 16 is a tree diagram showing a model of unsupervised learning (hierarchical clustering).
  • Variables A1 to A3 indicate first to third filters
  • variables B1 to B3 indicate fourth to sixth filters.
  • the learning unit 52 classifies variables A3 and B3 with the closest distance D between data into cluster CL1, classifies variables A1 and B1 that are next closest into cluster CL2, and so on, and repeats this to create a hierarchical clustering model. will be generated.
  • the specified number that is, the number of groups
  • the learning unit 52 selects cluster CL2 (first filter, fourth filter), cluster CL3 (second filter, third filter, sixth filter).
  • variable B2 fifth filter
  • the learning unit 52 generates a hierarchical clustering model so as to output a set of three filters having a large number of sections with the maximum response from each of the three clusters.
  • the fourth filter, third filter, and fifth filter which have the largest number of sections with the maximum response, are output from each of the three clusters.
  • the learning unit 52 may generate a non-hierarchical clustering model instead of a hierarchical clustering model.
  • the non-hierarchical clustering the k-means method, the k-means++ method, etc. can be used.
  • the learning unit 52 generates an unsupervised learning model that outputs a set of a specified number of filters F. Furthermore, each time the learning data acquisition unit 51 acquires a new learning data set DS, the learning unit 52 converts the state of the unsupervised learning model in accordance with learning using the new learning data set DS. In other words, the clusters are further adjusted to optimize the model for unsupervised learning. The learning unit 52 outputs the generated trained unsupervised learning model to the outside of the machine learning device 45.
  • the filter set setting unit 43 shown in FIG. 3 sets a set of a specified number of filters F using the trained unsupervised learning model output from the machine learning device 45 (machine learning unit). For example, according to the hierarchical clustering model shown in FIG. 16 generated using the learning data set DS of FIG. 15, the filter set setting unit 43 selects the fourth filter, The third filter and the fifth filter are automatically set.
  • FIG. 17 is a flowchart showing the execution procedure of the machine learning method.
  • the image receiving unit 36 receives an adjusted image of the object W.
  • the adjusted image may be a model image of an object W whose position and/or orientation are known, or may be an image of an object W whose position and/or orientation are unknown.
  • step S31 the feature extraction device 34 (feature extraction unit) generates a plurality of filtered images by processing the received adjusted image with a plurality of different filters F.
  • step S32 the learning data acquisition unit 51 acquires data regarding a plurality of different filters F and data indicating a state S for each predetermined section of a plurality of filter-processed images as a learning data set DS.
  • the data regarding the plurality of filters F includes at least one of the types and sizes of the plurality of filters F.
  • the data indicating the state S of each predetermined section of the plurality of filtered images may be data indicating the dispersion of the values of neighboring sections of the predetermined section of the filtered image, or the data indicating the state S of each predetermined section of the plurality of filtered images may be data indicating the variation in the values of the surrounding sections of the predetermined section of the filtered image, or the plurality of filtered images may be subjected to threshold processing.
  • the data may also be data showing the reaction of each predetermined section after the reaction.
  • label data L indicating the degree of the predetermined section of the filtered image from a normal state to an abnormal state, or target information by feature matching. It further includes the result of detecting at least one of the position and orientation of the object W (that is, the reward R).
  • the learning unit 52 generates a learning model LM that outputs a synthesis parameter P for synthesizing a plurality of filtered images.
  • the learning model LM includes at least one of a learning model LM1 that outputs a synthesis ratio C for each corresponding section of a plurality of filtered images, and a learning model LM2 that outputs a set of a specified number of filters F. That is, the synthesis parameter P output by the learning model LM1 is a synthesis ratio C for each predetermined section, and the synthesis parameter P output by the learning model LM2 is a set of a specified number of filters F.
  • the learning unit 52 converts the state of the learning model LM in accordance with learning based on the new learning data set DS. In other words, the learning model LM is optimized. As post-processing in step S33, it may be determined whether the learning model LM has converged, and the learning unit 52 may output the generated learned learning model LM to the outside of the machine learning device 45.
  • the machine learning device 45 uses machine learning to generate the learning model LM that outputs synthesis parameters for synthesizing a plurality of filtered images and outputs it to the outside, so that, for example, when the object W is a character, etc. Even if the features include both fine features such as rounded corners and coarse features such as rounded corners, or if the imaging conditions such as the illuminance of the reference light and the exposure time change, the feature extraction device 34 uses the output learned learning information.
  • the feature extraction device 34 generates and outputs the optimal feature extraction image
  • the feature matching device 35 uses the output optimal feature extraction image to determine at least one of the position and orientation of the object W in a short time. It is possible to provide an improved feature matching technology that enables stable detection.
  • FIG. 18 is a schematic diagram showing a UI 90 for setting the synthesis parameter P.
  • the synthesis parameter P includes a set of a specified number of filters F, a synthesis ratio C for each predetermined section, and the like. Since the optimal set of filters F and the optimal synthesis ratio C for each predetermined section change depending on the characteristics of the object W and the imaging conditions, the synthesis parameter P can be automatically adjusted using machine learning. desirable. However, the user may manually adjust the synthesis parameter P using the UI 90.
  • the UI 90 for setting synthesis parameters is displayed on the display of the teaching device 4 shown in FIG. 1, for example.
  • the UI 90 includes a partition number designation section 91 that specifies the number of partitions in which a plurality of filtered images are combined according to a separate combination ratio C, and a set of the specified number of filters F (in this example, three first filters).
  • a filter set designation unit 92 that designates filters F1 to F3), a combination ratio designation unit 93 that designates a combination ratio C for each predetermined section, and a threshold designation unit 94 that designates a threshold for feature extraction. It is equipped with
  • the user uses the number of sections designation unit 91 to specify the number of sections in which a plurality of filtered images are to be combined according to a separate combination ratio C. For example, if one section is one pixel, the user only needs to specify the number of pixels of the filtered image in the section number designation section 91. In this example, the number of sections is manually set to nine, so the filtered image is divided into nine rectangular regions of equal area.
  • the user specifies the number of filters F, the type of filters F, the size of filters F, and the activation of filters F in the filter set specifying section 92.
  • the number of filters F is manually set to three, and the types and sizes of filters F are a Sobel filter near 36 (first filter F1) and a Sobel filter near 28 (second filter F2). , and a Laplacian filter (third filter F3) near 60, and these first filter F1 to third filter F3 are enabled.
  • the user specifies the combination ratio C of the plurality of filtered images for each section in the combination ratio designation section 93.
  • the synthesis ratio C of the first filter F1 to the third filter F3 is manually set for each section.
  • the threshold specification unit 94 the user can specify a threshold value for extracting features of the object W from a composite image obtained by combining a plurality of filtered images, or a threshold for extracting features of the object W from a plurality of filtered images.
  • the threshold value is manually set to 125 or more.
  • the UI 90 reflect the automatically set synthesis parameters, etc. on the UI 90. According to such a UI 90, it is possible to manually set synthesis parameters according to the situation, and it is also possible to visually confirm the state of the automatically set synthesis parameters.
  • the aforementioned program or software may be provided by being recorded on a computer-readable non-transitory storage medium, such as a CD-ROM, or may be provided via a WAN (wide area network) or LAN (local area network) via wire or wireless. It may also be distributed and provided from a server or cloud on a network.
  • a computer-readable non-transitory storage medium such as a CD-ROM
  • WAN wide area network
  • LAN local area network

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

機械学習装置45は、対象物Wを撮像した画像に対して適用される異なる複数のフィルタFに関するデータと、複数のフィルタFで処理した複数のフィルタ処理画像の所定の区画ごとの状態を示すデータとを、学習データセットDSとして取得する学習データ取得部51と、学習データセットDSを用いて、複数のフィルタ処理画像を対応する区画ごとに合成するための合成パラメータPを出力する学習モデルLMを生成する学習部52と、を備える。

Description

機械学習装置、特徴抽出装置、及び制御装置
 本発明は、画像処理技術に関し、特に機械学習装置、特徴抽出装置、及び制御装置に関する。
 位置及び姿勢が不明な対象物に対してロボット、工作機械等の機械が何かしら作業を行う場合、対象物を撮像した画像を利用して対象物の位置及び姿勢を検出することがある。例えば、位置及び姿勢が既知である対象物を撮像したモデル画像から対象物の特定の箇所を表すモデル特徴を抽出して対象物のモデル特徴を対象物の位置及び姿勢と共に登録しておく。次いで、位置及び姿勢が不明である対象物を撮像した画像から対象物の特定の箇所を表す特徴を同様に抽出し、事前に登録しておいたモデル特徴と照合することで対象物の特徴の位置及び姿勢の変化量を算出し、位置及び姿勢が未知である対象物の位置及び姿勢を検出する。
 特徴照合に利用する対象物の特徴としては、画像中の輝度変化(勾配)を捉えた対象物の輪郭(つまり対象物のエッジやコーナー)がよく利用されている。特徴照合に利用する対象物の特徴は、適用される画像フィルタ(空間フィルタリングともいう。)の種類及びサイズによって大きく変化する。フィルタの種類は、用途種別として、ノイズ除去フィルタ、輪郭抽出フィルタ等があり、また、アルゴリズム種別として、ノイズ除去フィルタは、平均値フィルタ、メディアンフィルタ、ガウシアンフィルタ、膨張/収縮フィルタ等を含み、輪郭抽出フィルタは、プレヴィットフィルタ、ソーベルフィルタ、ラプラシアンフィルタ等のエッジ検出フィルタ、及びハリスオペレータ等のコーナー検出フィルタを含む。
 このような画像フィルタでは、フィルタの種類やサイズ等を変更するだけで抽出される対象物の特徴の様子が変化する。例えばサイズの小さい輪郭抽出フィルタでは、対象物に印字された文字等のように比較的細かい輪郭を抽出する場合には有効であるが、鋳物の丸まった角等のように比較的粗い輪郭を抽出する場合は苦手である。丸まった角に対しては、サイズの大きい輪郭抽出フィルタが有効となる。そのため、検出対象や撮像条件によって適切なフィルタの種類やサイズ等を所定の区画ごとに指定する必要がある。本願に関連する背景技術としては後述のものがある。
 特許文献1には、ロボットのビジュアルサーボに関し、対象物を含む画像と目標画像から、複数の異なる画像の特徴量(重心、エッジ、及びピクセルに関する画像特徴量)のそれぞれについて距離(特徴量の差)を検出して重み付けし、重み付けした距離を全ての画像特徴量について総和してその結果を制御信号として生成し、制御信号に基づいて対象物の位置又は姿勢のうちの一方又は両方を変化させる動作を行うことが記載されている。
 特許文献2には、複数のサイズからなるエッジ検出フィルタを使用して画像からエッジ検出を行い、エッジではない領域を平坦部領域として抽出し、抽出した平坦部領域について、着目画素の値とエッジ検出フィルタのサイズに対応する画素範囲の周辺画素の値の平均値との相対比を算出して透過率マップを作成し、作成した透過率マップを使用して平坦部領域の画像を補正し、ゴミの影などを除去することが記載されている。
特開2015-145050号公報 特開2005-079856号公報
 特徴照合に利用する画像領域は必ずしも対象物の特徴の抽出に適した箇所とは限らないため、フィルタの種類やサイズ等に依存してフィルタの反応が弱い箇所が発生する。フィルタ処理後の閾値処理における閾値を低く設定することで、反応が弱い箇所から輪郭を抽出することも可能であるが、不要なノイズも抽出されてしまうため、特徴照合の時間が増大する。また、僅かな撮像条件の変化で対象物の特徴が抽出されなくなることがある。
 そこで、本発明は、従来の問題点に鑑み、対象物を撮像した画像から対象物の特徴を短時間に且つ安定して抽出可能な技術を提供することを目的とする。
 本開示の一態様は、対象物を撮像した画像に対して適用される異なる複数のフィルタに関するデータと、複数のフィルタで処理した複数のフィルタ処理画像の所定の区画ごとの状態を示すデータとを、学習データセットとして取得する学習データ取得部と、学習データセットを用いて、複数のフィルタ処理画像を対応する区画ごとに合成するための合成パラメータを出力する学習モデルを生成する学習部と、を備える、機械学習装置を提供する。
 本開示の他の態様は、対象物を撮像した画像から対象物の特徴を抽出する特徴抽出装置であって、対象物を撮像した画像に対して異なる複数のフィルタで処理して複数のフィルタ処理画像を生成する複数フィルタ処理部と、複数のフィルタ処理画像の対応する区画ごとの合成割合に基づいて複数のフィルタ処理画像を合成して対象物の特徴抽出画像を生成して出力する特徴抽出画像生成部と、を備える、特徴抽出装置を提供する。
 本開示の別の態様は、対象物を撮像した画像から検出した対象物の位置及び姿勢の少なくとも一方に基づいて機械の動作を制御する制御装置であって、対象物を撮像した画像に対して異なる複数のフィルタで処理して複数のフィルタ処理画像を生成し、複数のフィルタ処理画像の対応する区画ごとの合成割合に基づいて複数のフィルタ処理画像を合成し、対象物の特徴を抽出する特徴抽出部と、抽出された対象物の特徴と、位置及び姿勢の少なくとも一方が既知である対象物を撮像したモデル画像から抽出されたモデル特徴とを照合して、位置及び姿勢の少なくとも一方が未知である対象物の位置及び姿勢の少なくとも一方を検出する特徴照合部と、検出された対象物の位置及び姿勢の少なくとも一方に基づいて機械の動作を制御する制御部と、を備える、制御装置を提供する。
 本開示によれば、対象物を撮像した画像から対象物の特徴を短時間に且つ安定して抽出可能な技術を提供できる。
一実施形態の機械システムの構成図である。 一実施形態の機械システムのブロック図である。 一実施形態の特徴抽出装置のブロック図である。 モデル登録時の機械システムの実行手順を示すフローチャートである。 システム稼働時の機械システムの実行手順を示すフローチャートである。 一実施形態の機械学習装置のブロック図である。 フィルタの種類及びサイズの一例を示す模式図である。 ラベルデータの取得方法を示す模式図である。 合成割合の学習データセットの一例を示す散布図である。 決定木のモデルを示す模式図である。 ニューロンのモデルを示す模式図である。 ニューラルネットワークのモデルを示す模式図である。 強化学習の構成を示す模式図である。 複数のフィルタ処理画像の所定の区画ごとの反応を示す模式図である。 指定個数のフィルタのセットの学習データセットの一例を示す表である。 教師なし学習(階層化クラスタリング)のモデルを示す樹形図である。 機械学習方法の実行手順を示すフローチャートである。 合成パラメータを設定するユーザインタフェース(UI)の一例を示す模式図である。
 以下、図面を参照して本開示の実施形態を詳細に説明する。本開示の実施形態において同一の又は類似の要素には同一の又は類似の符号を付与する。本開示の実施形態は本発明の技術的範囲及び用語の意味を限定するものではなく、本発明の技術的範囲は請求の範囲に記載された発明とその均等物に及ぶ点に留意されたい。
 まず、一実施形態の機械システム1の構成について説明する。図1は一実施形態の機械システム1の構成図であり、図2は一実施形態の機械システム1のブロック図である。機械システム1は、対象物Wを撮像した画像から検出した対象物Wの位置及び姿勢の少なくとも一方に基づいて機械2の動作を制御する機械システムである。機械システム1はロボットシステムであるが、工作機械、建設機械、車両、航空機等の他の機械を備える機械システムとして構成されてもよい。
 機械システム1は、機械2と、機械2の動作を制御する制御装置3と、機械2に動作を教示する教示装置4と、視覚センサ5と、を備えている。機械2は、多関節ロボットで構成されるが、パラレルリンク型ロボット、ヒューマノイド等の他の形態のロボットで構成されてもよい。また、他の実施形態において、機械2は、工作機械、建設機械、車両、航空機等の他の形態の機械で構成されることもある。機械2は、相対運動可能な複数の機械要素で構成される機構部21と、機構部21に着脱して連結可能なエンドエフェクタ22と、を備えている。機械要素は、例えばベース、旋回胴、上腕、前腕、手首等のリンクで構成され、それぞれのリンクは所定の軸線J1~J6回りに回動する。
 機構部21は、機械要素を駆動する電動機、検出器、減速機等を含む電動式のアクチュエータ23で構成されるが、他の実施形態では、油圧式、空気圧式等のシリンダ、ポンプ、制御弁等を含む流体式のアクチュエータで構成されてもよい。エンドエフェクタ22は、対象物Wの取出し及び払出しを行うハンドであるが、他の実施形態において、溶接ツール、切断ツール、研磨ツール等のツールで構成されることもある。
 制御装置3は、有線を介して機械2に通信可能に接続される。制御装置3は、プロセッサ(PLC、CPU、GPU等)、メモリ(RAM、ROM等)、及び入出力インタフェース(A/D変換器、D/A変換器等)を含むコンピュータと、機械2のアクチュエータを駆動する駆動回路と、を備えている。他の実施形態において、制御装置3は駆動回路を備えず、機械2が駆動回路を備えることもある。
 教示装置4は、有線又は無線を介して制御装置3に通信可能に接続される。教示装置4は、プロセッサ(CPU、MPU等)、メモリ(RAM、ROM等)、及び入出力インタフェースを含むコンピュータ、表示ディスプレイ、非常停止スイッチ、及びイネーブルスイッチ等を備えている。教示装置4は、例えば制御装置3に直接的に組付けられた操作盤又は、有線又は無線で制御装置3に通信可能に接続されるティーチペンダント、タブレット、PC、サーバ等で構成される。
 教示装置4は、基準位置に固定される基準座標系C1、制御対象部位であるエンドエフェクタ22に固定されるツール座標系C2、対象物Wに固定されるワーク座標系C3等の種々の座標系を設定する。エンドエフェクタ22の位置及び姿勢は、基準座標系C1におけるツール座標系C2の位置及び姿勢として表される。また、教示装置4は、図示しないが、視覚センサ5に固定されるカメラ座標系をさらに設定し、カメラ座標系における対象物Wの位置及び姿勢を、基準座標系C1における対象物Wの位置及び姿勢に変換する。対象物Wの位置及び姿勢は、基準座標系C1におけるワーク座標系C3の位置及び姿勢として表される。
 教示装置4は、機械2を実際に動かして制御対象部位の位置及び姿勢を教示するプレイバック方式、ダイレクトティーチング方式等のオンラインティーチング機能、又はコンピュータで生成した仮想空間上で機械2の仮想モデルを動かして制御対象部位の位置及び姿勢を教示するオフラインティーチング機能を備えている。教示装置4は、教示された制御対象部位の位置及び姿勢や動作速度等を種々の動作指令に関連付けて機械2の動作プログラムを生成する。動作指令は、直線移動、円弧移動、各軸移動等の種々の指令を含む。制御装置3は、教示装置4から動作プログラムを受信し、動作プログラムに従って機械2の動作を制御する。また、教示装置4は、制御装置3から機械2の状態を受信し、機械2の状態を表示ディスプレイ等に表示する。
 視覚センサ5は、2次元画像を出力する2次元カメラ、3次元画像を出力する3次元カメラ等で構成される。視覚センサ5は、エンドエフェクタ22の近傍に取付けられるが、他の実施形態では、機械2とは異なる場所に固定されて設置されることもある。制御装置3は、視覚センサ5を用いて対象物Wを撮像した画像を取得し、対象物Wを撮像した画像から対象物Wの特徴を抽出し、抽出された対象物Wの特徴と、位置及び姿勢の少なくとも一方が既知である対象物Wを撮像したモデル画像から抽出された対象物Wのモデル特徴とを照合することで、対象物Wの位置及び姿勢の少なくとも一方を検出する。
 なお、本書における対象物Wの位置及び姿勢とは、対象物Wの位置及び姿勢をカメラ座標系から基準座標系C1に変換したものであるが、単にカメラ座標系における対象物Wの位置及び姿勢であってもよい。
 図2に示すように、制御装置3は、種々のデータを記憶する記憶部31と、動作プログラムに従って機械2の動作を制御する制御部32と、を備えている。記憶部31は、メモリ(RAM、ROM等)を備えている。制御部32は、プロセッサ(PLC、CPU等)と、アクチュエータ23を駆動する駆動回路と、を備えているが、駆動回路は機械2の内部に配置され、制御部32はプロセッサのみを備えることもある。
 記憶部31は、機械2の動作プログラムや種々の画像データ等を記憶する。制御部32は、教示装置4で生成された動作プログラムと、視覚センサ5を用いて検出された対象物Wの位置及び姿勢とに従って機械2のアクチュエータ23を駆動制御する。アクチュエータ23は、図示しないが、一以上の電動機及び一以上の動作検出部を備えている。制御部32は、動作プログラムの指令値と動作検出部の検出値に応じて電動機の位置、速度、加速度等を制御する。
 制御装置3は、視覚センサ5を用いて対象物Wの位置及び姿勢の少なくとも一方を検出する物体検出部33をさらに備えている。他の実施形態において、物体検出部33は、制御装置3の外部に配置されて制御装置3と通信可能な物体検出装置として構成されてもよい。
 物体検出部33は、対象物Wを撮像した画像から対象物Wの特徴を抽出する特徴抽出部34と、抽出された対象物Wの特徴と、位置及び姿勢の少なくとも一方が既知である対象物Wを撮像したモデル画像から抽出したモデル特徴とを照合して、位置及び姿勢の少なくとも一方が未知である対象物Wの位置及び姿勢の少なくとも一方を検出する特徴照合部35と、を備えている。
 他の実施形態において、特徴抽出部34は、制御装置3の外部に配置されて制御装置3と通信可能な特徴抽出装置として構成されてもよい。同様に、他の実施形態において、特徴照合部35は、制御装置3の外部に配置されて制御装置3と通信可能な特徴照合装置として構成されることもある。
 制御部32は、検出された対象物Wの位置及び姿勢の少なくとも一方に基づいて機械2の制御対象部位の位置及び姿勢の少なくとも一方を補正する。例えば制御部32は、機械2の動作プログラムで使用される制御対象部位の位置及び姿勢のデータを補正してもよいし、又は機械2の動作中に制御対象部位の位置及び姿勢の補正量から逆運動学に基づいて一以上の電動機の位置偏差、速度偏差、加速度偏差等を算出してビジュアルフィードバックを行ってもよい。
 以上のように機械システム1は、視覚センサ5を用いて対象物Wを撮像した画像から検対象物Wの位置及び姿勢の少なくとも一方を検出し、対象物Wの位置及び姿勢の少なくとも一方に基づいて機械2の動作を制御する。しかし、特徴照合部35において対象物Wの特徴とモデル特徴との照合に利用される画像領域は、必ずしも対象物Wの特徴の抽出に適した箇所とは限らない。特徴抽出部34で使用されるフィルタFの種類やサイズ等に起因してフィルタFの反応が弱い箇所が発生することがある。フィルタ処理後の閾値処理における閾値を低く設定することで、反応が弱い箇所から輪郭を抽出することも可能であるが、不要なノイズも抽出されてしまうため、特徴照合に要する時間が増大する。また、僅かな撮像条件の変化で対象物Wの特徴が抽出されなくなることがある。
 そこで、特徴抽出部34は、対象物Wを撮像した画像を異なる複数のフィルタFで処理し、複数のフィルタ処理画像の対応する区画ごとの合成割合Cに基づいて複数のフィルタ処理画像を合成し、特徴抽出画像を生成して出力する。特徴抽出部34は、高速化を図るため、複数のフィルタ処理を並列処理で実行することが望ましい。
 ここで、「異なる複数のフィルタF」とは、フィルタFの種類及びサイズの少なくとも一方を変化させたフィルタFのセットを意味する。例えば異なる複数のフィルタFは、8近傍のプレヴィットフィルタ(第1フィルタ)、24近傍のプレヴィットフィルタ(第2フィルタ)、及び48近傍のプレヴィットフィルタ(第3フィルタ)という異なるサイズの3個のフィルタFで構成される。
 或いは、異なる複数のフィルタFは、アルゴリズムが異なる複数のフィルタFを組み合わせたフィルタFのセットでもよい。例えば異なる複数のフィルタFは、8近傍のソーベルフィルタ(第1フィルタ)、24近傍のソーベルフィルタ(第2フィルタ)、8近傍のラプラシアンフィルタ(第3フィルタ)、及び24近傍のラプラシアンフィルタ(第4フィルタ)という異なるアルゴリズム及び異なるサイズの4個のフィルタFのセットで構成される。
 さらに、異なる複数のフィルタFは、用途が異なるフィルタFを直列的に及び/又は並列的に組み合わせたフィルタFのセットでもよい。例えば異なる複数のフィルタFは、8近傍のノイズ除去フィルタ(第1フィルタ)、48近傍のノイズ除去フィルタ(第2フィルタ)、8近傍の輪郭抽出フィルタ(第3フィルタ)、及び48近傍の輪郭抽出フィルタ(第4フィルタ)という異なる用途及び異なるサイズの4個のフィルタFのセットで構成される。或いは、異なる複数のフィルタFは、8近傍のノイズ除去フィルタ+24近傍の輪郭抽出フィルタ(第1フィルタ)、及び48近傍のノイズ除去フィルタ+80近傍の輪郭抽出フィルタ(第2フィルタ)という異なる用途の複数のフィルタFを直列的に組み合わせた異なるサイズの2個のフィルタFのセットで構成されてもよい。同様に、異なる複数のフィルタFは、8近傍のエッジ検出フィルタ+8近傍のコーナー検出フィルタ(第1フィルタ)と、24近傍のエッジ検出フィルタ+24近傍のコーナー検出フィルタ(第2フィルタ)と、といった異なる用途の複数のフィルタFを直列的に組み合わせた異なるサイズの2個のフィルタFのセットで構成されてもよい。
 また、「区画」とは、一般に1画素に相当するが、8近傍の画素群、12近傍の画素群、24近傍の画素群、48近傍の画素群、80近傍の画素群といった近傍画素群で構成された区画でもよい。或いは、「区画」は、種々の画像セグメンテーション手法によって分割された画像のそれぞれの区画でもよい。画像セグメンテーション手法の一例としては、深層学習やk平均法等を挙げることができる。k平均法を用いる場合、RGB空間に基づいて画像セグメンテーションを行うのではなく、フィルタFの出力結果に基づいて画像セグメンテーションを行ってもよい。所定の区画ごとの合成割合Cや異なる複数のフィルタFのセットは手動で又は自動で設定される。
 このような異なる複数のフィルタFを利用することで、文字等の細かい特徴と丸まった角等の粗い特徴といった様子の異なる特徴も安定して抽出できるようになる。また、対象物Wの位置及び姿勢の少なくとも一方を検出する機械システム1のようなアプリケーションでは、未検出や誤検出によるシステム遅延、システム停止等を低減できる。
 さらに、所定の区画ごとに合成割合Cを設定することで、文字等の細かい特徴と丸まった角等の粗い特徴といった様子の異なる特徴が一つの画像の中に混在する場合であっても、所望の特徴を的確に抽出できる。
 教示装置4は、位置及び姿勢の少なくとも一方が既知である対象物Wを撮像したモデル画像を対象物Wの位置及び姿勢に関連付けて受付ける画像受付部36を備えている。画像受付部36は、対象物Wのモデル画像を対象物Wの位置及び姿勢に関連付けて受付けるUIを表示ディスプレイに表示する。特徴抽出部34は、受付けたモデル画像から対象物Wのモデル特徴を抽出して出力し、記憶部31は、出力された対象物Wのモデル特徴を対象物Wの位置及び姿勢に関連付けて記憶する。これにより、特徴照合部35で利用されるモデル特徴が事前に登録される。
 また、画像受付部36は、受付けたモデル画像に対して、明るさ、拡大又は縮小、剪断、平行移動、回転等のうちの一以上の変化を加えて、変化を加えた一以上のモデル画像を受付けてもよい。特徴抽出部34は、変化を加えた一以上のモデル画像から対象物Wの一以上のモデル特徴を抽出して出力し、記憶部31は、出力された対象物Wの一以上のモデル特徴を対象物Wの位置及び姿勢に関連付けて記憶する。モデル画像に対して一以上の変化を加えることにより、特徴照合部35は、位置及び姿勢の少なくとも一方が未知である対象物Wを撮像した画像から抽出された特徴を、一以上のモデル特徴と照合できるため、対象物Wの位置及び姿勢の少なくとも一方を安定して検出できるようになる。
 さらに、画像受付部36は、複数のフィルタ処理画像の対応する区画ごとの合成割合Cや指定複数のフィルタFのセットを自動で調整するための調整画像を受付けてもよい。調整画像は、位置及び姿勢の少なくとも一方が既知である対象物Wを撮像したモデル画像でもよいし、又は位置及び姿勢の少なくとも一方が未知である対象物Wを撮像した画像でもよい。特徴抽出部34は、受付けた調整画像を異なる複数のフィルタFで処理した複数のフィルタ処理画像を生成し、複数のフィルタ処理画像の所定の区画ごとの状態Sに基づいて所定の区画ごとの合成割合C及び指定個数のフィルタFのセットの少なくとも一方を手動で又は自動で設定する。
 複数のフィルタ処理画像の所定の区画ごとの状態Sは、対象物Wの特徴(文字等の細かい特徴、丸まった角等の粗い特徴、対象物Wの色や材質に起因した強反射等)や、撮像条件(参照光の照度、露光時間等)に応じて変化するため、後述の機械学習を用いて所定の区画ごとの合成割合Cや異なる複数のフィルタFのセットを自動的に調整することが望ましい。
 図3は一実施形態の特徴抽出装置34(特徴抽出部)のブロック図である。特徴抽出装置34は、プロセッサ(CPU、GPU等)、メモリ(RAM、ROM等)、及び入出力インタフェース(A/D変換器、D/A変換器等)を含むコンピュータを備えている。プロセッサは、メモリに記憶された特徴抽出プログラムを読み出して実行し、入出力インタフェースを介して入力された画像を異なる複数のフィルタFで処理して複数のフィルタ処理画像を生成し、複数のフィルタ処理画像の対応する区画ごとの合成割合Cに基づいて複数のフィルタ処理画像を合成し、対象物Wの特徴抽出画像を生成する。プロセッサは、入出力インタフェースを介して特徴抽出画像を特徴抽出装置34の外部へ出力する。
 特徴抽出装置34は、対象物Wを撮像した画像に対して異なる複数のフィルタFで処理して複数のフィルタ処理画像を生成する複数フィルタ処理部41と、複数のフィルタ処理画像の対応する区画ごとの合成割合Cに基づいて複数のフィルタ処理画像を合成し、対象物Wの特徴抽出画像を生成して出力する特徴抽出画像生成部42と、を備えている。
 特徴抽出画像生成部42は、複数のフィルタ処理画像を合成する画像合成部42aと、複数のフィルタ処理画像又は合成画像を閾値処理する閾値処理部42bと、を備えている。他の実施形態において、特徴抽出画像生成部42は、画像合成部42a、閾値処理部42bの順に処理を実行するのではなく、閾値処理部42b、画像合成部42aの順に処理を実行してもよい。つまり画像合成部42aは、閾値処理部42bの前段に配置されるのではなく、閾値処理部42bの後段に配置されることもある。
 また、特徴抽出部34は、異なる指定個数のフィルタFのセットを設定するフィルタセット設定部43と、複数のフィルタ処理画像の対応する区画ごとの合成割合Cを設定する合成割合設定部44と、をさらに備えている。フィルタセット設定部43は、異なる指定個数のフィルタFのセットを手動で又は自動で設定する機能を提供する。合成割合設定部44は、複数のフィルタ処理画像の対応する区画ごとの合成割合Cを手動で又は自動で設定する機能を提供する。
 以下、機械システム1におけるモデル登録時とシステム稼働時の実行手順について説明する。モデル登録時とは、対象物Wの位置及び姿勢を検出するための特徴照合で利用されるモデル特徴を事前に登録する場面を意味し、システム稼働時とは、機械2が実際に稼働して対象物Wに対して所定の作業を行う場面を意味する。
 図4はモデル登録時の機械システム1の実行手順を示すフローチャートである。まず、ステップS10では、画像受付部36が、位置及び姿勢の少なくとも一方が既知である対象物Wのモデル画像を、対象物Wの位置及び姿勢の少なくとも一方に関連付けて受付ける。
 ステップS11では、複数フィルタ処理部41が対象物Wのモデル画像を異なる複数のフィルタFで処理した複数のフィルタ処理画像を生成する。なお、ステップS11の前処理として、フィルタセット設定部43が異なる指定個数のフィルタFのセットを手動で設定してもよい。或いは、ステップS11の後処理として、フィルタセット設定部43が複数のフィルタ処理画像の所定の区画ごとの状態Sに基づいて異なる指定個数のフィルタFの最適なセットを自動で設定した後、再びステップS11に戻って複数のフィルタ処理画像を生成する処理を繰り返し、指定個数のフィルタFの最適なセットが収束した後、ステップS12に進んでもよい。
 ステップS12では、合成割合設定部44が複数のフィルタ処理画像の所定の区画ごとの状態Sに基づいて複数のフィルタ処理画像の対応する区画ごとの合成割合Cを手動で設定する。或いは、合成割合設定部44は、複数のフィルタ処理画像の所定の区画ごとの状態Sに基づいて複数のフィルタ処理画像の対応する区画ごとの合成割合Cを自動で設定してもよい。
 ステップS13では、特徴抽出画像生成部42が、設定された合成割合Cに基づいて複数のフィルタ処理画像を合成し、モデル特徴抽出画像(目標画像)を生成して出力する。ステップS14では、記憶部31がモデル特徴抽出画像を対象物Wの位置及び姿勢の少なくとも一方に関連付けて記憶することで、対象物Wのモデル特徴が事前に登録される。
 なお、モデル登録後において、画像受付部36が対象物Wを撮像した調整画像をさらに受付け、フィルタセット設定部43が、受付けた調整画像に基づいて指定個数のフィルタFのセットを手動で又は自動で再設定してもよいし、また、合成割合設定部44が、受付けた調整画像に基づいて所定の区画ごとの合成割合Cを手動で又は自動で再設定してもよい。調整画像による調整を繰り返すことにより、特徴抽出装置34は対象物Wの特徴を短時間に且つ安定して抽出できるといった特徴抽出技術の改善を提供できる。
 図5はシステム稼働時の機械システム1の実行手順を示すフローチャートである。まず、ステップS20では、特徴抽出装置34が視覚センサ5から位置及び姿勢の少なくとも一方が未知である対象物Wを撮像した実画像を受付ける。
 ステップS21では、複数フィルタ処理部41が対象物Wの実画像を異なる複数のフィルタFで処理した複数のフィルタ処理画像を生成する。なお、ステップS21の後処理として、フィルタセット設定部43が複数のフィルタ処理画像の所定の区画ごとの状態Sに基づいて異なる指定個数のフィルタFの最適なセットを自動で再設定した後、再びステップS11に戻って複数のフィルタ処理画像を生成する処理を繰り返し、指定個数のフィルタFの最適なセットが収束した後、ステップS22に進んでもよい。
 ステップS22では、合成割合設定部44が複数のフィルタ処理画像の所定の区画ごとの状態Sに基づいて複数のフィルタ処理画像の対応する区画ごとの合成割合Cを自動で再設定する。或いは、ステップS22の処理を行わず、ステップS23に進み、システム稼働前に事前に設定された所定の区画ごとの合成割合Cを用いてもよい。
 ステップS23では、特徴抽出画像生成部42が、設定された合成割合Cに基づいて複数のフィルタ処理画像を合成し、特徴抽出画像を生成して出力する。ステップS24では、特徴照合部35が、生成された特徴抽出画像と、事前に登録しておいたモデル特徴抽出画像(目標画像)とを照合し、位置及び姿勢の少なくとも一方が未知である対象物Wの位置及び姿勢の少なくとも一方を検出する。ステップS25では、制御部32が対象物Wの位置及び姿勢の少なくとも一方に基づいて機械2の動作を補正する。
 なお、システム稼働後において、対象物Wの位置及び姿勢の検出やシステム全体のサイクルタイムに時間がかかっている場合は、画像受付部36が対象物Wを撮像した調整画像をさらに受付け、フィルタセット設定部43が、受付けた調整画像に基づいて指定個数のフィルタFのセットを手動で又は自動で再設定してもよいし、また、合成割合設定部44が、受付けた調整画像に基づいて所定の区画ごとの合成割合Cを手動で又は自動で再設定してもよい。調整画像による調整を繰り返すことにより、特徴抽出装置34は対象物Wの特徴を短時間に且つ安定して抽出できるといった特徴抽出技術の改善を提供できる。
 以下、所定の区画ごとの合成割合Cや指定個数のフィルタFのセットを自動で調整する方法について詳細に説明する。所定の区画ごとの合成割合Cや指定個数のフィルタFのセットは、機械学習を用いて自動で調整される。
 図3を再び参照すると、特徴抽出装置34は、複数のフィルタ処理画像の所定の区画ごとの状態Sを学習する機械学習部45をさらに備えている。他の実施形態において、機械学習部45は、特徴抽出装置34(特徴抽出部)又は制御装置3の外部に配置されて特徴抽出装置34又は制御装置3と通信可能な機械学習装置として構成されてもよい。
 図6は一実施形態の機械学習装置45(機械学習部)のブロック図である。機械学習装置45は、プロセッサ(CPU、GPU等)、メモリ(RAM、ROM等)、及び入出力インタフェース(A/D変換器、D/A変換器等)を含むコンピュータを備えている。プロセッサは、メモリに記憶された機械学習プログラムを読み出して実行し、入出力インタフェースを介して入力された入力データに基づいて、複数のフィルタ処理画像を対応する区画ごとに合成するための合成パラメータPを出力する学習モデルLMを生成する。
 また、プロセッサは、入出力インタフェースを介して新たな入力データを入力する度に、新たな入力データに基づいた学習に応じて学習モデルLMの状態を変換する。つまり学習モデルLMを最適化する。プロセッサは、入出力インタフェースを介して学習済の学習モデルLMを機械学習装置45の外部へ出力する。
 機械学習装置45は、異なる複数のフィルタFに関するデータと、複数のフィルタ処理画像の所定の区画ごとの状態Sを示すデータとを、学習データセットDSとして取得する学習データ取得部51と、学習データセットDSを用いて、複数のフィルタ処理画像を合成するための合成パラメータPを出力する学習モデルLMを生成する学習部52と、を備えている。
 学習データ取得部51が新たな学習データセットDSを取得する度に、学習部52は、新たな学習データセットDSを基づいた学習に応じて学習モデルLMの状態を変換する。つまり学習モデルLMを最適化する。学習部52は、生成した学習済の学習モデルLMを機械学習装置45の外部へ出力する。
 学習モデルLMは、複数のフィルタ処理画像の対応する区画ごとの合成割合Cを出力する学習モデルLM1と、指定個数のフィルタFのセットを出力する学習モデルLM2とのうちの少なくとも一方を含む。つまり学習モデルLM1が出力する合成パラメータPは、所定の区画ごとの合成割合Cであり、学習モデルLM2が出力する合成パラメータPは、指定個数のフィルタFのセットである。
 <合成割合Cの学習モデルLM1>
 以下、複数のフィルタ処理画像の対応する区画ごとの合成割合Cの予測モデル(学習モデルLM1)について説明する。合成割合Cの予測は、合成割合という連続値の予測問題(すなわち回帰問題)であるため、合成割合を出力する学習モデルLM1の学習方法としては、教師あり学習、強化学習、深層強化学習等を用いることができる。また、学習モデルLM1としては、決定木、ニューロン、ニューラルネットワーク等のモデルを利用できる。
 まず、図6~図12を参照して、教師あり学習による合成割合Cの学習モデルLM1の生成について説明する。学習データ取得部51は、異なる複数のフィルタFに関するデータを学習データセットDSとして取得するが、複数のフィルタFに関するデータとしては、複数のフィルタFの種類及びサイズの少なくとも一方を含む。
 図7はフィルタFの種類及びサイズの一例を示す模式図である。フィルタFの種類は、ノイズ除去フィルタ(平均値フィルタ、メディアンフィルタ、ガウシアンフィルタ、膨張/収縮フィルタ等)、輪郭抽出フィルタ(プレヴィットフィルタ、ソーベルフィルタ、ラプラシアンフィルタ等のエッジ検出フィルタ、及びハリスオペレータ等のコーナー検出フィルタ)等の種々の種類を含む。一方、フィルタFのサイズは、4近傍、8近傍、12近傍、24近傍、28近傍、36近傍、48近傍、60近傍、80近傍等の種々のサイズを含む。フィルタFは、8近傍、24近傍、48近傍、80近傍等のように正方形でもよいし、4近傍のように十字形でもよいし、12近傍のように菱形でもよいし、28近傍、36近傍、60近傍等のように円形でもよい。つまりフィルタFのサイズを設定すると、フィルタFの形状を設定したことになる。
 フィルタFの1区画は、一般に画像の1画素に対応するが、隣接する4画素、隣接する9画素、隣接する16画素といった隣接画素群で構成された区画に対応してもよい。或いは、フィルタFの1区画は、種々の画像セグメンテーション手法によって分割された画像のそれぞれの区画に対応してもよい。画像セグメンテーション手法の一例としては、深層学習やk平均法等を挙げることができる。k平均法を用いる場合、RGB空間に基づいて画像セグメンテーションを行うのではなく、フィルタFの出力結果に基づいて画像セグメンテーションを行ってもよい。フィルタFの各区画は、フィルタFの種類に応じた係数又は重みを含む。一般に或る画像を或るフィルタFで処理すると、フィルタFの中心区画に対応する画像の区画の値が、フィルタFの中心区画の周辺になる周辺区画の係数又は重みと、フィルタFの周辺区画に対応する画像の周辺区画の値とに基づいて算出された値に置き換えられる。
 従って、対象物Wを撮像した画像を種類及びサイズの少なくとも一方を変化させた異なる複数のフィルタFで処理すると、異なる複数のフィルタ処理画像が生成される。つまりフィルタFの種類及びサイズの少なくとも一方を変化させるだけで、対象物Wの特徴が抽出され易い区画と、抽出され難い区画とが発生する。
 そこで、複数のフィルタFに関するデータは、複数のフィルタFの種類及びサイズの少なくとも一方を含む。本例では、複数のフィルタFに関するデータとして、4近傍のソーベルフィルタ(第1フィルタ)、8近傍のソーベルフィルタ(第2フィルタ)、12近傍のソーベルフィルタ(第3フィルタ)、24近傍のソーベルフィルタ(第4フィルタ)、28近傍のソーベルフィルタ(第5フィルタ)、36近傍のソーベルフィルタ(第6フィルタ)、48近傍のソーベルフィルタ(第7フィルタ)、60近傍のソーベルフィルタ(第8フィルタ)、及び80近傍のソーベルフィルタ(第9フィルタ)という1種類のフィルタと複数種類のサイズとを含んでいる。
 さらに、学習データ取得部51は、複数のフィルタ処理画像の所定の区画ごとの状態Sを示すデータを学習データセットDSとして取得するが、複数のフィルタ処理画像の所定の区画ごとの状態Sを示すデータとしては、フィルタ処理画像の所定の区画の周辺区画の値のバラツキを含む。「周辺区画の値のバラツキ」とは、例えば8近傍の画素群、12近傍の画素群、24近傍の画素群といった周辺画素群の値の分散値、又は標準偏差値を含む。
 例えば照合に利用したい対象物Wの特徴(例えばエッジやコーナー等)の周辺では、その特徴を境界として周辺区画の値のバラツキが変化することが想定されるため、周辺区画の値のバラツキは複数のフィルタ処理画像の対応する区画ごとの合成割合Cと相関性を有すると考えられる。そこで、複数のフィルタ処理画像の所定の区画ごとの状態Sを示すデータとして、所定の区画ごとの周辺区画の値のバラツキを含むことが望ましい。
 また、複数のフィルタ処理画像を閾値処理した後の所定の区画の反応が強い程、対象物Wの特徴が良好に抽出されている可能性が高いため、複数のフィルタ処理画像の所定の区画ごとの状態Sを示すデータとして、複数のフィルタ処理画像を閾値処理した後の所定の区画ごとの反応を含んでいてもよい。「所定の区画ごとの反応」とは、例えば8近傍の画素群、12近傍の画素群、24近傍の画素群といった所定の画素群における閾値以上の画素数である。
 また、教師あり学習、強化学習等を用いて合成割合Cの予測モデルを学習する場合、複数のフィルタ処理画像の所定の区画ごとの状態Sを示すデータとしては、フィルタ処理画像の所定の区画の正常状態から異常状態までの度合いを示すラベルデータLをさらに含む。ラベルデータLは、フィルタ処理画像の所定の区画の値がモデル特徴抽出画像(目標画像)の対応する区画の値に近づく程、ラベルデータLが1(正常状態)に近づき、フィルタ処理画像の所定の区画の値がモデル特徴抽出画像(目標画像)の対応する区画の値から遠ざかる程、ラベルデータLが0(異常状態)に近づくように正規化される。フィルタ画像の合成は、目標画像に近いフィルタ画像の合成割合を大きくすることで合成画像が目標画像に近づけることができる。例えば、このように設定したラベルデータLを推定する予測モデルを学習し、予測モデルの予測したラベルに従って合成割合を決定することで、目標画像に近い合成画像を得ることができる。
 図8はラベルデータLの取得方法を示す模式図である。図8の上段はモデル登録時の実行手順を示し、図8の下段はラベルデータ取得時の実行手順を示す。図8の上段に示すように、まず、画像受付部36が、位置及び姿勢の少なくとも一方が既知である対象物Wを含むモデル画像61を受付ける。この際、画像受付部36は、受付けたモデル画像61に対して一以上の変化(明るさ、拡大又は縮小、剪断、平行移動、回転等)を加え、変化を加えた一以上のモデル画像62を受付けてもよい。受付けたモデル画像61に対して加える一以上の変化は、特徴照合の際に利用される一以上の変化を利用してもよい。
 次いで、特徴抽出装置34(特徴抽出部)が、図4を参照して説明したモデル登録時の処理として、手動で設定された複数のフィルタFのセットに従ってモデル画像62をフィルタ処理して複数のフィルタ処理画像を生成し、手動で設定された合成割合Cに従って複数のフィルタ処理画像を合成することで、一以上のモデル画像62から対象物Wの一以上のモデル特徴63を抽出し、対象物Wのモデル特徴63を含む一以上のモデル特徴抽出画像64を生成して出力する。記憶部31は、出力された一以上のモデル特徴抽出画像64(目標画像)を記憶することで、モデル特徴抽出画像64を登録しておく。このとき、複数のフィルタFのセットや合成割合の手動設定に関して、ユーザの試行錯誤や工数が増加する場合は、ユーザがモデル画像62からモデル特徴63(エッジやコーナー)を手動で指定することでモデル特徴抽出画像64を手動で生成してもよい。
 続いて、図8の下段に示すように、学習データ取得部51が、対象物Wを撮像した画像を異なる複数のフィルタFで処理した複数のフィルタ処理画像71のそれぞれと、記憶されたモデル特徴抽出画像64(目標画像)とを差分することで、複数のフィルタ処理画像の所定の区画ごとの正常状態から異常状態までの度合いを示すラベルデータLを取得する。なお、モデル登録時に手動設定されたフィルタFのセットや合成割合は、あくまでモデル画像62からモデル特徴63が抽出されるように試行錯誤して手動で設定されるものであり、これをそのままシステム稼働時の対象物Wの画像に適用しても、対象物Wの状態の変化や撮像条件の変化に応じて対象物Wの特徴が適切に抽出されないことがあるため、合成割合Cや複数のフィルタFのセットの機械学習は必要であることに留意されたい。
 この際、学習データ取得部51は、差分後の所定の区画の値が0に近づく程(つまり目標画像の対応する区画の値に近い程)、ラベルデータLが1(正常状態)に近づき、差分後の所定の区画の値が0から遠ざかる程(つまり目標画像の対応する区画の値から遠ざかる程)、ラベルデータLが0(異常状態)に近づくように、ラベルデータLを正規化する。
 また、複数のモデル特徴抽出画像64が記憶部31に記憶されている場合、学習データ取得部51は、1個のフィルタ処理画像71と、複数のモデル特徴抽出画像64のそれぞれとを差分して、正常状態に近いラベルデータLが最も多い差分画像を正規化したものを最終的なラベルデータLとして採用する。
 以上により、学習データ取得部51は、異なる複数のフィルタFに関するデータと、複数のフィルタ処理画像の所定の区画ごとの状態Sを示すデータとを、学習データセットDSとして取得する。
 図9は合成割合Cの学習データセットDSの一例を示す散布図である。散布図の横軸はフィルタFの種類及びサイズ(説明変数x1)を示し、縦軸はフィルタ処理画像の所定の区画の周辺区画の値のバラツキ(説明変数x2)を示している。本例では、説明変数x1は、4近傍のソーベルフィルタ(第1フィルタ)から80近傍のソーベルフィルタ(第9フィルタ)までを含む。また、説明変数x2は、第1フィルタ~第9フィルタでそれぞれ処理した複数のフィルタ処理画像の所定の区画の周辺区画の値のバラツキを含む(〇で示す)。さらに、ラベルデータL(〇の右肩に示す数値)は、所定の区画の正常状態「1」から異常状態「0」までの度合いを示す。
 学習部52は、図9に示すような学習データセットDSを用いて、複数のフィルタ処理画像の対応する区画ごとの合成割合Cを出力する学習モデルLM1を生成する。
 まず、図9及び図10を参照して、合成割合を出力する学習モデルLM1として決定木のモデルを生成する場合について説明する。図10は決定木のモデルを示す模式図である。前述の通り、合成割合Cの予測は合成割合Cという連続値の予測問題(つまり回帰問題)であるため、決定木はいわゆる回帰木である。
 学習部52は、フィルタFの種類及びサイズである説明変数x1と、周辺区画の値のバラツキである説明変数x2とから、合成割合である目的変数y(図10の例ではy1~y5)を出力する回帰木のモデルを生成する。学習部52は、ジニ不純度、エントロピー等を用いて、情報利得が最大になるようにデータを分割していき(つまりデータが最も綺麗に分類されるように分割していき)、回帰木のモデルを生成する。
 例えば図9に示す学習データセットDSの例では、ソーベルフィルタのサイズが28近傍を超えたときに(太い実線が分岐線を示す)、正常状態「1」に近づくラベルデータLが増大するため(概ね0.5以上)、学習部52は、決定木の第1分岐における説明変数x1(フィルタFの種類及びサイズ)の閾値t1に「28近傍」を自動的に設定する。
 次いで、ソーベルフィルタのサイズが60近傍を超えたときに(太い実線が分岐線を示す)、異常状態「0」に近づくラベルデータLが増大するため(概ね0.3以下)、学習部52は、決定木の第2分岐における説明変数x1(フィルタFの種類及びサイズ)の閾値t2に「60近傍」を自動的に設定する。
 続いて、周辺区画の値のバラツキが98を超えたときに(太い実線が分岐線を示す)、正常状態「1」に近づくラベルデータLが増大するため(概ね0.6以上)、学習部52は、決定木の第3分岐における説明変数x2(周辺区画の値のバラツキ)の閾値t3に「98」を自動的に設定する。
 最後に、周辺区画の値のバラツキが78を下回ったときに(太い実線が分岐線を示す)、異常状態「0」に近づくラベルデータLが増大するため(概ね0.1以下)、学習部52は、決定木の第4分岐における説明変数x2(周辺区画の値のバラツキ)の閾値t4に「78」を自動的に設定する。
 目的変数y1~y5(合成割合)は、閾値t1~t4によって分割された領域におけるラベルデータLと出現確率とに基づいて決定される。例えば図9に示す学習データセットDSの例では、目的変数y1が約0.89となり、目的変数y2が約0.02となり、目的変数y3が約0.02となり、目的変数y4が約0.05となり、目的変数y5が約0.02となる。なお、合成割合(目的変数y1~y5)は、学習データセットDSに応じて、特定のフィルタ処理画像の合成割合が1、それ以外のフィルタ処理画像の合成割合が0になることもある。
 以上のように、学習部52が学習データセットDSを学習することで図10に示すような決定木のモデルを生成する。また、学習データ取得部51が新たな学習データセットDSを取得する度に、学習部52は、新たな学習データセットDSを用いた学習に応じて決定木のモデルの状態を変換する。つまり閾値tをさらに調整して決定木のモデルを最適化する。学習部52は、生成した学習済の決定木のモデルを機械学習装置45の外部へ出力する。
 図3に示す合成割合設定部44は、機械学習装置45(機械学習部)から出力された学習済の決定木のモデルを用いて、複数のフィルタ処理画像の対応する区画ごとに合成割合Cを設定する。例えば図9の学習データセットDSで生成された図10に示す決定木のモデルによれば、サイズが28近傍を超えていて60近傍以下のソーベルフィルタ(t1<x1<t2)で処理したフィルタ処理画像の所定の区画の周辺区画の値のバラツキが98を超える場合(x2>t3)、当該区画における当該ソーベルフィルタの合成割合として0.89(y1)が出力されるため、合成割合設定部44は、当該区画における当該ソーベルフィルタの合成割合を0.89に自動で設定する。
 また、サイズが28近傍以下のソーベルフィルタ(x1≦t1)で処理したフィルタ処理画像の所定の区画の周辺区画の値のバラツキが78を超える場合(x2>t4)、当該区画における当該ソーベルフィルタの合成割合として0.05(y4)が出力されるため、合成割合設定部44は、当該区画における当該ソーベルフィルタの合成割合を0.05に自動で設定する。同様に、合成割合設定部44は、出力された学習済みの決定木のモデルを用いて合成割合を自動で設定していく。
 以上の決定木のモデルは、比較的単純なモデルであるが、工業用途では撮像条件や対象物Wの状態がある程度に制限されるため、システムに合わせた条件で学習することで、特徴抽出の処理が単純なものでも非常に高い性能が得られ、処理時間の大幅な短縮に繋がる。ひいては対象物Wの特徴を短時間に且つ安定して抽出できるといった特徴抽出技術の改善を提供できる。
 次に図11を参照して、合成割合を出力する学習モデルLM1としてニューロン(単純パーセプトロン)のモデルを用いる場合を説明する。図11はニューロンのモデルを示す模式図である。ニューロンは、複数の入力x(図11の例では入力x1~x3)に対し一つの出力yを出力する。個々の入力x1、x2、x3にはそれぞれに重みw(図11の例では重みw1、w2、w3)が乗算される。ニューロンのモデルは、ニューロンを模した演算回路や記憶回路によって構成できる。入力xと出力yとの関係は、次式で表すことができる。次式において、θはバイアスであり、fは活性化関数である。
 図9に示す学習データセットDSの例では、例えば入力x1、x2、x3はフィルタFの種類及びサイズの少なくとも一方に関する説明変数であり、出力yは合成割合に関する目的変数である。また、入力x4、x5、x6、・・・と、対応する重みw4、w5、w6、・・・と、を必要に応じて追加してもよい。例えば入力x4、x5、x6はフィルタ処理画像の周辺区画の値のバラツキやフィルタ処理画像の反応に関する説明変数である。
 さらに、複数のニューロンを並列化して1つの層を形成し、複数の入力x1、x2、x3、・・・にそれぞれの重みwを乗算してそれぞれのニューロンに入力することで、合成割合に関する複数の出力y1、y2、y3、・・・を得ることができる。
 学習部52は、学習データセットDSを用いて、サポートベクターマシン等の学習アルゴリズムにより重みwを調整して、ニューロンのモデルを生成する。また、学習部52は、新たな学習データセットDSを用いた学習に応じてニューロンのモデルの状態を変換する。つまり重みwをさらに調整してニューロンのモデルを最適化する。学習部52は、生成した学習済のニューロンのモデルを機械学習装置45の外部へ出力する。
 図3に示す合成割合設定部44は、機械学習装置45(機械学習部)から出力された学習済のニューロンのモデルを用いて、複数のフィルタ処理画像の対応する区画ごとに合成割合Cを自動で設定する。
 以上のニューロンのモデルは、比較的単純なモデルであるが、工業用途では撮像条件や対象物Wの状態がある程度に制限されるため、システムに合わせた条件で学習することで、特徴抽出の処理が単純なものでも非常に高い性能が得られ、処理時間の大幅な短縮に繋がる。ひいては対象物Wの特徴を短時間に且つ安定して抽出できるといった特徴抽出技術の改善を提供できる。
 次に図12を参照して、合成割合を出力する学習モデルLM1として複数のニューロンを多層に組み合わせたニューラルネットワークを用いる場合について説明する。図12はニューラルネットワークのモデルを示す模式図である。ニューラルネットワークは、入力層L1と、中間層L2、L3(隠れ層ともいう)と、出力層L4と、を備えている。図12のニューラルネットワークは、2つの中間層L2、L3を備えているが、さらに多くの中間層を追加してもよい。
 入力層L1の個々の入力x1、x2、x3・・・にそれぞれの重みw(総称して重みW1で表す)が乗算されて、それぞれのニューロンN11、N12、N13に入力される。ニューロンN11、N12、N13の個々の出力は、特徴量として中間層L2に入力される。中間層L2では、入力した個々の特徴量にそれぞれの重みw(総称して重みW2で表す)が乗算されて、それぞれのニューロンN21、N22、N23に入力される。
 ニューロンN21、N22、N23の個々の出力は、特徴量として中間層L3に入力される。中間層L3では、入力した個々の特徴量にそれぞれの重みw(総称して重みW3で表す)が乗算されて、それぞれのニューロンN31、N32、N33に入力される。ニューロンN31、N32、N33の個々の出力は、特徴量として出力層L4に入力される。
 出力層L4では、入力した個々の特徴量にそれぞれの重みw(総称して重みW4で表す)が乗算されて、それぞれのニューロンN41、N42、N43に入力される。ニューロンN41、N42、N43の個々の出力y1、y2、y3、・・・は、目的変数として出力される。ニューラルネットワークは、ニューロンを模した演算回路や記憶回路を組み合わせることによって構成できる。
 ニューラルネットワークのモデルは多層パーセプトロンで構成できる。例えば入力層L1はフィルタFの種類に関する説明変数である複数の入力x1、x2、x3、・・・にそれぞれの重みwを乗算して一以上の特徴量を出力し、中間層L2は入力した特徴量とフィルタFのサイズに関する説明変数である複数の入力にそれぞれの重みwを乗算して一以上の特徴量を出力し、中間層L3は入力した特徴量とフィルタ処理画像の所定の区画の周辺区画の値のバラツキやフィルタ処理画像を閾値処理した後の所定の区画の反応に関する説明変数である一以上の入力にそれぞれの重みwを乗算して一以上の特徴量を出力し、出力層L4は入力した特徴量とフィルタ処理画像の所定の区画の合成割合に関する目的変数である複数の出力y1、y2、y3、・・・を出力する。
 或いは、ニューラルネットワークのモデルは、畳み込みニューラルネットワーク(CNN)を利用したモデルでもよい。つまりニューラルネットワークは、フィルタ処理画像を入力する入力層、特徴を抽出する一以上の畳み込み層、情報を集約する一以上のプーリング層、全結合層、及び所定の区画ごとの合成割合を出力するソフトマックス層を備えていてもよい。
 学習部52は、学習データセットDSを用いて、バックプロパゲーション(誤差逆伝播法)等の学習アルゴリズムにより深層学習を行い、ニューラルネットワークの重みW1~W4を調整し、ニューラルネットワークのモデルを生成する。例えば学習部52は、ニューラルネットワークの個々の出力y1、y2、y3、・・・を、所定の区画の正常状態から異常状態までの度合いを示すラベルデータLと比較して誤差逆伝播を行うことが望ましい。また、過学習を防止するため、学習部52は、必要に応じて正則化(ドロップアウト)を行ってニューラルネットワークのモデルをシンプルにするとよい。
 また、学習部52は、新たな学習データセットDSを用いた学習に応じてニューラルネットワークのモデルの状態を変換する。つまり重みwをさらに調整してニューラルネットワークのモデルを最適化する。学習部52は、生成した学習済のニューラルネットワークのモデルを機械学習装置45の外部へ出力する。
 図3に示す合成割合設定部44は、機械学習装置45(機械学習部)から出力された学習済のニューラルネットワークのモデルを用いて、複数のフィルタ処理画像の対応する区画ごとに合成割合Cを自動で設定する。
 以上のニューラルネットワークのモデルは、所定の区画の合成割合に相関性を有する、より多くの説明変数(次元)を纏めて取扱うことができる。また、CNNを利用した場合は、フィルタ処理画像の状態Sから所定の区画の合成割合に相関性を有する特徴量を自動的に抽出するため、説明変数の設計が不要になる。
 決定木、ニューロン、及びニューラルネットワークのいずれのモデルの場合においても、学習部52は、複数のフィルタ処理画像を対応する区画ごとの合成割合Cに基づいて合成した合成画像から抽出された対象物Wの特徴が、位置及び姿勢の少なくとも一方が既知である対象物Wを撮像したモデル画像から抽出された対象物Wのモデル特徴に近づくように、所定の区画ごとの合成割合Cを出力する学習モデルLM1を生成する。
 次に図13を参照して、合成割合を出力する学習モデルLM1として強化学習のモデルを用いる場合について説明する。図13は強化学習の構成を示す模式図である。強化学習の構成は、エージェントと呼ばれる学習主体と、エージェントの制御対象となる環境と、で構成される。エージェントが何らかの行動Aを実行すると、環境における状態Sが変化し、その結果として報酬Rがエージェントに対してフィードバックされる。学習部52は即時の報酬Rではなく、将来にわたる報酬Rの合計を最大化するように試行錯誤しながら最適な行動Aを探索していく。
 図13に示す例では、エージェントが学習部52であり、環境が物体検出装置33(物体検出部)である。エージェントによる行動Aは、異なる複数のフィルタFで処理した複数のフィルタ処理画像の対応する区画ごとの合成割合Cの設定である。また、環境における状態Sは、設定された所定の区画ごとの合成割合で複数のフィルタ処理画像を合成して生成された特徴抽出画像の状態である。さらに、報酬Rは、或る状態Sにおける特徴抽出画像をモデル特徴抽出画像と照合することで対象物Wの位置及び姿勢の少なくとも一方を検出した結果として得られる得点である。例えば対象物Wの位置及び姿勢の少なくとも一方を検出できた場合は、報酬Rは100点であり、対象物Wの位置及び姿勢のいずれも検出できなかった場合は、報酬Rは0点である。或いは、例えば対象物Wの位置及び姿勢の少なくとも一方を検出するまでに掛かった時間に応じた得点を報酬Rとしてもよい。
 学習部52が或る行動A(所定の区画ごとの合成割合の設定)を実行すると、物体検出装置33における状態S(特徴抽出画像の状態)が変化し、学習データ取得部51は、変化した状態Sとその結果を報酬Rとして取得し、報酬Rを学習部52に対してフィードバックする。学習部52は、即時の報酬Rではなく、将来にわたる報酬Rの合計を最大化するように試行錯誤しながら最適な行動A(最適な所定の区画ごとの合成割合の設定)を探索していく。
 強化学習のアルゴリズムとしては、Q学習、サルサ、モンテカルロ法等がある。以下では、強化学習の一例としてQ学習について説明するが、これに限定されるものではない。Q学習は、或る環境の状態Sの下で、行動Aを選択する価値Q(S,A)を学習する方法である。つまり、或る状態Sのとき、価値Q(S,A)の最も高い行動Aを最適な行動Aとして選択する。しかし、最初は状態Sと行動Aとの組合せについて、価値Q(S,A)の正しい値は全く分かっていない。そこで、エージェントは、或る状態Sの下で様々な行動Aを選択し、その時の行動Aに対して報酬Rが与えられる。それにより、エージェントはより良い行動の選択、すなわち正しい価値Q(S,A)を学習していく。
 行動の結果、将来にわたって得られる報酬Rの合計を最大化したい。そこで、最終的に、Q(S,A)=E[Σγ](報酬の割引期待値。γ:割引率、R:報酬、t:時刻)となるようにすることを目指す(期待値は最適な行動に従って状態変化したときについてとる。もちろん、最適な行動は分かっていないので、探索しながら学習しなければならない)。そのような価値Q(S,A)の更新式は、例えば次式により表すことができる。
 ここで、Sは時刻tにおける環境の状態を表し、Aは時刻tにおける行動を表す。行動Aにより、状態はSt+1に変化する。Rt+1はその状態の変化により貰える報酬を表している。また、maxの付いた項は、状態St+1の下で、その時に分かっている最もQ値の高い行動Aを選択した場合のQ値に割引率γを乗じたものになる。割引率γは、0<γ≦1のパラメータである。αは学習係数で、0<α≦1の範囲とする。
 この式は、試行した行動Aの結果、帰ってきた報酬Rt+1を元に、状態Sにおける行動Aの評価値Q(S,A)を更新する方法を表している。状態Sにおける行動Aの評価値Q(S,A)よりも、報酬Rt+1+行動Aによる次の状態における最良の行動maxAの評価値Q(St+1,maxAt+1)の方が大きければ、Q(S,A)を大きくするし、反対に小さければ、Q(S,A)も小さくする事を示している。つまり、或る状態におけるある行動の価値を、結果として即時帰ってくる報酬と、その行動による次の状態における最良の行動の価値に近付けるようにしている。
 Q(S,A)の計算機上での表現方法は、全ての状態と行動のペア(S,A)に対して、その値を行動価値テーブルとして保持しておく方法と、Q(S,A)を近似するような関数を用意する方法がある。後者の方法では、前述の更新式は、確率勾配降下法等の手法で近似関数のパラメータを調整していくことで実現することができる。近似関数としては、前述のニューラルネットワークのモデルを用いることができる(いわゆる深層強化学習)。
 以上の強化学習により、学習部52は、複数のフィルタ処理画像の対応する区画ごとの合成割合Cを出力する強化学習のモデルを生成する。また、学習部52は、新たな学習データセットDSを用いた学習に応じて強化学習のモデルの状態を変換する。つまり将来にわたる報酬Rの合計を最大化する最適な行動Aをさらに調整して強化学習のモデルを最適化する。学習部52は、生成した学習済の強化学習のモデルを機械学習装置45の外部へ出力する。
 図3に示す合成割合設定部44は、機械学習装置45(機械学習部)から出力された学習済の強化学習のモデルを用いて、複数のフィルタ処理画像の対応する区画ごとに合成割合Cを自動で設定する。
 <指定個数のフィルタFのセットの学習モデルLM2>
 以下、指定個数のフィルタFのセットの分類モデル(学習モデルLM2)について説明する。指定個数のフィルタFのセットの分類は、指定個数を超えるフィルタFのセットを事前に用意しておき、その中から指定個数のフィルタFの最適なセットをグループ分類する問題であるため、教師なし学習が好適である。或いは、指定個数を超えるフィルタFのセットの中から最適な指定個数のフィルタFのセットを選択するように強化学習を行ってもよい。
 まず、図13を再び参照して、指定個数のフィルタFのセットを出力する学習モデルLM2として強化学習のモデルを用いる場合について説明する。図13に示す例では、エージェントが学習部52であり、環境が物体検出装置33(物体検出部)である。エージェントによる行動Aは、指定個数のフィルタFのセットの選択(つまりフィルタFの種類及びサイズの少なくとも一方を変化させた指定個数のフィルタFの選択)である。また、環境における状態Sは、選択された指定個数のフィルタFで処理した複数のフィルタ処理画像の対応する区画ごとの状態である。さらに、報酬Rは、或る状態Sにおける複数のフィルタ処理画像の所定の区画ごとの正常状態から異常状態までの度合いを示すラベルデータLに応じた得点である。
 学習部52が或る行動A(指定個数のフィルタFのセットの選択)を実行すると、物体検出装置33における状態S(複数のフィルタ処理画像の所定の区画ごとの状態)が変化し、学習データ取得部51は、変化した状態Sとその結果を報酬Rとして取得し、報酬Rを学習部52に対してフィードバックする。学習部52は、即時の報酬Rではなく、将来にわたる報酬Rの合計を最大化するように試行錯誤しながら最適な行動A(最適な指定個数のフィルタFのセットの選択)を探索していく。
 以上の強化学習により、学習部52は、指定個数のフィルタFのセットを出力する強化学習のモデルを生成する。また、学習部52は、新たな学習データセットDSを用いた学習に応じて強化学習のモデルの状態を変換する。つまり将来にわたる報酬Rの合計を最大化する最適な行動Aをさらに調整して強化学習のモデルを最適化する。学習部52は、生成した学習済の強化学習のモデルを機械学習装置45の外部へ出力する。
 図3に示すフィルタセット設定部43は、機械学習装置45(機械学習部)から出力された学習済の強化学習のモデルを用いて、指定個数のフィルタFのセットを自動で設定する。
 次に図14~図16を参照して、指定個数のフィルタFのセットを出力する学習モデルLM2として教師なし学習のモデルを用いる場合について説明する。教師なし学習のモデルとしては、クラスタリング(階層化クラスタリング、非階層クラスタリング等)のモデルを利用できる。学習データ取得部51は、異なる複数のフィルタFに関するデータと、複数のフィルタ処理画像の所定の区画ごとの状態Sを示すデータと、を学習データセットDSとして取得する。
 複数のフィルタFに関するデータは、指定個数を超える複数のフィルタFの種類及びサイズの少なくとも一方のデータを含む。また、複数のフィルタ処理画像の所定の区画ごとの状態Sを示すデータは、複数のフィルタ処理画像を閾値処理した後の所定の区画ごとの反応であるが、他の実施形態では、所定の区画ごとの周辺区画の値のバラツキでもよい。
 図14は複数のフィルタ処理画像の所定の区画ごとの反応を示す模式図である。図14には、指定個数を超える第1~第nフィルタF(nは整数)で処理した第1~第nフィルタ処理画像を閾値処理した後の所定の区画80ごとの反応81が示されている。また、所定の区画80ごとの反応81とは、例えば8近傍の画素群、24近傍の画素群、48近傍の画素群といった所定の画素群における閾値以上の画素数である。第1~第nフィルタ処理画像をそれぞれ閾値処理した後の所定の区画80ごとの反応81が強い程、対象物Wの特徴が良好に抽出されている可能性が高いため、学習部52は、第1~第nフィルタ処理画像の中で区画80ごとの反応が最大となるように、指定個数のフィルタFのセットを分類する学習モデルLM2を生成する。
 例えば指定個数が3個であり、指定個数を超える6個の第1フィルタ~第6フィルタ(n=6)で処理した第1フィルタ処理画像~第6フィルタ処理画像を生成した場合について考える。例えば第1フィルタはサイズ小のプレヴィットフィルタであり、第2フィルタはサイズ中のプレヴィットフィルタであり、第3フィルタはサイズ大のプレヴィットフィルタであり、第4フィルタはサイズ小のラプラシアンフィルタであり、第5フィルタはサイズ中のラプラシアンフィルタであり、第6フィルタはサイズ大のラプラシアンフィルタである。
 図15は指定個数のフィルタFのセットの学習データセットの一例を示す表である。図15には、第1フィルタ~第6フィルタでそれぞれ処理した第1フィルタ処理画像~第6フィルタ処理画像をそれぞれ閾値処理した後の第1区画~第9区画における反応(閾値以上の画素数)が示されている。また、各区画で最大の反応を示したデータは、太字下線で強調表示されている。
 教師なし学習では、まず、各区画の反応を示すデータに基づいて第1フィルタ~第6フィルタをグループ分類していく。まず、学習部52は、分類基準としてフィルタ同士のデータ間の距離Dを算出する。距離Dは例えば次式のユークリッド距離を用いることができる。なお、Fa、Fbは任意の2個のフィルタであり、Fai、Fbiは各フィルタのデータであり、iは区画番号であり、nは区画数である。
 図15に示す学習データセットDSの例では、第1フィルタと第2フィルタのデータ間の距離Dが約18になる。同様に、学習部52は、任意のフィルタ同士のデータ間の距離Dを総当たりで算出していく。次いで、学習部52は、データ間の距離Dが最も近いフィルタ同士をクラスターCL1に分類し、次に近いフィルタ同士をクラスターCL2に分類し、・・・と繰り返していく。クラスター同士を併合する際は、単連結法、群平均法、ウォード法、重心法、メディアン法等を用いることができる。
 図16は教師なし学習(階層化クラスタリング)のモデルを示す樹形図である。変数A1~A3は第1フィルタ~第3フィルタを示し、変数B1~B3は第4フィルタ~第6フィルタを示す。学習部52は、データ間の距離Dが最も近い変数A3とB3をクラスターCL1に分類し、次に近い変数A1とB1をクラスターCL2に分類し、・・・と繰り返して、階層化クラスタリングのモデルを生成していく。本例では、指定個数(つまりグループ数)が3個であるため、学習部52は、クラスターCL2(第1フィルタ、第4フィルタ)、クラスターCL3(第2フィルタ、第3フィルタ、第6フィルタ)、及び変数B2(第5フィルタ)の3個のクラスターまでグループ分類したら、グループ分類を終了してもよい。
 次いで、学習部52は、3個のクラスターのそれぞれの中から反応が最大となる区画の個数が多い3個のフィルタのセットを出力するように階層化クラスタリングのモデルを生成する。図15の例では、3個のクラスターのそれぞれの中から反応が最大となる区画の個数が多い、第4フィルタ、第3フィルタ、及び第5フィルタが出力される。
 なお、他の実施形態において、学習部52は、階層化クラスタリングのモデルではなく、非階層クラスタリングのモデルを生成してもよい。非階層クラスタリングとしては、k平均法、k-means++法等を用いることができる。
 以上の教師なし学習により、学習部52は、指定個数のフィルタFのセットを出力する教師なし学習のモデルを生成する。また、学習データ取得部51が新たな学習データセットDSを取得する度に、学習部52は、新たな学習データセットDSを用いた学習に応じて教師なし学習のモデルの状態を変換する。つまりクラスターをさらに調整して教師なし学習のモデルを最適化する。学習部52は、生成した学習済の教師なし学習のモデルを機械学習装置45の外部へ出力する。
 図3に示すフィルタセット設定部43は、機械学習装置45(機械学習部)から出力された学習済の教師なし学習のモデルを用いて、指定個数のフィルタFのセットを設定する。例えば図15の学習データセットDSで生成された図16に示す階層化クラスタリングのモデルによれば、フィルタセット設定部43は、指定個数が3個のフィルタFの最適なセットとして、第4フィルタ、第3フィルタ、及び第5フィルタを自動で設定する。
 以上の実施形態では、種々の機械学習を説明してきたが、以下では、機械学習方法の実行手順を総括して説明する。図17は機械学習方法の実行手順を示すフローチャートである。まず、ステップS30では、画像受付部36が対象物Wを撮像した調整画像を受付ける。調整画像は、位置及び姿勢の少なくとも一方が既知である対象物Wを撮像したモデル画像でもよいし、又は位置及び姿勢の少なくとも一方が未知である対象物Wを撮像した画像でもよい。
 ステップS31では、特徴抽出装置34(特徴抽出部)が、受付けた調整画像を異なる複数のフィルタFで処理した複数のフィルタ処理画像を生成する。ステップS32では、学習データ取得部51が、異なる複数のフィルタFに関するデータと、複数のフィルタ処理画像の所定の区画ごとの状態Sを示すデータとを、学習データセットDSとして取得する。
 複数のフィルタFに関するデータは、複数のフィルタFの種類及びサイズの少なくとも一方を含む。また、複数のフィルタ処理画像の所定の区画ごとの状態Sを示すデータは、フィルタ処理画像の所定の区画の周辺区画の値のバラツキを示すデータでもよいし、又は複数のフィルタ処理画像を閾値処理した後の所定の区画ごとの反応を示すデータでもよい。教師あり学習や強化学習を行う場合は、所定の区画ごとの状態Sを示すデータとして、フィルタ処理画像の所定の区画の正常状態から異常状態までの度合いを示すラベルデータL、又は特徴照合により対象物Wの位置及び姿勢の少なくとも一方を検出した結果(つまり報酬R)をさらに含むことになる。
 ステップS33では、学習部52が複数のフィルタ処理画像を合成するための合成パラメータPを出力する学習モデルLMを生成する。学習モデルLMは、複数のフィルタ処理画像の対応する区画ごとの合成割合Cを出力する学習モデルLM1と、指定個数のフィルタFのセットを出力する学習モデルLM2と、のうちの少なくとも一方を含む。つまり学習モデルLM1が出力する合成パラメータPは、所定の区画ごとの合成割合Cであり、学習モデルLM2が出力する合成パラメータPは、指定個数のフィルタFのセットである。
 ステップS30~ステップS33を繰り返すことで、学習部52は、新たな学習データセットDSを基づいた学習に応じて学習モデルLMの状態を変換する。つまり学習モデルLMを最適化する。ステップS33の後処理として、学習モデルLMが収束したか否かを判定し、学習部52は、生成された学習済の学習モデルLMを機械学習装置45の外部へ出力してもよい。
 以上のように機械学習装置45が機械学習を用いて複数のフィルタ処理画像を合成するための合成パラメータを出力する学習モデルLMを生成して外部へ出力することで、例えば対象物Wが文字等の細かい特徴や丸まった角等の粗い特徴の双方を含む場合や、参照光の照度や露光時間等の撮像条件が変化する場合であっても、特徴抽出装置34は出力された学習済みの学習モデルLMを用いて最適な合成パラメータを設定して複数のフィルタ処理画像を合成し、特徴照合に最適な対象物Wの特徴を短時間に且つ安定して抽出できるといった特徴抽出技術の改善を提供できる。また、特徴抽出装置34が最適な特徴抽出画像を生成して出力することで、特徴照合装置35は出力された最適な特徴抽出画像を用いて対象物Wの位置及び姿勢の少なくとも一方を短時間に且つ安定して検出できるといった特徴照合技術の改善を提供できる。
 以下、合成パラメータPを設定するUIの一例について説明する。図18は合成パラメータPを設定するUI90を示す模式図である。前述の通り、合成パラメータPは、指定個数のフィルタFのセットや、所定の区画ごとの合成割合C等を含む。対象物Wの特徴や撮像条件に依存してフィルタFの最適なセットや所定の区画ごとの最適な合成割合Cも変化するため、合成パラメータPは機械学習を用いて自動で調整されることが望ましい。しかし、ユーザがUI90を用いて合成パラメータPを手動で調整してもよい。
 合成パラメータを設定するUI90は、例えば図1に示す教示装置4の表示ディスプレイに表示される。UI90は、複数のフィルタ処理画像が別個の合成割合Cに応じて合成される区画の個数を指定する区画数指定部91と、指定個数のフィルタFのセット(本例では3個の第1フィルタF1~第3フィルタF3)を指定するフィルタセット指定部92と、所定の区画ごとに合成割合Cをそれぞれ指定する合成割合指定部93と、特徴抽出用の閾値を指定する閾値指定部94と、を備えている。
 まず、ユーザは区画数指定部91において、複数のフィルタ処理画像が別個の合成割合Cに応じて合成される区画の個数をする。例えば1区画が1画素である場合は、ユーザは区画数指定部91においてフィルタ処理画像の画素数を指定すればよい。本例では、区画数が9個に手動で設定されているため、フィルタ処理画像は等しい面積の9個の矩形領域に分割される。
 次いで、ユーザは、フィルタセット指定部92において、フィルタFの個数、フィルタFの種類、フィルタFのサイズ、及びフィルタFの有効化を指定する。本例では、フィルタFの個数が3個に手動で設定され、フィルタFの種類及びサイズが、36近傍のソーベルフィルタ(第1フィルタF1)、28近傍のソーベルフィルタ(第2フィルタF2)、及び60近傍のラプラシアンフィルタ(第3フィルタF3)に手動で設定され、これら第1フィルタF1~第3フィルタF3が有効化されている。
 さらに、ユーザは合成割合指定部93において、複数のフィルタ処理画像の合成割合Cを区画ごとに指定する。本例では、第1フィルタF1~第3フィルタF3の合成割合Cが区画ごとに手動で設定されている。加えて、ユーザは閾値指定部94において、複数のフィルタ処理画像を合成した合成画像から対象物Wの特徴を抽出するための閾値、又は複数のフィルタ処理画像から対象物Wの特徴を抽出するための閾値を指定する。本例では、閾値が125以上に手動で設定されている。
 機械学習を用いて以上の合成パラメータが自動で設定された場合、UI90は、自動で設定された合成パラメータ等をUI90に反映することが望ましい。このようなUI90によれば、状況に応じて合成パラメータを手動で設定でき、且つ、自動で設定された合成パラメータの状態を視覚的に確認することができる。
 前述のプログラム又はソフトウェアは、コンピュータ読取り可能な非一時的記録媒体、例えばCD-ROM等に記録して提供してもよいし、或いは有線又は無線を介してWAN(wide area network)又はLAN(local area network)上のサーバ又はクラウドから配信して提供してもよい。
 本明細書において種々の実施形態について説明したが、本発明は、前述の実施形態に限定されるものではなく、以下の特許請求の範囲に記載された範囲内において種々の変更を行えることを認識されたい。
 1 機械システム
 2 機械
 3 制御装置
 4 教示装置
 5 視覚センサ
 21 機構部
 22 エンドエフェクタ
 23 アクチュエータ
 31 記憶部
 32 制御部
 33 物体検出部(物体検出装置)
 34 特徴抽出部(特徴抽出装置)
 35 特徴照合部
 36 画像受付部
 41 複数フィルタ処理部
 42 特徴抽出画像生成部
 42a 画像合成部
 42b 閾値処理部
 43 フィルタセット設定部
 44 合成割合設定部
 45 機械学習部(機械学習装置)
 51 学習データ取得部
 52 学習部
 61 モデル画像
 62 変化を加えた一以上のモデル画像
 63 モデル特徴
 64 モデル特徴抽出画像
 70 特徴
 71 フィルタ処理画像
 80 区画
 81 反応
 A 行動
 C 合成割合
 C1 基準座標系
 C2 ツール座標系
 C3 ワーク座標系
 D 距離
 DS データセット
 F、F1、F2、F3 フィルタ
 J1~J6 軸線
 L ラベルデータ
 LM、LM1、LM2 学習モデル
 P 合成パラメータ
 R 報酬
 S 状態
 W 対象物

Claims (15)

  1.  対象物を撮像した画像に対して適用される異なる複数のフィルタに関するデータと、前記複数のフィルタで処理した複数のフィルタ処理画像の所定の区画ごとの状態を示すデータとを、学習データセットとして取得する学習データ取得部と、
     前記学習データセットを用いて、前記複数のフィルタ処理画像を対応する前記区画ごとに合成するための合成パラメータを出力する学習モデルを生成する学習部と、
     を備える、機械学習装置。
  2.  前記学習モデルは、前記複数のフィルタ処理画像の対応する前記区画ごとの合成割合を出力する第1学習モデルと、指定個数のフィルタのセットを出力する第2学習モデルとのうちの少なくとも一方を含む、請求項1に記載の機械学習装置。
  3.  前記複数のフィルタに関するデータは、前記複数のフィルタの種類及びサイズの少なくとも一方に関するデータを含む、請求項1又は2に記載の機械学習装置。
  4.  前記複数のフィルタ処理画像の前記所定の区画ごとの状態を示すデータは、前記所定の区画の周辺区画の値のバラツキを示すデータ、又は前記複数のフィルタ処理画像を閾値処理した後の前記所定の区画ごとの反応を示すデータを含む、請求項1~3のいずれか一項に記載の機械学習装置。
  5.  前記複数のフィルタ処理画像の前記所定の区画ごとの状態を示すデータは、前記所定の区画ごとの正常状態から異常状態までの度合いを示すラベルデータを含む、請求項1~4のいずれか一項に記載の機械学習装置。
  6.  前記学習部は、前記複数のフィルタ処理画像を対応する前記区画ごとの合成割合に基づいて合成された合成画像から抽出された前記対象物の特徴が、位置及び姿勢の少なくとも一方が既知である前記対象物を撮像したモデル画像から抽出された前記対象物のモデル特徴に近づくように、前記学習モデルの状態を変換する、請求項1~5のいずれか一項に記載の機械学習装置。
  7.  前記学習データ取得部は、前記フィルタ処理画像と、位置及び姿勢の少なくとも一方が既知である前記対象物を撮像したモデル画像から抽出されたモデル特徴抽出画像とを差分して、前記複数のフィルタ処理画像の前記所定の区画ごとの正常状態から異常状態までの度合いを示すラベルデータを取得する、請求項1~6のいずれか一項に記載の機械学習装置。
  8.  前記学習データ取得部は、位置及び姿勢の少なくとも一方が既知である前記対象物を撮像したモデル画像に対して一以上の変化を加えたときに前記モデル画像から抽出された一以上のモデル特徴抽出画像を用いて、前記複数のフィルタ処理画像の前記所定の区画ごとの正常状態から異常状態までの度合いを示すラベルデータを取得する、請求項1~7のいずれか一項に記載の機械学習装置。
  9.  前記モデル画像に対して加える一以上の変化は、前記対象物を撮像した画像から抽出された前記対象物の特徴と、前記モデル画像から抽出された前記対象物のモデル特徴とを照合する際に利用される一以上の変化を含む、請求項8に記載の機械学習装置。
  10.  前記学習部は、前記対象物を撮像した画像から抽出された前記対象物の特徴と、位置及び姿勢の少なくとも一方が既知である前記対象物を撮像したモデル画像から抽出されたモデル特徴とを照合することで前記対象物の位置及び姿勢の少なくとも一方を検出した結果を用いて、前記学習モデルを生成する、請求項1~9のいずれか一項に記載の機械学習装置。
  11.  前記複数のフィルタ処理画像の前記所定の区画ごとの状態を示すデータは、指定個数を超える前記複数のフィルタで処理した前記複数のフィルタ処理画像を閾値処理した後の前記所定の区画ごとの反応を示すデータを含む、請求項1~10のいずれか一項に記載の機械学習装置。
  12.  前記学習部は、位置及び姿勢の少なくとも一方が既知である前記対象物を撮像したモデル画像を用いて、指定個数のフィルタのセットを出力する前記学習モデルを生成する、請求項1から11のいずれか一項に記載の機械学習装置。
  13.  前記学習部は、指定個数を超える前記複数のフィルタで処理した前記複数のフィルタ処理画像を閾値処理した後の前記所定の区画ごとの反応が前記所定の区画ごとに最大になるように、指定個数のフィルタのセットを出力する前記学習モデルを生成する、請求項1から12のいずれか一項に記載の機械学習装置。
  14.  対象物を撮像した画像から前記対象物の特徴を抽出する特徴抽出装置であって、
     前記対象物を撮像した前記画像に対して異なる複数のフィルタで処理して複数のフィルタ処理画像を生成する複数フィルタ処理部と、
     前記複数のフィルタ処理画像の対応する区画ごとの合成割合に基づいて前記複数のフィルタ処理画像を合成して前記対象物の特徴抽出画像を生成して出力する特徴抽出画像生成部と、
     を備える、特徴抽出装置。
  15.  対象物を撮像した画像から検出した前記対象物の位置及び姿勢の少なくとも一方に基づいて機械の動作を制御する制御装置であって、
     前記対象物を撮像した前記画像に対して異なる複数のフィルタで処理して複数のフィルタ処理画像を生成し、前記複数のフィルタ処理画像の対応する区画ごとの合成割合に基づいて前記複数のフィルタ処理画像を合成し、前記対象物の特徴を抽出する特徴抽出部と、
     抽出された前記対象物の特徴と、前記位置及び姿勢の少なくとも一方が既知である前記対象物を撮像したモデル画像から抽出されたモデル特徴とを照合して、前記位置及び前記姿勢の少なくとも一方が未知である前記対象物の前記位置及び前記姿勢の少なくとも一方を検出する特徴照合部と、
     検出された前記対象物の前記位置及び前記姿勢の少なくとも一方に基づいて前記機械の動作を制御する制御部と、
     を備える、制御装置。
PCT/JP2022/012453 2022-03-17 2022-03-17 機械学習装置、特徴抽出装置、及び制御装置 WO2023175870A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2022/012453 WO2023175870A1 (ja) 2022-03-17 2022-03-17 機械学習装置、特徴抽出装置、及び制御装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2022/012453 WO2023175870A1 (ja) 2022-03-17 2022-03-17 機械学習装置、特徴抽出装置、及び制御装置

Publications (1)

Publication Number Publication Date
WO2023175870A1 true WO2023175870A1 (ja) 2023-09-21

Family

ID=88022652

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2022/012453 WO2023175870A1 (ja) 2022-03-17 2022-03-17 機械学習装置、特徴抽出装置、及び制御装置

Country Status (1)

Country Link
WO (1) WO2023175870A1 (ja)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011150659A (ja) * 2010-01-25 2011-08-04 Ihi Corp 重み付け方法、装置、及びプログラム、並びに、特徴画像抽出方法、装置、及びプログラム
JP2018206252A (ja) * 2017-06-08 2018-12-27 国立大学法人 筑波大学 画像処理システム、評価モデル構築方法、画像処理方法及びプログラム
JP2019211903A (ja) * 2018-06-01 2019-12-12 キヤノン株式会社 情報処理装置、ロボットシステム、情報処理方法及びプログラム

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011150659A (ja) * 2010-01-25 2011-08-04 Ihi Corp 重み付け方法、装置、及びプログラム、並びに、特徴画像抽出方法、装置、及びプログラム
JP2018206252A (ja) * 2017-06-08 2018-12-27 国立大学法人 筑波大学 画像処理システム、評価モデル構築方法、画像処理方法及びプログラム
JP2019211903A (ja) * 2018-06-01 2019-12-12 キヤノン株式会社 情報処理装置、ロボットシステム、情報処理方法及びプログラム

Similar Documents

Publication Publication Date Title
US10737385B2 (en) Machine learning device, robot system, and machine learning method
US20180079076A1 (en) Machine learning device, robot system, and machine learning method for learning operation program of robot
Chan et al. A multi-sensor approach to automating co-ordinate measuring machine-based reverse engineering
CN107138432B (zh) 非刚性物体分拣方法和装置
US11673266B2 (en) Robot control device for issuing motion command to robot on the basis of motion sequence of basic motions
CN111683799B (zh) 动作控制装置、系统、方法、存储介质、控制及处理装置
CN106256512A (zh) 包括机器视觉的机器人装置
JP2019057250A (ja) ワーク情報処理装置およびワークの認識方法
CN112775967A (zh) 基于机器视觉的机械臂抓取方法、装置及设备
CN113172629A (zh) 一种基于时序触觉数据处理的物体抓取方法
CN111696092A (zh) 一种基于特征对比的缺陷检测方法及系统、存储介质
CN114494594B (zh) 基于深度学习的航天员操作设备状态识别方法
CN113034575A (zh) 一种模型构建方法、位姿估计方法及物体拣取装置
Leitner et al. Humanoid learns to detect its own hands
WO2023175870A1 (ja) 機械学習装置、特徴抽出装置、及び制御装置
CN116985141B (zh) 一种基于深度学习的工业机器人智能控制方法及系统
Wu et al. A cascaded CNN-based method for monocular vision robotic grasping
WO2020213194A1 (ja) 表示制御システム、および、表示制御方法
CN111275758A (zh) 混合型3d视觉定位方法、装置、计算机设备及存储介质
Takarics et al. Welding trajectory reconstruction based on the Intelligent Space concept
CN116724224A (zh) 加工面判定装置、加工面判定程序、加工面判定方法、加工系统、推论装置及机器学习装置
Minami et al. Evolutionary scene recognition and simultaneous position/orientation detection
CN113808206A (zh) 一种基于视觉追踪机器人的排版系统及方法
CN113870342A (zh) 外观缺陷检测方法、智能终端以及存储装置
CN112149727A (zh) 一种基于Mask R-CNN的青椒图像检测方法

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: 22932143

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2024507378

Country of ref document: JP

Kind code of ref document: A