Fault image generation method and device, electronic equipment and storage medium

By clustering and color space processing of photovoltaic power plant images, and using a GAN model to generate fault simulation images, the problems of poor generalization and low efficiency in existing technologies are solved, and efficient fault image generation is achieved.

CN120451608BActive Publication Date: 2025-11-18SHANGTEJIE POWER TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510936255.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-08
Publication Date
2025-11-18
Estimated Expiration
2045-07-08

AI Technical Summary

Technical Problem

Existing technologies generate fault images with poor generalization ability, making it difficult to meet the needs of photovoltaic power plants in different scenarios, and the generation efficiency is low.

Method used

By acquiring multiple images of the target structure, clustering and color space distribution similarity redundancy removal are performed, and a generative adversarial network (GAN) model is used to output a fault simulation image.

Benefits of technology

It effectively realizes the simulation generation of fault images of target structures, reduces the time and cost of manual data collection, and improves the generalization ability of image recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120451608B_ABST
    Figure CN120451608B_ABST
Patent Text Reader

Abstract

The present disclosure provides a fault image generation method and device, electronic equipment and storage medium, belonging to the technical field of image processing. The method comprises: acquiring multiple images of a target structure; performing clustering processing on the multiple images to obtain multiple clustering results, each clustering result comprising multiple images; performing color space distribution similarity redundancy removal processing on each clustering result to obtain multiple optimized clustering results; and outputting a fault simulation image of the target structure based on the multiple optimized clustering results through a generative adversarial network (GAN) model. The technical solution provided by the present disclosure solves the problem of sensitivity of the GAN network to the class difference of training data by clustering and removing redundancy of the acquired multiple images, and can effectively simulate and generate main fault images such as dropouts, hot spots and fragmentation of the target structure, thereby reducing the image acquisition time and cost of artificial fault data.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure belongs to the technical field of image processing, and particularly relates to a fault image generation method and device, an electronic device, and a storage medium. BACKGROUND

[0002] With the development of new energy, the number of photovoltaic power stations is increasing, and the corresponding operation and maintenance problems are increasingly prominent. With the development of unmanned aerial vehicle technology, the identification of component faults increasingly relies on AI image recognition and other automated means, which not only greatly improves the efficiency of fault diagnosis, but also effectively reduces labor costs and safety risks. However, AI image recognition relies on a large amount of data collection of fault images, and due to the limitations of complex terrain and weather conditions of photovoltaic power stations, it is difficult to collect a large amount of data.

[0003] In related technologies, an image transformation method is mainly used, that is, a local image is manually generated, and then scaling, deformation, rotation and other processing are performed, and then the processed image is embedded into a related background image to form a new image, that is, a fault image. The fault image generated by this method is relatively simple, has poor generalization, and is difficult to meet the differentiated requirements of photovoltaic power stations in different scenarios, such as water surface photovoltaic, roof photovoltaic, desert photovoltaic, etc., and has low generation efficiency. SUMMARY

[0004] Embodiments of the present disclosure provide a solution to solve the problem that the fault image generated in the related art is relatively simple, has poor generalization, and is difficult to meet the differentiated requirements of photovoltaic power stations in different scenarios, and has low generation efficiency.

[0005] In a first aspect, the present disclosure provides a fault image generation method, which comprises:

[0006] obtaining a plurality of images of a target structure, wherein the plurality of images include a plurality of images of the target structure under normal conditions and a plurality of images of the target structure under fault conditions;

[0007] performing clustering processing on the plurality of images to obtain a plurality of clustering results, each clustering result including a plurality of images;

[0008] performing color space distribution similarity redundancy removal processing on each clustering result to obtain an optimized plurality of clustering results;

[0009] outputting a fault simulation image of the target structure based on the optimized plurality of clustering results through a generative adversarial network (GAN) model.

[0010] In a second aspect, the present disclosure provides a fault image generation device, which comprises:

[0011] an acquisition unit configured to obtain a plurality of images of a target structure, wherein the plurality of images include a plurality of images of the target structure under normal conditions and a plurality of images of the target structure under fault conditions;

[0012] a clustering unit, configured to perform clustering processing on the multiple images to obtain multiple clustering results, each of which includes multiple images;

[0013] a redundancy removal unit, configured to perform color space distribution similarity redundancy removal processing on each of the clustering results to obtain multiple optimized clustering results;

[0014] a generation unit, configured to output a fault simulation image of a target structure based on the multiple optimized clustering results by using a generative adversarial network (GAN) model.

[0015] In a third aspect, the present disclosure provides an electronic device, comprising:

[0016] a processor; and

[0017] a memory configured to store executable instructions of the processor;

[0018] The processor is configured to execute the executable instructions to perform any of the methods in the first aspect or possible implementation manners of the first aspect.

[0019] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, and the computer program is executed by a processor to implement any of the methods in the first aspect or possible implementation manners of the first aspect.

[0020] In a fifth aspect, the present disclosure provides a computer program product comprising computer instructions, and the computer instructions are executed by a processor to implement any of the methods in the first aspect or possible implementation manners of the first aspect.

[0021] The technical solution provided by the present disclosure includes the following steps: obtaining multiple images of a target structure, wherein the multiple images include multiple images of the target structure under normal conditions and multiple images of the target structure under fault conditions; performing clustering processing on the multiple images to obtain multiple clustering results, each of which includes multiple images; performing color space distribution similarity redundancy removal processing on each of the clustering results to obtain multiple optimized clustering results; and outputting a fault simulation image of the target structure based on the multiple optimized clustering results by using a generative adversarial network (GAN) model. The technical solution provided by each embodiment of the present disclosure solves the problem that the GAN network is sensitive to the class difference of training data by performing clustering and redundancy removal on the obtained multiple images, and can effectively generate images simulating main faults such as string drop, hot spot, and fragmentation of the target structure, thereby reducing the image acquisition time and cost of artificial fault data. BRIEF DESCRIPTION OF DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the related art, below will briefly introduce the drawings needed to be used in the embodiments or the related art description. Obviously, the drawings in the following description are some embodiments of the present disclosure, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor. In the drawings:

[0023] Figure 1 A flowchart of a fault image generation method provided by an embodiment of the present disclosure is shown in the figure;

[0024] Figure 2 A structural diagram of a fault image generation device provided by an embodiment of the present disclosure is shown in the figure;

[0025] Figure 3 A structural diagram of an electronic device provided by an embodiment of the present disclosure is shown in the figure. DETAILED DESCRIPTION

[0026] The embodiments of the present disclosure will be described in detail below, and examples of the embodiments are shown in the drawings. The embodiments described below by referring to the drawings are exemplary and are intended to explain the present disclosure, and cannot be understood as a limitation of the present disclosure.

[0027] The terms "first" and "second" and the like in the specification, claims, and drawings of the embodiments of the present disclosure are used to distinguish similar objects, and do not necessarily have to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present disclosure described herein can be implemented, for example, in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0028] The fault image generation method provided by the embodiments of the present disclosure can run on a terminal device or a server. The terminal device can be a local terminal device, including VR (Virtual Reality), AR (Augmented Reality), MR (Mixed Reality), and other wearable devices. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, and basic cloud computing services such as big data and artificial intelligence platforms.

[0029] With the development of new energy, the number of photovoltaic power stations is increasing, and the corresponding operation and maintenance problems are increasingly prominent. With the development of unmanned aerial vehicle technology, the identification of component failures increasingly relies on AI image recognition and other automated means, which not only greatly improves the efficiency of fault diagnosis, but also effectively reduces labor costs and safety risks. However, AI image recognition relies on a large amount of data collection of fault images, and due to the limitations of complex terrain and weather conditions in photovoltaic power stations, it is difficult to collect a large amount of data.

[0030] In related technologies, the method of image transformation is mainly used, that is, first manually generate local images, then process them by scaling, deformation, rotation, etc., and then embed them into related background images to form new images, i.e. fault images. This method cannot generate simple fault images, has poor generalization, and is difficult to meet the differentiated requirements of photovoltaic power stations in different scenarios, such as water surface photovoltaic, roof photovoltaic, desert photovoltaic, etc., and has low generation efficiency.

[0031] Figure 1 A flowchart of a fault image generation method provided for an exemplary embodiment of the present disclosure, which can be applied to a device with data processing function, at least comprising the following steps S101-S104:

[0032] S101, obtaining multiple images of a target structure.

[0033] In some embodiments, the multiple images include multiple images of the target structure under normal conditions and multiple images of the target structure under fault conditions. The number of images is not limited here.

[0034] Further, in order to ensure the smoothness of subsequent image processing, the obtained multiple images of the target structure are preprocessed. For example, all the obtained images are adjusted to a preset size, such as 1024x1024 pixels, and the image pixel values are normalized to the range of [-1, 1], etc.

[0035] In other embodiments, the obtained multiple images of the target structure can be infrared images or optical images, which are set according to actual conditions.

[0036] S102, clustering processing the multiple images to obtain multiple clustering results.

[0037] In some embodiments, each clustering result includes multiple images.

[0038] In some embodiments, for the aforementioned step S102, the clustering processing the multiple images to obtain multiple clustering results comprises steps S11-S12:

[0039] S11, determining a preset number of first images in the multiple images.

[0040] S12, performing clustering processing on the plurality of images with the preset number of first images as clustering centers to obtain a plurality of clustering results.

[0041] In some embodiments, for the foregoing step S11, the preset number is the same as the number of the clustering results.

[0042] Further, in actual process, the person skilled in the art will generally set the preset number in combination with common photovoltaic power station topography, geomorphology and support types, and preferably the preset number can be set to 10. The specific value can be set according to actual conditions.

[0043] In some embodiments, for the foregoing step S12, the clustering processing on the plurality of images with the preset number of first images as clustering centers to obtain a plurality of clustering results includes steps S121-S122:

[0044] S121, calculating the Euclidean distance between any first image in the preset number of first images and all images in the plurality of images except the preset number of first images.

[0045] S122, assigning images with a Euclidean distance less than a first preset threshold to a cluster to which the first image belongs to obtain a clustering result, and further obtaining the preset number of clustering results.

[0046] In some embodiments, for the foregoing step S121, the calculation of the Euclidean distance between the first image and all images in the plurality of images except the preset number of first images includes steps S21-S24:

[0047] S21, performing gray processing on the first image to obtain a first gray image.

[0048] S22, performing gray processing on any second image of all images in the plurality of images except the preset number of first images to obtain a second gray image.

[0049] S23, determining a first feature vector of the first gray image and a second feature vector of the second gray image.

[0050] S24, obtaining the Euclidean distance between the first image and the second image based on a Euclidean distance formula, the first feature vector and the second feature vector.

[0051] The Euclidean distance formula is: The first feature vector is the first feature vector of the first gray image, and the second feature vector is the second feature vector of the second gray image. ​For the second feature vector, the k is the preset number, the i∈k, the The length of the first feature vector is the same as the length of the second feature vector.

[0052] In some embodiments, for the foregoing step S23, the feature vector refers to a surface texture feature vector of the picture.

[0053] Further, in the actual process, the HOGDescriptor::compute method in the image processing library OpenCV needs to be called to process the first and second gray images, and the length of the output first feature vector is consistent with the length of the second feature vector, that is, len=26244.

[0054] In some embodiments, a plurality of clustering results are obtained after step S12, but in order to ensure that the obtained clustering results are accurate, each clustering result needs to be traversed in turn, the cluster center is updated according to the sample mean, and if the updated cluster center is different from the cluster center before updating, the clustering is performed again according to steps S11-S12.

[0055] S103, color space distribution similarity redundancy processing is performed on each clustering result to obtain an optimized plurality of clustering results.

[0056] In some embodiments, for the foregoing step S103, the color space distribution similarity redundancy processing is performed on each clustering result to obtain an optimized plurality of clustering results, including steps S31-S33:

[0057] S31, for any clustering result in the plurality of clustering results, the cluster center in the clustering result is taken as an image reference value.

[0058] S32, the color difference between all images except the cluster center in the plurality of images contained in the clustering result and the cluster center is calculated in turn.

[0059] S33, based on the color difference, the images in the plurality of images contained in the clustering result that do not meet the preset condition are removed to obtain an optimized clustering result, and further to obtain an optimized plurality of clustering results.

[0060] In some embodiments, for the foregoing step S32, the color difference refers to the distribution similarity index of all images except the cluster center in the plurality of images contained in the clustering result and the cluster center in the four color spaces of H, S, Cb and Cr.

[0061] In some embodiments, for the foregoing step S33, the not meeting the preset condition refers to at least three of the distribution similarity indexes in the H, S, Cb, and Cr four color spaces being greater than a second preset threshold.

[0062] In some embodiments, for better understanding of the scheme, taking the first image and the second image as an example, the process of calculating the distribution similarity index in the Cr color space is as follows:

[0063] First, for the first image or the second image, it is divided into a plurality of patches, for example, for a 224*224 picture, it is divided into a plurality of patches by grid, each patch has a size of 16*16, and there are a total of 196 patches.

[0064] For each patch, a color correlation coefficient is defined .

[0065] Wherein . The specific is as follows:

[0066]

[0067] Wherein, is the value of the pixel at coordinates j, k in the patch in the c color space, and the is average value in the patch, and m and n are the height and width of the patch, respectively.

[0068] If so, taking the 224*224 picture as an example, for each color space c, there are 196 values, and the 196 values constitute the probability distribution of the picture in the c color space.

[0069] Next, the distribution similarity index of the first image and the second image in the Cr color space is calculated :

[0070]

[0071] Wherein, is the index of the probability distribution aggregated by the barrel, respectively, the number of the probability distribution of the first image p and the second image q in the index.

[0072] In this embodiment, the greater the value, the greater the difference between the first image and the second image.

[0073] S104, based on the optimized plurality of clustering results, output a fault simulation image of a target structure through a generative adversarial network (GAN) model.

[0074] The technical solution provided by the present disclosure is to obtain multiple images of a target structure, the multiple images including multiple images of the target structure under normal conditions and multiple images of the target structure under fault conditions; perform clustering processing on the multiple images to obtain multiple clustering results, each clustering result including multiple images; perform color space distribution similarity redundancy reduction processing on each clustering result to obtain multiple optimized clustering results; and output a fault simulation image of the target structure based on the multiple optimized clustering results through a generative adversarial network (GAN) model. The technical solution provided by each embodiment of the present disclosure solves the problem that a GAN network is sensitive to the class difference of training data by performing clustering and redundancy reduction on the obtained multiple images, and can effectively simulate and generate main fault images such as dropouts, hot spots, and fragmentation of the target structure, thereby reducing the image acquisition time and cost of artificial fault data.

[0075] Figure 2 A structural schematic diagram of a fault image generation device provided by an example embodiment of the present disclosure is shown in FIG. 1.

[0076] The device includes an acquisition unit 201, a clustering unit 202, a redundancy reduction unit 203, and a generation unit 204.

[0077] The acquisition unit 201 is configured to acquire multiple images of a target structure, the multiple images including multiple images of the target structure under normal conditions and multiple images of the target structure under fault conditions.

[0078] The clustering unit 202 is configured to perform clustering processing on the multiple images to obtain multiple clustering results, each clustering result including multiple images.

[0079] The redundancy reduction unit 203 is configured to perform color space distribution similarity redundancy reduction processing on each clustering result to obtain multiple optimized clustering results.

[0080] The generation unit 204 is configured to output a fault simulation image of the target structure based on the multiple optimized clustering results through a generative adversarial network (GAN) model.

[0081] In some embodiments, the device is configured to perform clustering processing on the multiple images to obtain multiple clustering results, and specifically configured to:

[0082] determine a preset number of first images in the multiple images, the preset number being the same as the number of the clustering results;

[0083] perform clustering processing on the multiple images with the preset number of first images as clustering centers to obtain multiple clustering results.

[0084] In some embodiments, the device is configured to cluster the plurality of images using the preset number of first images as cluster centers to obtain a plurality of clustering results, and the device is specifically configured to:

[0085] For any first image in the preset number of first images, calculate the Euclidean distance between the first image and all images in the plurality of images except the preset number of first images.

[0086] Assign images with a Euclidean distance less than a first preset threshold to a cluster to which the first image belongs to obtain a clustering result, and further obtain the preset number of clustering results.

[0087] In some embodiments, the device is configured to calculate the Euclidean distance between the first image and all images in the plurality of images except the preset number of first images, and the device is specifically configured to:

[0088] Perform grayscale processing on the first image to obtain a first grayscale image.

[0089] For any second image of all images in the plurality of images except the preset number of first images, perform grayscale processing on the second image to obtain a second grayscale image.

[0090] Determine a first feature vector of the first grayscale image and a second feature vector of the second grayscale image.

[0091] Based on a Euclidean distance formula, the first feature vector and the second feature vector, obtain the Euclidean distance between the first image and the second image.

[0092] The Euclidean distance formula is: , the first feature vector is , the second feature vector is , the length of the first feature vector is , and the length of the first feature vector is the same as the length of the second feature vector.

[0093] In some embodiments, the device is configured to perform color space distribution similarity redundancy processing on each clustering result to obtain an optimized plurality of clustering results, including:

[0094] For any clustering result in the plurality of clustering results, use the cluster center in the clustering result as an image reference value.

[0095] In turn, calculate the color difference between all images in the clustering result except the cluster center and the cluster center.

[0096] Based on the color difference condition, the images in the clustering result that do not meet the preset condition are removed to obtain an optimized clustering result, and then a plurality of optimized clustering results are obtained.

[0097] In some embodiments, the color difference condition refers to a distribution similarity index of all images in the clustering result except the cluster center and the cluster center in H, S, Cb, and Cr four color spaces.

[0098] In some embodiments, the preset condition refers to that at least three of the distribution similarity indexes in the H, S, Cb, and Cr four color spaces are greater than a second preset threshold.

[0099] The technical solution provided by the present disclosure obtains a plurality of images of a target structure, the plurality of images including a plurality of images of the target structure under normal conditions and a plurality of images of the target structure under fault conditions; performs clustering processing on the plurality of images to obtain a plurality of clustering results, each clustering result including a plurality of images; performs color space distribution similarity redundancy removal processing on each clustering result to obtain a plurality of optimized clustering results; and outputs a fault simulation image of the target structure based on the plurality of optimized clustering results through a generative adversarial network (GAN) model. The technical solution provided by each embodiment of the present disclosure solves the problem that the GAN network is sensitive to the class difference of training data by clustering and removing redundancies of the obtained plurality of images, and can effectively simulate and generate main fault images such as string drop, hot spot, and fragmentation of the target structure, thereby reducing the image acquisition time and cost of artificial fault data.

[0100] It should be understood that the device embodiments and the method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, details are not described here. Specifically, the device can perform the above-mentioned method embodiments, and the foregoing and other operations and / or functions of each module in the device are respectively for the corresponding processes in each method of the above-mentioned method embodiments, and for the sake of brevity, details are not described here.

[0101] The apparatus of the embodiments of the present disclosure is described above from the perspective of functional modules in combination with the drawings. It should be understood that the functional modules can be realized in the form of hardware, or in the form of instructions of software, or in the form of a combination of hardware and software modules. Specifically, each step of the method embodiments in the embodiments of the present disclosure can be completed by integrated logic circuits of hardware in a processor and / or instructions of software. The steps of the method disclosed in the embodiments of the present disclosure can be directly embodied as hardware code processing for execution by a processor, or can be executed by a combination of hardware and software modules in the processor. Alternatively, the software module can be located in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps in the above method embodiments in combination with the hardware thereof.

[0102] Figure 3 is a schematic block diagram of an electronic device provided by the embodiments of the present disclosure, which can include:

[0103] The memory 301 is configured to store a computer program and transmit the program code to the processor 302. In other words, the processor 302 can call and run the computer program from the memory 301 to implement the method in the embodiments of the present disclosure.

[0104] For example, the processor 302 can be configured to execute the above method embodiments according to the instructions in the computer program.

[0105] In some embodiments of the present disclosure, the processor 302 can include but is not limited to:

[0106] A general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.

[0107] In some embodiments of the present disclosure, the memory 301 includes but is not limited to:

[0108] The non-volatile memory can be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a Random Access Memory (RAM) used as an external cache. By way of example, and not limitation, many forms of RAM can be used, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), synch link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).

[0109] In some embodiments of the present disclosure, the computer program can be divided into one or more modules, which are stored in the memory 301 and executed by the processor 302 to complete the method provided by the present disclosure. The one or more modules can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program in the electronic device.

[0110] As shown in Figure 3 The electronic device can further include:

[0111] The transceiver 303 can be connected to the processor 302 or the memory 301.

[0112] The processor 302 can control the transceiver 303 to communicate with other devices, specifically, can send information or data to other devices, or receive information or data sent by other devices. The transceiver 303 can include a transmitter and a receiver. The transceiver 303 can further include an antenna, and the number of antennas can be one or more.

[0113] It should be understood that the various components within the electronic device are connected via a bus system, which includes, in addition to a data bus, a power supply bus, a control bus, and a state signal bus.

[0114] The present disclosure also provides a computer storage medium having stored thereon a computer program, which, when executed by a computer, enables the computer to perform the method of the above-mentioned method embodiments. Alternatively, the present disclosure embodiments also provide a computer program product containing instructions, which, when executed by a computer, causes the computer to perform the method of the above-mentioned method embodiments.

[0115] When implemented using software, the functions can be stored in or transmitted through the use of a computer-readable medium, which can be any device or medium that can store or transfer this type of program code for use by or in connection with an instruction execution system. The computer-readable medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, or any suitable combination of the foregoing. More specific examples of the computer-readable medium include an electrical connection based on one or more lines of wire, portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), and a digital video disc read-only memory (DVD / Blu-ray), and the like.

[0116] Those skilled in the art can realize that the modules and algorithm steps of each example described in connection with the embodiments disclosed herein can be realized in electronic hardware, or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present disclosure.

[0117] In several embodiments provided by the present disclosure, it should be understood that the disclosed system, device and method can be implemented in other manners. For example, the division of the above-described device embodiments is merely an example, and there can be other division manners. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the modules shown or discussed can be indirect coupling or communication connection through some interface, device or module, and can be electrical, mechanical or in other forms.

[0118] The modules described as separated components can or can not be physically separated, and the components shown as modules can or can not be physical modules, i.e., can be located in one place, or can be distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments. For example, the functional modules in the embodiments of the present disclosure can be integrated into a processing module, or can be physically present separately, or two or more modules can be integrated into one module.

[0119] The above is merely specific embodiments of the present disclosure, but the protection scope of the present disclosure is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the present disclosure, which should be covered by the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.

Claims

1. A method for generating fault images, characterized in that, The method includes: Acquire multiple images of the target structure, including multiple images of the target structure under normal conditions and multiple images under fault conditions; The multiple images are clustered to obtain multiple clustering results, each of which includes multiple images; Redundancy removal based on color space distribution similarity is performed on each clustering result to obtain multiple optimized clustering results; Based on the optimized clustering results, a fault simulation image of the target structure is output by a Generative Adversarial Network (GAN) model. The step of performing color space distribution similarity deduplication on each clustering result to obtain multiple optimized clustering results includes: For any one of the multiple clustering results, the cluster center in the clustering result is used as the image reference value; Calculate the color difference between all images (excluding the cluster center) and the cluster center in the multiple images included in the clustering result; Based on the color differences, images that do not meet the preset conditions are removed from the multiple images included in the clustering results to obtain optimized clustering results, and then multiple optimized clustering results are obtained. The color difference refers to the similarity index between all images in the clustering result (excluding the cluster center) and the cluster center in the four color spaces H, S, Cb, and Cr. The failure to meet the preset conditions refers to the fact that at least three of the four color spaces, namely H, S, Cb and Cr, have similarity indices that are greater than the second preset threshold. The process of calculating the similarity index of Cr color space distribution is as follows: For any first image that serves as a cluster center among the multiple images and any second image among all images except the cluster center, the first image and the second image are divided into multiple patches according to a grid, each patch being the same size, for a total of a first number of patches; For each patch, define a color correlation coefficient. ; in Specifically, it is as follows: in, These are the pixel values ​​at coordinates j and k in the patch, located in the c color space. yes The average value in the patch, where m and n are the height and width of the patch, respectively; Calculate the similarity index of the distribution of the first and second images in the Cr color space. : in, An index for bucketed summaries of probability distributions. The probability distributions of the first image p and the second image q are respectively in The number at the index.

2. The method according to claim 1, characterized in that, The clustering process performed on the multiple images yields multiple clustering results, including: A predetermined number of first images are determined from a plurality of images, wherein the predetermined number is the same as the number of clustering results; Using the preset number of first images as cluster centers, clustering is performed on the multiple images to obtain multiple clustering results.

3. The method according to claim 2, characterized in that, Using the predetermined number of first images as cluster centers, clustering is performed on the multiple images to obtain multiple clustering results, including: For any first image among the preset number of first images, calculate the Euclidean distance between the first image and all images in the plurality of images other than the preset number of first images; Images whose Euclidean distance is less than a first preset threshold are assigned to the cluster to which the first image belongs, resulting in a clustering result, and then the preset number of clustering results are obtained.

4. The method according to claim 3, characterized in that, The calculation of the Euclidean distance between the first image and all images in the plurality of images, excluding the preset number of first images, includes: The first image is processed to obtain a first grayscale image; For any second image among all the images except the preset number of first images, perform grayscale processing on the second image to obtain a second grayscale image; Determine the first feature vector of the first grayscale image and the second feature vector of the second grayscale image; Based on the Euclidean distance formula, the first feature vector, and the second feature vector, the Euclidean distance between the first image and the second image is obtained; The Euclidean distance formula is as follows: The For the first feature vector, the The second feature vector, the The length of the first feature vector is the same as the length of the second feature vector.

5. A fault image generation device, characterized in that, The device includes: The acquisition unit is used to acquire multiple images of the target structure, including multiple images of the target structure under normal conditions and multiple images under fault conditions; A clustering unit is used to perform clustering processing on the multiple images to obtain multiple clustering results, each clustering result including multiple images; The redundancy removal unit is used to perform color space distribution similarity redundancy removal on each clustering result to obtain multiple optimized clustering results; The generation unit is used to generate a fault simulation image of the target structure by generating an adversarial network (GAN) model based on the optimized multiple clustering results. The device is also used for: For any one of the multiple clustering results, the cluster center in the clustering result is used as the image reference value; Calculate the color difference between all images (excluding the cluster center) and the cluster center in the multiple images included in the clustering result; Based on the color differences, images that do not meet the preset conditions are removed from the multiple images included in the clustering results to obtain optimized clustering results, and then multiple optimized clustering results are obtained. The color difference refers to the similarity index between all images in the clustering result (excluding the cluster center) and the cluster center in the four color spaces H, S, Cb, and Cr. The failure to meet the preset conditions refers to the fact that at least three of the four color spaces, namely H, S, Cb and Cr, have similarity indices that are greater than the second preset threshold. The device is also used for: For any first image that serves as the cluster center among the multiple images and any second image among all images except the cluster center, the first image and the second image are divided into multiple patches according to a grid. Each patch is the same size, and there is a preset number of patches. For each patch, define a color correlation coefficient. ; in Specifically, it is as follows: in, These are the pixel values ​​at coordinates j and k in the patch, located in the c color space. yes The average value in the patch, where m and n are the height and width of the patch, respectively; Calculate the similarity index of the distribution of the first and second images in the Cr color space. : in, An index for bucketed summaries of probability distributions. The probability distributions of the first image p and the second image q are respectively in The number at the index.

6. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the method of any one of claims 1-4 by executing the executable instructions.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1-4.

Citation Information

Patent Citations

  • Defective sample generation system and method based on generative adversarial network and storage medium

    CN116664975A