Machine learning device, feature extraction device, and control device
The machine learning device stabilizes and speeds up object feature extraction by employing multiple filters with adjustable combination ratios and thresholds, addressing the instability and inefficiency of traditional methods.
Patent Information
- Application Number
- JP2024507378
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2022-03-17
- Publication Date
- 2026-01-14
- Estimated Expiration
- 2042-03-17
AI Technical Summary
Existing image processing techniques for detecting object features are unstable and time-consuming due to varying filter responses based on filter type and size, leading to unnecessary noise extraction and system delays.
A machine learning device that uses a combination of multiple filters with different types and sizes to process images, adjusting combination ratios and thresholds for each section to stabilize feature extraction, enabling efficient and accurate detection of object features.
Stable and rapid extraction of object features, reducing system delays and errors by using a machine learning model to optimize filter combinations and thresholds for improved feature matching.
Smart Images

Figure 0007799033000004 
Figure 0007799033000005 
Figure 0007799033000006
Abstract
Description
[Technical Field]
[0001] The present invention relates to image processing technology, and more particularly to a machine learning device, a feature extraction device, and a control device. [Background technology]
[0002] When a machine such as a robot or machine tool performs some kind of work on an object whose position and orientation are unknown, the position and orientation of the object may be detected using an image of the object. For example, model features representing specific parts of the object are extracted from a model image of an object whose position and orientation are known, and the model features of the object are registered together with the position and orientation of the object. Next, features representing specific parts of the object are similarly extracted from an image of an object whose position and orientation are unknown, and the changes in the position and orientation of the object's features are calculated by comparing them with the pre-registered model features, thereby detecting the position and orientation of the object whose position and orientation are unknown.
[0003] The object features often used for feature matching are the contours of the object (i.e., the edges and corners of the object) that capture brightness changes (gradients) in the image. The object features used for feature matching vary greatly depending on the type and size of the image filter (also called spatial filtering) applied. Filter types include noise reduction filters and contour extraction filters in terms of application type, and noise reduction filters include mean value filters, median filters, Gaussian filters, and dilation / erosion filters in terms of algorithm type, while contour extraction filters include edge detection filters such as Prewitt filters, Sobel filters, and Laplacian filters, and corner detection filters such as Harris operators.
[0004] With such image filters, simply changing the type, size, etc. of the filter changes the manner in which the features of the extracted object are changed. For example, a small-sized contour extraction filter is effective for extracting relatively fine contours, such as characters printed on an object, but is not good at extracting relatively coarse contours, such as rounded corners on a casting. A large-sized contour extraction filter is effective for rounded corners. Therefore, it is necessary to specify an appropriate type, size, etc. of the filter for each predetermined section depending on the detection object and imaging conditions. The background art related to this application is described below.
[0005] Patent document 1 describes a method for visual servoing of a robot in which distances (differences in features) are detected and weighted for each of a number of different image features (image features related to center of gravity, edges, and pixels) from an image containing an object and a target image, the weighted distances are summed for all image features, the result is generated as a control signal, and an operation is performed to change one or both of the position and posture of the object based on the control signal.
[0006] Patent document 2 describes a method of detecting edges from an image using edge detection filters of multiple sizes, extracting areas that are not edges as flat areas, calculating the relative ratio between the value of a pixel of interest and the average value of the surrounding pixels in a pixel range corresponding to the size of the edge detection filter for the extracted flat area, creating a transmittance map, and correcting the image of the flat area using the created transmittance map to remove shadows of dust, etc. [Prior art documents] [Patent documents]
[0007] [Patent Document 1] Japanese Patent Application Laid-Open No. 2015-145050 [Patent Document 2] Japanese Patent Application Laid-Open No. 2005-079856 Summary of the Invention [Problem to be solved by the invention]
[0008] The image area used for feature matching is not necessarily suitable for extracting the features of the object, and there may be areas where the filter response is weak depending on the type and size of the filter. While it is possible to extract contours from areas with weak response by setting a low threshold in the threshold processing after filtering, this also extracts unnecessary noise, increasing the time required for feature matching. Furthermore, even a slight change in the imaging conditions may prevent the object's features from being extracted.
[0009] In view of the above, the present invention has been made in view of the conventional problems and has an object to provide a technique that can stably extract the features of an object from an image of the object in a short time. [Means for solving the problem]
[0010] One aspect of the present disclosure provides a machine learning device including: a learning data acquisition unit that acquires, as a learning dataset, data on a plurality of different filters that are applied to an image of an object, and data indicating the state of each predetermined section of a plurality of filtered images processed with the plurality of filters; and a learning unit that uses the learning dataset to generate a learning model that outputs synthesis parameters for synthesizing the plurality of filtered images for each corresponding section. Another aspect of the present disclosure is a feature extraction device that extracts features of an object from an image of the object, the feature extraction device including: a multi-filter processing unit that processes the image of the object with a plurality of different filters to generate a plurality of filter-processed images; and a feature-extracted image generation unit that combines the plurality of filter-processed images based on a combination ratio for each corresponding section of the plurality of filter-processed images to generate and output a feature-extracted image of the object. a section number designation unit that designates the number of sections into which the plurality of filtered images are to be combined according to different combination ratios; a filter set designation unit that designates a set of the designated number of filters; a combination ratio designation unit that designates the combination ratio for each predetermined section; and a threshold designation unit that designates a threshold for extracting features of an object from a composite image obtained by combining the plurality of filtered images, or a threshold for extracting features of an object from the plurality of filtered images; A feature extraction device is provided, comprising: 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 posture of an object detected from an image of the object, the control device including: a feature extraction unit that processes the image of the object with a plurality of different filters to generate a plurality of filtered images, combines the plurality of filtered images based on a combination ratio for each corresponding section of the plurality of filtered images, and extracts features of the object; a section number designation unit that designates the number of sections into which the plurality of filtered images are to be combined according to different combination ratios; a filter set designation unit that designates a set of the designated number of filters; a combination ratio designation unit that designates the combination ratio for each predetermined section; and a threshold designation unit that designates a threshold for extracting features of an object from a composite image obtained by combining the plurality of filtered images, or a threshold for extracting features of an object from the plurality of filtered images; Provided is a control device comprising: a feature matching unit that matches extracted features of an object with model features extracted from a model image of an object whose position and / or orientation are known, to detect at least one of the position and orientation of an object whose position and / or orientation are unknown; and a control unit that controls the operation of a machine based on at least one of the position and orientation of the detected object. [Effects of the Invention]
[0011] According to the present disclosure, it is possible to provide a technology that can stably extract features of an object from an image of the object in a short time. [Brief explanation of the drawings]
[0012] [Figure 1] FIG. 1 is a configuration diagram of a mechanical system according to an embodiment. [Figure 2] FIG. 1 is a block diagram of a mechanical system according to one embodiment. [Figure 3] FIG. 1 is a block diagram of a feature extraction device according to an embodiment. [Figure 4] 10 is a flowchart showing the execution procedure of the machine system when registering a model. [Figure 5] 10 is a flowchart showing the execution procedure of the mechanical system when the system is in operation. [Figure 6] FIG. 1 is a block diagram of a machine learning device according to an embodiment. [Figure 7] 3A and 3B are schematic diagrams showing examples of types and sizes of filters. [Figure 8] FIG. 10 is a schematic diagram showing a method for acquiring label data. [Figure 9]FIG. 10 is a scatter plot illustrating an example of a training data set of composite proportions. [Figure 10] FIG. 1 is a schematic diagram showing a decision tree model. [Figure 11] FIG. 1 is a schematic diagram showing a model of a neuron. [Figure 12] FIG. 1 is a schematic diagram showing a neural network model. [Figure 13] FIG. 1 is a schematic diagram illustrating a configuration of reinforcement learning. [Figure 14] FIG. 10 is a schematic diagram showing the response of each predetermined section of a plurality of filtered images. [Figure 15] 1 is a table illustrating an example of a training data set for a set of a specified number of filters. [Figure 16] This is a tree diagram showing a model of unsupervised learning (hierarchical clustering). [Figure 17] 1 is a flowchart showing the execution procedure of a machine learning method. [Figure 18] FIG. 10 is a schematic diagram illustrating an example of a user interface (UI) for setting synthesis parameters. DETAILED DESCRIPTION OF THE INVENTION
[0013] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the drawings. In the embodiments of the present disclosure, identical or similar elements are designated by identical or similar reference numerals. It should be noted that the embodiments of the present disclosure do not limit the technical scope and meaning of the terms of the present invention, and the technical scope of the present invention encompasses the inventions described in the claims and their equivalents.
[0014] First, the configuration of a mechanical system 1 according to one embodiment will be described. Fig. 1 is a configuration diagram of the mechanical system 1 according to one embodiment, and 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 a machine 2 based on at least one of the position and posture of an object W detected from an image of the object W. The mechanical system 1 is a robot system, but may also be configured as a mechanical system including other machines such as machine tools, construction machinery, vehicles, and aircraft.
[0015] The machine 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 configured as an articulated robot, but may also be configured as other types of robots such as a parallel link robot or a humanoid. In other embodiments, the machine 2 may also be configured as other types of machines such as a machine tool, construction machinery, a vehicle, or an aircraft. The machine 2 includes a mechanical unit 21 that is configured as a plurality of mechanical elements capable of relative motion, and an end effector 22 that can be detachably connected to the mechanical unit 21. The mechanical elements are configured as links such as a base, a rotating body, an upper arm, a forearm, and a wrist, and each link rotates around a predetermined axis J1 to J6.
[0016] The mechanical unit 21 is composed of an electric actuator 23 including an electric motor for driving mechanical elements, a detector, a reducer, etc., but in other embodiments, it may be composed of a fluid actuator including a hydraulic or pneumatic cylinder, a pump, a control valve, etc. The end effector 22 is a hand that picks up and delivers the object W, but in other embodiments, it may be composed of a tool such as a welding tool, a cutting tool, or a polishing tool.
[0017] 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 interfaces (A / D converter, D / A converter, etc.), and a drive circuit that drives the actuators of the machine 2. In another embodiment, the control device 3 does not include the drive circuit, and the machine 2 may include the drive circuit.
[0018] The teaching device 4 is communicatively connected to the control device 3 via a wired or wireless connection. The teaching device 4 includes a computer including a processor (CPU, MPU, etc.), memory (RAM, ROM, etc.), and input / output interface, a display, an emergency stop switch, an enable switch, etc. The teaching device 4 is configured, for example, as an operation panel directly attached to the control device 3, or a teach pendant, tablet, PC, server, etc. communicatively connected to the control device 3 via a wired or wireless connection.
[0019] The teaching device 4 sets various coordinate systems, such as a reference coordinate system C1 fixed to a reference position, a tool coordinate system C2 fixed to the end effector 22, which is the part to be controlled, and a workpiece coordinate system C3 fixed to the 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. Although not shown, the teaching device 4 also sets a camera coordinate system fixed to the visual sensor 5, and converts the position and orientation of the object W in the camera coordinate system into the position and orientation of the object W in the reference coordinate system C1. 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.
[0020] The teaching device 4 has an online teaching function such as a playback method or a direct teaching method, which actually moves the machine 2 to teach the position and posture of the part to be controlled, or an offline teaching function, which moves a virtual model of the machine 2 in a computer-generated virtual space to teach the position and posture of the part to be controlled. The teaching device 4 generates an operation program for the machine 2 by associating the taught position, posture, operation speed, etc. of the part to be controlled with various operation commands. The operation commands include various commands such as linear movement, circular movement, and movement along each axis. The control device 3 receives the operation program from the teaching device 4 and controls the operation of the machine 2 in accordance with the operation program. The teaching device 4 also receives the status of the machine 2 from the control device 3 and displays the status of the machine 2 on a display or the like.
[0021] The visual sensor 5 is composed of a 2D camera that outputs 2D images, a 3D camera that outputs 3D images, or the like. The visual sensor 5 is attached near the end effector 22, but in other embodiments, it may be fixedly installed in a location different 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 detects at least one of the position and orientation of the object W by comparing the extracted features of the object W with model features of the object W extracted from a model image of the object W, whose position and / or orientation are known.
[0022] In this specification, the position and orientation of the object W refers to the position and orientation of the object W transformed from the camera coordinate system to the reference coordinate system C1, but may also simply refer to the position and orientation of the object W in the camera coordinate system.
[0023] 2, the control device 3 includes a storage unit 31 that stores various data, and a control unit 32 that controls the operation of the machine 2 in accordance with 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 located inside the machine 2 and the control unit 32 may include only a processor.
[0024] The memory unit 31 stores the operation program of the machine 2, various image data, etc. The control unit 32 drives and controls the actuator 23 of the machine 2 in accordance with the operation program generated by the teaching device 4 and the position and posture 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 units (not shown). The control unit 32 controls the position, speed, acceleration, etc. of the electric motor in accordance with the command values of the operation program and the detection values of the motion detection units.
[0025] The control device 3 further includes an object detection unit 33 that detects at least one of the position and posture of the target object W using the visual sensor 5. In another embodiment, the object detection unit 33 may be configured as an object detection device that is arranged outside the control device 3 and is capable of communicating with the control device 3.
[0026] The object detection unit 33 includes a feature extraction unit 34 that extracts features of the object W from an image of the object W, and a feature matching unit 35 that matches the extracted features of the object W with model features extracted from a model image of the object W, at least one of which is known, to detect at least one of the position and posture of the object W, at least one of which is unknown.
[0027] In another embodiment, the feature extraction unit 34 may be configured as a feature extraction device that is arranged outside the control device 3 and is capable of communicating with the control device 3. Similarly, in another embodiment, the feature matching unit 35 may be configured as a feature matching device that is arranged outside the control device 3 and is capable of communicating with the control device 3.
[0028] The control unit 32 corrects at least one of the position and attitude of the controlled parts of the machine 2 based on at least one of the detected position and attitude of the object W. For example, the control unit 32 may correct the data of the position and attitude of the controlled parts used in the operation program of the machine 2, or may calculate the position deviation, speed deviation, acceleration deviation, etc. of one or more electric motors based on inverse kinematics from the corrected amounts of the position and attitude of the controlled parts while the machine 2 is operating, and provide visual feedback.
[0029] As described above, the machine system 1 detects at least one of the position and orientation of the object W from an image captured by the visual sensor 5, and controls the operation of the machine 2 based on at least one of the position and orientation of the object W. However, 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 suitable for extracting the features of the object W. The type and size of the filter F used in the feature extraction unit 34 may result in areas where the filter F responds weakly. While it is possible to extract contours from areas where the response is weak by setting a low threshold in the threshold processing after filtering, this also results in the extraction of unnecessary noise, increasing the time required for feature matching. Furthermore, even a slight change in the imaging conditions may prevent the features of the object W from being extracted.
[0030] Therefore, the feature extraction unit 34 processes an image of the object W with a plurality of different filters F, combines the plurality of filter-processed images based on the combination ratio C for each corresponding section of the plurality of filter-processed images, and generates and outputs a feature-extracted image. To increase speed, the feature extraction unit 34 desirably executes the plurality of filter processes in parallel.
[0031] Here, "plurality of different filters F" refers to a set of filters F in which at least one of the type and size of the filters F is changed. For example, the plurality of different filters F is composed of three filters F of different sizes: a Prewitt filter (first filter) with 8 neighborhoods, a Prewitt filter (second filter) with 24 neighborhoods, and a Prewitt filter (third filter) with 48 neighborhoods.
[0032] Alternatively, the different filters F may be a set of filters F that combine multiple filters F with different algorithms. For example, the different filters F may be a set of four filters F with different algorithms and different sizes, namely, 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 (fourth filter).
[0033] Furthermore, the 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. For example, the different filters F may be a set of four filters F for different purposes and different sizes, such as an 8-neighbor noise removal filter (first filter), a 48-neighbor noise removal filter (second filter), an 8-neighbor contour extraction filter (third filter), and a 48-neighbor contour extraction filter (fourth filter). Alternatively, the different filters F may be a set of two filters F of different sizes in which multiple filters F for different purposes are combined in series, such as an 8-neighbor noise removal filter + a 24-neighbor contour extraction filter (first filter) and a 48-neighbor noise removal filter + a 80-neighbor contour extraction filter (second filter). Similarly, the different filters F may be a set of two filters F of different sizes in which multiple filters F for different purposes are combined in series, such as an 8-neighbor edge detection filter + an 8-neighbor corner detection filter (first filter) and a 24-neighbor edge detection filter + a 24-neighbor corner detection filter (second filter).
[0034] Furthermore, a "section" generally corresponds to one pixel, but may also be a section composed of a group of neighboring pixels, such as a group of 8 neighboring pixels, a group of 12 neighboring pixels, a group of 24 neighboring pixels, a group of 48 neighboring pixels, or a group of 80 neighboring pixels. Alternatively, a "section" may be each section of an image divided by various image segmentation techniques. Examples of image segmentation techniques include deep learning and k-means algorithms. When using k-means algorithms, image segmentation may be performed based on the output result of a filter F rather than on the RGB space. The blending ratio C for each predetermined section and the set of different filters F may be set manually or automatically.
[0035] By using such multiple different filters F, it becomes possible to stably extract features with different appearances, such as fine features like characters and coarse features like rounded corners. Furthermore, in applications such as a mechanical system 1 that detects at least one of the position and orientation of an object W, it is possible to reduce system delays and system stoppages due to non-detection or erroneous detection.
[0036] Furthermore, by setting a synthesis ratio C for each predetermined section, desired features can be accurately extracted even when different features, such as fine features such as characters and rough features such as rounded corners, are mixed in one image.
[0037] The teaching device 4 includes an image receiving unit 36 that receives a model image of an object W, at least one of whose position and orientation is known, in association with the position and orientation of the object W. The image receiving unit 36 displays a UI on the display that receives a model image of the object W in association with the position and orientation of the object W. 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. In this way, the model features used by the feature matching unit 35 are registered in advance.
[0038] Furthermore, the image receiving unit 36 may receive one or more modified model images by applying one or more changes to the received model image, such as brightness, enlargement or reduction, shearing, translation, and rotation. 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 stores the one or more output model features of the object W in association with the position and orientation of the object W. By applying one or more changes to the model image, the feature matching unit 35 can match features extracted from an image captured of the object W, at least one of whose position and orientation is unknown, with one or more model features, thereby enabling stable detection of at least one of the position and orientation of the object W.
[0039] Furthermore, the image receiving unit 36 may receive an adjusted image for automatically adjusting the combination ratio C for each corresponding section of the plurality of filtered images or the set of a specified plurality of filters F. The adjusted image may be a model image obtained by capturing an object W whose position and / or orientation are known, or an image obtained by capturing 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 manually or automatically sets at least one of the combination ratio C for each specified section and the set of a specified number of filters F based on the state S for each specified section of the plurality of filtered images.
[0040] Since the state S of each specified section of the multiple filtered images changes depending on the characteristics of the object W (fine features such as letters, coarse features such as rounded corners, strong reflection due to the color or material of the object W, etc.) and the imaging conditions (illuminance of the reference light, exposure time, etc.), it is desirable to automatically adjust the synthesis ratio C for each specified section and the set of multiple different filters F using machine learning, which will be described later.
[0041] 3 is a block diagram of a feature extraction device 34 (feature extraction unit) according to one embodiment. The feature extraction device 34 includes a computer including a processor (e.g., CPU, GPU), memory (e.g., RAM, ROM), and an input / output interface (e.g., A / D converter, D / A converter). The processor reads and executes a feature extraction program stored in the memory, processes an image input via the input / output interface with a plurality of different filters F to generate a plurality of filtered images, and combines the filtered images based on a combination ratio C for each corresponding section of the plurality of filtered images to generate a feature-extracted image of the object W. The processor outputs the feature-extracted image to the outside of the feature extraction device 34 via the input / output interface.
[0042] The feature extraction device 34 includes a multiple filter processing unit 41 that processes an image of an object W with multiple different filters F to generate multiple filtered images, and a feature extraction image generation unit 42 that combines the multiple filtered images based on a combination ratio C for each corresponding section of the multiple filtered images to generate and output a feature extraction image of the object W.
[0043] The feature extraction image generation unit 42 includes an image synthesis unit 42a that synthesizes a plurality of filter-processed images, and a threshold processing unit 42b that performs threshold processing on the plurality of filter-processed images or the synthesized image. In another embodiment, the feature extraction image generation unit 42 may perform processing in the order of the threshold processing unit 42b and the image synthesis unit 42a, rather than the image synthesis unit 42a and the threshold processing unit 42b. In other words, the image synthesis unit 42a may be arranged after the threshold processing unit 42b, rather than before the threshold processing unit 42b.
[0044] The feature extraction unit 34 also includes a filter set setting unit 43 that sets a set of a specified number of different filters F, and a combination ratio setting unit 44 that sets a combination ratio C for each corresponding section of a plurality of filter-processed images. The filter set setting unit 43 provides a function to manually or automatically set a set of a specified number of different filters F. The combination ratio setting unit 44 provides a function to manually or automatically set a combination ratio C for each corresponding section of a plurality of filter-processed images.
[0045] Below, we will explain the execution procedures when registering a model and when the system is in operation in the machine system 1. When registering a model, we mean a situation where model features to be used in feature matching to detect the position and posture of the object W are registered in advance, and when the system is in operation, we mean a situation where the machine 2 is actually in operation and performs a predetermined task on the object W.
[0046] 4 is a flowchart showing the execution procedure of the mechanical system 1 when registering a model. First, in step S10, the image receiving unit 36 receives a model image of an object W, at least one of whose position and orientation is known, in association with at least one of the position and orientation of the object W.
[0047] In step S11, the multiple filter processing unit 41 generates multiple filter-processed images by processing a model image of the object W with multiple different filters F. Note that, as pre-processing of step S11, the filter set setting unit 43 may manually set a set of a specified number of different filters F. Alternatively, as post-processing of step S11, the filter set setting unit 43 may automatically set an optimal set of a specified number of different filters F based on the state S of each predetermined section of the multiple filter-processed images, and then return to step S11 to repeat the process of generating multiple filter-processed images. After the optimal set of the specified number of filters F has converged, the process may proceed to step S12.
[0048] In step S12, the combination ratio setting unit 44 manually sets the combination ratio C for each corresponding partition of the plurality of filter-processed images based on the state S for each predetermined partition of the plurality of filter-processed images. Alternatively, the combination ratio setting unit 44 may automatically set the combination ratio C for each corresponding partition of the plurality of filter-processed images based on the state S for each predetermined partition of the plurality of filter-processed images.
[0049] In step S13, the feature extraction image generation unit 42 synthesizes the multiple filtered images based on the set synthesis ratio C to generate and output a model feature extraction image (target image). In step S14, the storage unit 31 stores the model feature extraction image in association with at least one of the position and posture of the object W, thereby registering the model features of the object W in advance.
[0050] After the model is registered, the image receiving unit 36 may further receive an adjusted image of the object W, and the filter set setting unit 43 may manually or automatically reset a set of a specified number of filters F based on the received adjusted image, and the blending ratio setting unit 44 may manually or automatically reset the blending ratio C for each predetermined section based on the received adjusted image. By repeating adjustment using the adjusted image, the feature extraction device 34 can provide an improvement in feature extraction technology, such as being able to stably extract the features of the object W in a short time.
[0051] 5 is a flowchart showing the execution procedure of the machine system 1 when the system is operating. First, in step S20, the feature extraction device 34 receives from the visual sensor 5 an actual image of an object W, at least one of the position and orientation of which is unknown.
[0052] In step S21, the multiple filter processing unit 41 generates multiple filter-processed images by processing the actual image of the object W with multiple different filters F. Note that, as a post-processing step of step S21, the filter set setting unit 43 may automatically reset an optimal set of a specified number of different filters F based on the state S of each predetermined section of the multiple filter-processed images, and then return to step S11 to repeat the process of generating multiple filter-processed images, and after the optimal set of the specified number of filters F has converged, the process may proceed to step S22.
[0053] In step S22, the combination ratio setting unit 44 automatically resets the combination ratio C for each corresponding partition of the plurality of filter-processed images based on the state S for each predetermined partition of the plurality of filter-processed images. Alternatively, the process may proceed to step S23 without performing the process of step S22, and the combination ratio C for each predetermined partition that was set in advance before the system was put into operation may be used.
[0054] In step S23, the feature extraction image generation unit 42 combines the multiple filtered images based on the set combination ratio C to generate and output a feature extraction image. In step S24, the feature matching unit 35 compares the generated feature extraction image with a model feature extraction image (target image) registered in advance, and detects at least one of the position and posture of the object W, at least one of which is unknown. In step S25, the control unit 32 corrects the operation of the machine 2 based on at least one of the position and posture of the object W.
[0055] After the system is put into operation, if it takes a long time to detect the position and orientation of the object W or for the cycle time of the entire system, the image receiving unit 36 may further receive an adjusted image of the object W, and the filter set setting unit 43 may manually or automatically reset the set of the specified number of filters F based on the received adjusted image, and the blending ratio setting unit 44 may manually or automatically reset the blending ratio C for each predetermined section based on the received adjusted image. By repeating adjustment using the adjusted image, the feature extraction device 34 can provide an improvement in feature extraction technology, such as being able to stably extract the features of the object W in a short time.
[0056] The following describes in detail a method for automatically adjusting the combination ratio C for each predetermined section and the set of a specified number of filters F. The combination ratio C for each predetermined section and the set of a specified number of filters F are automatically adjusted using machine learning.
[0057] 3, 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. In another embodiment, the machine learning unit 45 may be configured as a machine learning device that is arranged outside the feature extraction device 34 (feature extraction unit) or the control device 3 and is capable of communicating with the feature extraction device 34 or the control device 3.
[0058] 6 is a block diagram of a machine learning device 45 (machine learning unit) according to one embodiment. The machine learning device 45 includes a computer including a processor (CPU, GPU, etc.), memory (RAM, ROM, etc.), and an input / output interface (A / D converter, D / A converter, etc.). The processor reads and executes a machine learning program stored in the memory, and generates a learning model LM that outputs a synthesis parameter P for synthesizing multiple filtered images for each corresponding partition, based on input data input via the input / output interface.
[0059] Furthermore, each time new input data is input via the input / output interface, the processor converts the state of the learning model LM in accordance with learning based on the new input data. In other words, the processor optimizes the learning model LM. The processor outputs the learned learning model LM to the outside of the machine learning device 45 via the input / output interface.
[0060] The machine learning device 45 includes a learning data acquisition unit 51 that acquires data on a plurality of different filters F and data indicating the state S of each predetermined section of a plurality of filter-processed images as a learning dataset DS, and a learning unit 52 that uses the learning dataset DS to generate a learning model LM that outputs synthesis parameters P for synthesizing a plurality of filter-processed images.
[0061] Every time the training data acquisition unit 51 acquires a new training data set DS, the training unit 52 converts the state of the training model LM in accordance with training based on the new training data set DS. In other words, the training unit 52 optimizes the training model LM. The training unit 52 outputs the generated trained training model LM to the outside of the machine learning device 45.
[0062] 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. In other words, the synthesis parameter P output by the learning model LM1 is the 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.
[0063] <Learning model LM1 for synthesis ratio C> Below, we will explain the prediction model (learning model LM1) of the combination ratio C for each corresponding section of multiple filtered images. Since predicting the combination ratio C is a prediction problem of continuous values called combination ratios (i.e., a regression problem), supervised learning, reinforcement learning, deep reinforcement learning, etc. can be used as a learning method for the learning model LM1 that outputs the combination ratios. In addition, models such as decision trees, neurons, and neural networks can be used as the learning model LM1.
[0064] First, generation of a learning model LM1 of a combination ratio C by supervised learning will be described with reference to Figures 6 to 12. A learning data acquisition unit 51 acquires data on a plurality of different filters F as a learning dataset DS, and the data on the plurality of filters F includes at least one of the types and sizes of the plurality of filters F.
[0065] FIG. 7 is a schematic diagram showing an example of the type and size of filter F. The types of filter F include various types such as noise removal filters (average filter, median filter, Gaussian filter, dilation / erosion filter, etc.) and contour extraction filters (edge detection filters such as Prewitt filter, Sobel filter, Laplacian filter, and corner detection filter such as Harris operator). On the other hand, the size of filter F includes various sizes such as 4-neighbor, 8-neighbor, 12-neighbor, 24-neighbor, 28-neighbor, 36-neighbor, 48-neighbor, 60-neighbor, and 80-neighbor. Filter F may be square, such as 8-neighbor, 24-neighbor, 48-neighbor, or 80-neighbor, cross, such as 4-neighbor, diamond, such as 12-neighbor, or circular, such as 28-neighbor, 36-neighbor, or 60-neighbor. In other words, setting the size of filter F is equivalent to setting the shape of filter F.
[0066] One section of filter F generally corresponds to one pixel of an image, but may also correspond to a section consisting of a group of adjacent pixels, such as four adjacent pixels, nine adjacent pixels, or 16 adjacent pixels. Alternatively, one section of filter F may correspond to each section of an image divided by various image segmentation methods. Examples of image segmentation methods include deep learning and k-means. When k-means is used, image segmentation may be performed based on the output result of filter F rather than based on RGB space. Each section of filter F includes coefficients or weights according to the type of filter F. Generally, when an image is processed with a filter F, the value of the section of the image corresponding to the central section of filter F is replaced with a value calculated based on the coefficients or weights of the surrounding sections surrounding the central section of filter F and the values of the surrounding sections of the image corresponding to the surrounding sections of filter F.
[0067] Therefore, when an image of the object W is processed with a plurality of different filters F, each of which has a different type and / or size, a plurality of different filter-processed images are generated. In other words, simply by changing at least one of the type and size of the filter F, some sections are easy to extract the features of the object W from, and some sections are difficult to extract the features from.
[0068] Therefore, the data on the plurality of filters F includes at least one of the types and sizes of the plurality of filters F. In this example, the data on the plurality of filters F includes one type of filter and multiple sizes, namely, a 4-neighbor Sobel filter (first filter), an 8-neighbor Sobel filter (second filter), a 12-neighbor Sobel filter (third filter), a 24-neighbor Sobel filter (fourth filter), a 28-neighbor Sobel filter (fifth filter), a 36-neighbor Sobel filter (sixth filter), a 48-neighbor Sobel filter (seventh filter), a 60-neighbor Sobel filter (eighth filter), and an 80-neighbor Sobel filter (ninth filter).
[0069] Furthermore, 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 dataset DS, and the data indicating the state S of each predetermined section of the plurality of filter-processed images includes the variation in values of neighboring sections of the predetermined section of the filter-processed images. The "variation in values of neighboring sections" includes the variance or standard deviation of the values of neighboring pixel groups, such as a group of 8 neighboring pixels, a group of 12 neighboring pixels, or a group of 24 neighboring pixels.
[0070] For example, around a feature (such as an edge or corner) of the object W to be used for matching, it is expected that the variation in values of the surrounding sections will change with the feature as the boundary, and therefore the variation in values of the surrounding sections is thought to have a correlation with the composition ratio C for each corresponding section of the multiple filtered images. Therefore, it is desirable to include the variation in values of the surrounding sections for each specified section as data indicating the state S for each specified section of the multiple filtered images.
[0071] Furthermore, since the stronger the response of a predetermined section after threshold processing of the multiple filtered images, the more likely it is that the features of the object W have been successfully extracted, the response of each predetermined section after threshold processing of the multiple filtered images may be included as data indicating the state S of each predetermined section of the multiple filtered images. The "response of each predetermined section" refers to the number of pixels equal to or greater than a threshold in a predetermined pixel group, such as a pixel group of 8 neighbors, a pixel group of 12 neighbors, or a pixel group of 24 neighbors.
[0072] Furthermore, when a prediction model for the combination ratio C is trained using supervised learning, reinforcement learning, or the like, the data indicating the state S of each predetermined section of the multiple filtered images further includes label data L indicating the degree of normality to abnormality of the predetermined section of the filtered image. The label data L is normalized so that the closer the value of the predetermined section of the filtered image is to the value of the corresponding section of the model feature extraction image (target image), the closer the label data L is to 1 (normal state), and the farther the value of the predetermined section of the filtered image is from the value of the corresponding section of the model feature extraction image (target image), the closer the label data L is to 0 (abnormal state). The combination of filtered images can be made closer to the target image by increasing the combination ratio of filtered images closer to the target image. For example, a prediction model that estimates the set label data L is trained, and the combination ratio is determined according to the labels predicted by the prediction model, thereby obtaining a combined image that is closer to the target image.
[0073] FIG. 8 is a schematic diagram showing a method for acquiring label data L. The upper part of FIG. 8 shows the execution procedure for model registration, and the lower part of FIG. 8 shows the execution procedure for label data acquisition. As shown in the upper part of FIG. 8, first, the image accepting unit 36 accepts a model image 61 including an object W of which at least one of the position and orientation is known. At this time, the image accepting unit 36 may apply one or more changes (brightness, enlargement or reduction, shearing, translation, rotation, etc.) to the accepted model image 61 and accept one or more model images 62 with the changes applied. The one or more changes applied to the accepted model image 61 may be one or more changes used during feature matching.
[0074] Next, as part of the model registration process described with reference to FIG. 4 , the feature extraction device 34 (feature extraction unit) filters the model image 62 according to a set of multiple manually set filters F to generate multiple filtered images, and then combines the multiple filtered images according to a manually set blending ratio C to extract one or more model features 63 of the object W from one or more model images 62, thereby generating and outputting one or more model feature extraction images 64 including the model features 63 of the object W. The storage unit 31 stores the output one or more model feature extraction images 64 (target images), thereby registering the model feature extraction images 64. At this time, if manually setting the set of multiple filters F and the blending ratio increases the user's trial and error or the number of steps required, the user may manually specify the model features 63 (edges or corners) from the model image 62 to manually generate the model feature extraction image 64.
[0075] 8, the learning data acquisition unit 51 obtains label data L indicating the degree of normality to abnormality for each predetermined section of the plurality of filter-processed images by subtracting each of the plurality of filter-processed images 71, which are obtained by processing an image of the object W with a plurality of different filters F, from the stored model feature extraction image 64 (target image). Note that the set of filters F and the combination ratio manually set at the time of model registration are set manually through trial and error so that model features 63 are extracted from the model image 62. Even if this is applied as is to an image of the object W during system operation, the features of the object W may not be appropriately extracted depending on changes in the state of the object W or changes in the imaging conditions, and therefore machine learning of the combination ratio C and the set of the plurality of filters F is necessary.
[0076] At this time, the learning data acquisition unit 51 normalizes the label data L so that the closer the value of a specified section after the difference is to 0 (i.e., the closer it is to the value of the corresponding section of the target image), the closer the label data L is to 1 (normal state), and the farther the value of a specified section after the difference is from 0 (i.e., 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).
[0077] Furthermore, when multiple model feature extraction images 64 are stored in the memory unit 31, the learning data acquisition unit 51 subtracts one filter-processed image 71 from each of the multiple model feature extraction images 64, and normalizes the differential image that has the most label data L close to the normal state, and adopts it as the final label data L.
[0078] As described above, the learning data acquiring unit 51 acquires data relating to 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.
[0079] FIG. 9 is a scatter plot showing an example of a training dataset DS for a composite ratio C. The horizontal axis of the scatter plot indicates the type and size of filter F (explanatory variable x1), and the vertical axis indicates the variation in values of neighboring sections of a given section of a filtered image (explanatory variable x2). In this example, explanatory variable x1 includes the 4th nearest Sobel filter (first filter) to the 80th nearest Sobel filter (ninth filter). Furthermore, explanatory variable x2 includes the variation in values of neighboring sections of a given section of multiple filtered images processed with the first to ninth filters (indicated by circles). Furthermore, label data L (the value shown to the right of the circle) indicates the degree of the given section, ranging from a normal state of "1" to an abnormal state of "0."
[0080] 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.
[0081] First, a case where a decision tree model is generated as a learning model LM1 that outputs a combination ratio will be described with reference to Figures 9 and 10. Figure 10 is a schematic diagram showing a decision tree model. As mentioned above, since predicting the combination ratio C is a prediction problem of a continuous value, the combination ratio C (i.e., a regression problem), the decision tree is a so-called regression tree.
[0082] The learning unit 52 generates a regression tree model that outputs a response variable y (y1 to y5 in the example of FIG. 10) that is a synthesis ratio, from an explanatory variable x1 that is the type and size of the filter F and an explanatory variable x2 that is the variation in values of the surrounding sections. The learning unit 52 uses Gini impurity, entropy, etc. to divide the data so that the information gain is maximized (i.e., divides the data so that it is classified most neatly), and generates a regression tree model.
[0083] For example, in the example of the learning dataset DS shown in Figure 9, when the size of the Sobel filter exceeds 28 neighborhoods (the thick solid line indicates the branch line), the label data L approaching the normal state "1" increases (approximately 0.5 or more), so the learning unit 52 automatically sets the threshold t1 of the explanatory variable x1 (type and size of filter F) in the first branch of the decision tree to "28 neighborhoods."
[0084] Next, when the size of the Sobel filter exceeds around 60 (the thick solid line indicates the branch line), the label data L approaching the abnormal state "0" increases (approximately 0.3 or less), so the learning unit 52 automatically sets the threshold t2 of the explanatory variable x1 (type and size of filter F) in the second branch of the decision tree to "around 60."
[0085] Next, when the variation in values of the surrounding sections exceeds 98 (the thick solid line indicates the branch line), the label data L approaching the normal state "1" increases (generally 0.6 or more), so the learning unit 52 automatically sets the threshold t3 of the explanatory variable x2 (variation in values of the surrounding sections) in the third branch of the decision tree to "98."
[0086] Finally, when the variation in values of the surrounding sections falls below 78 (the thick solid line indicates the branch line), the label data L approaching the abnormal state "0" increases (generally below 0.1), so the learning unit 52 automatically sets the threshold t4 of the explanatory variable x2 (variation in values of the surrounding sections) in the fourth branch of the decision tree to "78."
[0087] The target variables y1 to y5 (synthesis ratios) are determined based on the label data L and the appearance probability in the regions divided by the threshold values t1 to t4. For example, in the example of the learning dataset DS shown in FIG. 9, the target variable y1 is approximately 0.89, the target variable y2 is approximately 0.02, the target variable y3 is approximately 0.02, the target variable y4 is approximately 0.05, and the target variable y5 is approximately 0.02. Note that the synthesis ratios (target variables y1 to y5) may be such that the synthesis ratio of a specific filtered image is 1 and the synthesis ratios of other filtered images are 0 depending on the learning dataset DS.
[0088] As described above, the learning unit 52 learns the learning dataset DS to generate a decision tree model as shown in FIG. 10. Also, each time the learning data acquisition unit 51 acquires a new learning dataset DS, the learning unit 52 converts the state of the decision tree model according to the learning using the new learning dataset DS. That is, the threshold value t is further adjusted to optimize the decision tree model. The learning unit 52 outputs the generated learned decision tree model to the outside of the machine learning device 45.
[0089] The synthesis ratio setting unit 44 shown in FIG. 3 sets the synthesis ratio C for each corresponding section of a plurality of filtered images using the learned decision tree model output from the machine learning device 45 (machine learning unit). For example, according to the decision tree model shown in FIG. 10 generated from the learning dataset DS in FIG. 9, when the variation in the values of the peripheral sections of a predetermined section of the filtered image processed by the Sobel filter (t1 < x1 < t2) with a size exceeding around 28 and not exceeding around 60 exceeds 98 (x2 > t3), 0.89 (y1) is output as the synthesis ratio of the Sobel filter in that section. Therefore, the synthesis ratio setting unit 44 automatically sets the synthesis ratio of the Sobel filter in that section to 0.89.
[0090] Furthermore, when the variation in values of neighboring sections of a given section of a filtered image processed with a Sobel filter (x1≦t1) whose size is 28 or less exceeds 78 (x2>t4), 0.05 (y4) is output as the synthesis ratio of the Sobel filter in that section, and the synthesis ratio setting unit 44 automatically sets the synthesis ratio of the Sobel filter in that section to 0.05. Similarly, the synthesis ratio setting unit 44 automatically sets the synthesis ratio using the output trained decision tree model.
[0091] The above decision tree model is a relatively simple model, but since the imaging conditions and state of the object W are limited to a certain extent in industrial applications, learning under conditions tailored to the system can achieve very high performance even with simple feature extraction processing, leading to a significant reduction in processing time. This can ultimately provide an improvement in feature extraction technology, enabling the features of the object W to be extracted stably in a short time.
[0092] Next, referring to FIG. 11, we will explain the case where a neuron (simple perceptron) model is used as the learning model LM1 that outputs the synthesis ratio. FIG. 11 is a schematic diagram showing a neuron model. A neuron outputs one output y for multiple inputs x (inputs x1 to x3 in the example of FIG. 11). Each of the inputs x1, x2, and x3 is multiplied by a weight w (weights w1, w2, and w3 in the example of FIG. 11). A neuron model can be constructed using an arithmetic circuit and a memory circuit that imitate a neuron. The relationship between the input x and the output y can be expressed by the following equation. In the following equation, θ is the bias, and f k is the activation function.
[0093]
number
[0094] In the example of the training dataset DS shown in Figure 9, for example, inputs x1, x2, and x3 are explanatory variables related to at least one of the type and size of the filter F, and output y is a response variable related to the blending ratio. In addition, inputs x4, x5, x6, ... and corresponding weights w4, w5, w6, ... may be added as needed. For example, inputs x4, x5, and x6 are explanatory variables related to the variation in values of the surrounding sections of the filtered image or the response of the filtered image.
[0095] Furthermore, by parallelizing multiple neurons to form a layer and multiplying multiple inputs x1, x2, x3, ... by their respective weights w and inputting them to each neuron, multiple outputs y1, y2, y3, ... related to the synthesis ratio can be obtained.
[0096] The learning unit 52 uses the training dataset DS to adjust the weight w using a training algorithm such as a support vector machine to generate a neuron model. The learning unit 52 also converts the state of the neuron model in response to training using a new training dataset DS. In other words, the weight w is further adjusted to optimize the neuron model. The learning unit 52 outputs the generated trained neuron model to the outside of the machine learning device 45.
[0097] The synthesis ratio setting unit 44 shown in FIG. 3 automatically sets a synthesis ratio C for each corresponding section of a plurality of filtered images using a trained neuron model output from a machine learning device 45 (machine learning unit).
[0098] The above neuron model is a relatively simple model, but since the imaging conditions and state of the object W are limited to a certain extent in industrial applications, by learning under conditions tailored to the system, very high performance can be obtained even with simple feature extraction processing, leading to a significant reduction in processing time. This can ultimately provide an improvement in feature extraction technology, enabling the features of the object W to be extracted stably in a short time.
[0099] Next, referring to Fig. 12, we will explain the case where a neural network combining multiple neurons in multiple layers is used as the learning model LM1 that outputs the synthesis ratio. 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 called hidden layers), and an output layer L4. The neural network in Fig. 12 includes two intermediate layers L2 and L3, but more intermediate layers may be added.
[0100] Each input x1, x2, x3, etc. in the input layer L1 is multiplied by its respective weight w (collectively referred to as weight W1), and the result is input to each of the neurons N11, N12, and N13. The individual outputs of the neurons N11, N12, and N13 are input to the hidden layer L2 as features. In the hidden layer L2, each of the input features is multiplied by its respective weight w (collectively referred to as weight W2), and the result is input to each of the neurons N21, N22, and N23.
[0101] The individual outputs of neurons N21, N22, and N23 are input as features to hidden layer L3. In hidden layer L3, the individual input features are multiplied by their respective weights w (collectively referred to as weights W3), and the results are input to neurons N31, N32, and N33. The individual outputs of neurons N31, N32, and N33 are input as features to output layer L4.
[0102] In the output layer L4, each input feature is multiplied by its respective weight w (collectively referred to as weight W4) and input to each of the neurons N41, N42, and N43. The individual outputs y1, y2, y3, ... of the neurons N41, N42, and N43 are output as the objective variables. A neural network can be constructed by combining arithmetic circuits and memory circuits that mimic neurons.
[0103] A neural network model can be constructed using 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; the middle layer L2 multiplies multiple inputs, which are explanatory variables related to the input feature quantities and the size of filter F, by their respective weights w and outputs one or more feature quantities; the middle layer L3 multiplies one or more inputs, which are explanatory variables related to the input feature quantities and the variation in values of neighboring compartments of a specified compartment of the filtered image or the response of a specified compartment after thresholding the filtered image, by their respective weights w and outputs one or more feature quantities; and the output layer L4 outputs multiple outputs y1, y2, y3, ..., which are objective variables related to the input feature quantities and the composition ratio of a specified compartment of the filtered image.
[0104] Alternatively, the neural network model may be a model using a convolutional neural network (CNN), which may include an input layer that receives a filtered image, one or more convolutional layers that extract features, one or more pooling layers that aggregate information, a fully connected layer, and a softmax layer that outputs a composite ratio for each predetermined region.
[0105] The learning unit 52 uses the learning dataset DS to perform deep learning using a learning algorithm such as backpropagation, adjusts the weights W1 to W4 of the neural network, and generates a neural network model. For example, the learning unit 52 preferably performs backpropagation by comparing the individual outputs y1, y2, y3, ... of the neural network with label data L indicating the degree of normality to abnormality of a specific section. In addition, to prevent overlearning, the learning unit 52 may perform regularization (dropout) as necessary to simplify the neural network model.
[0106] The learning unit 52 also transforms the state of the neural network model in response to learning using the new learning dataset DS. That is, 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.
[0107] The synthesis ratio setting unit 44 shown in FIG. 3 automatically sets a synthesis ratio C for each corresponding section of a plurality of filter-processed images using a trained neural network model output from a machine learning device 45 (machine learning unit).
[0108] The neural network model described above can handle a larger number of explanatory variables (dimensions) that are correlated with the composition ratio of a specified section. Furthermore, when CNN is used, feature quantities that are correlated with the composition ratio of a specified section are automatically extracted from the state S of the filtered image, eliminating the need to design explanatory variables.
[0109] In the case of any of the decision tree, neuron, and neural network models, the learning unit 52 generates a learning model LM1 that outputs a synthesis ratio C for each predetermined section so that the features of an object W extracted from a composite image obtained by synthesizing multiple filtered images based on the synthesis ratio C for each corresponding section approach the model features of an object W extracted from a model image obtained by capturing an object W whose position and / or orientation are known.
[0110] Next, referring to Fig. 13, we will explain the case where a reinforcement learning model is used as the learning model LM1 that outputs the synthesis ratio. Fig. 13 is a schematic diagram showing the configuration of reinforcement learning. The configuration of reinforcement learning consists of a learning subject called an agent and an environment that is the object of control for the agent. When the agent performs some action A, the 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 not the immediate reward R but the total reward R over the future.
[0111] In the example shown in FIG. 13, the agent is the learning unit 52, and the environment is the object detection device 33 (object detection unit). Action A by the agent is the setting of a combination ratio C for each corresponding section of a plurality of filtered images processed with a plurality of different filters F. Furthermore, state S in the environment is the state of a feature-extracted image generated by combining a plurality of filtered images at a combination ratio for each predetermined section. Furthermore, 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 a feature-extracted image in a certain state S with a model feature-extracted image. For example, if at least one of the position and orientation of the object W can be detected, reward R is 100 points, and if neither the position nor the orientation of the object W can be detected, reward R is 0 points. Alternatively, reward R may be a score according to the time it takes to detect at least one of the position and orientation of the object W.
[0112] When the learning unit 52 executes a certain action A (setting of a synthesis ratio for each predetermined section), the state S (state of the feature extraction image) in the object detection device 33 changes, and the learning data 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 an optimal action A (setting of an optimal synthesis ratio for each predetermined section) by trial and error so as to maximize not the immediate reward R but the total reward R over the future.
[0113] Reinforcement learning algorithms include Q-learning, SALSA, and Monte Carlo methods. Below, we will explain Q-learning as an example of reinforcement learning, but it is not limited to this. Q-learning is a method for learning the value Q(S,A) of selecting action A in a certain environmental state S. In other words, in a certain state S, the action A with the highest value Q(S,A) is selected as the optimal action A. However, initially, the correct value Q(S,A) for the combination of state S and action A is completely unknown. Therefore, the agent selects various actions A in a certain state S, and a reward R is given for each action A selected. This allows the agent to learn how to select better actions, i.e., the correct value Q(S,A).
[0114] As a result of the action, we want to maximize the total reward R that can be obtained in the future. Therefore, ultimately, Q(S,A)=E[Σγ t R t ] (the discounted expected value of the reward, where γ is the discount rate, R is the reward, and t is the time) (the expected 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 through exploration). The update formula for such value Q(S,A) can be expressed, for example, as follows:
[0115]
number
[0116] where S t represents the state of the environment at time t, and A t represents the action at time t. Action A t Therefore, the status is S t+1 Changes to R t+1 represents the reward that can be obtained by changing the state. Also, the term with max represents the reward that can be obtained by changing the state S t+1 It is calculated by multiplying the Q value of the action A with the highest Q value known at that time by the discount rate γ. The discount rate γ is a parameter with a range of 0<γ≦1. α is the learning coefficient, which is in the range of 0<α≦1.
[0117] This formula is the attempted action A t As a result, the reward returned was R t+1 Based on this, state S t Action A in t The evaluation value Q(S t ,A t ) is updated. The evaluation value Q(S t ,A t ) than the reward R t+1 + Evaluation value Q(S t+1 ,maxA t+1 ) is larger, then Q(S t ,A t ) is increased, and conversely, if it is small, Q(S t ,A t ) is also small. In other words, the value of an action in a certain state is made closer to the value of the immediate reward that results from that action and the best action in the next state that results from that action.
[0118] There are two ways to represent Q(S,A) on a computer: one is to store the values for all state-action pairs (S,A) as an action-value table, and the other is to prepare a function that approximates Q(S,A). In the latter method, the update formula mentioned above can be realized by adjusting the parameters of the approximation function using techniques such as stochastic gradient descent. The approximation function can be the neural network model mentioned above (so-called deep reinforcement learning).
[0119] Through the above reinforcement learning, the learning unit 52 generates a reinforcement learning model that outputs a combination ratio C for each corresponding section of a plurality of filtered images. The learning unit 52 also transforms the state of the reinforcement learning model in response to learning using a new learning dataset 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.
[0120] The synthesis ratio setting unit 44 shown in FIG. 3 automatically sets a synthesis ratio C for each corresponding section of a plurality of filtered images using a trained reinforcement learning model output from a machine learning device 45 (machine learning unit).
[0121] <Learning model LM2 for a set of a specified number of filters F> Below, we will explain the classification model (learning model LM2) for sets of a specified number of filters F. Classification of sets of a specified number of filters F involves preparing sets of filters F exceeding the specified number in advance, and then group-classifying the optimal sets of the specified number of filters F from these sets. Therefore, unsupervised learning is suitable. Alternatively, reinforcement learning may be performed to select the optimal set of the specified number of filters F from the sets of filters F exceeding the specified number.
[0122] First, referring back to FIG. 13, a case will be described in which a reinforcement learning model is used as the learning model LM2 that outputs a set of a specified number of filters F. In the example shown in FIG. 13, the agent is the learning unit 52, and the environment is the object detection device 33 (object detection unit). Action A by the agent is the selection of a set of a specified number of filters F (i.e., the selection of a specified number of filters F in which at least one of the type and size of the filters F is changed). Furthermore, the state S in the environment is the state of each corresponding section of a plurality of filtered images processed with the selected specified number of filters F. Furthermore, the reward R is a score corresponding to label data L that indicates the degree of normality to abnormality for each predetermined section of a plurality of filtered images in a certain state S.
[0123] When the learning unit 52 executes a certain action A (selection of 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 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 an optimal action A (selection of an optimal set of a specified number of filters F) by trial and error so as to maximize not the immediate reward R but the total reward R over the future.
[0124] Through the above reinforcement learning, the learning unit 52 generates a reinforcement learning model that outputs a set of a specified number of filters F. The learning unit 52 also transforms the state of the reinforcement learning model in response to learning using a new learning dataset 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.
[0125] The filter set setting unit 43 shown in FIG. 3 automatically sets a set of a specified number of filters F using a trained reinforcement learning model output from a machine learning device 45 (machine learning unit).
[0126] Next, with reference to Figs. 14 to 16, a case where an unsupervised learning model is used as the learning model LM2 that outputs a set of a specified number of filters F will be described. As the unsupervised learning model, a clustering model (hierarchical clustering, non-hierarchical clustering, etc.) can be used. The learning data acquisition unit 51 acquires, as a learning dataset DS, data on a plurality of different filters F and data indicating the state S for each predetermined section of a plurality of filtered images.
[0127] The data relating to the plurality of filters F includes data on at least one of the types and sizes of the plurality of filters F exceeding a specified number. Furthermore, the data indicating the state S for each predetermined section of the plurality of filtered images is the response of each predetermined section after threshold processing of the plurality of filtered images, but in other embodiments, it may be the variation in values of surrounding sections for each predetermined section.
[0128] FIG. 14 is a schematic diagram showing the response for each predetermined section of a plurality of filtered images. FIG. 14 shows the response 81 for each predetermined section 80 after threshold processing of the first through n-th filtered images, which are processed with first through n-th filters F (n is an integer) exceeding the specified number. The response 81 for each predetermined section 80 refers to the number of pixels equal to or greater than a threshold in a predetermined pixel group, such as a pixel group of 8 neighbors, a pixel group of 24 neighbors, or a pixel group of 48 neighbors. The stronger the response 81 for each predetermined section 80 after threshold processing of the first through n-th filtered images, the more likely it is that the features of the object W have been successfully extracted. Therefore, the learning unit 52 generates a learning model LM2 that classifies a set of the specified number of filters F so as to maximize the response for each section 80 among the first through n-th filtered images.
[0129] For example, consider the case where the specified number is three and the first to sixth filter processed images are generated by processing six filters (n=6) exceeding the specified number, i.e., the first filter is a small-sized Prewitt filter, the second filter is a medium-sized Prewitt filter, the third filter is a large-sized Prewitt filter, the fourth filter is a small-sized Laplacian filter, the fifth filter is a medium-sized Laplacian filter, and the sixth filter is a large-sized Laplacian filter.
[0130] Fig. 15 is a table showing an example of a training data set for a set of a specified number of filters F. Fig. 15 shows the responses (number of pixels above the threshold) in the first to ninth sections after threshold processing of the first to sixth filtered images, which are processed with the first to sixth filters, respectively. In addition, the data showing the maximum response in each section is highlighted in bold and underlined.
[0131] In unsupervised learning, first, the first to sixth filters are classified into groups based on the data showing the response of each section. First, the learning unit 52 calculates the distance D between the data of the filters as a classification criterion. For example, the Euclidean distance of the following formula can be used for the distance D. Note that, F a, F b are any two filters, and F ai , F bi is the data of each filter, i is the partition number, and n is the number of partitions.
[0132]
number
[0133] In the example of the training dataset DS shown in FIG. 15, the distance D between the data of the first filter and the second filter is approximately 18. Similarly, the learning unit 52 calculates the distance D between the data of any two filters in a brute-force manner. Next, the learning unit 52 classifies the filters whose data distance D is closest into cluster CL1, classifies the filters whose data distance D is next closest into cluster CL2, and so on. When merging clusters, the single linkage method, group average method, Ward's method, center of gravity method, median method, etc. can be used.
[0134] FIG. 16 is a tree diagram showing a model of unsupervised learning (hierarchical clustering). Variables A1 to A3 represent the first to third filters, and variables B1 to B3 represent the fourth to sixth filters. The learning unit 52 classifies variables A3 and B3, which have the closest distance D between their data, into cluster CL1, and then classifies variables A1 and B1, which are the next closest, into cluster CL2, and so on, repeating this process to generate a hierarchical clustering model. In this example, since the specified number (i.e., the number of groups) is three, the learning unit 52 may end the group classification after classifying up to three clusters: cluster CL2 (first filter, fourth filter), cluster CL3 (second filter, third filter, sixth filter), and variable B2 (fifth filter).
[0135] Next, the learning unit 52 generates a hierarchical clustering model so as to output a set of three filters that have the largest number of sections with the highest response from each of the three clusters. In the example of Fig. 15, the fourth filter, the third filter, and the fifth filter that have the largest number of sections with the highest response from each of the three clusters are output.
[0136] In another embodiment, the learning unit 52 may generate a non-hierarchical clustering model instead of a hierarchical clustering model. As the non-hierarchical clustering model, a k-means method, a k-means++ method, or the like can be used.
[0137] Through the above unsupervised learning, 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 dataset DS, the learning unit 52 converts the state of the unsupervised learning model in accordance with learning using the new learning dataset DS. In other words, the clusters are further adjusted to optimize the unsupervised learning model. The learning unit 52 outputs the generated trained unsupervised learning model to the outside of the machine learning device 45.
[0138] The filter set setting unit 43 shown in Fig. 3 uses a trained unsupervised learning model output from the machine learning device 45 (machine learning unit) to set a set of a specified number of filters F. For example, according to the hierarchical clustering model shown in Fig. 16 generated using the training dataset DS of Fig. 15, the filter set setting unit 43 automatically sets a fourth filter, a third filter, and a fifth filter as an optimal set of the specified number of three filters F.
[0139] In the above embodiments, various types of machine learning have been described. Below, an execution procedure of the machine learning method will be summarized. Fig. 17 is a flowchart showing the execution procedure of the machine learning method. First, in step S30, the image receiving unit 36 receives an adjusted image obtained by capturing an image of an object W. The adjusted image may be a model image obtained by capturing an object W whose position and / or orientation are known, or may be an image obtained by capturing an object W whose position and / or orientation are unknown.
[0140] In step S31, the feature extraction device 34 (feature extraction unit) generates a plurality of filter-processed images by processing the received adjusted image with a plurality of different filters F. In step S32, the learning data acquisition unit 51 acquires data on the plurality of different filters F and data indicating the state S of each predetermined section of the plurality of filter-processed images as a learning dataset DS.
[0141] The data on the multiple filters F includes at least one of the types and sizes of the multiple filters F. Furthermore, the data indicating the state S for each predetermined section of the multiple filtered images may be data indicating the variation in values of neighboring sections of the predetermined section of the filtered images, or data indicating the response of each predetermined section after threshold processing of the multiple filtered images. When supervised learning or reinforcement learning is performed, the data indicating the state S for each predetermined section will further include label data L indicating the degree of normality to abnormality of the predetermined section of the filtered images, or the result of detecting at least one of the position and orientation of the target W by feature matching (i.e., reward R).
[0142] In step S33, the learning unit 52 generates a learning model LM that outputs a synthesis parameter P for synthesizing a plurality of filter-processed 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 filter-processed images, and a learning model LM2 that outputs a set of a specified number of filters F. In other words, the synthesis parameter P output by the learning model LM1 is the 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.
[0143] By repeating steps S30 to S33, the learning unit 52 converts the state of the learning model LM in accordance with learning based on the new learning dataset DS. In other words, the learning model LM is optimized. As a post-processing step of step S33, the learning unit 52 may determine whether the learning model LM has converged, and output the generated trained learning model LM to the outside of the machine learning device 45.
[0144] As described above, by having the machine learning device 45 use machine learning to generate and externally output a learning model LM that outputs synthesis parameters for synthesizing multiple filter-processed images, even when, for example, the object W includes both fine features such as characters and coarse features such as rounded corners, or when imaging conditions such as the illuminance of the reference light and exposure time change, the feature extraction device 34 can use the output, trained learning model LM to set optimal synthesis parameters and synthesize multiple filter-processed images, thereby providing an improvement in feature extraction technology that can quickly and stably extract features of the object W that are optimal for feature matching.Furthermore, by having the feature extraction device 34 generate and output an optimal feature-extracted image, the feature matching device 35 can quickly and stably detect at least one of the position and orientation of the object W using the output optimal feature-extracted image, providing an improvement in feature matching technology.
[0145] An example of a UI for setting the synthesis parameters P will be described below. FIG. 18 is a schematic diagram showing a UI90 for setting the synthesis parameters P. As described above, the synthesis parameters P include a set of a specified number of filters F, a synthesis ratio C for each predetermined section, and the like. Because 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, it is desirable to automatically adjust the synthesis parameters P using machine learning. However, the user may also manually adjust the synthesis parameters P using the UI90.
[0146] The UI 90 for setting the synthesis parameters is displayed, for example, on the display of the teaching device 4 shown in Fig. 1. The UI 90 includes a segment number designation unit 91 for designating the number of segments into which a plurality of filtered images are synthesized according to separate synthesis ratios C, a filter set designation unit 92 for designating a set of a designated number of filters F (in this example, three filters, a first filter F1 to a third filter F3), a synthesis ratio designation unit 93 for designating the synthesis ratio C for each predetermined segment, and a threshold designation unit 94 for designating a threshold for feature extraction.
[0147] First, the user sets the number of segments into which multiple filtered images will be combined according to different combination ratios C in segment number designation unit 91. For example, if one segment is one pixel, the user can simply designate the number of pixels in the filtered image in segment number designation unit 91. In this example, the number of segments is manually set to nine, so the filtered image is divided into nine rectangular regions of equal area.
[0148] Next, the user uses the filter set designation unit 92 to designate the number of filters F, the type of filters F, the size of filters F, and activation of filters F. In this example, the number of filters F is manually set to three, the type and size of filters F are manually set to a Sobel filter (first filter F1) with 36 neighborhoods, a Sobel filter (second filter F2) with 28 neighborhoods, and a Laplacian filter (third filter F3) with 60 neighborhoods, and these first filter F1 to third filter F3 are activated.
[0149] Furthermore, the user specifies a combination ratio C of the multiple filtered images for each section in a combination ratio specification unit 93. In this example, the combination ratio C of the first filter F1 to the third filter F3 is manually set for each section. In addition, the user specifies a threshold value for extracting the features of the object W from a composite image obtained by combining multiple filtered images, or a threshold value for extracting the features of the object W from multiple filtered images in a threshold value specification unit 94. In this example, the threshold value is manually set to 125 or more.
[0150] When the above synthesis parameters are automatically set using machine learning, it is desirable that the UI 90 reflect the automatically set synthesis parameters, etc. on the UI 90. With such a UI 90, synthesis parameters can be manually set depending on the situation, and the status of the automatically set synthesis parameters can be visually confirmed.
[0151] The above-mentioned program or software may be provided by being recorded on a computer-readable non-transitory recording medium, such as a CD-ROM, or may be provided by being distributed via wired or wireless connection from a server or cloud on a WAN (wide area network) or LAN (local area network).
[0152] While various embodiments have been described herein, it should be recognized that the present invention is not limited to the above-described embodiments, but rather can be modified in various ways within the scope of the following claims. [Explanation of symbols]
[0153] 1 Mechanical Systems 2 machines 3. Control device 4 Teaching device 5. Visual Sensor 21 Mechanism 22 End Effector 23 Actuator 31 Storage section 32 Control Unit 33 Object detection unit (object detection device) 34 Feature extraction unit (feature extraction device) 35 Feature matching unit 36 Image Reception Department 41 Multiple filter processing unit 42 Feature extraction image generation unit 42a Image synthesis unit 42b Threshold processing section 43 Filter set setting section 44 Composite ratio setting section 45 Machine Learning Department (Machine Learning Device) 51 Learning data acquisition unit 52 Learning Department 61 Model Images 62 One or more model images with changes 63 Model Features 64 model feature extraction images 70 Features 71 Filtered Images 80 plots 81 responses A action C. Synthesis ratio C1 Reference Coordinate System C2 Tool coordinate system C3 work coordinate system D distance DS dataset F, F1, F2, F3 filters J1~J6 axis L Label Data LM, LM1, LM2 learning models P synthesis parameter R Reward S state W Object
Claims
1. a learning data acquisition unit that acquires, as a learning data set, data relating to a plurality of different filters that are applied to images of an object, and data indicating the state of each predetermined section of a plurality of filtered images that have been processed with the plurality of filters; a learning unit that generates a learning model that outputs synthesis parameters for synthesizing the plurality of filtered images for each of the corresponding sections using the learning data set; A machine learning device comprising:
2. The machine learning device according to claim 1 , wherein the learning model includes at least one of a first learning model that outputs a synthesis ratio for each corresponding section of the plurality of filter-processed images, and a second learning model that outputs a set of a specified number of filters.
3. The machine learning device according to claim 1 , wherein the data on the plurality of filters includes data on at least one of the types and sizes of the plurality of filters.
4. The machine learning device according to any one of claims 1 to 3, wherein the data indicating the state of each of the specified sections of the plurality of filtered images includes data indicating the variation in values of sections surrounding the specified section, or data indicating the response of each of the specified sections after threshold processing of the plurality of filtered images.
5. The machine learning device according to any one of claims 1 to 4, wherein the data indicating the state of each of the predetermined sections of the plurality of filtered images includes label data indicating the degree of normality to abnormality for each of the predetermined sections.
6. The machine learning device according to any one of claims 1 to 5, wherein the learning unit converts the state of the learning model so that features of the object extracted from a composite image obtained by combining the plurality of filtered images based on a synthesis ratio for each of the corresponding sections approach model features of the object extracted from a model image capturing the object, at least one of a position and a posture of which is known.
7. 7. The machine learning device according to claim 1, wherein the learning data acquisition unit obtains label data indicating a degree of normality to abnormality for each of the predetermined sections of the plurality of filtered images by subtracting the filtered images from a model feature extraction image extracted from a model image capturing the object, the position and / or orientation of which are known.
8. The machine learning device according to any one of claims 1 to 7, wherein the learning data acquisition unit acquires label data indicating a degree of normality to abnormality for each of the predetermined sections of the plurality of filtered images, using one or more model feature extraction images extracted from a model image obtained by capturing an image of the object, at least one of whose position and orientation is known, when one or more changes are made to the model image.
9. 9. The machine learning device according to claim 8, wherein the one or more changes applied to the model image include one or more changes used when matching features of the object extracted from an image capturing the object with model features of the object extracted from the model image.
10. The machine learning device according to any one of claims 1 to 9, wherein the learning unit generates the learning model using a result of detecting at least one of the position and posture of the object by comparing features of the object extracted from an image of the object with model features extracted from a model image of the object, the at least one of the position and posture of which is known.
11. The machine learning device according to any one of claims 1 to 10, wherein the data indicating the state of each of the predetermined sections of the plurality of filtered images includes data indicating the response of each of the predetermined sections after threshold processing of the plurality of filtered images processed with more than a specified number of the plurality of filters.
12. 12. The machine learning device according to claim 1, wherein the learning unit generates the learning model that outputs a set of a specified number of filters using a model image obtained by capturing the object, the position and / or orientation of which are known.
13. 13. The machine learning device according to claim 1, wherein the learning unit generates the learning model that outputs a set of a specified number of filters so that a response for each of the specified sections after threshold processing of the plurality of filtered images processed with more than a specified number of the plurality of filters is maximized for each of the specified sections.
14. A feature extraction device that extracts features of an object from an image of the object, a multiple filter processing unit that processes the image of the object with a plurality of different filters to generate a plurality of filter-processed images; a feature extraction image generation unit that generates and outputs a feature extraction image of the object by combining the plurality of filter-processed images based on a combination ratio for each corresponding section of the plurality of filter-processed images; a segment number designation unit that designates the number of segments into which the plurality of filtered images are to be combined according to different combination ratios; a filter set designation unit that designates a set of a designated number of the filters; a synthesis ratio designation unit that designates the synthesis ratio for each predetermined section; a threshold value specifying unit that specifies a threshold value for extracting features of an object from a composite image obtained by combining a plurality of filtered images, or a threshold value for extracting features of an object from a plurality of filtered images; A feature extraction device comprising:
15. A control device that controls an operation of a machine based on at least one of a position and an attitude of an object detected from an image of the object, a feature extraction unit that processes the image of the object using a plurality of different filters to generate a plurality of filtered images, combines the plurality of filtered images based on a combination ratio for each corresponding section of the plurality of filtered images, and extracts features of the object; a segment number designation unit that designates the number of segments into which the plurality of filtered images are to be combined according to different combination ratios; a filter set designation unit that designates a set of a designated number of the filters; a synthesis ratio designation unit that designates the synthesis ratio for each predetermined section; a threshold value specifying unit that specifies a threshold value for extracting features of an object from a composite image obtained by combining a plurality of filtered images, or a threshold value for extracting features of an object from a plurality of filtered images; a feature matching unit that matches the extracted features of the object with model features extracted from a model image obtained by capturing an image of the object, at least one of which is known, to detect at least one of the position and the orientation of the object, at least one of which is unknown; a control unit that controls an operation of the machine based on at least one of the position and the posture of the detected object; A control device comprising:
Citation Information
Patent Citations
Image processing unit and picture processing program
JP2005079856A
Method, device, and program for weighting, and method, device, and program for extracting feature image
JP2011150659A
Robot system, robot control device, robot control method and robot control program
JP2015145050A
Image processing system, evaluation model construction method, image processing method, and program
JP2018206252A
Information processor, robot system, information processing method and program
JP2019211903A