An online visual inspection method and system for printing patterns on a color photovoltaic backsheet

By combining multi-angle stroboscopic imaging with CIE-Lab spatial decoupling technology, texture reconstruction model and Gaussian background modeling, the detection challenges of flexible material deformation and complex texture backgrounds were solved, and high-precision defect detection and classification of colored photovoltaic backsheets were achieved.

CN122156149APending Publication Date: 2026-06-05XINYUAN CAINENG (YANCHENG) TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XINYUAN CAINENG (YANCHENG) TECHNOLOGY CO LTD
Filing Date
2026-03-05
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing technologies cannot effectively solve the problem of template matching failure caused by deformation of flexible materials, cannot accurately separate minute defects in complex texture backgrounds, have a high false detection rate, cannot distinguish between physical damage and printing quality problems, and make it difficult to trace the cause of defects.

Method used

By employing multi-angle stroboscopic imaging and CIE-Lab spatial decoupling technology, orthogonal feature maps are constructed by acquiring high-angle coaxial light images and low-angle grazing light images. Texture complexity is analyzed using gradient energy and local variance. Combined with texture reconstruction model and Gaussian background modeling, virtual standard brightness map and background benchmark map are generated for adaptive threshold segmentation and defect classification.

Benefits of technology

It achieves high-precision online inspection of colored photovoltaic backsheets, reduces false detection rate, can distinguish between physical defects and printing defects, provides data support for the causes of defects, and provides a basis for process improvement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122156149A_ABST
    Figure CN122156149A_ABST
Patent Text Reader

Abstract

The application discloses an online visual detection method and system for printing patterns of a color photovoltaic backboard, and relates to the field of visual detection; coaxial light and grazing light images of the backboard are acquired through a multi-angle stroboscopic light source and a linear array camera to generate four-channel data containing color and topography information; the images are converted to CIE-Lab space and the regions are divided into high-frequency texture regions and low-frequency smooth regions by using an adaptive texture analysis algorithm; for the high-frequency regions, a generative adversarial network based on a gated attention mechanism is used to reconstruct a virtual standard brightness map without defects, and for the low-frequency regions, a Gaussian background model is used; a multi-dimensional residual tensor containing brightness, topography and chrominance is generated through multi-channel difference operation; and defects are classified by using a decision tree based on a physical damage index and a chemical printing index. The application effectively solves the false detection problem of the color backboard caused by complex texture and flexible deformation, and realizes high-precision online detection and classification of defects such as scratches, ink flying and color difference.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of visual inspection technology, and more specifically, relates to an online visual inspection method and system for printed patterns on color photovoltaic backsheets. Background Technology

[0002] With the rapid development of building-integrated photovoltaics (BIPV) technology, the application scenarios of photovoltaic modules have expanded from traditional power plants to building rooftops and exterior wall decorations. In order to meet the aesthetic needs of architecture, photovoltaic backsheets are no longer limited to a single white or black color, but have emerged in large numbers with complex patterns such as wood grain, stone grain, and camouflage.

[0003] Current back panel appearance inspection mainly relies on manual visual inspection or traditional AOI (Automated Optical Inspection) technology. Manual inspection is inefficient and prone to causing visual fatigue; traditional AOI technology mostly uses "standard template matching" or simple "grayscale threshold segmentation" methods. These methods face significant challenges when dealing with colored back panels: First, as a flexible material, the back panel will undergo slight stretching deformation during production and transportation, causing the image to be inspected to fail to align with the standard template at the pixel level, resulting in a large number of false residuals; second, the texture of the colored back panel itself (such as dark wood grain knots) is extremely similar to defects (such as black spots and dirt) in grayscale, making it difficult for traditional algorithms to distinguish between background textures and real defects.

[0004] It can be seen that the existing technology has the following problems: 1. It cannot effectively solve the problem of template matching failure caused by the deformation of flexible materials; 2. It cannot accurately separate tiny defects in complex texture backgrounds, resulting in an extremely high false detection rate; 3. Monochrome imaging cannot distinguish between physical damage (such as scratches) and printing quality problems (such as color difference and ink splatter), making it impossible to trace the cause of defects. Summary of the Invention

[0005] (a) Technical problems to be solved To address the problems in related technologies, this invention provides an online visual inspection method and system for printing patterns on color photovoltaic backsheets, thereby overcoming the aforementioned technical problems existing in the prior art.

[0006] (II) Technical Solution To solve the above-mentioned technical problems, the present invention is achieved through the following technical solution: S1. During the backplane transmission process, high-angle coaxial light images and low-angle grazing light images are acquired, and registration and channel stitching are performed to generate four-channel raw image data. S2. Extract the brightness feature map, red-green feature map, yellow-blue feature map and morphology feature map of the four-channel raw image data, and construct an orthogonal feature map group; S3. Using a texture analysis algorithm based on gradient energy and local variance, the complexity of the brightness feature map in the orthogonal feature map group is calculated to generate a texture complexity probability map; the texture complexity probability map is divided into a high-frequency texture region and a low-frequency smooth region according to the probability threshold. S4. For high-frequency texture areas, a flawless virtual standard brightness map is obtained through a trained texture reconstruction model; for low-frequency smooth areas, a background baseline map is generated using Gaussian background modeling. S5. Based on the orthogonal feature map group, calculate the difference between the luminance feature map and the virtual standard luminance map, and the difference between the morphology feature map, red-green feature map, yellow-blue feature map and the background reference map, respectively, to obtain the luminance residual map, morphology residual map, first chromaticity residual map and second chromaticity residual map, and generate the residual response map through the residual merging operation. Anomalies in the residual response map are extracted using an adaptive threshold segmentation algorithm to obtain a candidate defect set. S6. Using a defect classification decision tree, extract the physical damage index and chemical printing index of candidate spots in the candidate defect spot set, and output the defect type. Preferably, step S1 includes the following steps: S11. Set the line scan camera to be perpendicular to the transmission direction of the back panel, configure the first light source as a white coaxial LED light source, and configure the second light source as a blue strip LED light source; S12. Use the encoder to trigger the camera to perform time-division stroboscopic exposure acquisition; during the odd-numbered line scanning time, light up the first light source and acquire a coaxial light image reflecting the color information of the printed pattern; during the even-numbered line scanning time, light up the second light source and acquire a grazing light image reflecting the surface unevenness and scratch information. S13. Perform interline interpolation compensation on the coaxial light image and the grazing light image to eliminate the spatial misalignment caused by time-division exposure, and obtain the compensated coaxial light image and grazing light image. The compensated coaxial light image and the grazing light image are fused together to obtain four-channel raw image data. Preferably, step S2 includes the following steps: S21. Perform distortion correction and white balance processing on the first three channels of RGB data in the four-channel original image to obtain a standard RGB image; S22. Use a nonlinear transformation formula to convert the standard RGB image into XYZ tristimulus values, and then use a nonlinear mapping function to convert the XYZ values ​​into CIE-Lab space values ​​to obtain the brightness feature map, red-green feature map, and yellow-blue feature map. Gray-scale stretching and normalization are performed on the fourth channel grazing light data of the four-channel original image data to output a morphological feature map. S23. Construct an orthogonal feature map group based on the brightness feature map, red-green feature map, yellow-blue feature map, and shape feature map; Preferably, step S3 includes the following steps: S31. Define the sliding window size; traverse the sliding window on the brightness feature channel in the orthogonal feature map group, calculate the sum of squares of the gradient magnitude of the pixel grayscale values ​​within the window, and obtain the local texture energy. S32. Calculate the variance of pixel gray values ​​within the sliding window and construct a texture complexity evaluation function; based on the variance of pixel gray values ​​within the sliding window, obtain the texture complexity matrix through the texture complexity evaluation function; normalize the texture complexity matrix to the [0,1] interval to obtain the texture complexity probability map. S33. Set a texture differentiation threshold; in the texture complexity probability, pixels whose texture complexity is greater than the texture differentiation threshold are classified into high-frequency texture regions and marked as 1 in the mask matrix; otherwise, they are classified as low-frequency smooth regions and marked as 0 in the mask matrix. Preferably, step S4 includes the following steps: S41. Construct a texture reconstruction model, the texture reconstruction model including a generator. G The generator adopts the U-Ne0020t architecture, which includes a downsampling encoder, a bottleneck layer, and an upsampling decoder; the discriminator adopts the PatchGAN architecture. S42. Construct a sample set of good products containing only defect-free colored backplate images; S43. During the training phase, random masking is applied to the good sample set of color backplate images. The masked images are then input into the generator in the texture reconstruction model. The generator outputs the repaired reconstructed image. The discriminator determines the authenticity of the repaired reconstructed image and the original good image. S44. Define the combined loss function; iteratively update the generator parameters by minimizing the combined loss function until the texture reconstruction model can automatically infer and generate the normal texture of the occluded area based on the surrounding texture, and obtain the trained texture reconstruction model. S45. Input the image of the high-frequency texture region into the trained texture reconstruction model to obtain a defect-free virtual standard brightness map; and generate a background reference map by using a Gaussian mixture model to process the image of the low-frequency smooth region. Preferably, the calculation of the combined loss function in S44 includes the following steps: S4411. Calculate the difference in probability distribution between the generated image and the real image in the discriminator output to obtain the adversarial loss; S4412. Calculate the average absolute difference between the corresponding pixel values ​​of the generated image and the real image to obtain the pixel consistency loss; S4413. Input the generated image and the real image into the pre-trained VGG-19 network respectively, extract the feature maps of the 3rd, 4th and 5th convolutional layers, calculate the Euclidean distance between the feature maps, and obtain the perceptual loss. S4414. Set the weight coefficients for the weight coefficients, pixel consistency loss, and perceptual loss, and obtain the total loss of the texture reconstruction model by weighted summation through the combined loss function; Preferably, in step S44, the generator is iteratively updated by minimizing the combined loss function. G The parameters include the following steps: S4421. Construct a chromosome population; use the chromosomes in the population as a generator. G Parameter combinations; S4422. By minimizing the combined loss function, chromosomes in the chromosome population are selected, crossovered, and mutated; the process is repeated iteratively until the maximum number of iterations is reached or the loss value is less than a preset loss value threshold, at which point the optimal chromosome is obtained; the optimal chromosome is then applied to the generator. Preferably, step S5 includes the following steps: S51. Calculate the absolute difference between the brightness feature map of the orthogonal feature map group and the virtual standard map to obtain the texture region residual map; S52. Calculate the differences between the morphology feature map, red-green feature map, yellow-blue feature map and background reference map in the orthogonal feature map group, and perform Z-score standardization to obtain the smooth area residual map; S53. Merge the residual map of the textured area and the residual map of the smooth area to obtain the residual response map of the entire field; Hysteresis threshold segmentation is performed on the residual response map to generate a complete set of candidate defect spots; Preferably, step S6 includes the following steps: S61. Traverse each spot in the candidate defect set and calculate its position. L , a , b The average gray values ​​of the corresponding regions in the three channel residual maps are obtained. L Channel residual a Channel residual b Channel residuals; calculate the aspect ratio of each candidate spot in the candidate defect spot set to obtain the spot aspect ratio set; S63. Define the formulas for the physical damage index and the printing defect judgment index; S64, based on L Channel residual a Channel residual b The channel residuals and the set of aspect ratios of the spots are used to obtain the physical damage index and the printing defect judgment index for each spot through the physical damage index formula and the printing defect judgment index formula. Based on the physical damage index and printing defect judgment index of each spot, the defect type of the candidate spots in the spot set is output through the rules of the defect classification decision tree. S65. Encapsulate the defect type and coordinate information of candidate spots in the spot set into a JSON format data stream and output it. Preferably, an online visual inspection system for printed patterns on a color photovoltaic backsheet is used to implement the above-mentioned online visual inspection method for printed patterns on a color photovoltaic backsheet, comprising: The multispectral imaging module includes a linear array camera, a coaxial light source, a bar light source, and a synchronization controller, used to acquire four channels of raw image data from the backplane. The color space decoupling module performs RGB to Lab conversion and channel separation based on four-channel raw image data, and constructs an orthogonal feature map group. The texture analysis and reconstruction module, which includes an FPGA accelerator card and a GPU inference unit, performs texture complexity calculation, network inference and background modeling based on orthogonal feature map groups to obtain a virtual standard brightness map and a background reference map. The defect fusion decision module performs differential operations, threshold segmentation, and decision tree-based defect classification based on a virtual standard brightness map and a background baseline map, and outputs the final detection report.

[0007] (III) Beneficial Effects The present invention has the following beneficial effects: This invention effectively solves the problem of distinguishing between physical and printing defects by using multi-angle stroboscopic imaging and CIE-Lab spatial decoupling technology. By acquiring coaxial and grazing light images, physical features are extracted using the high sensitivity of grazing light to surface morphology, while chemical printing features are extracted using the color separation characteristics of CIE-Lab space. This multi-dimensional feature decoupling enables the system not only to detect defects but also to determine whether the defects originate from mechanical scratching on the production line or inkjet abnormalities in the printing process by constructing physical and chemical indices, providing data support for process improvement.

[0008] This invention overcomes the shortcomings of traditional template matching methods in terms of sensitivity to deformation of flexible materials by introducing GAN texture reconstruction technology based on gating attention mechanism. For high-frequency texture areas, it uses generative adversarial networks to learn the manifold distribution of good textures, which can automatically repair and generate virtual standard maps that are completely consistent with the texture direction of the current image to be inspected based on contextual semantics. This method of using reconstruction as a detection method does not require pixel-level physical alignment, has strong robustness to stretching and offset of the backplane, and significantly reduces the false detection rate caused by texture misalignment.

[0009] This invention employs an adaptive partitioning detection strategy based on texture complexity, balancing detection accuracy and computational efficiency. By using gradient energy and local variance, the image is logically divided into high-frequency texture regions and low-frequency smooth regions, and two targeted algorithms, deep learning reconstruction and Gaussian background modeling, are used respectively. This avoids the waste of computational power caused by using complex networks in smooth regions, while preventing the failure of simple algorithms in complex texture regions. Combined with dual-threshold hysteresis segmentation and multi-channel residual fusion, it achieves high signal-to-noise ratio extraction of minute defects in complex backgrounds.

[0010] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description

[0011] To more clearly illustrate the technical solutions of the embodiments of the invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the invention. For those skilled in the art, the drawings can be obtained from these drawings without creative effort.

[0012] Figure 1 This is a flowchart illustrating an online visual inspection method for printing patterns on a color photovoltaic backsheet according to the present invention. Figure 2 This is a schematic diagram of a module of an online visual inspection system for printing patterns on a colored photovoltaic backsheet, according to the present invention. Detailed Implementation

[0013] The technical solutions of the embodiments of the invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the invention, and not all embodiments. Based on the embodiments of the invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the invention.

[0014] To address the technical problems raised in the background section, please refer to [link / reference]. Figure 1 This invention provides an online visual inspection method and system for printing patterns on color photovoltaic backsheets, comprising: S1. During the backplane transmission process, high-angle coaxial light images and low-angle grazing light images are acquired, and sub-pixel registration and channel stitching are performed to generate four-channel raw image data; the four-channel raw image data includes surface texture information and physical morphology information. S2. Extract the brightness feature map, red-green feature map, yellow-blue feature map and morphology feature map of the four-channel raw image data, and construct an orthogonal feature map group; S3. Using a texture analysis algorithm based on gradient energy and local variance, the complexity of the brightness feature map in the orthogonal feature map group is calculated to generate a texture complexity probability map; the texture complexity probability map is divided into a high-frequency texture region and a low-frequency smooth region according to the probability threshold. S4. For high-frequency texture areas, a flawless virtual standard brightness map is obtained through a trained texture reconstruction model; for low-frequency smooth areas, a background baseline map is generated using Gaussian background modeling. S5. Based on the orthogonal feature map group, calculate the difference between the luminance feature map and the virtual standard luminance map, and the difference between the morphology feature map, red-green feature map, yellow-blue feature map and the background reference map, respectively, to obtain the luminance residual map, morphology residual map, first chromaticity residual map and second chromaticity residual map, and generate the residual response map through the residual merging operation. Anomalies in the residual response map are extracted using an adaptive threshold segmentation algorithm to obtain a candidate defect set. S6. Using a defect classification decision tree, extract the physical damage index and chemical printing index of candidate spots in the candidate defect spot set, and output the defect type. The above embodiments acquire coaxial and grazing light images of the back panel using a multi-angle strobe light source and a linear scan camera, generating four-channel data containing color and shape information. The images are converted to CIE-Lab space, and an adaptive texture analysis algorithm is used to divide the region into a high-frequency texture area and a low-frequency smooth area. For the high-frequency area, a generative adversarial network based on a gated attention mechanism is used to reconstruct a defect-free virtual standard brightness map, and Gaussian background modeling is used for the low-frequency area. A multi-dimensional residual tensor containing brightness, shape, and chromaticity is generated through multi-channel difference operations. Defects are classified using a decision tree based on physical damage index and chemical printing index. This solves the problem of false detection caused by the complex texture and flexible deformation of the colored back panel, and realizes high-precision online detection and classification of defects such as scratches, ink splatter, and color difference.

[0015] The above embodiment S1 includes the following steps: S11. Set the line scan camera to be perpendicular to the transmission direction of the back panel, configure the first light source as a white coaxial LED light source with an angle greater than 70 degrees, and configure the second light source as a blue strip LED light source with an angle less than 20 degrees. In specific implementation, the above embodiment S11 is as follows: an 8K resolution color line scan camera is selected, and the line frequency is set to 20kHz; the first light source is a high color rendering index white LED with a color temperature of 6500K, and the installation angle is 75 degrees (relative to the horizontal plane). The light is incident perpendicularly to the back panel surface through a beam splitter, mainly used to excite the color information of the printed pattern. The white light covers the full spectrum to ensure true color reproduction; the second light source is a blue strip LED with a wavelength of 460nm, and the installation angle is 15 degrees. The low-angle grazing is convenient to highlight the physical bumps, scratches and bubbles on the back panel surface. The blue light has a short wavelength and low scattering rate, which significantly enhances the contrast of small physical defects. S12. Use the encoder to trigger the camera to perform time-division stroboscopic exposure acquisition; during the odd-numbered line scanning time, light up the first light source and acquire a coaxial light image reflecting the color information of the printed pattern; during the even-numbered line scanning time, light up the second light source and acquire a grazing light image reflecting the surface unevenness and scratch information. In specific implementation, embodiment S12 above is as follows: a rotary encoder is installed on the production line drive shaft, and outputs a pulse signal every time the backplate moves 0.1mm; the camera receives the pulse signal as a trigger source; control logic is set: when the first pulse signal is received... N pulses ( N When the number of blue light sources is odd, the camera is triggered to expose, and an I / O signal is output to illuminate the white coaxial light source. The exposure time is set to 20μs. At this time, the blue light source is turned off, and the camera captures a "color line". When the first blue light source is received, the camera is triggered to expose the white coaxial light source. The exposure time is set to 20μs. N +1 pulse triggers camera exposure and simultaneously outputs IO signal to illuminate blue bar light source. Exposure time is set to 30μs. At this time, white light source turns off, and camera captures a "shape line". This targeted time-division stroboscopic method avoids mutual interference between light sources from different angles. S13. Perform interline interpolation compensation on the coaxial light image and the grazing light image to eliminate the spatial misalignment caused by time-division exposure, and obtain the compensated coaxial light image and grazing light image. The compensated coaxial light image and the grazing light image are fused together to obtain four-channel raw image data. In specific implementation, the above embodiment S13 is as follows: Due to the time-division acquisition of odd and even rows, there is a 0.1mm misalignment between the color texture row and the shape feature row in physical space; a linear interpolation algorithm is used for correction: To reduce periodic texture distortion, this embodiment uses edge-preserving interpolation based on directional gradient. First, the structural tensor of the upper and lower neighborhoods of the missing row is calculated to determine the main direction of the local texture, and linear interpolation is performed along the main direction; it has been verified that on typical samples such as wood grain and stone grain, this method can improve the structural similarity (SSIM) index of texture reconstruction by an average of about 15% compared with ordinary linear interpolation; furthermore, by setting Image Color ( x , y ) is a color map, Image Shape( x , y () represents the shape; for Image Shape in odd-numbered rows y For missing location data, use (Image Shape( x , y -1)+Image Shape( x , y Fill with +1)) / 2; finally synthesize a four-channel tensor Data Raw=[ R coaxial , G coaxial , B coaxial , Mono grazing ],in, R coaxial , G coaxial , B coaxial The first three channels are derived from the red, green, and blue components of the spatially aligned Image Color image after interpolation correction, and together they constitute the color texture information from the coaxial light. Mono grazing This is the fourth channel, derived from grazing light (using the blue single-channel grayscale value). The above embodiments, through time-division stroboscopic and multi-angle lighting strategies, simultaneously acquire high-fidelity printed pattern information and high-contrast surface physical morphology information in a single scan. Furthermore, the spatial alignment problem is solved through interpolation algorithms, providing a basic decoupled data source for subsequent differentiation between printed color differences and physical scratches.

[0016] The above embodiment S2 includes the following steps: S21. Perform distortion correction and white balance processing on the first three channels of RGB data in the four-channel original image to obtain a standard RGB image; In specific implementation, the above embodiment S21 is as follows: the lens distortion coefficient of the camera is obtained using a calibration board, and the first three channels (RGB) of the Data Raw are corrected for geometric distortion using bilinear interpolation; a white standard block area at the edge of the back plate is selected, the R, G, and B gain coefficients are calculated, and automatic white balance (AWB) is performed to ensure that R=G=B and eliminate the influence of light source color temperature drift. S22. Use a nonlinear transformation formula to convert the standard RGB image into XYZ tristimulus values, and then use a nonlinear mapping function to convert the XYZ values ​​into CIE-Lab space values ​​to obtain the brightness feature map, red-green feature map, and yellow-blue feature map. Gray-scale stretching and normalization are performed on the fourth channel grazing light data of the four-channel original image data to output a morphological feature map. In specific implementation, the above embodiment S22 specifically involves: converting the standard RGB image, after Gamma correction, into the CIE-XYZ space: [X, Y, Z] via matrix multiplication. T =M*[R, G, B] T Where [X, Y, Z] T Represents the tristimulus value vector, T Indicates transpose; M is the standard transformation matrix (e.g., the transformation matrix under a D65 light source); [R, G, B] T Represents a column vector composed of linear RGB values; Convert to Lab space: Luminance channel L =116 * f(Y / Yn) - 16; Red-Green Channel a =500*[f(X / Xn)-f(Y / Yn)]; Yellow-Blue Channel b =200*[f(Y / Yn)-f(Z / Zn)]; where Xn, Yn, and Zn are the tristimulus values ​​of the reference white point, i.e., the XYZ values ​​that a pure white object should be measured under a specified light source under standard observation conditions; f() is a nonlinear mapping function, and when X / Xn>0.008856, f(X / Xn)=(X / Xn). (1 / 3) Otherwise, f(X / Xn) = 7.787*t + 16 / 116; the reason for the conversion is that the Lab space is perceptibly uniform, and the brightness information... L With color information a , b They are orthogonally separated; S23. Based on the luminance feature map, red-green feature map, yellow-blue feature map, and morphology feature map, construct an orthogonal feature map group; the orthogonality here refers to the luminance in the CIE-Lab color space (…). L ) and chromaticity ( a , bThe channels are approximately independent and uncorrelated in mathematical definition and visual perception; this orthogonality allows for the separate analysis and processing of luminance information (mainly corresponding to physical morphology) and chromaticity information (mainly corresponding to printing color). In specific implementation, the above embodiment S23 specifically involves: converting the obtained L The component, as a brightness characteristic, includes information such as the depth of the wood grain texture on the back panel and the shadows from physical scratches, and is unaffected by color changes; a The components are used as red-green features (positive values ​​lean towards red, negative values ​​lean towards green), and... b The components are represented by yellow and blue characteristics (positive values ​​lean towards yellow, negative values ​​lean towards blue); in this embodiment, for a back panel with imitation mahogany grain, the variation in the depth of the wood grain is mainly reflected in the brightness characteristics, while the overall reddish-brown tone is mainly reflected in the low-frequency components of the red-green and yellow-blue characteristics; if ink splatter (black ink droplets) occurs, the brightness characteristic value will drop sharply, because black ink absorbs light across the entire spectrum, and its chromaticity value will shift towards the neutral gray point ( a =0, b =0) convergence; for example, on a reddish imitation mahogany texture background ( a On >0), a black ink droplet will cause that point to... a The value decreased; against a bluish, stone-like background ( b <0) will lead to b The value tends to 0 as it increases; if a transparent scratch appears, only the brightness feature value changes (light scattering causes it to darken), while the red-green and yellow-blue feature values ​​remain basically unchanged; this separation characteristic is the basis for subsequent classification algorithms; The above embodiments achieve physical-level decoupling of luminance and color information by converting the image domain from RGB to CIE-Lab. This not only improves the sensitivity to minute color differences by utilizing the perceptual uniformity of the Lab space, but more importantly, it provides clear feature dimensions for subsequent algorithms. Specifically, the L channel is used to process morphology and texture details, and the a / b channels are used to monitor printing color deviation, effectively reducing the interference of complex colored backgrounds on detection.

[0017] The above embodiment S3 includes the following steps: S31. Define the sliding window size; traverse the sliding window on the brightness feature channel in the orthogonal feature map group, calculate the sum of squares of the gradient magnitude of the pixel grayscale values ​​within the window, and obtain the local texture energy. In specific implementation, the above embodiment S31 specifically involves: setting the size of the sliding window. W =15 (corresponding to a physical size of approximately 1.5mm, covering the wood grain texture cycle); the Sobel operator is used to calculate the horizontal gradient of the pixel grayscale values ​​within the window. G x and vertical gradient G y; Calculate local texture energy E ( x , y )= Σ( G x ²+ G y ²), the summation range is ( ) x , y A 15x15 window centered on the region; the local texture energy value reflects the richness of the region's edges; S32. Calculate the variance of pixel gray values ​​within the sliding window and construct a texture complexity evaluation function; based on the variance of pixel gray values ​​within the sliding window, obtain the texture complexity matrix through the texture complexity evaluation function; normalize the texture complexity matrix to the [0,1] interval to obtain the texture complexity probability map. In specific implementation, the above embodiment S32 specifically involves: calculating the texture complexity probability map by performing a sliding window calculation on the brightness feature map, and fusing local gradient energy and gray-level variance to generate a normalized matrix. Each pixel value (0-1 interval) quantifies the texture complexity at that location, used to distinguish the image into high-frequency texture areas and low-frequency smooth areas; calculating the gray-level variance within the same window. Var ( x , y The texture complexity evaluation function C ( x , y )= α * E ( x , y )+(1- α )* Var ( x , y ),in, C ( x , y ) represents the overall complexity; α This embodiment sets an energy weighting coefficient. α =0.6, where 0.6 is determined by calibrating the gradient energy through data from the historical texture complexity calculation process. The gradient energy's ability to represent texture is slightly stronger than the variance, with a ratio of approximately 3 / 2. Therefore, the energy weighting coefficient is set. α =0.6); α The values ​​are calibrated using a grid search method: on a training set containing back panel images of wood grain, stone grain, and solid colors, the optimal value is obtained by searching using the intersection-union ratio (IUU) of the final texture segmentation result and the manually labeled IUU. α=0.6; To address the multi-peak complexity distribution problem, a Gaussian smoothing filter is applied to the complexity probability map before applying the Otsu algorithm to merge adjacent peaks and improve the robustness of threshold selection; Furthermore, for the wood grain nodule region on the back panel, the gradient changes drastically. E ( x , y The large value leads to a high overall complexity. C ( x , y The value is high; for light-colored background areas on the back panel, the grayscale is flat. E ( x , y )and Var ( x , y They are all very small. C ( x , y The value is low; S33. Set a texture discrimination threshold; in the texture complexity probability, if the texture complexity of a pixel is greater than the texture discrimination threshold... T tex Pixels that are classified as high-frequency texture areas are marked as 1 in the mask matrix; otherwise, they are classified as low-frequency smooth areas and marked as 0 in the mask matrix. In specific implementation, the above embodiment S33 specifically involves: using Otsu's method to perform adaptive threshold calculation on the texture complexity probability map to obtain the optimal threshold. T tex Specifically, the optimal threshold T tex The calculation formula is ;in, s 2 (t) represents the inter-class variance between foreground and background; t Represents a candidate threshold (an integer between 0 and 255); w 0( t ) indicates that when the threshold is t At that time, the proportion of pixels classified as background (i.e., low-frequency smooth region) to the total number of pixels in the image. w 1( t ) indicates that when the threshold is t At that time, the proportion of pixels classified as foreground (i.e., high-frequency texture area) to the total number of pixels is... w 0( t )+ w 1( t )=1; m 0( t ), m 1( t ) respectively represent when the threshold ist At that time, the average grayscale value of all pixels classified as background and the average grayscale value of all pixels classified as foreground; select the one that makes s 2 ( t The largest t value as the optimal threshold T tex By utilizing the bimodal distribution characteristics of textured regions (high frequency, high variance) and smooth regions (low frequency, low variance) on the histogram, the statistically optimal segmentation point (optimal threshold) is sought. T tex This ensures adaptability to differences in backplate texture between different batches; Mask( x , y )=1(when C ( x , y > T tex Mask represents areas with complex textures, such as wood grain lines; x , y )=0 (when C(x,y)≤ T tex (This represents a smooth background area, such as the background color); The above embodiment S3 accurately segments a complex backplane image into two parts: the main texture skeleton and the background filling. The above embodiment achieves adaptive quantization of the texture distribution on the backplane surface by constructing a complexity evaluation function that integrates gradient energy and local variance. By generating a mask matrix, the image is logically divided into high-frequency texture areas and low-frequency smooth areas, providing an accurate spatial index for subsequent use of different detection strategies (GAN reconstruction and statistical modeling) for different areas, avoiding false positives in complex texture areas and false negatives in smooth areas in the one-size-fits-all algorithm. The above embodiment S4 includes the following steps: S41. Construct a texture reconstruction model, the texture reconstruction model including a generator. G and discriminator D generator G It adopts the U-Ne0020t architecture, which includes a downsampling encoder, a bottleneck layer, and an upsampling decoder; discriminator D The PatchGAN architecture is used. In specific implementation, the above embodiment S41 is as follows: the input of generator G is an L-channel image block (256*256 pixels) with defects (or occluded by a mask); the encoder part contains 4 convolutional layers (Conv2d-BatchNorm-LeakyReLU), with the number of channels being 64-128-256-512 respectively, progressively extracting deep semantic features of the texture; the decoder part contains 4 deconvolutional layers, with skip connections between the corresponding layers of the encoder. Through the generator G A gated attention mechanism is introduced into the skip connections in the model. An attention weight map is generated by 1*1 convolution and sigmoid activation, which is then multiplied by the feature map. This allows the texture reconstruction model to focus more on the continuity of the texture during restoration and suppress irrelevant noise features. The gated attention mechanism modulates the encoder features passed by the skip connections channel by channel and pixel by pixel through a learnable attention weight map. During texture restoration, the feature transmission that is consistent with the texture direction of the missing region is strengthened, and irrelevant background noise is suppressed, thereby ensuring that the generated texture is visually continuous and consistent with the surrounding environment. The discriminator D adopts a fully convolutional PatchGAN structure, and the output is a 30*30 matrix. Each element in the matrix represents whether the corresponding 70*70 receptive field region of the original image is real or fake. S42. Construct a sample set of good products containing only defect-free colored backplate images; In specific implementation, the above embodiment S42 specifically involves: collecting 500,000 backplate images that are determined to be qualified on the production line, cropping them into small 256*256 image blocks, and using them as a training set; without the need for manual labeling of defects, the texture reconstruction model is trained through unsupervised learning; S43. During the training phase, random masking is applied to the good sample set of color backplate images, and the masked images are input into the generator in the texture reconstruction model. G generator G Output the repaired and reconstructed image; discriminator D Determine the authenticity of the reconstructed image after restoration compared to the original good image; In specific implementation, the above embodiment S43 specifically involves: during each training iteration, randomly generating some black squares on the good product image (simulating defect occlusion); generator G The task is to draw the black square area back based on the surrounding wood grain pattern that is not obscured, so that it looks like normal wood grain. S44. Define the combination loss function; iteratively update the generator by minimizing the combination loss function. G The parameters are adjusted until the texture reconstruction model can automatically infer and generate normal textures in the occluded area (i.e., the potential defect area) based on the surrounding textures, thus obtaining a trained texture reconstruction model. The calculation of the combined loss function in embodiment S44 above includes the following steps: S4411. Calculate the difference in probability distribution between the generated image and the real image in the discriminator output to obtain the adversarial loss. L adv ; S4412. Calculate the average absolute difference between corresponding pixel values ​​in the generated image and the real image to obtain the pixel consistency loss. L pixel ; S4413. Input the generated image and the real image into the pre-trained VGG-19 network respectively, extract the feature maps of the 3rd, 4th and 5th convolutional layers, calculate the Euclidean distance between the feature maps, and obtain the perceptual loss. L perceptual ; S4414. Set the weight coefficients for the weight coefficients, pixel consistency loss, and perceptual loss, and obtain the total loss of the texture reconstruction model by weighted summation through the combined loss function; In specific implementation, the above embodiment S44 specifically refers to: countering loss. L adv Using the least-squares loss of LSGAN makes the generated images more realistic; pixel consistency loss L pixel Calculate the L1 distance between the generated image and the original image to ensure that the overall color and brightness do not deviate; perceptual loss. L perceptual The generated image and the original image are input into a pre-trained VGG-19 network. The VGG-19 network is pre-trained on the large-scale ImageNet dataset containing defect-free colored backing images and has the ability to extract general image features. A ReLU3 layer (1 layer) extracts mid-level texture features, a ReLU4 layer (1 layer) extracts structural features, and a ReLU5 layer (1 layer) extracts high-level semantic features. The Euclidean distance between these feature maps is calculated, enabling the generator to learn the perceptual structure of the wood grain rather than simply matching pixel colors, and not just the proximity of pixel values. Weights are set as follows: l 1=1, l 2=100, l 3=10; weighting coefficient l 1=1, l 2=100, l=3=10 is used to balance the magnitude of the gradient. The pixel loss value is usually small (between 0 and 1), so it needs to be given a large weight (100) to ensure basic convergence. The perceptual loss value is moderate, and the weight is set to 10 to maintain structural fidelity. The adversarial loss is responsible for the overall realism, and the weight is set to 1. The Adam optimizer is used to directly minimize the total loss, and the learning rate is set to 0.0002. The model converges after 200 epochs. The loss weight coefficients (λ1, λ2, λ3) are determined on the validation set by grid search. The model is trained using a dataset containing augmented samples (obtained by randomly rotating, adjusting brightness and contrast of the original good image). The reconstruction quality is quantitatively evaluated on an independent test set containing images. The average peak signal-to-noise ratio (PSNR) is greater than 32dB, and the structural similarity index (SSIM) is greater than 0.96, indicating that the generated image is close to the real good image in terms of pixel accuracy and structural perception. In the above embodiment, in S44, the generator is iteratively updated by minimizing the combination loss function. G The parameters include the following steps: S4421. Construct a chromosome population; use the chromosomes in the population as a generator. G Parameter combinations; S4422. By minimizing the combinatorial loss function, chromosomes in the chromosome population are selected, crossovered, and mutated; the process is repeated iteratively until the maximum number of iterations is reached or the loss value is less than a preset loss value threshold, at which point the optimal chromosome is obtained; the optimal chromosome is then applied to the generator. G ; In specific implementation; S4421 and S4422 above specifically refer to: constructing a chromosome population, setting the size of the chromosome population as... f This embodiment sets f If the value is 50, then the chromosome population is represented as follows: ,in, l i Represents the 1st chromosome in the population. Each chromosome in the chromosome population is used as a random generator within the search space. G The parameter combination; the maximum number of optimization iterations is set to 200; The process begins with iteration. In each iteration, the fitness value of each chromosome in the chromosome population is calculated based on the contrastive loss function, resulting in a set of chromosome fitness values. The smaller the loss, the higher the fitness. Based on the chromosome fitness values ​​in the set, chromosomes are selected from the chromosome population in descending order of fitness value, resulting in a selected chromosome population. Crossover and mutation operations are performed on the chromosomes in the selected chromosome population to obtain the manipulated chromosome population. In each iteration, the current best combination is selected based on the chromosome performance values ​​in the set of chromosome performance values. The crossover is calculated using the mean of the parent values, and the mutation is Gaussian mutation. Repeat the iteration until the maximum number of optimization iterations is reached or the preset loss value threshold is reached, then stop the iteration and take the current best combination as the optimal solution; S45. Input the image of the high-frequency texture region into the trained texture reconstruction model to obtain a defect-free virtual standard brightness map; and generate a background reference map by using a Gaussian mixture model to process the image of the low-frequency smooth region. In specific implementation, the above embodiment S45 is as follows: For high-frequency texture regions (Mask=1), the current image to be detected is directly input into the trained generator. G If the input image has a "black spot defect" somewhere, due to the generator... G Having only seen good products, it will consider the black spot to be an occluded area and reconstruct it as a normal wood grain color based on the surrounding texture; the output image is the virtual standard image; the standard texture image (i.e. the virtual standard brightness image) is an ideal brightness image without defects that is dynamically reconstructed based on the context of the image to be inspected by a trained generative adversarial network, and serves as the benchmark for difference comparison, rather than a fixed template; For the low-frequency smooth region (Mask=0), a Gaussian mixture model (GMM) is used to calculate the mean of historical good product data for this region. m and variance s Generate an image where all pixel values ​​are the average. m The standard background reference diagram; The above embodiments construct a reconstruction-detection model by introducing a U-Net generative adversarial network with a gated attention mechanism. By leveraging the network's deep understanding of the texture manifold of good products, it can "repair" defective input images into defect-free virtual standard images. Compared with traditional template matching methods, this method does not require precise pixel alignment, has strong robustness to stretching deformation of the back panel, and can perfectly solve the defect detection problem of complex wood grain and stone grain back panels.

[0018] The above embodiment S5 includes the following steps: S51. Calculate the absolute difference between the brightness feature map of the orthogonal feature map group and the virtual standard map to obtain the texture region residual map. Rtex ; In specific implementation, the above embodiment S51 specifically refers to: the absolute difference between the brightness feature map and the virtual standard map, that is, the absolute value of the difference between the pixel points in the brightness feature map and the pixel values ​​in the virtual standard map. Further, the brightness feature map and the virtual standard map can be considered as a matrix; specifically, in this embodiment, the brightness feature map is... The virtual standard diagram is It can be seen that there is a defective feature point with a pixel value of 30 in the brightness feature map. At this time, the texture area residual map between the brightness feature map and the virtual standard map is... ; S52. Calculate the differences between the orthogonal feature map group and the morphological features, red-green features, yellow-blue features, and background baseline map, and perform Z-score standardization to obtain the smooth region residual map. R flat ; In specific implementation, the calculation process of S52 in the above embodiment is the same as the calculation process of S51; S53, Residual Map of Blended Texture Area R tex Residual plot of smooth region R flat This yields the residual response diagram for the entire field; Hysteresis threshold segmentation is performed on the residual response map to generate a complete set of candidate defect spots; In specific implementation, the above embodiment S53 specifically involves: using the mask matrix generated in S3 to seamlessly stitch the two types of residual maps together; setting a high threshold. Th high and low threshold Th low Select a value greater than the high threshold. Th high Pixels that are considered strong defect seed points are selected by recursive search and are connected to strong defect seed points with pixel values ​​greater than a low threshold. Th low Weak defect points are identified, and a complete set of candidate defect spots is generated; this embodiment sets... Th high =30 (grayscale level) Th low =15; This embodiment Th high , Th low The settings are based on the noise statistical analysis of 100 defect-free good product backplate residual maps, and the mean background noise of the good product residual maps is measured. m noise ≈5, standard deviation s noise ≈3; Setting Th low= m noise +3 s noise ≈15 to filter out 99.7% of background noise; set Th high =2× Th low =30 to ensure that only high-confidence defect cores can trigger region growth, avoiding isolated false alarms caused by noise; this dual-threshold strategy can effectively extract weak edges of defects, prevent defect breakage, and avoid isolated false alarms caused by noise; finally, a binary defect blob set is obtained. The above embodiments use a partitioned differential strategy to eliminate texture interference in the high-frequency region by using deep learning reconstruction and eliminate uneven illumination interference in the low-frequency region by using statistical standardization. Finally, high signal-to-noise ratio residual spots are extracted by hysteresis threshold segmentation, which ensures the visibility of tiny defects (such as 0.1mm-level ink flakes) in complex backgrounds, while greatly suppressing false alarms caused by normal texture fluctuations.

[0019] The above embodiment S6 includes the following steps: S61. Traverse each spot in the candidate defect set. Blob i Calculate its in L , a , b The average gray values ​​of the corresponding regions in the three channel residual maps are obtained. L Channel residual Res L , a Channel residual Res a , b Channel residual Res b ; Calculate the aspect ratio of each candidate spot in the candidate defect spot set. R atio This yields a set of spots with aspect ratios. S63. Define the formulas for the physical damage index and the printing defect judgment index; In specific implementation, the above embodiment S63 is specifically: physical damage index formula P idx = Res L / ( Res a + Res b + e The formula for the printing defect judgment index is: C idx =max( Res a , Res b ) / ( Res L + e ),in, P idx Indicates the physical damage index of the spot; C idx The index indicating printing defect judgment of spots; e To prevent arbitrary minimum values ​​from being divided by zero, this embodiment uses 0.001; the logic of the physical damage index formula is that physical scratches typically only change the intensity of surface reflected light ( L Channel mutation), without changing the color property of the substance ( a / b (The channel changes little), therefore when Res L big, Res a , Res b Hour, P idx The value is very high; the logic of the printing defect judgment index formula is that printing defects (such as ink dripping, color deviation) are essentially changes in the color of the material. Res a , Res b When it is large, therefore C idx High value; S64, based on L Channel residual Res L , a Channel residual Res a , b Channel residual Res b The physical damage index and printing defect judgment index of each spot are obtained by using the physical damage index formula and the printing defect judgment index formula, as well as the set of spot aspect ratios. Based on the physical damage index and printing defect judgment index of each spot, the defect type of the candidate spots in the spot set is output through the rules of the defect classification decision tree. In specific implementation, the above embodiment S64 is specifically as follows: If P idx Preset physical threshold T phy and Ratio >5.0, judged as physical scratch; if C idx Preset printing threshold T chem If determined to be ink splatter or color difference; ResL If the value is negative and the amplitude exceeds the threshold, it is determined to be either a white gap or a pinhole; in this embodiment, the following settings are used: T phy =2.0, T chem =0.5; T phy =2.0, T chem =0.5 is derived from the feature statistics of labeled defect samples; statistics show that purely physical scratches P idx The distribution mean is 4.5, and 98% of the samples are greater than 2.0; while pure printing defects... C idx The distribution mean is 0.85, and 95% of the samples have a mean greater than 0.5. Therefore, 2.0 and 0.5 are selected as the boundary values ​​to maximize the classification margin, which can effectively distinguish between the two types of defects; Decision logic 1: If P idx >2.0 and Ratio >5.0 (slender), classified as "Scratch"; Judgment logic 2: If P idx >2.0 and Ratio <2.0 (circle), determined as "convex hull / dent"; Decision logic 3: if C idx >0.5, and Res L <0 (darkens), judged as "ink splatter / dirt"; Judgment logic 4: if Res L >50 (significantly brighter) and C idx A value <0.5 was classified as "white gap / coating peeling". Evaluation was conducted using five-fold cross-validation on an independent test set of images covering wood grain, stone grain, and solid color back panels. The evaluation results showed an overall defect detection rate (recall) of 99.2%, a precision rate of 98.5%, and an average classification accuracy of 98.8%. The classification accuracy for the main defect categories (scratches, ink splatter, white gaps) all exceeded 97.5%. The misclassification rate between physical and chemical defects was less than 1.5%, demonstrating the effectiveness of the physical damage index and printing defect judgment index with their threshold settings. S65. Encapsulate the defect type and coordinate information of candidate spots in the spot set into a JSON format data stream for output; transmit the output data to the PLC in real time to control the marking machine to mark defects on the edge of the back plate, or control the slitting machine to remove defective products; The above embodiments, by constructing a decision tree classifier based on multi-channel residual comparison, cleverly utilize the physical characteristics of the CIE-Lab color space to transform abstract defect image features into quantifiable "physical indices" and "chemical indices." This successfully solves the classification problem in traditional visual inspection where it is difficult to distinguish between "light-colored scratches" and "light-colored printing textures," and "black dirt" and "dark wood grain," thus achieving refined classification and hierarchical control of all types of defects on photovoltaic backsheets.

[0020] For further details, please refer to Figure 2 An online visual inspection system for printing patterns on color photovoltaic backsheets, used to implement the aforementioned online visual inspection method for printing patterns on color photovoltaic backsheets, includes: The multispectral imaging module includes a linear array camera, a coaxial light source, a bar light source, and a synchronization controller, used to acquire four channels of raw image data from the backplane. The color space decoupling module performs RGB to Lab conversion and channel separation based on four-channel raw image data, and constructs an orthogonal feature map group. The texture analysis and reconstruction module, which includes an FPGA accelerator card and a GPU inference unit, performs texture complexity calculation, network inference and background modeling based on orthogonal feature map groups to obtain a virtual standard brightness map and a background reference map. The defect fusion decision module performs differential operations, threshold segmentation, and decision tree-based defect classification based on a virtual standard brightness map and a background baseline map, and outputs the final detection report.

[0021] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0022] The preferred embodiments of the invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention.

Claims

1. An online visual inspection method for printed patterns on color photovoltaic backsheets, characterized in that, Includes the following steps: S1. During the backplane transmission process, high-angle coaxial light images and low-angle grazing light images are acquired, and registration and channel stitching are performed to generate four-channel raw image data. S2. Extract the brightness feature map, red-green feature map, yellow-blue feature map and morphology feature map of the four-channel raw image data, and construct an orthogonal feature map group; S3. Using a texture analysis algorithm based on gradient energy and local variance, the complexity of the brightness feature map in the orthogonal feature map group is calculated to generate a texture complexity probability map; the texture complexity probability map is divided into a high-frequency texture region and a low-frequency smooth region according to the probability threshold. S4. For high-frequency texture areas, a flawless virtual standard brightness map is obtained through a trained texture reconstruction model; for low-frequency smooth areas, a background baseline map is generated using Gaussian background modeling. S5. Based on the orthogonal feature map group, calculate the difference between the luminance feature map and the virtual standard luminance map, and the difference between the morphology feature map, red-green feature map, yellow-blue feature map and the background reference map, respectively, to obtain the luminance residual map, morphology residual map, first chromaticity residual map and second chromaticity residual map, and generate the residual response map through the residual merging operation. Anomalies in the residual response map are extracted using an adaptive threshold segmentation algorithm to obtain a candidate defect set. S6. Using a defect classification decision tree, extract the physical damage index and chemical printing index of candidate spots in the candidate defect spot set, and output the defect type.

2. The online visual inspection method for printed patterns on a color photovoltaic backsheet according to claim 1, characterized in that, S1 includes the following steps: S11. Set the line scan camera to be perpendicular to the transmission direction of the back panel, configure the first light source as a white coaxial LED light source, and configure the second light source as a blue strip LED light source; S12. Use the encoder to trigger the camera to perform time-division stroboscopic exposure acquisition; during the odd-numbered line scanning time, light up the first light source and acquire a coaxial light image reflecting the color information of the printed pattern; during the even-numbered line scanning time, light up the second light source and acquire a grazing light image reflecting the surface unevenness and scratch information. S13. Perform interline interpolation compensation on the coaxial light image and the grazing light image to eliminate the spatial misalignment caused by time-division exposure, and obtain the compensated coaxial light image and grazing light image. The compensated coaxial light image and the grazing light image are fused together to obtain four-channel raw image data.

3. The online visual inspection method for printed patterns on a color photovoltaic backsheet according to claim 2, characterized in that, S2 includes the following steps: S21. Perform distortion correction and white balance processing on the first three channels of RGB data in the four-channel original image to obtain a standard RGB image; S22. Use a nonlinear transformation formula to convert the standard RGB image into XYZ tristimulus values, and then use a nonlinear mapping function to convert the XYZ values ​​into CIE-Lab space values ​​to obtain the brightness feature map, red-green feature map, and yellow-blue feature map. Gray-scale stretching and normalization are performed on the fourth channel grazing light data of the four-channel original image data to output a morphological feature map. S23. Construct an orthogonal feature map group based on the brightness feature map, red-green feature map, yellow-blue feature map, and shape feature map.

4. The online visual inspection method for printed patterns on a color photovoltaic backsheet according to claim 3, characterized in that, S3 includes the following steps: S31. Define the sliding window size; traverse the sliding window on the brightness feature channel in the orthogonal feature map group, calculate the sum of squares of the gradient magnitude of the pixel grayscale values ​​within the window, and obtain the local texture energy. S32. Calculate the variance of pixel gray values ​​within the sliding window and construct a texture complexity evaluation function; based on the variance of pixel gray values ​​within the sliding window, obtain the texture complexity matrix through the texture complexity evaluation function; normalize the texture complexity matrix to the [0,1] interval to obtain the texture complexity probability map. S33. Set a texture differentiation threshold; in the texture complexity probability, pixels whose texture complexity is greater than the texture differentiation threshold are classified into high-frequency texture areas and marked as 1 in the mask matrix; otherwise, they are classified as low-frequency smooth areas and marked as 0 in the mask matrix.

5. The online visual inspection method for printed patterns on a color photovoltaic backsheet according to claim 4, characterized in that, S4 includes the following steps: S41. Construct a texture reconstruction model, which includes a generator and a discriminator; the generator adopts the U-Ne0020t architecture and includes a downsampling encoder, a bottleneck layer and an upsampling decoder; the discriminator adopts the PatchGAN architecture. S42. Construct a sample set of good products containing only defect-free colored backplate images; S43. During the training phase, random masking is applied to the good sample set of color backplate images. The masked images are then input into the generator in the texture reconstruction model. The generator outputs the repaired reconstructed image. The discriminator determines the authenticity of the repaired reconstructed image and the original good image. S44. Define the combined loss function; iteratively update the generator parameters by minimizing the combined loss function until the texture reconstruction model can automatically infer and generate the normal texture of the occluded area based on the surrounding texture, and obtain the trained texture reconstruction model. S45. Input the image of the high-frequency texture area into the trained texture reconstruction model to obtain a defect-free virtual standard brightness map; and use the image of the low-frequency smooth area through a Gaussian mixture model to generate a background reference map.

6. The online visual inspection method for printed patterns on a color photovoltaic backsheet according to claim 5, characterized in that, The calculation of the combined loss function in S44 includes the following steps: S4411. Calculate the difference in probability distribution between the generated image and the real image in the discriminator output to obtain the adversarial loss; S4412. Calculate the average absolute difference between the corresponding pixel values ​​of the generated image and the real image to obtain the pixel consistency loss; S4413. Input the generated image and the real image into the pre-trained VGG-19 network respectively, extract the feature maps of the 3rd, 4th and 5th convolutional layers, calculate the Euclidean distance between the feature maps, and obtain the perceptual loss. S4414. Set the weight coefficients for the pixel consistency loss and the perceptual loss, and obtain the total loss of the texture reconstruction model by weighted summation through the combined loss function.

7. The online visual inspection method for printed patterns on a color photovoltaic backsheet according to claim 5, characterized in that, In step S44, the generator is iteratively updated by minimizing the combination loss function. G The parameters include the following steps: S4421. Construct a chromosome population; use the chromosomes in the population as a generator. G Parameter combinations; S4422. By minimizing the combined loss function, chromosomes in the chromosome population are selected, crossovered, and mutated; the process is repeated iteratively until the maximum number of iterations is reached or the loss value is less than the preset loss value threshold, at which point the optimal chromosome is obtained; the optimal chromosome is then applied to the generator.

8. The online visual inspection method for printed patterns on a color photovoltaic backsheet according to claim 5, characterized in that, S5 includes the following steps: S51. Calculate the absolute difference between the brightness feature map of the orthogonal feature map group and the virtual standard map to obtain the texture region residual map; S52. Calculate the differences between the morphology feature map, red-green feature map, yellow-blue feature map and background reference map in the orthogonal feature map group, and perform Z-score standardization to obtain the smooth area residual map; S53. Merge the residual map of the textured region and the residual map of the smooth region to obtain the residual response map of the entire field; perform hysteresis threshold segmentation on the residual response map to generate a complete set of candidate defect spots.

9. The online visual inspection method for printed patterns on a color photovoltaic backsheet according to claim 6, characterized in that, S6 includes the following steps: S61. Traverse each spot in the candidate defect set and calculate its position. L , a , b The average gray values ​​of the corresponding regions in the three channel residual maps are obtained. L Channel residual a Channel residual b Channel residuals; calculate the aspect ratio of each candidate spot in the candidate defect spot set to obtain the spot aspect ratio set; S63. Define the formulas for the physical damage index and the printing defect judgment index; S64, based on L Channel residual a Channel residual b The channel residuals and the set of aspect ratios of the spots are used to obtain the physical damage index and the printing defect judgment index for each spot through the physical damage index formula and the printing defect judgment index formula. Based on the physical damage index and printing defect judgment index of each spot, the defect type of the candidate spots in the spot set is output through the rules of the defect classification decision tree. S65. Encapsulate the defect type and coordinate information of candidate spots in the spot set into a JSON format data stream and output it.

10. An online visual inspection system for printed patterns on color photovoltaic backsheets, characterized in that, The system for implementing the online visual inspection method for printed patterns on a color photovoltaic backsheet as described in any one of claims 1-9 includes: The multispectral imaging module includes a linear array camera, a coaxial light source, a bar light source, and a synchronization controller, used to acquire four channels of raw image data from the backplane. The color space decoupling module performs RGB to Lab conversion and channel separation based on four-channel raw image data, and constructs an orthogonal feature map group. The texture analysis and reconstruction module, which includes an FPGA accelerator card and a GPU inference unit, performs texture complexity calculation, network inference and background modeling based on orthogonal feature map groups to obtain a virtual standard brightness map and a background reference map. The defect fusion decision module performs differential operations, threshold segmentation, and decision tree-based defect classification based on a virtual standard brightness map and a background baseline map, and outputs the final detection report.