CN116188391A - Method and device for detecting broken gate defect, electronic equipment and storage medium - Google Patents

Method and device for detecting broken gate defect, electronic equipment and storage medium Download PDF

Info

Publication number
CN116188391A
CN116188391A CN202211728087.5A CN202211728087A CN116188391A CN 116188391 A CN116188391 A CN 116188391A CN 202211728087 A CN202211728087 A CN 202211728087A CN 116188391 A CN116188391 A CN 116188391A
Authority
CN
China
Prior art keywords
image
model
defect
semantic segmentation
random
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211728087.5A
Other languages
Chinese (zh)
Inventor
邓东升
唐永亮
杨艺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Luster LightTech Co Ltd
Original Assignee
Luster LightTech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Luster LightTech Co Ltd filed Critical Luster LightTech Co Ltd
Priority to CN202211728087.5A priority Critical patent/CN116188391A/en
Publication of CN116188391A publication Critical patent/CN116188391A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E10/00Energy generation through renewable energy sources
    • Y02E10/50Photovoltaic [PV] energy

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Photovoltaic Devices (AREA)

Abstract

The application relates to the technical field of photovoltaic cell detection, in particular to a method, a device, electronic equipment and a storage medium for detecting a broken gate defect, which are used for acquiring an image to be detected of a photovoltaic cell to be detected, inputting the image to be detected into a broken gate defect detection model, and enabling the broken gate defect detection model to output a detection result image. Because the broken gate defect detection model is adopted, the broken gate defect in the image to be detected can be rapidly and accurately segmented, and a detection result image is obtained. Meanwhile, the broken gate defect detection model is a model obtained by training an initial semantic segmentation model, so that the characteristics of the defect contour can be well learned, and the accurate defect contour is obtained.

Description

Method and device for detecting broken gate defect, electronic equipment and storage medium
Technical Field
The application relates to the technical field of photovoltaic cells, in particular to a method and a device for detecting broken gate defects, electronic equipment and a storage medium.
Background
In recent years, the field of photovoltaic cells is vigorously developed. How to realize high-precision rapid detection of various defects in the production link, improves the product qualification rate and becomes the biggest problem facing the production link.
At present, defects such as obvious scratch, hidden crack, black spot, cold joint, pollution, crack, angle breakage and the like of the photovoltaic cell can be detected by means of manual detection, traditional computer vision method detection and the like.
However, the photovoltaic broken gate defect cannot be well identified and detected due to the small defect width and small background color difference with the photovoltaic cell. Therefore, a method for detecting the broken gate defect of the photovoltaic cell is needed.
Disclosure of Invention
In order to solve the problem of broken gate defect detection of the existing photovoltaic cell, the application provides a broken gate defect detection method, a broken gate defect detection device, electronic equipment and a storage medium.
In a first aspect, an embodiment of the present application provides a method for detecting a broken gate defect, where the method includes:
acquiring an image to be inspected of a photovoltaic cell;
inputting an image to be inspected into a broken gate defect detection model; the broken gate defect detection model is a model obtained by training an initial semantic segmentation model;
and obtaining a detection result image output by the broken gate defect detection model, wherein when the image to be detected comprises a broken gate defect, the detection result image comprises a broken gate defect contour.
In one embodiment, before inputting the image to be inspected into the broken gate defect detection model, the method further comprises:
acquiring a sample image set; the sample image set comprises a plurality of target sample images with gate breakage defects and defect labeling images corresponding to the target sample images;
inputting each target sample image into an initial semantic segmentation model in sequence, training the semantic segmentation model based on a broken gate defect detection result corresponding to each target sample image and a defect labeling image corresponding to each target sample image output by the semantic segmentation model, wherein the trained semantic segmentation model is a broken gate defect detection model.
In one embodiment, the method for detecting a gate-off defect further includes:
acquiring a plurality of initial sample images; the initial sample image comprises a broken gate defect;
carrying out data enhancement on each initial sample image to obtain each target sample image; the data enhancement modes include random scaling, random rotation, random clipping, random flipping, and random photometric distortion.
In one embodiment, the data enhancement is performed on each initial sample image to obtain each target sample image, including:
sequentially performing random scaling, random rotation, random cutting, random overturning and random luminosity distortion treatment on each initial sample image to obtain each target sample image; random photometric distortions include random luminance, random contrast, random saturation, random chromaticity.
In one embodiment, each target sample image is sequentially input into an initial semantic segmentation model, and the semantic segmentation model is trained based on a broken gate defect detection result corresponding to each target sample image and a defect labeling image corresponding to each target sample image output by the semantic segmentation model, including:
after the target sample images are input into the initial semantic segmentation model, calculating a loss value based on detection results corresponding to the target sample images output by the semantic segmentation model, defect labeling images corresponding to the target sample images and a preset loss function;
if the loss value is not smaller than the preset threshold value, adjusting the super-parameters of the semantic segmentation model based on the loss value;
and inputting the next target sample image into the semantic segmentation model after the super parameters are adjusted, and returning to the step of executing the calculation of the loss value until the loss value is smaller than a preset threshold value, determining that a preset convergence condition is reached, and obtaining the broken gate defect detection model.
In one embodiment, the predetermined loss function is a focal point loss function.
In one embodiment, the semantic segmentation model is a segvormer-B0 model.
In one embodiment, before training the broken gate defect detection model, the weight attenuation of the normalization and position modules in the initial semantic segmentation model is canceled, and the learning rate of the head weight in the initial semantic segmentation model is set to be 10 times of the learning rate of the backbone network;
an AdamW optimizer is used in training the broken gate defect detection model.
In a second aspect, an embodiment of the present application provides a broken gate defect detection device, including:
the first acquisition module is used for acquiring an image to be inspected of the photovoltaic cell;
the input module is used for inputting the image to be inspected into the broken gate defect detection model; the broken gate defect detection model is a model obtained by training an initial semantic segmentation model;
the second acquisition module is used for acquiring a detection result image output by the broken gate defect detection model, and when the image to be detected comprises a broken gate defect, the detection result image comprises a contour aiming at the broken gate defect.
In a third aspect, the present application provides an electronic device, comprising: a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method in any of the embodiments of the first aspect described above when executing the computer program.
In a fourth aspect, the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of any of the embodiments of the first aspect described above.
The beneficial effects of this application:
in the method, the device, the electronic equipment and the storage medium for detecting the broken gate defect provided by the embodiment of the application, the image to be detected of the photovoltaic cell to be detected is obtained, and the image to be detected is input into the broken gate defect detection model, so that the broken gate defect detection model outputs a detection result image. Because the broken gate defect detection model is adopted, the broken gate defect in the image to be detected can be rapidly and accurately segmented, and a detection result image is obtained. Meanwhile, the broken gate defect detection model is a model obtained by training an initial semantic segmentation model, so that the characteristics of the defect outline can be well learned, and a more accurate defect labeling result can be obtained.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief description will be given below of the drawings that are needed in the embodiments or the prior art descriptions, it being obvious that the drawings in the following description are some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort to a person skilled in the art.
FIG. 1 is a diagram illustrating an internal architecture of an electronic device according to an embodiment of the present application;
FIG. 2 is a diagram illustrating another internal architecture of an electronic device according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating a first method for detecting a broken gate defect according to an embodiment of the present disclosure;
FIG. 4 is a flowchart of a second method for detecting a broken gate defect according to an embodiment of the present disclosure;
FIG. 5 is a flowchart illustrating a third method for detecting a broken gate defect according to an embodiment of the present disclosure;
FIG. 6 is a schematic structural diagram of a semantic segmentation model according to an embodiment of the present application;
FIG. 7 is a flowchart of a fourth method for detecting a broken gate defect according to an embodiment of the present disclosure;
fig. 8 is a block diagram of a broken gate defect detecting device according to an embodiment of the present application.
Detailed Description
For purposes of clarity, embodiments and advantages of the present application, the following description will make clear and complete the exemplary embodiments of the present application, with reference to the accompanying drawings in the exemplary embodiments of the present application, it being apparent that the exemplary embodiments described are only some, but not all, of the examples of the present application.
It should be noted that the brief description of the terms in the present application is only for convenience in understanding the embodiments described below, and is not intended to limit the embodiments of the present application. Unless otherwise indicated, these terms should be construed in their ordinary and customary meaning.
The terms "first," second, "" third and the like in the description and in the claims and in the above drawings are used for distinguishing between similar or similar objects or entities and not necessarily for describing a particular sequential or chronological order, unless otherwise indicated. It is to be understood that the terms so used are interchangeable under appropriate circumstances.
The terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a product or apparatus that comprises a list of elements is not necessarily limited to all elements explicitly listed, but may include other elements not expressly listed or inherent to such product or apparatus.
The terms "disposed about," "connected to" and "connected to" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; can be directly connected or indirectly connected through an intermediate medium, and can be communication between two elements. The specific meaning of the terms in this application will be understood by those of ordinary skill in the art in a specific context. How to realize high-precision rapid detection of various defects in the production link of the photovoltaic cell, and improve the product qualification rate becomes the biggest problem facing the prior art. Typically, manual inspection may be employed, with conventional computer vision methods detecting some of the more significant defects. Such as scratches, hidden cracks, black spots, cold joints, contamination, cracks, chipping, etc. However, since the width of the imaged photovoltaic gate-breaking defect is only about 4 pixels, the length is about 50 pixels, and the color difference between the imaged photovoltaic gate-breaking defect and the background is small, the difference between the imaged photovoltaic gate-breaking defect and the background is only about 10 gray values, and the high-precision rapid detection is difficult to realize by the common defect detection method.
Based on the above, the application provides a method for detecting the broken gate defect, which can be applied to electronic equipment. The electronic device may be a server, and its internal structure may be as shown in fig. 1. The electronic device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic device includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the electronic device is for storing image data of the photovoltaic cells. The network interface of the electronic device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of broken gate defect detection.
In another embodiment, the electronic device may be a terminal, and the internal structure thereof may be as shown in fig. 2. The electronic device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic device includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The communication interface of the electronic device is used for performing wired or wireless communication with an external terminal, and the wireless mode can be realized through the W-shaped network, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a method of broken gate defect detection. The display screen of the electronic equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the electronic equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structures shown in fig. 1 and 2 are merely block diagrams of portions of structures related to the aspects of the present application and do not constitute a limitation of the electronic device to which the aspects of the present application apply, and that a particular electronic device may include more or fewer components than shown in the drawings, or may combine certain components, or may have different arrangements of components.
In one embodiment, the method for detecting a gate breakage defect will be described by taking the electronic device in fig. 1 or fig. 2 as an example of an execution body. Fig. 3 schematically illustrates a flow chart of a method for detecting a gate-off defect according to an embodiment of the present application, where, as shown in fig. 3, the method for detecting a gate-off defect is implemented by the following steps:
s202, obtaining an image to be inspected of the photovoltaic cell.
The image to be inspected is an image obtained by shooting the surface of the photovoltaic cell to be inspected by shooting equipment.
Optionally, after the image to be inspected is obtained, data enhancement processing may be performed on the image to be inspected, so as to obtain the image to be inspected after data enhancement. The data enhancement modes comprise random scaling, random rotation, random clipping, random flipping and random photometric distortion.
S204, inputting the image to be inspected into the broken gate defect detection model. The broken gate defect detection model is a model obtained by training an initial semantic segmentation model.
Specifically, the image to be inspected is input into a broken gate defect detection model, and the broken gate defect detection model can divide the image to be inspected and obtain a division result of the broken gate defect.
In one embodiment, as shown in fig. 4, before inputting the image to be inspected into the broken gate defect detection model, the broken gate defect detection method further includes:
s302, a sample image set is obtained, wherein the sample image set comprises a plurality of target sample images with broken gate defects and defect labeling images corresponding to the target sample images.
Each target sample image is different, each target sample image can comprise various different broken grid defects, and each target sample image correspondingly comprises a defect labeling image. It should be noted that the broken gate defect is mainly caused by that the thin gate line and the main gate line cannot form a loop due to the thin gate break point or the thin gate missing in the metal printing process of the photovoltaic cell.
Before training the gate-break defect detection model, a sample image set is first required, and an embodiment will be described how to generate each target sample image in the sample image set, in an alternative embodiment, as shown in fig. 5, the gate-break defect detection method further includes:
s402, acquiring a plurality of initial sample images, wherein the initial sample images comprise broken gate defects.
S404, data enhancement is carried out on each initial sample image, and each target sample image is obtained. The data enhancement modes include random scaling, random rotation, random clipping, random flipping, and random photometric distortion.
Optionally, after a plurality of sample images are obtained, screening can be performed with respect to the sample images, and the images with the gate breakage defect are screened out to obtain a plurality of initial sample images.
Wherein random photometric distortion includes random luminance, random contrast, random saturation, random chromaticity, without limitation.
Specifically, each initial sample image can be sequentially subjected to random scaling, random rotation, random clipping, random overturning and random photometric distortion treatment to obtain each target sample image with enhanced data.
In this embodiment of the present application, after data enhancement processing is performed on each initial sample image, details in each initial image may be further displayed, so as to facilitate subsequent segmentation of the defect location.
S304, sequentially inputting each target sample image into an initial semantic segmentation model, training the semantic segmentation model based on the gate breakage defect detection result corresponding to each target sample image and the defect labeling image corresponding to each target sample image output by the semantic segmentation model, wherein the trained semantic segmentation model is the gate breakage defect detection model.
Wherein the initial semantic segmentation model may comprise: the segfermer b1 model, the segfermer b2 model, the segfermer b3 model, the segfermer b4 model, the segfermer b5 model, and the like are not limited herein.
Alternatively, the initial semantic segmentation model is the Segfomer-B0 model.
The model is composed of an encoder and a decoder, and the structure diagram is shown in fig. 6. The encoder is constructed using a stack of 4 transform blocks (transform blocks), after each transform block the resolution of the feature map is converted to 1/4,1/8,1/16,1/32, respectively. Furthermore, the four feature maps of different resolutions may be fused later in the decoder. The Transformer block is composed of an Efficient Self-Attention module (efficiency Self-atttion, abbreviated as (efficiency Self-Attn)), a hybrid feed forward network module (mi×feed-forward network, abbreviated as mi× -FFN), and an overlap-merge module (Overlap Patch Merging).
The decoder fuses the characteristic diagrams with 4 different resolutions from the encoder together in the channel direction after linear transformation (Multilayer Perceptron, abbreviated as MLP, also called multi-layer perceptron) and up-sampling (Upsample), and then obtains the final result after linear transformation twice, namely, outputs the gate breakage defect detection result.
Specifically, each target sample image may be sequentially input into the initial semantic segmentation model, so that the semantic segmentation model performs image segmentation on the defect, and a broken gate defect detection result corresponding to each target sample image is output. When the broken gate defect detection result is output each time, the loss can be calculated based on the broken gate defect detection result, the defect labeling image corresponding to each target sample image and a preset loss function, parameters of the model are adjusted based on the loss and a preset convergence condition, and the broken gate defect detection model is obtained when the preset convergence condition is reached.
Optionally, before training the broken gate defect detection model, canceling the weight attenuation of the Normalization and the position module (pos_block) in the initial semantic segmentation model, and setting the learning rate of the head weight in the initial semantic segmentation model to be 10 times of the learning rate of the backbone network;
an AdamW optimizer may be employed in training the gate-break defect detection model. Of course, SGD, adam, adamax, sparseAdam may also be employed as an optimizer training, without limitation.
In an alternative embodiment, the preset convergence condition may be reached when the number of exercises reaches a target number.
In another alternative embodiment, step S304, as shown in fig. 7, specifically includes:
s3042, after the target sample image is input into the initial semantic segmentation model, calculating a loss value based on a detection result corresponding to the target sample image output by the semantic segmentation model, defect labeling images corresponding to the target sample images and a preset loss function.
The preset loss functions comprise Cross-entropy loss functions (Cross-entropy loss function, CE for short) and binary Cross-entropy loss functions (Binary Cross Entropy, BCE).
The standard form of CE loss is as follows:
Figure BDA0004030929270000061
in the formula, x represents a sample, y represents an actual label, p represents a predicted output, and n represents a sample total amount.
Optionally, the predetermined loss function is a Focal loss function (Focal loss).
The form of Focal Loss may be:
Figure BDA0004030929270000071
FL(p t )=-α t (1-p t ) γ log(p t );
in the formula, pt is determined by the label image, and p is the model prediction output. When a certain pixel value of the label image is 1, pt=p; when a certain value of the label image is 0, pt=1 to p. FL is Foca loss, and γ and α are the FL regulators. Alternatively, γ=2.0, α=0.5. The problem of serious unbalance of the duty ratio of the background pixel to the defect pixel in the image can be solved.
Specifically, when the preset Loss function is Focal Loss, a Loss value is calculated based on a detection result corresponding to the target sample image output by the semantic segmentation model, defect labeling images corresponding to the target sample images and the preset Loss function.
S3044, if the loss value is not smaller than the preset threshold value, adjusting the super-parameters of the converter model based on the loss value.
S3046, inputting the next target sample image into the semantic segmentation model after the super parameters are adjusted, and returning to the step of executing the calculation of the loss value until the loss value is smaller than a preset threshold value, determining that a preset convergence condition is reached, and obtaining the broken gate defect detection model.
In this embodiment, by adopting a manner of calculating the loss value, the super parameters of the model are continuously adjusted based on the loss value, so as to capture the position and shape of the broken gate defect more accurately.
In this embodiment, a sample image set is obtained, each target sample image is sequentially input into an initial semantic segmentation model, the semantic segmentation model is trained based on a broken gate defect detection result corresponding to each target sample image output by the semantic segmentation model, and the trained semantic segmentation model is a broken gate defect detection model. The method can divide the broken gate defects by adopting a semantic division model, and further trains a broken gate defect detection model capable of identifying the broken gate defects so as to facilitate the detection of the broken gate defects subsequently.
S206, obtaining a detection result image output by the broken gate defect detection model, wherein when the image to be detected comprises broken gate defects, the detection result image comprises contours aiming at the broken gate defects.
Specifically, after the detection result image output by the broken gate defect detection model is obtained, the detection result image output by the broken gate defect detection model is obtained. If the image to be inspected includes a broken gate defect, the detection result image includes a broken gate defect outline, and optionally, the broken gate defect outline can be marked by using an arrow, a character, a box and the like.
In the embodiment of the application, an image to be detected of the photovoltaic cell to be detected is obtained, and the image to be detected is input into the broken gate defect detection model, so that the broken gate defect detection model outputs a detection result image. Because the broken gate defect detection model is adopted, the broken gate defect in the image to be detected can be rapidly and accurately segmented, and a detection result image is obtained. Meanwhile, the broken gate defect detection model is a model obtained by training an initial semantic segmentation model, so that the characteristics of the defect outline can be well learned, and a more accurate defect labeling result can be obtained.
It should be understood that, although the steps in the flowcharts of fig. 3-7 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 3-7 may include multiple steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor does the order in which the steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of the steps or stages in other steps or other steps.
Based on the same inventive concept, fig. 8 schematically illustrates a block diagram of a broken gate defect detecting device according to an embodiment of the present application, as shown in fig. 8, including:
a first obtaining module 801, configured to obtain an image to be inspected of a photovoltaic cell;
an input module 802, configured to input an image to be inspected into a broken gate defect detection model; the broken gate defect detection model is a model obtained by training an initial semantic segmentation model;
the second obtaining module 803 is configured to obtain a detection result image output by the broken gate defect detection model, where when the image to be inspected includes a broken gate defect, the detection result image includes a contour for the broken gate defect.
The implementation principle and technical effects are similar to those of the above method embodiment, and are not described herein.
In some embodiments, the gate-break defect detection apparatus, before inputting the image to be inspected into the gate-break defect detection model, further comprises:
the third acquisition module is used for acquiring a sample image set; the sample image set comprises a plurality of target sample images with gate breakage defects and defect labeling images corresponding to the target sample images;
the training module is used for sequentially inputting each target sample image into the initial semantic segmentation model, training the semantic segmentation model based on the gate breakage defect detection results corresponding to each target sample image and the defect labeling images corresponding to each target sample image output by the semantic segmentation model, and enabling the trained semantic segmentation model to be the gate breakage defect detection model.
In some embodiments, the gate-break defect detection apparatus further comprises:
a fourth acquisition module, configured to acquire a plurality of initial sample images; the initial sample image comprises a broken gate defect;
the data enhancement module is used for carrying out data enhancement on each initial sample image to obtain each target sample image; the data enhancement modes include random scaling, random rotation, random clipping, random flipping, and random photometric distortion.
In some embodiments, the data enhancement module comprises:
the enhancement unit is used for sequentially carrying out random scaling, random rotation, random cutting, random overturning and random luminosity distortion treatment on each initial sample image to obtain each target sample image; random photometric distortions include random luminance, random contrast, random saturation, random chromaticity.
In some embodiments, the training module comprises:
the loss calculation unit is used for calculating a loss value based on a detection result corresponding to the target sample image output by the semantic segmentation model, a defect labeling image corresponding to each target sample image and a preset loss function after the target sample image is input to the initial semantic segmentation model;
the adjusting unit is used for adjusting the super-parameters of the semantic segmentation model based on the loss value if the loss value is not smaller than a preset threshold value;
the model determining unit is used for inputting the next target sample image into the semantic segmentation model after the super parameters are adjusted, and returning to the step of executing the calculation loss value until the loss value is smaller than a preset threshold value, determining that a preset convergence condition is reached, and obtaining the broken gate defect detection model.
Optionally, the preset loss function is a focal point loss function.
Alternatively, the semantic segmentation model is a segvormer-B0 model.
Optionally, before training the broken gate defect detection model, canceling the weight attenuation of the normalization and position module in the initial semantic segmentation model, and setting the learning rate of the head weight in the initial semantic segmentation model to be 10 times of the learning rate of the backbone network; an AdamW optimizer is used in training the broken gate defect detection model.
The implementation principle and technical effects are similar to those of the above method embodiment, and are not described herein.
In some embodiments, a computer device is provided, comprising a memory and a processor, which when executing a computer program implements the steps of the above-described method for detecting a gate break defect. The implementation principle and technical effects are similar to those of the above method embodiment, and are not described herein.
In some embodiments, a computer readable storage medium is provided, in which instructions are stored which, when run on a computer, cause the computer to perform the steps of the above-described method of detecting a gate breakage defect. The implementation principle and technical effects are similar to those of the above method embodiment, and are not described herein.
It should be noted that, user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, presented data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the various embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the various embodiments provided herein may include at least one of relational databases and non-relational databases. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic units, quantum computing-based data processing logic units, etc., without being limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples represent only a few embodiments of the present application, which are described in more detail and are not thereby to be construed as limiting the scope of the present application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application shall be subject to the appended claims.

Claims (11)

1. A method for detecting a gate break defect, the method comprising:
acquiring an image to be inspected of a photovoltaic cell;
inputting the image to be inspected into a broken gate defect detection model; the broken gate defect detection model is a model obtained by training an initial semantic segmentation model;
and obtaining a detection result image output by the broken gate defect detection model, wherein when the image to be detected comprises a broken gate defect, the detection result image comprises a broken gate defect contour.
2. The method according to claim 1, characterized by further comprising, before said inputting the image to be inspected into a gate-off defect detection model:
acquiring a sample image set; the sample image set comprises a plurality of target sample images with gate breakage defects and defect labeling images corresponding to the target sample images;
inputting each target sample image into an initial semantic segmentation model in sequence, training the semantic segmentation model based on a broken gate defect detection result corresponding to each target sample image and a defect labeling image corresponding to each target sample image output by the semantic segmentation model, wherein the trained semantic segmentation model is the broken gate defect detection model.
3. The method of claim 2, further comprising:
acquiring a plurality of initial sample images; the initial sample image comprises a broken gate defect;
performing data enhancement on each initial sample image to obtain each target sample image; the data enhancement modes comprise random scaling, random rotation, random clipping, random flipping and random photometric distortion.
4. The method of claim 3, wherein the performing data enhancement on each of the initial sample images to obtain each of the target sample images comprises:
sequentially performing random scaling, random rotation, random cutting, random overturning and random photometric distortion treatment on each initial sample image to obtain each target sample image; the random photometric distortion includes random luminance, random contrast, random saturation, random chromaticity.
5. The method for detecting a gate breakage defect according to claim 2, wherein the sequentially inputting each of the target sample images into an initial semantic segmentation model, training the semantic segmentation model based on a gate breakage defect detection result corresponding to each of the target sample images and a defect labeling image corresponding to each of the target sample images output by the semantic segmentation model, comprises:
after the target sample image is input into the initial semantic segmentation model, calculating a loss value based on a detection result corresponding to the target sample image output by the semantic segmentation model, a defect labeling image corresponding to each target sample image and a preset loss function;
if the loss value is not smaller than a preset threshold value, adjusting the super-parameters of the semantic segmentation model based on the loss value;
and inputting a next target sample image into the semantic segmentation model after the super parameters are adjusted, and returning to the step of executing calculation of the loss value until the loss value is smaller than a preset threshold value, determining that the preset convergence condition is reached, and obtaining the broken gate defect detection model.
6. The method of claim 5, wherein the predetermined loss function is a focus loss function.
7. The method of any one of claims 2-6, wherein the semantic segmentation model is a segvormer-B0 model.
8. The method according to any one of claims 2 to 6, wherein before training the broken gate defect detection model, weight attenuation of the normalization and position modules in the initial semantic segmentation model is canceled, and the learning rate of the head weight in the initial semantic segmentation model is set to 10 times the learning rate of the backbone network;
and an AdamW optimizer is adopted in the process of training the broken gate defect detection model.
9. A broken gate defect detection device, comprising:
the first acquisition module is used for acquiring an image to be inspected of the photovoltaic cell;
the input module is used for inputting the image to be inspected into a broken gate defect detection model; the broken gate defect detection model is a model obtained by training an initial semantic segmentation model;
the second acquisition module is used for acquiring a detection result image output by the broken gate defect detection model, and when the image to be detected comprises a broken gate defect, the detection result image comprises a broken gate defect contour.
10. An electronic device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 8 when the computer program is executed.
11. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 8.
CN202211728087.5A 2022-12-30 2022-12-30 Method and device for detecting broken gate defect, electronic equipment and storage medium Pending CN116188391A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211728087.5A CN116188391A (en) 2022-12-30 2022-12-30 Method and device for detecting broken gate defect, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211728087.5A CN116188391A (en) 2022-12-30 2022-12-30 Method and device for detecting broken gate defect, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116188391A true CN116188391A (en) 2023-05-30

Family

ID=86445458

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211728087.5A Pending CN116188391A (en) 2022-12-30 2022-12-30 Method and device for detecting broken gate defect, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116188391A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116664846A (en) * 2023-07-31 2023-08-29 华东交通大学 Method and system for realizing 3D printing bridge deck construction quality monitoring based on semantic segmentation

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116664846A (en) * 2023-07-31 2023-08-29 华东交通大学 Method and system for realizing 3D printing bridge deck construction quality monitoring based on semantic segmentation
CN116664846B (en) * 2023-07-31 2023-10-13 华东交通大学 Method and system for realizing 3D printing bridge deck construction quality monitoring based on semantic segmentation

Similar Documents

Publication Publication Date Title
CN109859163A (en) A kind of LCD defect inspection method based on feature pyramid convolutional neural networks
JP2024509411A (en) Defect detection method, device and system
CN110675370A (en) Welding simulator virtual weld defect detection method based on deep learning
CN110826588A (en) Drainage pipeline defect detection method based on attention mechanism
CN112613375B (en) Tire damage detection and identification method and equipment
CN110648310A (en) Weak supervision casting defect identification method based on attention mechanism
CN110245683B (en) Residual error relation network construction method for less-sample target identification and application
NL2030315B1 (en) Computer-implemented ai method for detecting surface defects of electroluminescent semiconductor panel
CN116188391A (en) Method and device for detecting broken gate defect, electronic equipment and storage medium
CN111681228A (en) Flaw detection model, training method, detection method, apparatus, device, and medium
CN115829995A (en) Cloth flaw detection method and system based on pixel-level multi-scale feature fusion
CN115984226A (en) Insulator defect detection method, device, medium, and program product
Wu et al. Crack detecting by recursive attention U-Net
CN114612803A (en) Transmission line insulator defect detection method for improving CenterNet
CN116542980B (en) Defect detection method, defect detection apparatus, defect detection program, storage medium, and defect detection program
CN115953388A (en) Chip defect detection method, device, equipment, storage medium and program product
CN115601341A (en) Method, system, equipment, medium and product for detecting defects of PCBA (printed circuit board assembly) board
CN115861160A (en) Method and device for detecting surface defects of power interface of mobile phone and storage medium
CN115423798A (en) Defect identification method, defect identification device, computer equipment, storage medium and computer program product
CN112837329B (en) Tibetan ancient book document image binarization method and system
CN114782983A (en) Road scene pedestrian detection method based on improved feature pyramid and boundary loss
CN113034432A (en) Product defect detection method, system, device and storage medium
CN116523917B (en) Defect detection method, device, computer equipment and storage medium
TWI807854B (en) Method for detecting defects, computer device and storage medium
CN115393746A (en) Transmission line multi-scale target fault detection method based on DenseNet and application

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination