System and method for finding and classifying pattern in image with vision system

By combining a neural network classifier with a pattern detection tool, the system enhances the accuracy and reliability of pattern detection in manufacturing environments, effectively addressing the challenge of distinguishing between subtly different patterns.

JP2025085016AInactive Publication Date: 2025-06-03COGNEX CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2025036767
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2019-01-16
Filing Date
2025-03-07
Publication Date
2025-06-03
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Conventional pattern detection tools struggle to accurately distinguish between trained patterns with subtle differences, leading to potential misidentification in manufacturing environments.

Method used

The integration of a neural network classifier with a pattern detection tool, allowing for sub-pixel accurate labeling of detected patterns and improved performance by focusing on a subset of trained templates or reconstructing images to enhance pattern recognition.

Benefits of technology

This approach significantly enhances the accuracy and reliability of pattern detection, reducing computational effort and improving the robustness of pattern recognition, especially in cases of distorted or unclear shapes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025085016000001_ABST
    Figure 2025085016000001_ABST
Patent Text Reader

Abstract

To find patterns in images that incorporate neural net classifiers.SOLUTION: In a vision system configuration 100, a pattern finding tool is coupled with a neural net processor that can be run before or after the tool to have labeled pattern results with sub-pixel accuracy. In the case of a pattern finding tool that can detect multiple templates, its performance is improved when the processor informs the pattern finding tool to work only on a subset of originally trained templates. In the case of a pattern finding tool that initially detects a pattern, the processor can then determine whether it has found a correct pattern. The neural network can also reconstruct / clean-up an imaged shape, and / or to eliminate pixels less relevant to the shape of interest, therefore reducing the search time, as well significantly increasing the chance of lock on the correct shapes.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to machine vision systems and methods, and more particularly to pattern search and recognition tools.

Background Art

[0002] A machine vision system, also referred to herein as a "vision system", is used to perform various tasks in a manufacturing environment. Generally, a vision system consists of one or more cameras equipped with an image sensor (or "imager") that acquires a grayscale or color image of a scene that includes an object being manufactured. The image of the object can be analyzed to provide data / information to the user and related manufacturing processes. The data generated by the image is typically analyzed and processed by one or more vision system processors in the vision system, and these vision system processors can be either dedicatedly constructed or part of one or more software applications instantiated within a general-purpose computer (e.g., a PC, laptop, tablet, or smartphone).

[0003] Common vision system tasks include alignment and inspection. In an alignment task, vision system tools such as the well-known PatMax(R) system commercially available from Cognex Corporation of Natick, Massachusetts, compare features in an image of a scene to a trained pattern (using an actual model or a synthetic model) to determine the presence and pose of the pattern in the imaged scene. This information can be used to search for defects or perform other operations such as parts rejection in subsequent inspection (or other) operations.

[0004] It is desirable to improve the performance of conventional pattern detection tools that can include a predetermined list of searchable patterns (e.g., images of circles, squares, screw images, etc.). Such tools may sometimes fail to properly distinguish between certain trained patterns with subtle differences (e.g., a circle and a circle with a small notch). SUMMARY OF THE INVENTION

[0005] The present invention overcomes this drawback of the prior art by providing a system and method for detecting patterns in an image that incorporates a neural network (also referred to as a "neural net") classifier (sometimes referred to as an "analyzer"). The pattern detection tool is coupled with a classifier that can be executed before or after the tool to have pattern detection results labeled with sub-pixel accuracy. In the case of a pattern detection tool that can detect multiple templates, the performance of the neural net classifier is improved when it is notified to work only with a subset of the templates that were initially trained. Alternatively, the performance of the pattern detection tool can be improved by using a neural network to reconstruct / remove the image before executing the pattern detection tool. Additionally, a neural network can be used to calculate a weighting value for each pixel in the image based on the likelihood that the pixel belongs to the pattern. Similarly, in the case of a tool that first detects a pattern, the neural net classifier can determine whether the tool has found the correct pattern.

[0006] In an exemplary embodiment, a system and method for detecting patterns in an image includes a pattern detection tool trained based on one or more templates associated with one or more training images that include a pattern of interest. A neural network classifier is trained with the one or more training images, and at runtime a template matching process operates such that (a) the trained neural network classifier provides one or more templates based on the runtime image to the pattern detection tool, and the trained pattern detection tool performs pattern matching based on the one or more template images combined with the runtime image, or (b) the trained pattern detection tool provides the pattern detected from the runtime image to the trained neural network classifier, and the trained neural network classifier performs pattern matching based on the detected pattern and the runtime image. The pattern detection tool is adapted to be trained using multiple templates or a single template. The neural network includes a convolutional neural network (CNN).

[0007] In another embodiment, a system and method for detecting patterns in an image are provided, including a neural network trained to identify one or more candidate shapes in the image and configured to identify the probability that one or more shapes are present in the image during runtime operation. Thereby, the neural network (a) generates a weighted mask having the features of one or more candidate shapes that exceed a probability threshold, and / or (b) generates a reconstructed image in which the features of the model of one or more candidate shapes are replaced with an image in which the neural network analyzer identifies the presence of the features of one or more candidate shapes that exceed the probability threshold. Exemplarily, the pattern detection tool is trained to detect one or more candidate shapes in (a) the weighted mask and / or (b) the reconstructed image using one or more models associated with the one or more candidate shapes. The neural network defines a weighted mask in which each pixel has a score related to the identification of one or more shapes. The reconstructed image can be defined as a binary image. Exemplarily, the neural network analyzer provides data regarding the presence of one or more types of candidate shapes to the pattern detection tool, and the pattern detection tool restricts the process to a process related to identifying the type. Generally, the neural network may include a convolutional neural network (CNN).

[0008] The present invention will be described below with reference to the accompanying drawings.

Brief Description of the Drawings

[0009]

Figure 1

[0010]

Figure 2

[0011]

Figure 3

[0012]

Figure 4

[0013]

Figure 5

[0014]

Figure 6

[0015]

Figure 7

[0016]

Figure 8

[0017]

Figure 9

[0018]

Figure 10

[0019]

Figure 11

[0020]

Figure 12

[0021] I. Overview of the System

[0022] FIG. 1 shows a generalized vision system configuration 100 for use by an exemplary system and method. The vision system can be implemented in any acceptable environment, including part / surface inspection, robot control, part alignment, etc. This system includes at least one vision system camera assembly 110 having an optical system O and an image sensor (also referred to as a "sensor" or "imager") S, and may also include on-board lighting or separate lighting (not shown). The camera assembly images a scene 120 that may include one or more stationary or moving objects 130. In this example, the objects include a contour shape and various internal shapes 132, 134, 136, and 138 that are geometrically regular or irregular. More generally, the pattern may be any geometric shape or any 2D image of an object.

[0023] The camera assembly 110 and associated sensor S are interconnected with a vision system processor 140, which can be placed fully or partially within the camera assembly 110 or in a separate processing device such as a server, PC, laptop, tablet, or smartphone (computer 160). The computing device may include appropriate user interfaces such as a display / touch screen 162, keyboard 164, and mouse 166.

[0024] Exemplarily, the vision system process (processor) 140 operates various vision system tools and associated software / firmware to process and analyze images of the object 130 acquired and / or saved at runtime. The process (processor) 140 can function according to specific parameters and be trained to recognize specific shapes detected in the object using training procedures. The process (processor) 140 includes various vision system components, including the above-mentioned PatMax(R) software package and its variations, such as the pattern detection tool 142 found in PatMax(R) multi-model. The pattern detection tool can use trained patterns or patterns of standard shapes (such as squares, circles, etc.), which are included in the training template. As described below, the vision system process (processor) also includes or is associated with a neural network process (processor) 150. The neural network process (processor) (also referred to as "neural net") operates on various patterns in the form of a classifier to enhance the pattern detection speed and performance of the system 100.

[0025] The results of the pattern detection can be transmitted via the computer interface 162 to the user and / or other downstream utilization devices or processes (processors) 180, such as an assembly robot controller, in-line inspection, part inspection / rejection, quality control, etc.

[0026] Conventional approaches to pattern matching are recognized to involve training a conventional pattern matching tool, such as PatMax(R) or PatMax(R) multi-model, using a model image having a shape or feature of interest. At run time, the pattern matching tool executes through one or more (and in some cases all) of the trained templates in an effort to identify an exact match with the trained pattern in the acquired image of the object being inspected.

[0027] On the other hand, the present embodiment provides a smart pattern detection tool that utilizes a neural network process to enhance a conventional pattern detection tool, thereby providing the pattern detection tool with the ability to automatically label the patterns detected in the tool results, or the ability to reliably detect patterns using a related neural network classifier. With this approach, it becomes possible to train the smart pattern detection tool in a database of images including templates. After training, at run time, the smart pattern detection tool combines the best features of a conventional pattern detector with a neural network classifier to provide a correctly labeled pattern detection result with high-precision pose (position, scale, rotation, etc.).

[0028] II. Pattern Detection with Narrowed Search Using a Neural Network

[0029] Referring to FIG. 2, this shows a block diagram representing the pre-run training procedure 200. Tool 210 includes a conventional pattern detection tool 220 and a related neural network classifier that assists the pattern detection tool in detecting the correct pattern from among a set / plurality of trained patterns (templates) 240.

[0030] More specifically, during training, a conventional pattern detection tool 220 (e.g., PatMax(R) multi-model) is trained with one or more template images. At the same time, a neural network classifier (e.g., a convolutional neural network (CNN)) 230 is trained with a plurality of exemplary images of the patterns represented by each template. The neural network classifier 230 is trained to process an input image and report a subset of the template labels detected within the input image.

[0031] FIG. 3 shows a runtime procedure 300 (using pre-classification), where the trained neural network classifier 310 is first executed with a runtime input image 320 (acquired by camera 110 and / or saved from a previous acquisition) to determine the probability of each template. The smart pattern detection tool filters out the best results and then notifies the trained pattern detection tool 350 to work with a subset of these M matching templates instead of the full set of N templates (240 in FIG. 2). Thus, a subset of the M best-matching templates 340 is provided to the trained pattern detection tool 350 as search parameters. The input image 320 is provided to the pattern detection tool 350, and the search parameters are used to generate matching template results 360 as the output of the tool 350. These results can be displayed to the user or used in downstream utilization operations (e.g., component alignment, inspection, etc.). Advantageously, this process 300 reduces the computational effort typically required to generate the matching templates.

[0032] According to embodiments of the present specification, various proprietary and commercially available (e.g., open source) neural network architectures and related classifiers can be used. For example, TensorFlow, Microsoft CNTK, etc.

[0033] An application example where the above-described training-time procedure 200 and execution-time procedure 300 can be used is to detect the correct reference when it can vary depending on parts with different reference shapes (such as a cross, a rhombus, etc.). Exemplarily, a conventional pattern detection tool is trained with template images representing each possible reference pattern. Further, a neural network classifier (e.g., TensorFlow) is trained with a plurality of images showing variations from the appearance of each reference pattern, along with the labels associated with each reference pattern. At execution time, first, the pre-trained neural network classifier is executed to return a set of labels detected in the execution-time image. Using this information, the system notifies a pattern detection tool (e.g., PatMax(R) multi-model) to execute only with a set of templates represented by the labels generated by the neural network classifier, thereby accelerating alignment and producing more reliable results.

[0034] In the configuration shown in FIG. 4, a conventional pattern detection tool detects a specific pattern, and a neural network classifier determines whether it is a correct matching (i.e., post-classification). At training time, the conventional pattern detection tool 410 is trained using a single image template 440. Next, a neural network classifier (e.g., TensorFlow) 430 associated with the tool 410 is trained with a plurality of images for the desired template. The input to the classifier 430 is the same image as that input to the conventional pattern detection tool 440.

[0035] FIG. 5 shows an execution-time procedure 500 (using post-classification), where a pattern in the input image 520 is first detected by a pattern detection tool 550. The input image 520 is provided to a trained neural network classifier 510 along with an optional bounding box calculated from the output of a conventional pattern detection tool (e.g., PatMax(R)). Next, the classifier 510 determines whether the conventional pattern detection has detected a correct / matching pattern 560. The output 510 of the classifier is the overall reliability that the trained template has been detected.

[0036] As an example, the operational use case involves very confusing shapes with slight differences, such as a circle and a circle with a notch. Assume that a conventional pattern detection tool (e.g., PatMax(R)) 350 is trained with a template image representing a circle with a notch. Next, the neural net classifier 510 is trained with images including the desired shape (circle with a notch) along with other confusing shapes (circle without a notch). At runtime, the input image is supplied to the trained neural net classifier 510 along with an optional bounding box calculated from the output of the conventional pattern detection tool, and then the classifier determines whether the conventional pattern detection detected the correct pattern (circle with a notch). By this procedure, the robustness of pattern detection is improved in this exemplary case.

[0037] Note that the conventional pattern detection tool and its ability to be trained with one or more templates are highly variable in alternative embodiments. The pre-classification and post-classification procedures described above can be modified to include different types of pattern detection tools and associated templates in alternative embodiments, respectively.

[0038] III. Pattern Detection Narrowing the Search Using a Trained Pattern Tool

[0039] Referring to FIG. 6, an overall (generalized) procedure 600 for smart pattern detection according to another exemplary embodiment that can be implemented by the configuration 100 of FIG. 1 is shown. Some patterns may prove to be more difficult to identify using conventional trained pattern detection tools that operate on the acquired images. In some cases, the unique characteristics of neural network / deep learning architectures can provide advantages when initially identifying pattern candidates within an image. Thus, in procedure 600, a neural network is trained to identify various pattern types and applied to the image acquired in step 610, thereby generating a list of candidates having scores associated with a given type of shape. Next, procedure 600 applies a conventional pattern detection tool (e.g., PatMax(R) multimodel) to the shape candidates having scores exceeding a specific threshold, based on the scores (step 620). The pattern detection tool can search for the specific shapes identified by the neural network or for various types of shapes in each candidate.

[0040] Advantageously, the neural network can efficiently identify possible candidates, while computationally difficult tasks such as subpixel-level model fitting can be processed in a robust manner by the pattern detection tool.

[0041] The training for a neural network to recognize a specific shape is described in step 710 of procedure 700 in FIG. 7. Once trained, at runtime (step 720), the neural network uses the trained configuration to assign a score (probability) to each pixel of the acquired image based on whether the acquired image appears to be part of the trained shape. The result (step 730) is a probability image where each pixel in the image has been assigned a score. The probability image from step 730 can be saved and then provided (e.g., as a mask) to a pattern detection tool. In the pattern detection tool, pixels that do not appear to have a candidate shape are masked out of the image result on which the pattern detection tool operates (step 740). The result of the neural network may include the type of candidate shape within the probability image. With the shape type information, the pattern detection tool can narrow the search in the probability image (at the selected location) to only the shape types provided by the result (step 750). Therefore, the pattern detection tool can operate more quickly and efficiently as it avoids executing tools that are not relevant to the candidate shape.

[0042] The above-described procedure 600 is advantageous in various applications. For example, using a neural network to first screen an image is useful when there is a large amount of local distortion. This is because the neural network essentially reconstructs the image based on probability in a way that is easier to analyze by pattern detection. As an example, the incoming image may be highly textured and lack defined contrast lines. After being processed by the neural network, the resulting probability image is a binary representation with well-defined boundaries of high contrast representing rectangles, triangles, circles, etc. In a specific example, the neural network can effectively resolve the shape at the end of a rope or cable that may fray (creating a very textured area). The neural network provides the pattern detection tool with a bright rectangle on a dark background, or vice versa.

[0043] As described in step 800 of FIG. 3, at runtime, the trained (trained using a model-based template for the shape of interest) pattern detection tool receives from the neural network a probability image (mask) and information (optionally) regarding the type of candidate shape identified within the image (step 810). The pattern detection tool focuses on the selected region on the image and operates using tools and processes associated with the identified image type (step 820). Next, the pattern detection tool generates a result of the detected shape being placed within the image, and appropriate coordinate (and other) data regarding the shape is output for subsequent operations at step 830.

[0044] Further, referring to FIG. 9, a block diagram of an exemplary procedure 900 for creating and using a weighted mask in relation to a shape of interest within an acquired image is shown. As shown therein, an image 910 is input into a neural network 920. Using appropriately trained techniques, the neural network 920 outputs a weighted mask for the shape of interest 930. As described above, each pixel is scored based on the likelihood of being part of the shape of interest. Next, the weighted mask 930, together with the raw image data 910, is input into a pattern detection (template matching) tool (e.g., Cognex SearchMax(R), PatMax(R), etc.). Thereby, the tool 940 outputs the position of the shape of interest within the image 950 and additional matching score information 960 that can be based on the data contained in the weighted mask 930.

[0045] Procedure 900 is illustrated in the schematic diagram 1000 of FIG. 10. The exemplary shape of interest 1010 is shown as a U-shaped structure with a continuous boundary. However, the associated acquired image 1012 provides a broken boundary 1014 and intervening shapes 1016. Further, the image shape of interest 1012 is rotated at an angle with respect to the orientation of the shape 1010 expected within the scene. There may also be differences based on other distortions between the acquired image and the expected shape. As described herein, the shape data of interest 1010 and the image data 1012 are input into a neural network 1020. The resulting output weighted mask 1030 of the image is represented as a series of shape segments 1040 that approximate the underlying shape of interest and omit the intervening shape data 1016. As shown here, the segments 1040 encompass a range of surrounding pixels with higher probability / likelihood. This region approximates the general contour of the edge of the shape of interest. This representation 1040 is more easily matched by a conventionally model-trained pattern detection (template matching) tool.

[0046] In another exemplary embodiment, a neural network can be used to reconstruct and / or remove a shape of interest in an image. As shown in procedure 1100 of FIG. 11, neural network 1120 receives the acquired image data 1110 and outputs a reconstruction of the shape of interest 1130 using training, where each pixel is scored by the likelihood that the pixel belongs to the shape of interest (i.e., the target of the neural network training). Next, this reconstruction is input into a model-based pattern detection (template matching) tool 1140 that includes a template of the shape of interest. The tool outputs a rough location of the shape of interest 1150. This rough location can be used by downstream processes if applicable, and / or can optionally be input again into a pattern detection tool 1160 (the same tool as block 1140 or a different tool) that has been re-trained with the model. The raw image data 1110 is also provided to the pattern detection tool 1160. The output of tool 1160 from inputs 1110 and 1150 is the refined location 1170 of the shape of interest within image 1110.

[0047] As an example of procedure 1100, schematic diagram 1200 of FIG. 12 shows two input shapes 1210 and 1212 within an image. Each shape receives neural network reconstructions 1220 and 1222 as described above. Thereby, reconstructed shapes 1230 and 1232 are generated for use in the acquired image data. As a result, the reconstruction can replace existing distorted or unclear shapes. Thus, the use of a neural network can effectively provide for the removal and / or reconstruction of incomplete or distorted shapes within image data, and such data can be more effectively used by downstream operations. This downstream operation includes pattern detection using the pattern detection tool described above or another suitable tool. As shown here, the shape can be represented as a binary image with a well-defined boundary that conforms to the boundary of the expected shape / model shape.

[0048] IV. Conclusion

[0049] It will be apparent that the above-described system and method provide a more reliable and faster technique for the detection and matching of patterns trained using a combination of conventional pattern matching applications and neural network classifiers. This approach reduces the number of templates or enables filtering of the detected patterns, resulting in enhanced determination of the system and method for correct matching. Further, the above system and method not only use the neural network as a reconstruction / removal tool for the imaged shape and / or exclude pixels that are not highly relevant to the shape of interest, thereby significantly reducing the search time, but also effectively enables a significant increase in the possibility of locking onto the correct shape. This technique is particularly effective when the shape within the image is distorted or when shape features are missing.

[0050] The above has described in detail exemplary embodiments of the present invention. Various modifications and additions can be made without departing from the spirit and scope of the present invention. Each feature of the various embodiments described above may be combined with the features of another described embodiment as long as it is appropriate to provide combinations of a number of features in a related new embodiment. Further, although a number of separate embodiments of the apparatus and method of the present invention have been described above, what is described herein is only an illustration of the application of the principles of the present invention. For example, the terms "process" and / or "processor" as used herein should be broadly construed to include various functions and components based on electronic hardware and / or software (or may be referred to as functional "modules" or "elements"). It should also be noted that the displayed process or processor may be combined with other processes and / or processors, or divided into various sub-processes or sub-processors. Such sub-processes and / or sub-processors can be combined in various ways according to the embodiments described herein. Similarly, it is clearly contemplated that any function, process, and / or processor herein can be implemented using electronic hardware, software, or a combination of hardware and software consisting of a non-transitory computer-readable medium of program instructions. In addition, the various terms used herein to represent directions and / or orientations, such as "vertical", "horizontal", "up", "down", "bottom", "top", "side", "front", "rear", "left", "right", and the like, are only used as relative expressions and do not represent absolute orientations based on a fixed coordinate system such as the direction of gravity. In addition, when the words "substantially" or "approximately" are used with respect to a particular measurement, value, or characteristic, it refers to an amount within the normal operating range for achieving the desired result, but includes a certain degree of variation due to inherent inaccuracies and errors within the allowable error range of the system (e.g., 1 to 5 percent). Therefore, this description should be received only as an example and does not mean to limit the scope of the present invention otherwise.

[0051] The claims are set forth below.

Claims

1. 1. A system for detecting a pattern in an image, comprising: a pattern detection tool trained based on one or more templates associated with one or more training images containing a pattern of interest; a neural net classifier trained on one or more training images; At run time, either (a) or (b) of the following occurs: (a) the trained neural net classifier provides one or more templates based on a runtime image to the pattern detection tool, and the trained pattern detection tool performs pattern matching based on the one or more template images combined with the runtime image; or (b) the trained pattern detection tool provides the detected patterns from the run-time image to the trained neural net classifier, and the trained neural net classifier performs pattern matching based on the detected patterns and the run-time image: a template matching process; The above system.

2. The system of claim 1 , wherein the pattern detection tool is adapted to be trained using a plurality of the templates.

3. The system of claim 1 , wherein the pattern detection tool is trained using a single said template.

4. The system of claim 1 , wherein the neural net comprises a convolutional neural network (CNN).

5. 1. A system for detecting a pattern in an image, comprising: a neural network trained to identify one or more candidate shapes within an image and configured to identify a probability of the presence of one or more of the shapes within the image during run-time operation, whereby the neural network (a) generates a weighted mask having features of the one or more candidate shapes that exceed a probability threshold, or (b) generates a reconstructed image in which the features of a model of the one or more candidate shapes are replaced within the image in which the neural network identifies the presence of one or more features of the candidate shapes that exceed a probability threshold. The above system.

6. 6. The system of claim 5, further comprising a pattern detection tool trained using one or more models corresponding to one or more of the candidate shapes to detect the one or more candidate shapes in (a) the weighted mask or (b) the reconstructed image.

7. 7. The system of claim 6, wherein the neural network defines the weighted mask, each pixel having a score related to one or more of the shape distinctions.

8. The system of claim 5 , wherein the reconstructed image is defined as a binary image.

9. The system of claim 6 , wherein the neural network provides data regarding the presence of one or more of the candidate shape types to the pattern detection tool, and the pattern detection tool limits processes related to identifying the types.

10. The system of claim 5 , wherein the neural network comprises a convolutional neural network (CNN).

11. 1. A system for detecting a pattern in an image, comprising: a neural network trained to identify one or more candidate shapes within an image and configured to identify a probability of the presence of one or more of the shapes within the image during run-time operation, whereby the neural network (a) generates a weighted mask having features of the one or more candidate shapes that exceed a probability threshold, and (b) generates a reconstructed image in which the features of models of the one or more candidate shapes are replaced within the image in which the neural network identifies the presence of one or more features of the candidate shapes that exceed the probability threshold. The above system.

12. 12. The system of claim 11, further comprising a pattern detection tool trained using one or more models corresponding to the one or more candidate shapes to detect the one or more candidate shapes in (a) the weighted mask and (b) the reconstructed image.

13. 1. A method for detecting a pattern in an image, comprising: using a neural network to find one or more candidate shapes within an image and identify a probability of the one or more shapes being present within the image during run-time operation; and (a) generating a weighted mask having one or more features of the candidate shape that exceed a probability threshold; or (b) generating a reconstructed image in which the features of one or more models of the candidate shape are replaced in the image in which the neural network identifies the presence of one or more features of the candidate shape that exceed a probability threshold. The above method comprising the steps of:

14. 14. The method of claim 13, further comprising detecting the one or more candidate shapes in (a) the weighted mask or (b) the reconstructed image using a pattern detection tool trained with one or more models corresponding to the one or more candidate shapes.

15. The method of claim 14 , further comprising using the neural network to define the weighting mask such that each pixel has a score related to one or more of the shape distinctions.

16. The method of claim 13 , further comprising defining the reconstructed image as a binary image.

17. 17. The method of claim 16, further comprising providing data from the neural network to the pattern detection tool regarding the presence of one or more of the candidate shape types, and restricting the method of detecting the patterns to those relevant to identifying the types.

18. 14. The method of claim 13, wherein the neural network comprises a convolutional neural network (CNN).

19. 1. A system for detecting a pattern in an image, comprising: a neural network trained to identify one or more candidate shapes within an image and configured to identify a probability of the one or more shapes being present within the image during run-time operation, whereby the neural network generates a weighted mask having features of the one or more candidate shapes that exceed a probability threshold; The above system.

20. 20. The system of claim 19, further comprising a pattern detection tool trained with one or more models corresponding to one or more of the candidate shapes to detect the one or more candidate shapes in the weighting mask.

21. 1. A system for detecting a pattern in an image, comprising: a neural network trained to identify one or more candidate shapes within an image and configured to identify a probability of the presence of one or more of said shapes within said image during run-time operation, whereby a reconstructed image is created in which model features of the one or more candidate shapes are replaced within the image in which the neural network identifies the presence of one or more features of said candidate shapes that exceed a probability threshold; The above system comprising:

22. The system of claim 21 , wherein the reconstructed image defines a binary image.