A method, apparatus, equipment and medium for detecting surface defects in wind turbine blades
By using mask-guided image segmentation and an unsupervised anomaly detection model, the problems of difficult sample acquisition and loss of minute defects in wind turbine blade defect detection are solved, thereby improving the accuracy and efficiency of detection.
Patent Information
- Application Number
- CN202611442670.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-16
- Publication Date
- 2026-11-17
AI Technical Summary
Existing methods for detecting defects in wind turbine blades rely on supervised deep learning models. Training requires a large number of defect samples and has limited generalization ability. Furthermore, full-image scaling can cause small defects to be easily missed, resulting in a high rate of missed detections.
A mask-guided image segmentation method is adopted, which segments the target region and the background region using a binary mask image, uses a sliding window to filter candidate window images, and combines an unsupervised anomaly detection model for defect detection.
It effectively reduces the loss of minute defects, reduces background interference and computational waste, improves the accuracy and efficiency of defect detection, and overcomes the problems of difficult sample acquisition and limited category detection.
Smart Images

Figure CN123118588A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, and in particular to a method, apparatus, equipment and medium for detecting surface defects in wind turbine blades. Background Technology
[0002] Wind turbines (hereinafter referred to as wind turbines) may develop various surface defects such as cracks, paint peeling, and corrosion during operation. Timely and accurate detection of these defects is of great significance for ensuring equipment safety and operational efficiency. With the development of industrial digitalization and intelligent operation and maintenance, image-based automatic surface defect detection is gradually replacing manual inspection.
[0003] Current mainstream defect detection methods mostly rely on supervised deep learning models, which require a large number of defect samples and corresponding annotations covering various categories for training. However, the reality of wind turbines is that defects are diverse in type and form, making them difficult to exhaustively list; moreover, abnormal (defect) data is extremely scarce – the vast majority of collected images are normal samples. Obtaining a sufficient number of comprehensive defect annotation samples is extremely costly, and in many scenarios, it is simply impossible to obtain them. If a certain type of defect is not included in the training labels, the model cannot detect objects of that category, thus limiting its generalization ability. In addition, existing technologies often use full-image scaling for defect detection, directly scaling high-resolution images to the model input size. However, wind turbine detection images are usually extremely high-resolution, and the target area (such as wind turbine blades) only occupies a portion of the image. Small defects are easily lost under overall scaling, leading to an increased false negative rate. Summary of the Invention
[0004] This invention provides a method, apparatus, equipment, and medium for detecting surface defects in wind turbine blades, in order to solve one of the aforementioned technical problems.
[0005] According to one aspect of the present invention, a method for detecting surface defects in wind turbine blades is provided, the method comprising: An image containing wind turbine blades is acquired and processed to obtain a binary mask image; wherein, in the binary mask image, the pixel value of the blade region is 1, and the pixel value of the non-blade region is 0. The image to be detected is divided into a target region and a background region based on the binary mask image, and the pixel values of the background region are set to zero to obtain a mask suppression image; wherein, the target region refers to the image region in the image to be detected that corresponds to the leaf region in the binary mask image; Multiple candidate window images are obtained by traversing the mask suppression image using a sliding window. The candidate window images are then filtered based on the number of target pixels in each candidate window image to obtain the target window image. Herein, the target pixel refers to the pixel that falls into the target region, and the sliding window step size does not exceed the sliding window size. An unsupervised anomaly detection model is used to detect surface defects in the target window image to obtain window anomaly detection results, and the anomaly detection results of the image to be detected are determined based on the window anomaly detection results.
[0006] According to another aspect of the present invention, a device for detecting surface defects of wind turbine blades is provided, the device comprising: The blade mask determination module is used to acquire an image to be detected containing wind turbine blades and process the image to be detected to obtain a binary mask image; wherein, the pixel value of the blade area in the binary mask image is 1, and the pixel value of the non-blade area is 0. The mask suppression module is used to divide the image to be detected into a target region and a background region according to the binary mask image, and set the pixel values of the background region to zero to obtain a mask suppression image; wherein, the target region refers to the image region in the image to be detected that corresponds to the leaf region in the binary mask image; The window image determination module is used to traverse the mask suppression image using a sliding window to obtain multiple candidate window images, and to filter the candidate window images based on the number of target pixels in each candidate window image to obtain a target window image; wherein, the target pixel refers to the pixel falling into the target region, and the sliding window step size does not exceed the sliding window size; An anomaly detection module is used to perform surface defect detection on the target window image using an unsupervised anomaly detection model to obtain window anomaly detection results, and to determine the anomaly detection results of the image to be detected based on the window anomaly detection results.
[0007] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the wind turbine blade surface defect detection method according to any embodiment of the present invention.
[0008] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the wind turbine blade surface defect detection method according to any embodiment of the present invention.
[0009] The technical solution of this invention involves acquiring an image to be detected containing wind turbine blades and processing the image to obtain a binary mask image. In the binary mask image, the pixel value of the blade region is 1, and the pixel value of the non-blade region is 0. The image to be detected is divided into a target region and a background region based on the binary mask image. The pixel values of the background region are set to zero to obtain a mask suppression image. The target region refers to the image region in the image to be detected that corresponds to the blade region in the binary mask image. A sliding window is used to traverse the mask suppression image to obtain multiple candidate window images. The candidate window images are then filtered based on the number of target pixels in each candidate window image to obtain a target window image. Target pixels refer to pixels falling within the target region, and the sliding window step size does not exceed the sliding window size. An unsupervised anomaly detection model is used to perform surface defect detection on the target window image to obtain a window anomaly detection result. The anomaly detection result of the image to be detected is determined based on the window anomaly detection result. This technical solution employs mask-guided image segmentation, which effectively reduces the loss of minor defects caused by direct scaling of the entire image; window image filtering enables precise location of target areas, thereby greatly reducing background interference and computational waste; and the use of an unsupervised anomaly detection model for defect detection effectively overcomes the difficulties in obtaining anomaly samples and the limitations in defect category detection under supervised models, thus helping to improve the accuracy and efficiency of wind turbine blade surface defect detection.
[0010] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 This is a flowchart of a method for detecting surface defects in wind turbine blades according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the extraction process of a mask-suppressed image according to an embodiment of the present invention; Figure 3A This is a schematic diagram of a window anomaly detection result provided by an embodiment of the present invention; Figure 3B This is a schematic diagram of anomaly detection results for an image to be detected according to an embodiment of the present invention; Figure 4This is a flowchart of another method for detecting surface defects of wind turbine blades according to an embodiment of the present invention; Figure 5 This is a schematic diagram of a sliding window traversing a mask-suppressed image according to an embodiment of the present invention; Figure 6 This is a partial candidate window image after image traversal is completed, as provided in an embodiment of the present invention; Figure 7 This is a schematic diagram illustrating the calculation principle of an integral graph query method provided by an embodiment of the present invention; Figure 8 This is a schematic diagram of a wind turbine blade surface defect detection device according to an embodiment of the present invention; Figure 9 This is a schematic diagram of the structure of an electronic device for implementing a method for detecting surface defects on wind turbine blades according to an embodiment of the present invention. Detailed Implementation
[0013] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0014] It should be noted that the terms "first," "second," "target," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0015] Example 1 Figure 1This is a flowchart of a method for detecting surface defects on wind turbine blades according to Embodiment 1 of the present invention. This embodiment is applicable to situations requiring high-precision detection of surface defects on wind turbine blades. The method can be executed by a wind turbine blade surface defect detection device, which can be implemented in hardware and / or software. This device can be configured in an electronic device with data processing capabilities. Figure 1 As shown, the method includes: S110: Obtain the image to be detected containing the wind turbine blades, and process the image to be detected to obtain a binary mask image.
[0016] In this embodiment, firstly, an image containing wind turbine blades is acquired. This image can be captured using a gimbal camera on a drone. Then, a target segmentation algorithm is used to segment the blade region in the image to obtain a binary mask image. The image to be detected can be an image for surface defect detection; it includes at least wind turbine blades and typically also includes a large amount of background (such as sky, ground, vegetation, unrelated equipment, etc.). The binary mask image includes blade regions and non-blade regions, where the pixel value of the blade regions is 1, and the pixel value of the non-blade regions is 0. For example, the target segmentation algorithm can be set to YOLOseg, which is an end-to-end instance segmentation model based on an improvement of YOLO (You Only Look Once) v5s.
[0017] Furthermore, when the target segmentation model has a systematic outward expansion error (i.e. the segmentation edge extends outward by a few pixels relative to the real target), the segmentation edge is easily mixed into the background. In this case, a morphological erosion operation can be performed on the binary mask image to make the mask edge shrink inward by one ring (the shrinkage range is adjustable by the kernel size and the number of iterations), thereby generating a mask that fits the real target better.
[0018] S120: Divide the image to be detected into a target region and a background region according to the binary mask image, and set the pixel values of the background region to zero to obtain the mask suppression image.
[0019] In this embodiment, after obtaining the binary mask image, the image to be detected can be divided into a target region and a background region based on the binary mask image. The target region can refer to the image region in the image to be detected that corresponds to the leaf region in the binary mask image. The background region can refer to the image region in the image to be detected that corresponds to the non-leaf region in the binary mask image, or it can be understood as the image region in the image to be detected other than the target region. Then, the pixel values of the background region are set to zero to obtain a mask suppression image containing only leaves, which can eliminate background interference at its source.
[0020] Figure 2A schematic diagram of the extraction process of a mask-suppressed image is shown, where "original image" represents the image to be detected, "segmentation mask" represents the binary mask image (the target area is white), "mask after morphological erosion" represents the shrinkage effect after performing morphological erosion on the binary mask image (used to eliminate segmentation edge error bands), and "mask suppression result" represents the mask-suppressed image (non-target areas are blacked out).
[0021] S130, a sliding window is used to traverse the mask suppression image to obtain multiple candidate window images, and the candidate window images are filtered based on the number of target pixels in each candidate window image to obtain the target window image.
[0022] In this embodiment, after obtaining the masked suppression image, a sliding window is used to traverse the entire masked suppression image, starting from the upper left corner. During the traversal, image regions corresponding to the sliding window are cropped from the masked suppression image to obtain multiple candidate window images. It should be noted that to ensure continuous coverage of the target region and no missed detection blind spots, the sliding window step size needs to be set to not exceed the sliding window size. The sliding window size can be used to characterize the size of the sliding window; the sliding window step size can be a pre-set distance for a single movement of the sliding window, used to characterize the distance between adjacent windows. For example, the sliding window size can be set to 500×500, and the sliding window step size can be set to 250, at which point the overlap rate of adjacent windows is 50%. Then, the number of target pixels in each candidate window image is counted, where target pixels refer to pixels falling within the target region. The candidate window images are then filtered by the number of target pixels to obtain target window images, used to determine whether the candidate window images contain the number of target pixels required for defect detection, i.e., whether the number of target pixels in the candidate window images is sufficient for defect detection. For example, a preset minimum number of pixels (e.g., 100) can be set in advance according to actual detection needs. Then, the number of target pixels in each candidate window image is compared with the preset minimum number of pixels. If the number of target pixels is greater than the preset minimum number of pixels, it indicates that the number of target pixels in the corresponding candidate window image is sufficient. At this time, the corresponding candidate window image can be retained as the target window image. Otherwise, it indicates that the number of target pixels in the corresponding candidate window image is insufficient. At this time, the corresponding candidate window image can be directly removed to avoid the decrease in defect detection accuracy due to insufficient number of target pixels.
[0023] S140, use an unsupervised anomaly detection model to perform surface defect detection on the target window image to obtain the window anomaly detection result, and determine the anomaly detection result of the image to be detected based on the window anomaly detection result.
[0024] In this embodiment, after obtaining the target window image, the target window images can be batch input into a pre-trained unsupervised anomaly detection model for surface defect detection. The window anomaly detection result corresponding to each target window image can be obtained based on the model output. The unsupervised anomaly detection model refers to an artificial intelligence model trained in an unsupervised manner that can detect blade surface defects based on images. This model adopts an unsupervised approach of "learning only normal, not anomalies," using a large number of normal samples to train the model. During inference, it only marks areas "significantly different from normal textures," detecting unknown defect types without any defect annotations. This eliminates the dependence on defect sample annotations and improves the model's generalization ability and scene adaptability.
[0025] For example, an unsupervised anomaly detection model can employ a memory-based unsupervised anomaly model (such as PatchCore). This model takes a target window image as input and outputs the window anomaly detection result. Optionally, the window anomaly detection result includes a window anomaly heatmap and a window anomaly score. The window anomaly heatmap reflects the anomaly score of each pixel in the target window image. The window anomaly score is the maximum anomaly score in the window anomaly heatmap, and the higher the anomaly score, the greater the likelihood of a surface defect. The window anomaly heatmap is an unnormalized pixel-by-pixel anomaly heatmap. Specifically, the window anomaly heatmap has the same size as the target window image, and each pixel in the target window image corresponds to an anomaly score at the same position in the window anomaly heatmap. The anomaly score ranges from [0,1], and a higher anomaly score indicates a greater likelihood of a surface defect. The window anomaly score is the maximum anomaly score selected from the corresponding window anomaly heatmap; one target window image corresponds to one window anomaly heatmap and one window anomaly score.
[0026] After obtaining the window anomaly detection result corresponding to each target window image, the anomaly detection result of the image to be detected can be determined based on the window anomaly detection result. Optionally, determining the anomaly detection result of the image to be detected based on the window anomaly detection result includes: determining whether there is a window anomaly score greater than a preset anomaly threshold; if so, then the target window image with a window anomaly score greater than the preset anomaly threshold is taken as an anomaly window image, and the anomaly detection result of the image to be detected is determined based on the anomaly heatmap corresponding to the anomaly window image; otherwise, the anomaly detection result of the image to be detected is directly determined to be that there are no surface defects.
[0027] The preset anomaly threshold can be a reference value for window anomaly scores, pre-set based on actual engineering experience, used to determine whether a target window image has surface defects. For example, the preset anomaly threshold can be set to 0.8. Specifically, each window anomaly score is compared with the preset anomaly threshold to determine if any window anomaly score is greater than the preset anomaly threshold. If the window anomaly score is greater than the preset anomaly threshold, it indicates that the corresponding target window image has surface defects; if the window anomaly score is less than or equal to the preset anomaly threshold, it indicates that the corresponding target window image does not have surface defects. If a window anomaly score is greater than the preset anomaly threshold, the target window image with the window anomaly score greater than the preset anomaly threshold is identified as an anomaly window image, and the anomaly detection result of the image to be detected is determined based on the anomaly heatmap corresponding to the anomaly window image; otherwise, the anomaly detection result of the image to be detected can be directly determined as no surface defects.
[0028] Figure 3A This diagram illustrates a window anomaly detection result, where "partial photo" represents the target window image, "score" represents the window anomaly score, and "Patchcore anomaly heatmap" represents the window anomaly heatmap. When the preset anomaly threshold is set to 0.750, a score of 1.000 > 0.750 indicates the presence of an anomaly (high score); a score of 0.720 < 0.750 indicates the absence of an anomaly (normal, low score); and a score of 0.501 < 0.750 also indicates the absence of an anomaly (normal, low score).
[0029] This solution uses a preset anomaly threshold set based on actual engineering experience to quickly screen target window images and exclude those without surface defects. For abnormal window images that may have surface defects, the final anomaly detection result needs to be determined based on the anomaly heatmap. This approach effectively balances the efficiency and accuracy of defect detection and reduces the waste of computing resources.
[0030] In this embodiment, optionally, determining the anomaly detection result of the image to be detected based on the anomaly heatmap corresponding to the anomaly window image includes: adding the anomaly heatmap corresponding to the anomaly window image to the background image based on the position information of the anomaly window image in the mask suppression image to obtain a reference anomaly image; wherein the background image and the mask suppression image have the same size, and the pixel values of the background image are all 0; integrating the various anomaly heatmaps in the reference anomaly image to obtain an overall anomaly heatmap; wherein, for the overlapping area of the anomaly heatmaps, the maximum anomaly score corresponding to each pixel in the overlapping area is taken as the anomaly score of the corresponding pixel; and determining the anomaly detection result of the image to be detected based on the overall anomaly heatmap.
[0031] Specifically, firstly, based on the positional information (i.e., positional distribution) of the abnormal window image in the mask suppression image, the abnormal heatmap corresponding to the abnormal window image is added to the corresponding position in the background image to obtain a reference abnormal image. Setting the background image and the mask suppression image to the same size accelerates the accurate mapping of the abnormal heatmap; setting all pixel values in the background image to 0 ensures that only the abnormal heatmap is presented in the background image, effectively avoiding other background interference. Then, the various abnormal heatmaps in the reference abnormal image are integrated to obtain a non-overlapping overall abnormal heatmap. It should be noted that in existing technologies, the average value is usually used as a representative value for processing overlapping areas; however, averaging dilutes strong anomalies, leading to a decrease in defect detection accuracy. Therefore, in this embodiment, for the overlapping areas of the abnormal heatmaps, the maximum abnormal score corresponding to each pixel within the overlapping area is selected as the abnormal score of the corresponding pixel, thereby effectively avoiding the problem of strong anomalies being diluted. Finally, the anomaly detection result of the image to be detected can be determined based on the overall abnormal heatmap.
[0032] This solution integrates the various anomaly heatmaps in the reference anomaly image by taking the maximum value, which can effectively avoid the dilution problem of strong anomalies and help to further improve the accuracy of defect detection.
[0033] In this embodiment, optionally, determining the anomaly detection result of the image to be detected based on the overall anomaly heatmap includes: determining the critical anomaly score based on the statistical characteristics of the anomaly scores in the overall anomaly heatmap; performing binarization processing on the reference anomaly image based on the critical anomaly score to obtain the initial anomaly detection result; and performing a morphological closing operation on the initial anomaly detection result to obtain the anomaly detection result of the image to be detected.
[0034] The statistical features can include the mean and standard deviation. Specifically, firstly, the mean and standard deviation of all anomaly scores in the overall anomaly heatmap are calculated, and a critical anomaly score is determined accordingly. The critical anomaly score serves as a reference value for determining pixel-level anomalies; if the anomaly score of a pixel is greater than the critical anomaly score, it indicates that the pixel is abnormal; otherwise, it indicates that the pixel is not abnormal. For example, the critical anomaly score S can be calculated as S = mean + K × std, where mean and std represent the mean and standard deviation of all anomaly scores in the overall anomaly heatmap, respectively; K represents a pre-set balancing coefficient used to adjust the weight of the mean and standard deviation, for example, K can be set to 2.0. Then, the critical anomaly score is used as a binarization threshold to binarize the reference anomaly image, setting regions in the reference anomaly image with a score greater than the critical anomaly score to 1 and other regions to 0, thus obtaining the initial anomaly detection result. It should be noted that binarization often produces breaks or internal voids. Therefore, morphological closing operations (such as using a 5×5 elliptic kernel) can be performed on the initial anomaly detection results to connect breaks and fill internal voids in defects, thereby optimizing the quality of the mask morphology. This ultimately forms a continuous, quantifiable binary defect mask as the anomaly detection result for the image to be detected. See [link to relevant documentation]. Figure 3B .
[0035] This scheme employs a dual judgment mechanism of "coarse screening followed by fine analysis" for image anomaly detection. The critical anomaly score used in the fine analysis depends on the statistical characteristics of the anomaly score in the overall anomaly heatmap, which helps to further improve the accuracy of defect detection.
[0036] The technical solution of this invention involves acquiring an image to be detected containing wind turbine blades and processing the image to obtain a binary mask image. In the binary mask image, the pixel value of the blade region is 1, and the pixel value of the non-blade region is 0. The image to be detected is divided into a target region and a background region based on the binary mask image. The pixel values of the background region are set to zero to obtain a mask suppression image. The target region refers to the image region in the image to be detected that corresponds to the blade region in the binary mask image. A sliding window is used to traverse the mask suppression image to obtain multiple candidate window images. The candidate window images are then filtered based on the number of target pixels in each candidate window image to obtain a target window image. Target pixels refer to pixels falling within the target region, and the sliding window step size does not exceed the sliding window size. An unsupervised anomaly detection model is used to perform surface defect detection on the target window image to obtain a window anomaly detection result. The anomaly detection result of the image to be detected is determined based on the window anomaly detection result. This technical solution employs mask-guided image segmentation, which effectively reduces the loss of minor defects caused by direct scaling of the entire image; window image filtering enables precise location of target areas, thereby greatly reducing background interference and computational waste; and the use of an unsupervised anomaly detection model for defect detection effectively overcomes the difficulties in obtaining anomaly samples and the limitations in defect category detection under supervised models, thus helping to improve the accuracy and efficiency of wind turbine blade surface defect detection.
[0037] Example 2 Figure 4 This is a flowchart of a wind turbine blade surface defect detection method provided in Embodiment 2 of the present invention. This embodiment is based on the above embodiment and optimized. Specifically, the optimization is as follows: multiple candidate window images are obtained by traversing the mask suppression image with a sliding window, including: traversing the mask suppression image with a sliding window, cropping the image region corresponding to the sliding window based on the sliding window size during the traversal process to obtain multiple candidate window images, and setting the pixel values of the regions in the candidate window images that exceed the mask suppression image to zero, until the sliding window is completely outside the mask suppression image.
[0038] like Figure 4 As shown, the method in this embodiment specifically includes the following steps: S210: Obtain the image to be detected containing the wind turbine blades, and process the image to be detected to obtain a binary mask image.
[0039] In the binary mask image, the pixel value of the leaf region is 1, and the pixel value of the non-leaf region is 0.
[0040] S220: The image to be detected is divided into target region and background region according to the binary mask image, and the pixel values of the background region are set to zero to obtain the mask suppression image.
[0041] The target region refers to the image region in the image to be detected that corresponds to the leaf region in the binary mask image.
[0042] S230: A sliding window is used to traverse the mask suppression image. During the traversal, the image region corresponding to the sliding window is cropped based on the sliding window size to obtain multiple candidate window images. The pixel values of the regions in the candidate window images that are outside the mask suppression image are set to zero until the sliding window is completely outside the mask suppression image.
[0043] In this embodiment, to eliminate the detection blind zone between target edges and image edges, the sliding window is allowed to slide out of the mask suppression image boundary during the process of traversing the mask suppression image using a sliding window. This ensures that targets close to the edge of the mask suppression image are not missed. The step size of the sliding window does not exceed the sliding window size.
[0044] For example, refer to Figure 5 Starting from the top left corner of the masked image, a fixed-size (e.g., 500×500) sliding window is used to traverse the entire masked image with a fixed step size (e.g., 250). During the traversal, the image region corresponding to the sliding window is cropped to obtain multiple candidate window images of the same size as the sliding window, until the sliding window is completely outside the masked image. It should be noted that the candidate window images may be entirely or partially located inside the masked image; for candidate window images that are partially located inside the masked image, the pixel values of the regions of the candidate window image that extend beyond the masked image need to be set to zero. This effectively eliminates background interference while maintaining the same candidate window image size. Figure 6 This paper presents a partial candidate window image after the mask suppression image has been traversed, wherein the pixel value of the region outside the mask suppression image in the candidate window image is 0 (blacked out).
[0045] S240: Filter the candidate window images based on the number of target pixels in each candidate window image to obtain the target window image.
[0046] In this embodiment, optionally, the candidate window images are filtered based on the number of target pixels in each candidate window image to obtain the target window image, including: determining the number of target pixels in each candidate window image; determining whether the number of target pixels meets the target number condition; wherein, the target number condition means that the number of target pixels is not less than a preset minimum number of pixels and the ratio of the number of target pixels to the number of effective pixels in the corresponding candidate window image is not less than a preset percentage, and effective pixels refer to pixels that do not exceed the mask suppression image; if satisfied, the candidate window image corresponding to the number of target pixels is determined as the target window image.
[0047] Specifically, the number of target pixels in each candidate window image is first determined. One approach is direct counting (pixel-level summation), but this is time-consuming and inefficient when dealing with a large number of candidate window images. To improve efficiency, an integral image lookup method can be used. Optionally, after processing the image to be detected to obtain a binary mask image, the process includes: determining the integral image corresponding to the binary mask image; where the integral image and the binary mask image have the same size, and the integral value at the reference position in the integral image represents the sum of all pixel values within the corresponding region in the binary mask image of the rectangular area formed by the upper left corner of the integral image to the reference position; correspondingly, the number of target pixels in each candidate window image is determined, including: querying the integral image based on the effective corner positions of each candidate window image in the mask suppression image; where effective corner positions refer to the corner positions of the window image that do not exceed the mask suppression image; and determining the number of target pixels in each candidate window image based on the query results of the integral image.
[0048] The reference position can refer to any location within the integral plot. For example, see [link to example]. Figure 7 Taking a 5×5 binary mask image (1 represents the target, 0 represents the background) as an example, this paper illustrates how to use the integral image lookup method to determine the number of target pixels in each candidate window image. Figure 7 In (a), the red rectangle corresponds to the candidate window image, and in (b), the integral value of each cell is equal to the cumulative number of 1s in the rectangular area formed by the top left corner to that cell within the corresponding area in (a).
[0049] Specifically, firstly, the effective corner positions of each candidate window image in the mask suppression image are determined. For candidate window images entirely within the mask suppression image, the effective corner positions are the pixels located at the top-left, bottom-left, top-right, and bottom-right corners of the candidate window image. For candidate window images partially within the mask suppression image, the effective corner positions are the pixels located at the top-left, bottom-left, top-right, and bottom-right corners of the intersection region of the candidate window image and the mask suppression image; that is, the portion outside the mask suppression image is not considered. Then, for each candidate window image, the integral value of the target position is obtained by querying the integral image based on the effective corner position. The target position includes the bottom-right effective corner position (see point D in the integral image), the pixel position in the row preceding the bottom-right effective corner position (see point B in the integral image), the pixel position in the row preceding the bottom-left effective corner position (see point C in the integral image), and the pixel position at the intersection of the row and column preceding the top-left effective corner position (see point A in the integral image). It should be noted that if the target location exceeds the masked suppression image, the corresponding integral value is set to 0. Furthermore, to ensure that the integral image query rectangle is completely consistent with the actual cropped pixel set, the sliding window size needs to be set to an even number and the step size to an integer. Then, the number of target pixels NUM in the corresponding candidate window image can be calculated based on the integral value at the target location, specifically expressed as: NUM = I(D) - I(B) - I(C) + I(A), where I is the integral value. For example, for... Figure 7 The number of target pixels in the candidate window image in (a) is: NUM = I(D) - I(B) - I(C) + I(A) = 11 - 2 - 2 + 0 = 7. Therefore, the integral image lookup method only requires creating an integral image globally once. For each candidate window image, it only needs to query 4 integral values and perform 3 addition and subtraction operations to quickly and accurately locate the number of target pixels in the candidate window image. This method is applicable to candidate window images of any size.
[0050] This scheme, through this setup, can quickly and accurately determine the number of target pixels in each candidate window image using the integral image query method. Compared with the direct counting method, it greatly improves computational efficiency and effectively reduces the waste of computational resources.
[0051] After determining the number of target pixels in each candidate window image, it can be determined whether the number of each target pixel meets the target number condition. The target number condition means that the number of target pixels is not less than a preset minimum number of pixels, and the ratio of the number of target pixels to the number of effective pixels in the corresponding candidate window image is not less than a preset percentage. Effective pixels refer to pixels that do not exceed the mask suppression image. It can be understood that for candidate window images entirely located within the mask suppression image, the corresponding effective pixel count is the total number of pixels in the candidate window image falling within the target region; for candidate window images partially located within the mask suppression image, the corresponding effective pixel count is the total number of pixels falling within the target region in the intersection area of the candidate window image and the mask suppression image. If the number of target pixels meets the target number condition, it indicates that the corresponding candidate window image has a sufficient number of target pixels, and the candidate window image corresponding to the target pixel count can be retained as the target window image. If the number of target pixels does not meet the target number condition, it indicates that the corresponding candidate window image does not have a sufficient number of target pixels, and the candidate window image corresponding to the target pixel count can be directly eliminated to avoid inaccurate defect detection due to an insufficient number of target pixels.
[0052] This solution uses a dual-gating system to filter candidate window images, ensuring that the filtered target window images have a sufficient number of target pixels for defect detection, which helps to further improve the accuracy of defect detection.
[0053] S250: The unsupervised anomaly detection model is used to detect surface defects in the target window image to obtain the window anomaly detection result. Based on the window anomaly detection result, the anomaly detection result of the image to be detected is determined.
[0054] The technical solution of this invention, when using a sliding window to traverse a mask suppression image, involves cropping the image region corresponding to the sliding window based on the sliding window size during the traversal process to obtain multiple candidate window images. The pixel values of regions in the candidate window images that extend beyond the mask suppression image are set to zero until the sliding window is completely outside the mask suppression image. This technical solution allows the sliding window to extend beyond the image boundary during image block cropping, ensuring that targets close to the image edge are not missed, thereby eliminating the detection blind zone between the target edge and the image edge and helping to further improve the accuracy of defect detection.
[0055] Example 3 Figure 8 This is a schematic diagram of a wind turbine blade surface defect detection device provided in Embodiment 3 of the present invention. This device can execute the wind turbine blade surface defect detection method provided in any embodiment of the present invention, and possesses the corresponding functional modules and beneficial effects for executing the method. For example... Figure 8As shown, the device includes: The blade mask determination module 310 is used to acquire an image to be detected containing wind turbine blades and process the image to be detected to obtain a binary mask image; wherein, the pixel value of the blade area in the binary mask image is 1, and the pixel value of the non-blade area is 0. The mask suppression module 320 is used to divide the image to be detected into a target region and a background region according to the binary mask image, and set the pixel values of the background region to zero to obtain a mask suppression image; wherein, the target region refers to the image region in the image to be detected that corresponds to the leaf region in the binary mask image; The window image determination module 330 is used to traverse the mask suppression image using a sliding window to obtain multiple candidate window images, and to filter the candidate window images based on the number of target pixels in each candidate window image to obtain a target window image; wherein, the target pixel refers to the pixel falling into the target area, and the sliding window step size does not exceed the sliding window size; Anomaly detection module 340 is used to perform surface defect detection on the target window image using an unsupervised anomaly detection model to obtain window anomaly detection results, and to determine the anomaly detection results of the image to be detected based on the window anomaly detection results.
[0056] Optionally, the window image determination module 330 is used for: The mask suppression image is traversed using a sliding window. During the traversal, the image region corresponding to the sliding window is cropped based on the sliding window size to obtain multiple candidate window images. The pixel values of the regions in the candidate window images that are outside the mask suppression image are set to zero until the sliding window is completely outside the mask suppression image.
[0057] Optionally, the window image determination module 330 is further configured to: Determine the number of target pixels in each candidate window image; Determine whether the number of target pixels meets the target number condition; wherein, the target number condition means that the number of target pixels is not less than the preset minimum number of pixels and the ratio of the number of target pixels to the number of effective pixels in the corresponding candidate window image is not less than the preset proportion, and the effective pixels refer to pixels that do not exceed the mask suppression image; If the conditions are met, the candidate window image corresponding to the target pixel count is determined as the target window image.
[0058] Optionally, the apparatus further includes: an integral map determination module, used for: After processing the image to be detected to obtain a binary mask image, an integral image corresponding to the binary mask image is determined; wherein, the integral image and the binary mask image have the same size, and the integral value at the reference position in the integral image is used to characterize the sum of all pixel values in the corresponding region of the rectangular area formed from the upper left corner of the integral image to the reference position in the binary mask image; Accordingly, the window image determination module 330 is also used for: The integral image is queried based on the effective corner positions of each candidate window image in the mask suppression image; wherein, the effective corner positions refer to the corner positions of the window images that do not exceed the mask suppression image; The number of target pixels in each candidate window image is determined based on the query results of the integral image.
[0059] Optionally, the window anomaly detection result includes a window anomaly heatmap and a window anomaly score. The window anomaly heatmap is used to reflect the anomaly score of each pixel in the target window image. The window anomaly score refers to the maximum anomaly score in the window anomaly heatmap. The level of the anomaly score is positively correlated with the probability of the existence of surface defects. Accordingly, the anomaly detection module 340 is used for: Determine whether the window anomaly score is greater than a preset anomaly threshold; If so, the target window image with a window anomaly score greater than the preset anomaly threshold is taken as the abnormal window image, and the anomaly detection result of the image to be detected is determined according to the anomaly heatmap corresponding to the abnormal window image. Otherwise, the abnormal detection result of the image to be detected is directly determined to be that there are no surface defects.
[0060] Optionally, the anomaly detection module 340 is further configured to: Determining the anomaly detection result of the image to be detected based on the anomaly heatmap corresponding to the anomaly window image includes: Based on the position information of the abnormal window image in the mask suppression image, the abnormal heatmap corresponding to the abnormal window image is added to the background image to obtain a reference abnormal image; wherein, the background image and the mask suppression image have the same size, and the pixel value of the background image is 0. The various anomaly heatmaps in the reference anomaly image are integrated to obtain an overall anomaly heatmap; wherein, for the overlapping areas of the anomaly heatmaps, the maximum anomaly score corresponding to each pixel in the overlapping area is taken as the anomaly score of the corresponding pixel. The anomaly detection result of the image to be detected is determined based on the overall anomaly heatmap.
[0061] Optionally, the anomaly detection module 340 is further configured to: The critical anomaly score is determined based on the statistical characteristics of the anomaly scores in the overall anomaly heatmap. The reference anomaly image is binarized based on the critical anomaly score to obtain the initial anomaly detection result. A morphological closing operation is performed on the initial anomaly detection result to obtain the anomaly detection result of the image to be detected.
[0062] The wind turbine blade surface defect detection device provided in this embodiment of the invention can execute the wind turbine blade surface defect detection method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method.
[0063] Example 4 Figure 9 A schematic diagram of an electronic device 10, which can be used to implement embodiments of the present invention, is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0064] like Figure 9 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0065] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0066] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as the wind turbine blade surface defect detection method.
[0067] In some embodiments, the wind turbine blade surface defect detection method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the wind turbine blade surface defect detection method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the wind turbine blade surface defect detection method by any other suitable means (e.g., by means of firmware).
[0068] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0069] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0070] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0071] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0072] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0073] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0074] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0075] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for detecting surface defects in wind turbine blades, characterized in that, The method includes: An image containing wind turbine blades is acquired and processed to obtain a binary mask image; wherein, in the binary mask image, the pixel value of the blade region is 1, and the pixel value of the non-blade region is 0. The image to be detected is divided into a target region and a background region based on the binary mask image, and the pixel values of the background region are set to zero to obtain a mask suppression image; wherein, the target region refers to the image region in the image to be detected that corresponds to the leaf region in the binary mask image; Multiple candidate window images are obtained by traversing the mask suppression image using a sliding window. The candidate window images are then filtered based on the number of target pixels in each candidate window image to obtain the target window image. Herein, the target pixel refers to the pixel that falls into the target region, and the sliding window step size does not exceed the sliding window size. An unsupervised anomaly detection model is used to detect surface defects in the target window image to obtain window anomaly detection results, and the anomaly detection results of the image to be detected are determined based on the window anomaly detection results.
2. The method according to claim 1, characterized in that, Multiple candidate window images are obtained by traversing the mask suppression image using a sliding window, including: The mask suppression image is traversed using a sliding window. During the traversal, the image region corresponding to the sliding window is cropped based on the sliding window size to obtain multiple candidate window images. The pixel values of the regions in the candidate window images that are outside the mask suppression image are set to zero until the sliding window is completely outside the mask suppression image.
3. The method according to claim 1 or 2, characterized in that, The candidate window images are filtered based on the number of target pixels in each candidate window image to obtain the target window image, including: Determine the number of target pixels in each candidate window image; Determine whether the number of target pixels meets the target number condition; wherein, the target number condition means that the number of target pixels is not less than the preset minimum number of pixels, and the ratio of the number of target pixels to the number of effective pixels in the corresponding candidate window image is not less than the preset proportion, and the effective pixels refer to pixels that do not exceed the mask suppression image; If the conditions are met, the candidate window image corresponding to the target pixel count is determined as the target window image.
4. The method according to claim 3, characterized in that, After processing the image to be detected to obtain a binary mask image, the process further includes: Determine the integral image corresponding to the binary mask image; wherein the integral image and the binary mask image have the same size, and the integral value at the reference position in the integral image is used to characterize the sum of all pixel values in the corresponding region of the rectangular area formed from the upper left corner of the integral image to the reference position in the binary mask image; Accordingly, the number of target pixels in each candidate window image is determined, including: The integral image is queried based on the effective corner positions of each candidate window image in the mask suppression image; wherein, the effective corner positions refer to the corner positions of the window images that do not exceed the mask suppression image; The number of target pixels in each candidate window image is determined based on the query results of the integral image.
5. The method according to claim 1, characterized in that, The window anomaly detection results include a window anomaly heatmap and a window anomaly score. The window anomaly heatmap is used to reflect the anomaly score of each pixel in the target window image. The window anomaly score refers to the maximum anomaly score in the window anomaly heatmap. The level of the anomaly score is positively correlated with the probability of the existence of surface defects. Accordingly, determining the anomaly detection result of the image to be detected based on the window anomaly detection result includes: Determine whether the window anomaly score is greater than a preset anomaly threshold; If so, the target window image with a window anomaly score greater than the preset anomaly threshold is taken as the abnormal window image, and the anomaly detection result of the image to be detected is determined according to the anomaly heatmap corresponding to the abnormal window image. Otherwise, the abnormal detection result of the image to be detected is directly determined to be that there are no surface defects.
6. The method according to claim 5, characterized in that, Determining the anomaly detection result of the image to be detected based on the anomaly heatmap corresponding to the anomaly window image includes: Based on the position information of the abnormal window image in the mask suppression image, the abnormal heatmap corresponding to the abnormal window image is added to the background image to obtain a reference abnormal image; wherein, the background image and the mask suppression image have the same size, and the pixel value of the background image is 0. The various anomaly heatmaps in the reference anomaly image are integrated to obtain an overall anomaly heatmap; wherein, for the overlapping areas of the anomaly heatmaps, the maximum anomaly score corresponding to each pixel in the overlapping area is taken as the anomaly score of the corresponding pixel. The anomaly detection result of the image to be detected is determined based on the overall anomaly heatmap.
7. The method according to claim 6, characterized in that, Determining the anomaly detection result of the image to be detected based on the overall anomaly heatmap includes: The critical anomaly score is determined based on the statistical characteristics of the anomaly scores in the overall anomaly heatmap. The reference anomaly image is binarized based on the critical anomaly score to obtain the initial anomaly detection result. A morphological closing operation is performed on the initial anomaly detection result to obtain the anomaly detection result of the image to be detected.
8. A device for detecting surface defects in wind turbine blades, characterized in that, The device includes: The blade mask determination module is used to acquire an image to be detected containing wind turbine blades and process the image to be detected to obtain a binary mask image; wherein, the pixel value of the blade area in the binary mask image is 1, and the pixel value of the non-blade area is 0. The mask suppression module is used to divide the image to be detected into a target region and a background region according to the binary mask image, and set the pixel values of the background region to zero to obtain a mask suppression image; wherein, the target region refers to the image region in the image to be detected that corresponds to the leaf region in the binary mask image; The window image determination module is used to traverse the mask suppression image using a sliding window to obtain multiple candidate window images, and to filter the candidate window images based on the number of target pixels in each candidate window image to obtain a target window image; wherein, the target pixel refers to the pixel falling into the target region, and the sliding window step size does not exceed the sliding window size; An anomaly detection module is used to perform surface defect detection on the target window image using an unsupervised anomaly detection model to obtain window anomaly detection results, and to determine the anomaly detection results of the image to be detected based on the window anomaly detection results.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the wind turbine blade surface defect detection method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that are used to cause a processor to execute the wind turbine blade surface defect detection method according to any one of claims 1-7.
