Metrology-based assisted defect recognition

Some embodiments of systems, devices, and methods obtain a plurality of training images; obtain one or more target regions; generate one or more respective statistical characterizations of the one or more target regions; obtain a test image; locate the one or more target regions on the test image; compare the one or more target regions in the test image to the one or more respective statistical characterizations of the one or more target regions; and detect anomalies in the one or more target regions in the test image based at least in part on the comparison of the one or more target regions in the test image to the one or more respective statistical characterizations of the one or more target regions.

BACKGROUND

Technical Field

This application generally concerns computer vision that detects anomalies in images.

Background

Computer-vision systems can detect visual anomalies in images. For example, nondestructive computer-vision testing techniques can be used to examine the properties of objects without causing damage to the objects. These techniques can be used in a quality-control process to identify defects in the objects.

Existing metrology applications used in non-destructive testing rely on making measurements in images or in volumes of structures of importance to ensure that the structural dimensions are consistent with design tolerances. For example, an x-ray image of a pipeline may check the wall thickness to ensure that the thickness exceeds a certain minimum thickness.

However, there are variations in part placement for imaging, and there are natural variations from part to part due to variations in the manufacturing process. The actual natural variations may or may not be known. Also, while actual measurements against a design specification may be important, in some cases, it may be equally important to be able to detect abnormal variations in the manufactured part. These abnormalities in critical structures may be highlighted to part inspectors so that they may make a determination about whether or not the part is structurally compromised.

SUMMARY

An aspect of the present disclosure provides an anomaly-detection approach to metrology and learns normal manufacturing variations of a component from training images of the component. This enables the highlighting of manufacturing inconsistencies even when the component may be within manufacturing tolerances. The discovery of these inconsistencies can help manufacturing-process reviews and improvements and can also help to determine the effects of changes made to the manufacturing process.

Some embodiments of a device comprise one or more computer-readable storage media and one or more processors. The one or more processors are configured to cause the device to obtain a plurality of training images; obtain one or more target regions; generate one or more respective statistical characterizations of the one or more target regions; obtain a test image; locate the one or more target regions on the test image; compare the one or more target regions in the test image to the one or more respective statistical characterizations of the one or more target regions; and detect anomalies in the one or more target regions in the test image based at least in part on the comparison of the one or more target regions in the test image to the one or more respective statistical characterizations of the one or more target regions.

Some embodiments of a method comprise obtaining a plurality of training images that includes a reference image; selecting a target region in the reference image; selecting respective target regions in the other training images in the plurality of training images, wherein the respective target regions in the other training images correspond to the target region in the reference image; selecting a pair of key points in the target region in the reference image; selecting respective pairs of key points in the other training images, wherein the respective pairs of key points in the other training images correspond to the pair of key points in the target region in the reference image; and measuring respective distances between the key points in the pairs of key points in the training images.

Some embodiments of one or more computer-readable storage media store instructions that, when executed by one or more computing devices, cause the one or more computing devices to perform operations that comprise obtaining a reference image; selecting a pair of key points in the reference image; measuring a distance between the key points in the pair of key points in the reference image; obtaining a test image; selecting a pair of key points in the test image, wherein each key point in the pair of key points in the test image corresponds to a respective key point in the pair of key points in the reference image; measuring a distance between the key points in the pair of key points in the test image; and detecting an anomaly in the test image based at least in part on the distance between the key points in the pair of key points in the test image.

BRIEF DESCRIPTION OF EXEMPLARY EMBODIMENTS

The following paragraphs describe certain explanatory embodiments. Other embodiments may include alternatives, equivalents, and modifications. Additionally, the explanatory embodiments may include several novel features, and a particular feature may not be essential to some embodiments of the devices, systems, and methods that are described herein.

FIG. 1illustrates an example embodiment of a system10for image anomaly detection. The system10includes one or more anomaly-detection devices100; at least one image-capturing device, such as an x-ray or CT machine110A or a camera1108; and a display device120. The one or more anomaly-detection devices100are specially configured computing devices that are configured to learn the variations in target regions of object components that have been imaged through the x-ray or CT machine110A or the camera1108. The one or more anomaly-detection devices100are also configured to process an acquired test image (e.g., from the x-ray or CT machine110A or the camera1108) and determine whether measurements in the target regions are anomalous or not. The one or more anomaly-detection devices100are also configured to show the image of the component and any anomalous regions on the display device120.

FIG. 2illustrates an example embodiment of an operational flow for anomaly detection. Although this operational flow and the other operational flows that are described herein are each presented in a certain respective order, some embodiments of these operational flows perform at least some of the operations in different orders than the presented orders. Examples of different orders include concurrent, parallel, overlapping, reordered, simultaneous, incremental, and interleaved orders. Also, some embodiments of these operational flows include operations (e.g., blocks) from more than one of the operational flows that are described herein. Thus, some embodiments of the operational flows may omit blocks, add blocks (e.g., include blocks from other operational flows that are described herein), change the order of the blocks, combine blocks, or divide blocks into more blocks relative to the example embodiments of the operational flows that are described herein.

Furthermore, although this operational flow and the other operational flows that are described herein are performed by an anomaly-detection device, some embodiments of these operational flows are performed by two or more anomaly-detection devices or by one or more other specially-configured computing devices.

InFIG. 2, the flow starts in block B200and continues to block B210, where an anomaly-detection device trains a metrology model294using exemplary training images292. The metrology model294contains statistical characterizations295of target regions of a component being imaged. Next, the flow moves to block B220, where the anomaly-detection device determines if there are images to be tested. If there are images to be tested (B220=Yes), then the flow proceeds to block B230, where the anomaly-detection device obtains (e.g., retrieves, selects) a test image, and the flow continues to block B240. In block B240, the anomaly-detection device applies the metrology model294, which includes a statistical characterization295of one or more target regions, to the obtained test image. Regions of the test image which do not fit the statistical characterization295are then detected and, in block B250, the anomaly-detection device outputs or stores the anomalous regions299. The flow then returns to block B220, where the anomaly-detection device determines whether there are more images to be tested. If, in block B220, the anomaly-detection device determines that there are no more additional images to be tested (B220=No), then the flow moves to block B260, where the flow ends.

FIG. 3illustrates an example embodiment of an operational flow for training an anomaly detection model. The flow begins in block B300and continues to block B305, where an anomaly-detection device obtains a reference image391(e.g., an image of a component). Next, in block B310, the anomaly-detection device defines one or more target regions in the reference image391. In some embodiments, the target region is a line that starts at one pixel in the reference image391and ends at a different pixel in the reference image391. The line defines an intensity profile in the image along the line. In some embodiments the line intensity profiles are interpolated along the line to account for transitions across the image pixels in both the x and y directions. The line intensity profile interpolation can be achieved by various techniques, such as nearest neighbor, bi-linear interpolation, or bi-cubic interpolation, for example. In some embodiments, polynomial interpolation is used (e.g., a two-dimensional (for images) or a three-dimensional (for volumes) generalization of a Savitzky-Golay filter), which not only provides image or volume intensity interpolation, but also provides partial derivatives of the intensity along the line. The directional derivatives (e.g., first and second derivatives) of the intensity along the line may then be generated. As will be explained later, the anomaly-detection device may later use the intensity profile along the line and one or more of the intensity derivatives along the line.

In some embodiments, the target region may be defined by a user. For example, the anomaly-detection device may allow the user to mark the reference image391with lines (or other target regions) of interest. This may allow the user to define regions or measurements that are of critical importance to the viability of the component being imaged. And, in some embodiments, the anomaly-detection device determines one or more of the target regions, for example regions that correspond to structural walls or channels.

Next, the flow continues to block B315, where a plurality of training images392of the component are obtained by the anomaly-detection device. The training images392—as well as the reference image391—depict the component in approximately the same orientation and scale. The flow then continues to block B320, where the anomaly-detection device aligns each of the plurality of training images392to the reference image391. The alignment may include some degree of non-linear warping, rotation, and scaling, for example. The output of block B320is a respective alignment map393for each training image392that describes transformations that map the coordinates in the training image392to the coordinates of the reference image391.

The flow continues to block B325, where the anomaly-detection device checks if there are any target regions to be processed. If there is at least one target region (B325=Yes), then the flow proceeds to block B330, where the anomaly-detection device selects a target region to be processed. Then, in block B335, the anomaly-detection device selects a pair of key points, which includes a first key point and a second key point, in the target region in the reference image391. In some embodiments in which a target region is a line, the first and second key points are points along the line that can be easily recognized from one image to the next image. The first and second key points may be selected based on the line's intensity profile, and examples of key points include the following: inflection points along edges, peak intensities, and profile corners at the junction of various intensity regions.

Then the flow continues to block B340, where the anomaly-detection device maps the target region in the reference image391to a respective target region in each of the training images392. The mapping is obtained by using the inverse of the alignment map393between the respective training image392and the reference image391. Target regions that correspond to each other depict the same location or approximately the same location on the component. Thus, the target regions in the training images392correspond to the target region in the reference image391. Also, the target regions in the training images392may correspond to each other.

Once the target region has been mapped to each of the training images392, in block B345the anomaly-detection device selects a pair of key points, which includes a third key point and a fourth key point, in the target region in each training image392(each target region in each training image392has its own third key point and fourth key point). The third key point and the fourth key point respectively correspond to the first key point and second key point in the reference image. Key points that correspond to each other have the same location or approximately the same location on the component. Accordingly, all of the third key points may correspond to each other, and all of the fourth key points may correspond to each other.

Next, in block B350, with all of the third and fourth key points selected, the anomaly-detection device measures the respective distance between the third and fourth key points in each pair of third and fourth key points. In some embodiments, the reference image391is chosen from the plurality of training images392, and therefore the distance between the first and second key points of the reference image391is also included in the distances measured. Also, in some embodiments, the anomaly-detection device calculates a respective global scale factor or a respective local scale factor between each of the training images392and the reference image391and applies a correction to the respective distance in each of the training images392based on the respective global scale factor or the respective local scale factor.

In block B355, the anomaly-detection device statistically characterizes the plurality of distances for the target region, thereby generating a statistical characterization394of the target region. Some embodiments of the anomaly-detection device calculate a mean and a standard deviation of the distances as the statistical characterization394. For example, some embodiments generate the statistical characterization394robustly using one or more of the following: a median value, a MAD (Median Absolute Deviations), or an IQR (Inter-Quartile Range), for example. And some embodiments perform density estimation, use the distance histograms as the statistical characterization394, or fit the observed data to a reference probability distribution or density.

The flow then returns to block B325, where a determination is made as to whether there is another target region. If there is another target region, then the anomaly-detection device repeats blocks B330-B355. Otherwise (B325=No), the flow moves to block B370, where the flow ends.

FIG. 4illustrates an example embodiment of an operational flow for testing an image for anomalies. This embodiment applies a metrology model, for example the metrology model294inFIG. 2. The flow begins in block B400and moves to block B405, where an anomaly-detection device obtains a test image495(for example from an image-capturing device110A or1108inFIG. 1). In block B410, the anomaly-detection device generates an alignment map493that the anomaly-detection device can use to align the test image495to a reference image491.

In block B415, the anomaly-detection device determines whether there are any target regions to process. If so (B415=Yes), the flow proceeds to block B420, where the anomaly-detection device identifies the target region (e.g., a measurement line) in the test image495using the inverse of the alignment map493. For example, the anomaly-detection device may project a target region from the reference image491to the test image495using the inverse of the alignment map493. Then, in block B425, the anomaly-detection device selects a pair of key points, which includes a third key point and a fourth key point, in the target region in the test image495based on the first and second key points that were defined in the reference image491. The third key point in the test image495corresponds to the first key point in the reference image491, and the fourth key point in the test image495corresponds to the second key point in the reference image491.

In block B430, the anomaly-detection device calculates the distance between the third and fourth key points in the test image495. Some embodiments of the anomaly-detection device adjust the distance between the third and fourth key points in the test image495based on global scaling or local scaling. Next, in block B435, the anomaly-detection device compares the distance to the statistical characterization494of the target region's corresponding training distances (the distances between the third and fourth key points in the training images).

The flow then continues to block B440, where the anomaly-detection device determines whether the distance in the test image is abnormal based on the comparison to the statistical characterization494in block B435. For example, some embodiments determine that a distance is abnormal if the distance is more than n standard deviations from the mean or median (e.g., n=4). In some embodiments, the determination is based on a calculated probability of observing such a distance, a calculated probability of observing a greater distance (e.g., if the distance is greater than the expected mean or median), or a calculated probability of observing a lesser distance (e.g., if the distance is less than the expected mean or median) given the observed distances in the training and reference images.

If the region is determined to be abnormal in block B440(B440=Yes), then the flow moves to block B445, where the anomaly-detection device marks the region with an abnormal marking496. The flow then returns to block B415. If the region is determined to not be abnormal (B440=No), then the flow returns to B415, and the anomaly-detection device does not mark the region as abnormal.

Again, in block B415, the anomaly-detection device determines whether there are any more target regions to be processed (e.g., target regions that have not yet been processed). If another target region is to be processed (B415=Yes), then the flow repeats blocks B420through B445. If no more target regions are to be processed (B415=No), then the flow ends at block B450.

In some embodiments, training and test images are aligned and mapped directly back to the original reference-image coordinates. In these embodiments, distances are implicitly scaled to the reference space, and the target regions are defined on the aligned images all in the reference-image coordinates. This may simplify some of the processing but may also present problems if the alignment includes warping, which may distort some distances. Thus some embodiments use linear or affine alignment methods to prevent unanticipated contraction or dilation of distance measurements. However, these embodiments may optionally use non-linear alignment methods (local warping) to help determine correspondences between the first and third key points and the second and fourth key points.

FIG. 5Aillustrates an example embodiment of an image of a component581with target regions (a first target region583A and a second target region583B). The image shows a cross-section of the component581, which include three openings or channels582. Some embodiments of an anomaly-detection device generate a user interface that provides a user the ability to indicate the first target region583A and the second target region583B by drawing respective lines across regions of interest that are to be measured. In this example embodiment, the wall thickness of the component581may be of critical design importance to the structural integrity or function of the component581. A user may identify such regions in the component581by drawing a respective line across each region.

FIG. 5Billustrates example embodiments of line intensity profiles. InFIG. 5B, the y axis indicates intensity, and the x axis indicates position. The first target region583A was identified in a plurality of training images, and each line intensity profile shows the intensity of the first target region583A in a respective training image of the plurality of training images.FIG. 5Bshows significant variations in the intensity profiles in the first target region583A.

FIG. 6Aillustrates example embodiments of line intensity profiles,FIG. 6Billustrates the first derivatives of the line intensity profiles inFIG. 6A, andFIG. 6Cillustrates the second derivatives of the line intensity profiles inFIG. 6A.

FIG. 6Aillustrates the line intensity profiles from the first target region583A inFIG. 5A. InFIG. 6A, the y axis indicates intensity, and the x axis indicates position. Also, the line intensity profiles inFIG. 6A, the first derivatives inFIG. 6B, and the second derivatives inFIG. 6Chave been smoothed. In this example, the smoothed profiles and their respective derivatives were calculated by fitting each sample in the profile to a polynomial using the three neighboring samples to the left and to the right of the sample in question. This approach is sometimes referred to as a Savitzky-Golay filter. Because each point is fit to a local polynomial, derivatives of the polynomial fit can be easily calculated, provided that the polynomial order is high enough to support non-zero higher-order derivatives. Additionally, in this example embodiment, the line profiles were linearly extrapolated by three samples on the left side and by three samples of the right side of the profiles to calculate the smoothed profiles and their derivatives at the beginnings and the ends of the profiles. Also, the smoothed profiles and their derivatives may be truncated at the beginning and end or estimated causally or non-causally. To calculate first and second order derivatives, the polynomial should be at least cubic. Also, other smoothing filters, such as Gaussian filters, sliding median filters, or mean filters, can be used to smooth the line intensity profiles.

FIGS. 6B and 6Cshow that the intensity profile derivatives are highly repeatable across the training images. Thus, key points can be selected based on the line intensity profiles, based on the first derivatives of the line intensity profiles, and based on the second derivatives of the line intensity profiles. For example, key points (e.g., as selected in B335or B345inFIG. 3, as selected in B425inFIG. 4) may be local minima or maxima of the line intensity profiles, local minimums or maximums of the first derivatives of the line intensity profiles, local minima or maxima of the second derivatives of the line intensity profiles, zero crossings of the first derivatives of the line intensity profiles, or zero crossings of the second derivatives of the line intensity profiles.

Other embodiments of the anomaly-detection device use other techniques to select key points, and above-describe embodiments present a few example embodiments. For example, approximations of first derivative filters, such as Prewitt and Sobel filters, or approximations of second derivative filters, such as Laplacian filters, can also be used to locate the key points after being convolved with the smoothed line intensity profiles. Also for example, the target region in an image may be filtered with Sobel kernels in the horizontal and vertical directions, and then the resulting filter magnitudes may be projected onto the target region to select key points along the target region.

Other embodiments provide for key points to be selectable by a user based on the stability and repeatability of the key points across the set of training images. And some embodiments of the anomaly-detection device provide suggestions of key point pairs to a user. For example, candidate key points may be determined based on the derivatives as described above. Then candidate key-point pairs can be ranked based on the variance or MAD of distances between the key points in the pairs so that the key points suggested to the user represent the key points that provide more consistency in measurement across the training images. In some cases, the variation (e.g., variance or MAD) can be relative to the overall mean or median distance so that the suggestions are not biased towards suggesting key points that measure smaller distances or larger distances. For example, some embodiments of an anomaly-detection device display ranked key-point pairs on a user interface, highlight suggested key-point pairs on the user interface, and receive one or more user selections of key-point pairs via the user interface.

FIG. 7Aillustrates an example embodiment of a user interface that displays key points along a line intensity profile. The user interface770shows the line intensity profile of a reference image fromFIG. 6A. The user interface770also shows various candidate key points771A-F. Candidate key points771A and771B, which are marked with diamonds, were obtained from local minima of the line intensity profile's second derivative. Candidate key points771C and771D, which are marked with squares, were obtained from the extrema of the first derivative (e.g., the maximum value and the minimum value along the intensity profile's first derivative). Candidate key points771E and771F, which are marked with circles, were obtained from the local maxima of the second derivative of the intensity profile.

The highlighted region772is a user-interface element that may be adjusted by moving the edges773A-773B of the highlighted region. Some embodiments of the anomaly-detection device allow the highlighted region772to snap to two of the candidate key points771A-F. In this way, the user may define the critical measurement to make along the target region's intensity profile by defining the key points. Using key points that are consistent across images improves the automation and detection of measurements in test and training images.

In some embodiments, key-point correspondence between third and fourth key points (e.g., as selected in B345inFIG. 3, as selected in B425inFIG. 4) and first and second key points (e.g., as selected in B335inFIG. 3) along the line intensity profile is performed for a plurality of key points along the line intensity profile. In this way, not only are the selected measurement key points used for measurement correspondence, but also the additional non-measurement key points may be used to more accurately register the intensity profiles between images. A median shift between key points along the profile may be used and can even help determine a test-image key-point location.

Also, some embodiments measure the distance between key points in pixels. And some embodiments measure the distance in some other unit of measurement using a conversion scale that converts the scale in the image to the other unit of measurement (e.g., that converts pixels to another unit of distance, such as a nanometer or a millimeter).

Additionally, some embodiments statistically characterize variations of a plurality of key points to help the anomaly-detection device determine whether statistically significant component variation (e.g., distortion) has occurred along the intensity profile of the target region.

And some embodiments statistically characterize the target region through a correlation or normalized correlation of the target region or line intensity profile. The intensity of the target region or the line intensity profile is first normalized with the intensity of the reference target region or line intensity profile or is normalized based on the statistics of a bigger region that contains the defined target region or line intensity profile. Thus, variations in the target region or line intensity profile can be measured wholly along the line intensity profile, instead of only a measurement of variation in distances. These embodiments may help further detect abnormalities in the target region. Some embodiments perform stretching of intensity profiles to make the profiles the same length when performing correlations. Other embodiments do not perform stretching and pad shorter profiles, for example with an average value or zero. And some embodiments find key points on the line intensity profile by finding points on the intensity profile that have a maximal orthogonal distance from a line connecting the profile extrema points.

FIG. 7Billustrates example embodiments of distances776A-F between pairs of key points771A-F. The key points771A-F inFIG. 7Bare the same as the candidate key points771A-F inFIG. 7A. The distance between a pair of key points depends on the key points771A-F that are selected. For example, the distance will be distance776A if key point771E and key point771B are selected. The distance will be distance776C if key point771A and key point771D are selected. The distance will be distance776F if key point771E and key point771F are selected.

FIG. 8illustrates an example embodiment of an image of a component, a target region, and key points. The component581and the first target region583A are the same as inFIG. 5A. Also,FIG. 8shows the candidate key points771A-F fromFIG. 7Ain the first target region583A. A pair of key points from the candidate key points771A-F can be used to measure the thickness of the component581in the first target region583A.

FIG. 9illustrates an example embodiment of a statistical characterization of the distances between key points on line intensity profiles from training images.FIG. 9includes a histogram975of third-to-fourth key-point distances, and the histogram975can be used to characterize the distances. For example, a mean and a standard deviation may be calculated, and a corresponding test-image measurement (e.g., test-image measurement976) may be compared against the mean and the standard deviation to determine if the test-image measurement976is an abnormal (e.g., outlying) measurement. Some embodiments use the histogram975to estimate the probability density of the measurements, which may reflect naturally occurring manufacturing variances of the region of the component under scrutiny. Also, some embodiments use a classifier that learns abnormal and non-abnormal measurements. Additionally, although the x axis inFIG. 9indicates the distance in pixels, some embodiments use other measures of distance (e.g., millimeters, centimeters, inches).

Furthermore, some embodiments may not use a statistical characterization of the distance between key points. In such embodiments, the key points are used to compare a region of a test image to a respective region of a reference image, and anomalies are generated when the measurement deviates from an expected measurement (within a specified tolerance) or deviates from the measurement (within the specified tolerance) obtained in the reference image. In these embodiments, only one training image (the reference image) is needed instead of a plurality of training images. However, some embodiments may still use the plurality of training images to determine the expected measurement, to identify stable or repeatable key points, or to provide the user with feedback as to the distribution of the measurements found in the training images relative to the manufacturing tolerance. In this manner, the user can then see how close the manufacturing variation is to the specified tolerance.

FIG. 10illustrates an example embodiment of a system for image anomaly detection. The system10includes an anomaly-detection device1000, which is a specially-configured computing device; an image-capturing device1010; and a display device1020. In this embodiment, the anomaly-detection device1000and the image-capturing device1010communicate via one or more networks1099, which may include a wired network, a wireless network, a LAN, a WAN, a MAN, and a PAN. Also, in some embodiments the devices communicate via other wired or wireless channels.

The anomaly-detection device1000includes one or more processors1001, one or more I/O components1002, and storage1003. Also, the hardware components of the anomaly-detection device1000communicate via one or more buses or other electrical connections. Examples of buses include a universal serial bus (USB), an IEEE 1394 bus, a PCI bus, an Accelerated Graphics Port (AGP) bus, a Serial AT Attachment (SATA) bus, and a Small Computer System Interface (SCSI) bus.

The one or more processors1001include one or more central processing units (CPUs), which may include one or more microprocessors (e.g., a single core microprocessor, a multi-core microprocessor); one or more graphics processing units (GPUs); one or more tensor processing units (TPUs); one or more application-specific integrated circuits (ASICs); one or more field-programmable-gate arrays (FPGAs); one or more digital signal processors (DSPs); or other electronic circuitry (e.g., other integrated circuits). The I/O components1002include communication components (e.g., a graphics card, a network-interface controller) that communicate with the display device1020, the network1099, the image-capturing device1010, and other input or output devices (not illustrated), which may include a keyboard, a mouse, a printing device, a touch screen, a light pen, an optical-storage device, a scanner, a microphone, a drive, and a game controller (e.g., a joystick, a gamepad).

The storage1003includes one or more computer-readable storage media. As used herein, a computer-readable storage medium includes an article of manufacture, for example a magnetic disk (e.g., a floppy disk, a hard disk), an optical disc (e.g., a CD, a DVD, a Blu-ray), a magneto-optical disk, magnetic tape, and semiconductor memory (e.g., a non-volatile memory card, flash memory, a solid-state drive, SRAM, DRAM, EPROM, EEPROM). The storage1003, which may include both ROM and RAM, can store computer-readable data or computer-executable instructions.

The anomaly-detection device1000also includes an alignment module1003A, a training module1003B, a key-point module1003C, a statistics module1003D, an anomaly-detection module1003E, and a communication module1003F. A module includes logic, computer-readable data, or computer-executable instructions. In the embodiment shown inFIG. 10, the modules are implemented in software (e.g., Assembly, C, C++, C#, Java, BASIC, Perl, Visual Basic, Python). However, in some embodiments, the modules are implemented in hardware (e.g., customized circuitry) or, alternatively, a combination of software and hardware. When the modules are implemented, at least in part, in software, then the software can be stored in the storage1003. Also, in some embodiments, the anomaly-detection device1000includes additional or fewer modules, the modules are combined into fewer modules, or the modules are divided into more modules.

The alignment module1003A includes instructions that cause the anomaly-detection device1000to align training images or test images (e.g., align training images or test images to a reference image) and produce corresponding alignment maps. For example, some embodiments of the alignment module1003A include instructions that cause the anomaly-detection device1000to perform at least some of the operations that are described in block B320inFIG. 3or in block B410ofFIG. 4.

The training module1003B includes instructions that cause the anomaly-detection device1000to train a metrology model using a reference image and a plurality of training images. For example, some embodiments of the training module1003B include instructions that cause the anomaly-detection device1000to perform at least some of the operations that are described in block B210inFIG. 2or in blocks B300-B355inFIG. 3. Also, the training module1003B may call the alignment module1003A, the key-point module1003C, or the statistics module1003D.

The key-point module1003C includes instructions that cause the anomaly-detection device1000to select key points in a target region (e.g., based on the target region's intensity profile). For example, some embodiments of the key-point module1003C include instructions that cause the anomaly-detection device1000to perform at least some of the operations that are described in blocks B335and B345inFIG. 3or in block B425inFIG. 4.

The statistics module1003D includes instructions that cause the anomaly-detection device1000to generate a statistical characterization of one or more target regions. For example, some embodiments of the statistics module1003D include instructions that cause the anomaly-detection device1000to perform at least some of the operations that are described in block B355inFIG. 3to produce a statistical characterization394of a target region.

The anomaly-detection module1003E includes instructions that cause the anomaly-detection device1000to detect one or more anomalies in target regions based on statistical characterizations of the regions. For example, some embodiments of the anomaly-detection module1003E include instructions that cause the anomaly-detection device1000to perform the operations that are described in blocks B220-B260inFIG. 2or in blocks B415-B445inFIG. 4. Results from the anomaly-detection module1003E may be shown on the display device1020by highlighting potential anomalies in a test image to a user of the device. Also, anomaly-detection module1003E may call the key-point module1003C.

The communications module1003F includes instructions that cause the anomaly-detection device1000to communicate with one or more other devices (e.g., the image-capturing device1010, the display device1020), for example to obtain one or more images from the other devices or to send one or more images to the other devices.

The image-capturing device1010includes one or more processors1011, one or more I/O components1012, storage1013, a communication module1013A, and an image-capturing assembly1014. The image-capturing assembly1014includes one or more image sensors and may include one or more lenses and an aperture. The communication module1013A includes instructions that, when executed, or circuits that, when activated, cause the image-capturing device1010to capture an image, receive a request for an image from a requesting device, retrieve a requested image from the storage1013, or send a retrieved image to the requesting device (e.g., the detection device1000).

At least some of the above-described devices, systems, and methods can be implemented, at least in part, by providing one or more computer-readable media that contain computer-executable instructions for realizing the above-described operations to one or more computing devices that are configured to read and execute the computer-executable instructions. The systems or devices perform the operations of the above-described embodiments when executing the computer-executable instructions. Also, an operating system on the one or more systems or devices may implement at least some of the operations of the above-described embodiments.

Furthermore, some embodiments use one or more functional units to implement the above-described devices, systems, and methods. The functional units may be implemented in only hardware (e.g., customized circuitry) or in a combination of software and hardware (e.g., a microprocessor that executes software).

Additionally, some embodiments of the devices, systems, and methods combine features from two or more of the embodiments that are described herein. Also, as used herein, the conjunction “or” generally refers to an inclusive “or,” though “or” may refer to an exclusive “or” if expressly indicated or if the context indicates that the “or” must be an exclusive “or.”