A method and system for detecting defects in a shielding film

By combining multi-band imaging and feature extraction networks, the problems of low contrast and texture misjudgment in shielding film defect detection are solved, achieving efficient defect identification and reducing the false negative rate.

CN122115453APending Publication Date: 2026-05-29JIANGXI ZHUOXUN MICROELECTRONICS CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JIANGXI ZHUOXUN MICROELECTRONICS CO LTD
Filing Date
2026-04-29
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In existing technologies, machine vision uses single-band imaging to detect shallow scratches on transparent/semi-transparent substrates on shielding films and foreign object defects with refractive indices close to those of the substrate, resulting in extremely low contrast, high false negative rates, and the fine mesh texture of the shielding film is easily misjudged as a defect.

Method used

Images are acquired using three imaging modalities: transmission, red light reflection, and near-infrared reflection. Combined with a feature extraction network, defect features are enhanced by difference index maps and frequency domain filtering techniques, and interference from the inherent periodic texture of the shielding film is filtered out. The defect feature vectors are obtained by the feature extraction network for comparison.

Benefits of technology

It improved contrast, reduced the false negative rate, enhanced the ability to identify complex defects, reduced the probability of texture misjudgment, and improved the generalization recognition ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122115453A_ABST
    Figure CN122115453A_ABST
Patent Text Reader

Abstract

The application provides a shielding film defect detection method and system, the method comprising: acquiring a transmission image, a red light reflection image and a near-infrared reflection image corresponding to the shielding film, and then acquiring a defect feature image; filtering out frequency domain components corresponding to inherent periodic textures of the shielding film in the defect feature image to obtain an enhanced image; inputting the enhanced image into a feature extraction network to obtain a defect feature map; obtaining a defect feature vector based on the defect feature map, comparing the defect feature vector with a plurality of defect feature templates, and obtaining a detection defect category. By acquiring images of three different physical imaging modalities of transmission, red light reflection and near-infrared reflection, the information limitation of single waveband imaging is broken, the signal-to-noise ratio and detectability of the defect signal are improved from the source, the contrast is improved, and the missed detection rate is reduced. By filtering out the inherent periodic textures of the shielding film, the background texture interference is targeted and actively suppressed, and the probability of misjudging the texture as a defect is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method and system for detecting defects in shielding films. Background Technology

[0002] Shielding films are widely used in smartphones, wearable devices, automotive electronics, and high-end FPCs. With the development of electronic products towards higher speeds and thinner designs, their market demand continues to grow.

[0003] A shielding film is a functional thin film primarily used to block and absorb electromagnetic interference. It prevents external electromagnetic noise from entering the circuit while suppressing the outward radiation of high-speed internal signals, thereby improving the signal transmission stability and reliability of the equipment.

[0004] Surface defects in shielding films can directly lead to the failure of product shielding effectiveness or the risk of short circuits. Existing defect detection methods use machine vision to image in a single wavelength (such as visible light). For defects such as shallow scratches on transparent / semi-transparent substrates or foreign objects with a refractive index close to that of the substrate, the imaging contrast is extremely low, resulting in a high rate of missed detection. Furthermore, shielding films often have fine mesh textures used for signal routing, which are easily misjudged as defects. Summary of the Invention

[0005] To address the shortcomings of existing technologies, the present invention aims to provide a method and system for detecting defects in shielding films. This invention addresses the technical problems of existing machine vision systems that use single-band imaging for shielding film defect detection, resulting in extremely low imaging contrast and a high rate of missed detection for defects such as shallow scratches on transparent / semi-transparent substrates and foreign objects with refractive indices close to those of the substrate. Furthermore, shielding films often have fine mesh textures used for signal routing, which are easily misjudged as defects.

[0006] To achieve the above objectives, in a first aspect, embodiments of this application provide a method for detecting defects in a shielding film, comprising the following steps: Acquire the transmission image, red light reflection image, and near-infrared reflection image corresponding to the shielding film, and obtain the defect feature image based on the transmission image, the red light reflection image, and the near-infrared reflection image; Filter out the frequency domain components in the defect feature image that correspond to the inherent periodic texture of the shielding film to obtain an enhanced image; The enhanced image is input into a feature extraction network comprising an encoder, a channel module, and a spatial module to obtain a defect feature map. Based on the defect feature map, a defect feature vector is obtained, and the defect feature vector is compared with several defect feature templates to obtain the detected defect category.

[0007] Furthermore, the step of obtaining the defect feature image based on the transmission image, the red light reflection image, and the near-infrared reflection image includes: Obtain a first difference index map between the red light reflection image and the near-infrared reflection image, and obtain a second difference index map between the transmission image and the red light reflection image; Based on the first difference index map and the second difference index map, a defect saliency image is obtained. The defect saliency image is subjected to a first adjustment process to obtain a first adjusted image. The red light reflection image is subjected to a second adjustment process to obtain a second adjusted image. The first adjusted image and the second adjusted image are stacked to form a defect feature image.

[0008] Furthermore, the formula for obtaining the first difference index map is: , in, This represents the first difference index graph. Represents near-infrared reflectance images. Represents a red light reflection image. Denotes the first constant; The formula for obtaining the second difference index plot is: , in, This represents the second difference index graph. Represents a transmission image. This represents the second constant.

[0009] Furthermore, the step of performing a first adjustment process on the defect saliency image to obtain a first adjusted image includes: The minimum and maximum pixel values ​​are selected from all the original pixel values ​​of the defect saliency image. The minimum pixel value is mapped to a first preset value, and the maximum pixel value is mapped to a second preset value. Based on the minimum pixel value, the first preset value, the maximum pixel value, and the second preset value, the remaining original pixel values ​​are mapped to updated pixel values ​​to obtain a stage image; The stage image is divided into several grid regions, the histogram distribution of the grid regions is obtained, the cumulative distribution function of the grid regions is obtained through the histogram distribution, and the pixel mapping function corresponding to the grid regions is obtained through the cumulative distribution function. The updated pixel values ​​in the stage image are converted into final pixel values ​​based on the pixel mapping function to obtain the first adjusted image.

[0010] Furthermore, the step of converting the updated pixel values ​​in the stage image into final pixel values ​​based on the pixel mapping function includes: Select the grid region containing the updated pixel value as the standard grid, and select the four grid regions adjacent to the standard grid as neighboring grids; The updated pixel value is mapped to a mapped pixel value based on the pixel mapping function of the neighboring grid; Obtain the x-axis normalized distance and y-axis normalized distance between the updated pixel value and the center pixel value of the standard grid; The final pixel value is obtained based on the x-axis normalized distance, the y-axis normalized distance, and the mapped pixel value.

[0011] Furthermore, the step of filtering out the frequency domain components in the defect feature image that correspond to the inherent periodic texture of the shielding film to obtain the enhanced image includes: Perform a two-dimensional discrete cosine transform on the defect feature image to obtain the frequency domain coefficient matrix; Locate the energy peak points of the shielding film due to its inherent periodic texture in the energy spectrum of the frequency domain coefficient matrix; Using the energy peak point as the center, the stopband range is determined by the degree of energy diffusion at the energy peak point in order to construct an elliptical bandstop filter; All the elliptic band-stop filters are combined into a single filter, and the frequency domain coefficient matrix is ​​filtered by the single filter. The filtered frequency domain coefficient matrix is ​​then subjected to an inverse discrete cosine transform to obtain an enhanced image.

[0012] Furthermore, the encoder includes several convolutional layers, and the step of inputting the enhanced image into a feature extraction network including an encoder, a channel module, and a spatial module to obtain a defect feature map includes: The enhanced image is input into the encoder to obtain several initial scale feature maps through several convolutional layers; The initial scale feature maps are converted into stage scale feature maps by feature pyramid fusion. Several stage-scale feature maps are respectively input into the channel module and the spatial module to obtain the channel attention weight map and the spatial attention weight map. The final scale feature map is obtained by using the stage scale feature map, the channel attention weight map, and the spatial attention weight map, and several final scale feature maps are stitched together to form a defect feature map.

[0013] Furthermore, the loss function of the feature extraction network is: , in, Represents the loss function. The feature values ​​of the anchor sample image are represented. The feature value represents the positive sample image of the same type as the anchor sample image. The feature values ​​of negative sample images that belong to a different class than the anchor sample image. Represents the distance metric function. Indicates boundary values, This indicates taking the maximum value.

[0014] Furthermore, the step of comparing the defect feature vector with several defect feature templates to obtain the detected defect category includes: Obtain the cosine similarity between the defect feature vector and each defect feature template; The cosine similarity is compared with a similarity threshold, and the defect category corresponding to the defect feature template with a cosine similarity greater than the similarity threshold is selected as the detection defect category.

[0015] Secondly, embodiments of this application provide a shielding film defect detection system, applied to the shielding film defect detection method as described in the first aspect above, the system comprising: The splicing module is used to acquire the transmission image, red light reflection image and near-infrared reflection image corresponding to the shielding film, and to acquire the defect feature image based on the transmission image, the red light reflection image and the near-infrared reflection image; An enhancement module is used to filter out the frequency domain components in the defect feature image that correspond to the inherent periodic texture of the shielding film, so as to obtain an enhanced image; The extraction module is used to input the enhanced image into a feature extraction network including an encoder, a channel module, and a spatial module to obtain a defect feature map; The execution module is used to obtain a defect feature vector based on the defect feature map, and compare the defect feature vector with several defect feature templates to obtain the detected defect category.

[0016] Thirdly, embodiments of this application provide a computer, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the shielding membrane defect detection method as described in the first aspect above.

[0017] Fourthly, embodiments of this application provide a storage medium storing a computer program thereon, which, when executed by a processor, implements the shielding membrane defect detection method as described in the first aspect above.

[0018] Compared with existing technologies, the beneficial effects of this invention are as follows: By acquiring images of three different physical imaging modes—transmission, red light reflection, and near-infrared reflection—it breaks through the information limitations of single-band imaging. The combination of these three images enriches the information source from multiple physical dimensions, providing an information basis for subsequent processing to distinguish defects of different attributes. This improves the signal-to-noise ratio and detectability of defect signals from the source, increases contrast, and reduces the false negative rate. By filtering out and removing the inherent periodic texture of the shielding film, it can specifically and actively suppress background texture interference, thereby reducing the probability of misjudging textures as defects. By introducing the feature extraction network, the defect feature vector is obtained and compared with the defect feature template, improving the generalization recognition ability of complex and multifaceted defects. Attached Figure Description

[0019] Figure 1 This is a flowchart of the shielding film defect detection method in the first embodiment of the present invention; Figure 2 This is a structural block diagram of the shielding membrane defect detection system in the second embodiment of the present invention; The following detailed description, in conjunction with the accompanying drawings, will further illustrate the present invention. Detailed Implementation

[0020] To facilitate understanding of the present invention, a more complete description will be given below with reference to the accompanying drawings. Several embodiments of the invention are illustrated in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.

[0021] It should be noted that when a component is said to be "fixed to" another component, it can be directly on the other component or there may be an intervening component. When a component is said to be "connected to" another component, it can be directly connected to the other component or there may be an intervening component. The terms "vertical," "horizontal," "left," "right," and similar expressions used in this document are for illustrative purposes only.

[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0023] Please see Figure 1 The shielding film defect detection method provided in the first embodiment of the present invention includes the following steps: S10: Obtain the transmission image, red light reflection image and near-infrared reflection image corresponding to the shielding film, and obtain the defect feature image based on the transmission image, the red light reflection image and the near-infrared reflection image; In this embodiment, a sampling spectrophotometer and an integrating sphere are used together to acquire the transmission image. The red light reflection image and the near-infrared reflection image are acquired by combining a multispectral imaging spectrometer and a sensor. Understandably, the center wavelength of the red light band of the red light reflection image is 634nm~666nm, and the center wavelength of the near-infrared band of the near-infrared reflection image is 814nm~866nm.

[0024] Step S10 includes: S110: Obtain a first difference index map between the red light reflection image and the near-infrared reflection image, and obtain a second difference index map between the transmission image and the red light reflection image; It should be noted that before obtaining the first difference index map and the second difference index map, spatial registration operation needs to be performed on the red light reflection image, the near-infrared reflection image and the transmission image to make the position of each pixel in the red light reflection image, the near-infrared reflection image and the transmission image correspond.

[0025] The formula for obtaining the first difference index graph is: , in, This represents the first difference index graph. Represents near-infrared reflectance images. Represents a red light reflection image. The first constant is represented; understandably, at each pixel position, the pixel values ​​of the near-infrared reflective image and the red reflective image are subtracted and summed to obtain the absolute difference in reflectivity between the two bands.

[0026] The formula for obtaining the second difference index plot is: , in, This represents the second difference index graph. Represents a transmission image. This represents the second constant. The first difference index map is used to enhance defects sensitive to changes in the surface material of the shielding film, while the second difference index map is used to enhance defects sensitive to internal inclusions and uneven thickness. The combination of the two actively enhances the defect signal, achieving higher significance than the original image.

[0027] S120: Obtain a defect saliency image based on the first difference index map and the second difference index map, perform a first adjustment process on the defect saliency image to obtain a first adjusted image, and perform a second adjustment process on the red light reflection image to obtain a second adjusted image; Based on prior knowledge (such as the material spectral signal being more important when detecting surface contamination), a first fusion weight and a second fusion weight are set for the first difference index map and the second difference index map, respectively. The sum of the first fusion weight and the second fusion weight is 1. Then, the first difference index map and the second difference index map are fused into the defect saliency image through the first fusion weight and the second fusion weight.

[0028] Further, the minimum pixel value and the maximum pixel value are selected from all the original pixel values ​​of the defect saliency image, the minimum pixel value is mapped to a first preset value, and the maximum pixel value is mapped to a second preset value; In this embodiment, the first preset value is 0, and the second preset value is 255.

[0029] Based on the minimum pixel value, the first preset value, the maximum pixel value, and the second preset value, the remaining original pixel values ​​are mapped to updated pixel values ​​to obtain a stage image; The formula for obtaining the updated pixel value is: , in, This indicates updating the pixel value. This represents the remaining original pixel value. Indicates the maximum pixel value. Indicates the minimum pixel value. This represents the second preset value. This indicates the first preset value.

[0030] The stage image is divided into several grid regions, the histogram distribution of the grid regions is obtained, the cumulative distribution function of the grid regions is obtained through the histogram distribution, and the pixel mapping function corresponding to the grid regions is obtained through the cumulative distribution function. Suppose a certain grid region has 4 pixel values, represented as: If the grayscale range is 0~255, then the histogram distribution of this grid area is as follows: grayscale level 15 appears once, grayscale level 20 appears twice, grayscale level 25 appears once, and the total pixel value is 4. Therefore, the cumulative distribution function is: , , The pixel mapping function is characterized as: , in, Represents the mapped pixel value. Represents the original probability distribution. This represents the minimum probability of the original distribution. Indicates the maximum gray level. Indicates rounding down to the nearest integer. Taking 0.75 as an example, The value is 170. By obtaining the updated pixel value, the local contrast of different regions can be adaptively enhanced, making the low contrast defects hidden in each local region visible.

[0031] Based on the pixel mapping function, the updated pixel values ​​in the stage image are converted into final pixel values ​​to obtain a first adjusted image; The grid region containing the updated pixel value is selected as the standard grid, and the four grid regions adjacent to the standard grid are selected as neighboring grids. Specifically, the neighboring grids are the top left, top right, bottom left, and bottom right. That is, the top left, top right, bottom left, and bottom right grid regions of the standard grid are selected as neighboring grids. It should be noted that if the standard grid is a boundary grid, for the missing neighboring grids, the standard grid itself is selected as the neighboring grid. For example, if the standard grid is in the top left corner, it is missing the top left, top right, and bottom left three neighboring grid regions. In this case, the standard grid itself is selected as the top left, top right, and bottom left three neighboring grid regions.

[0032] The updated pixel value is mapped to a mapped pixel value based on the pixel mapping function of the neighboring grid. The normalized x-axis distance (the difference between their horizontal coordinates) and the normalized y-axis distance (the difference between their vertical coordinates) between the updated pixel value and the center pixel value of the standard grid are obtained. The final pixel value is obtained based on the normalized x-axis distance, the normalized y-axis distance, and the mapped pixel value. The formula for obtaining the final pixel value is: , in, Indicates the final pixel value. Represents the normalized distance along the y-axis. Represents the normalized distance along the z-axis. , , , These represent the mapped pixel values ​​of the updated pixel values ​​in the neighboring grids at the top left, top left, bottom right, and bottom right, respectively. By obtaining these final pixel values, potential grayscale abrupt changes or discontinuities at region boundaries are eliminated, ensuring the smoothness of the output image and providing a higher-quality, more natural input image for subsequent feature extraction, thereby improving the accuracy of defect recognition. Understandably, the second adjusted image is obtained in the same way as the first adjusted image, and will not be described again here.

[0033] S130: Stack the first adjusted image and the second adjusted image to form a defect feature image; Understandably, the first adjusted image and the second adjusted image are stacked in the channel dimension to form a multi-channel defect feature image (the defect feature image can be characterized as, for example, 1024*1024*2). The first adjusted image carries the physical attribute information of the defect after fusion enhancement, and the second adjusted image retains the original spatial structure details.

[0034] S20: Filter out the frequency domain components in the defect feature image that correspond to the inherent periodic texture of the shielding film to obtain an enhanced image; Step S20 includes: S210: Perform a two-dimensional discrete cosine transform on the defect feature image to obtain the frequency domain coefficient matrix; The frequency domain coefficient matrix is ​​obtained through standard two-dimensional DCT transformation, which has been widely used and will not be elaborated here. The inherent periodic texture of the shielding film appears as a series of highly concentrated, discrete peak points in the frequency domain, while defects are usually isolated and non-periodic, with relatively dispersed energy distribution in the frequency domain. Therefore, by obtaining the frequency domain coefficient matrix, the two can be separated in the frequency domain.

[0035] S220: Locate the energy peak point of the shielding film due to its inherent periodic texture in the energy spectrum of the frequency domain coefficient matrix; Calculate the logarithmic energy spectrum of the frequency domain coefficient matrix, and perform a smoothing filter (such as a Gaussian low-pass filter) on the logarithmic energy spectrum to suppress high-frequency noise and small fluctuations, thereby obtaining a saliency map. Scan the entire frequency domain and record the coordinates of the points in the saliency map where the value is greater than a preset threshold and has the maximum value in its local neighborhood, and record them as energy peak points.

[0036] S230: Using the energy peak point as the center, the stopband range is determined by the degree of energy diffusion at the energy peak point in order to construct an elliptical bandstop filter; For each energy peak point, multiple radial profiles are drawn on its corresponding logarithmic energy spectrum. The positions where the energy drops from the peak to halfway down in the u and v directions on each profile are analyzed, and the average distance from these positions to the peak is calculated to obtain the u-axis and v-axis energy diffusion ranges. A safety factor (1.5) is set, and this safety factor is multiplied by the u-axis and v-axis energy diffusion ranges respectively to obtain the u-axis and v-axis semi-axis lengths. These u-axis and v-axis semi-axis lengths are understood to be the stopband range. An elliptic bandstop filter is constructed based on the energy peak point, the u-axis semi-axis length, and the v-axis semi-axis length. By adaptively obtaining the stopband range, the filter can more accurately adapt to the actual energy distribution of the texture frequency, effectively suppressing texture while preserving, to the greatest extent possible, defect information that is close to but non-periodic to the texture frequency. S240: Combine all the elliptic band-stop filters into a total filter, and filter the frequency domain coefficient matrix through the total filter. Perform inverse discrete cosine transform on the filtered frequency domain coefficient matrix to obtain an enhanced image. The entire elliptic bandstop filter is multiplied point-by-point to obtain the total filter. Filtering is then performed by point-by-point complex multiplication of the total filter with the frequency domain coefficient matrix (for each channel). This operation significantly attenuates the energy of frequency bands close to zero in the total filter (corresponding to the inherent periodic texture of the shielding film), thus preserving the energy of other frequency bands. The inverse discrete cosine transform and the two-dimensional discrete cosine transform are often used together, and will not be elaborated further here.

[0037] S30: Input the enhanced image into a feature extraction network including an encoder, a channel module, and a spatial module to obtain a defect feature map; During the training phase of the feature extraction network, the loss function of the feature extraction network is: , in, Represents the loss function. The feature values ​​of the anchor sample image are represented. The feature value represents the positive sample image of the same type as the anchor sample image. The feature values ​​of negative sample images that belong to a different class than the anchor sample image. Represents the distance metric function. Indicates boundary values, This indicates taking the maximum value. Intuitively, the eigenvalue refers to the feature extracted from the image by the feature extraction network during the training phase.

[0038] Step S30 includes: S310: Input the enhanced image into the encoder to obtain several initial scale feature maps through several convolutional layers; The encoder includes several convolutional layers. For each convolutional layer, it outputs the value of the enhanced image at position P. Assuming there are four convolutional layers, the four initial scale feature maps output are represented as {C2, C3, C4, C5}. S320: Convert several initial scale feature maps into several stage scale feature maps through feature pyramid fusion; For the initial scale feature map C5, it is upsampled to the same spatial size as C4, and a 1*1 convolution is performed on C4 to adjust its channel count. The two are then added element-wise, and finally fused and refined using a 3*3 convolution to generate the stage scale feature map P5 corresponding to the initial scale feature map C5. For the initial scale feature map C4, the stage scale feature map P5 is upsampled to the same spatial size as the initial scale feature map C4, and a 1*1 convolution is performed on C4 to adjust its channel count. The two are then added element-wise, and finally fused and refined using a 3*3 convolution to generate the stage scale feature map P4 corresponding to the initial scale feature map C4. The stage scale feature maps P3 and P2 are obtained in the same way as the stage scale feature map P4, and will not be described again here. Through feature pyramid fusion, each stage scale feature map incorporates generated semantics and shallow details, providing a multi-scale information foundation for detecting defects of different sizes.

[0039] S330: Input several of the stage-scale feature maps into the channel module and the spatial module respectively to obtain the channel attention weight map and the spatial attention weight map; For each stage-scale feature map, in the channel module, global average pooling and global max pooling are performed to obtain two C*1*1 vectors. These two vectors are input into a small multilayer perceptron, and the outputs are summed and activated by Sigmoid to generate a channel attention weight map. In the spatial module, average pooling and max pooling are performed on the stage-scale feature maps in the channel dimension to obtain two 1*H*W feature maps. These two feature maps are concatenated in the channel dimension to form a 2*H*W feature map. This 2*H*W feature map is then convolved by a 7*7 convolutional layer to reduce the number of channels to 1, and activated by Sigmoid to generate a spatial attention weight map.

[0040] S340: Obtain the final scale feature map through the stage scale feature map, the channel attention weight map and the spatial attention weight map, and stitch several of the final scale feature maps together to form a defect feature map; The stage-scale feature map, the channel attention weight map, and the spatial attention weight map are multiplied element-wise to obtain the final scale feature map. Several final scale feature maps are adjusted to the same size and stitched together along the channel dimension to form the defect feature map.

[0041] S40: Obtain a defect feature vector based on the defect feature map, and compare the defect feature vector with several defect feature templates to obtain the detected defect category; Understandably, the defect feature template is obtained from the feature extraction network by processing an image with a known defect through the same steps.

[0042] Step S40 includes: S410: Obtain the cosine similarity between the defect feature vector and each defect feature template; The calculation of cosine similarity is already quite common, so it will not be elaborated on here.

[0043] S420: Compare the cosine similarity with the similarity threshold, and select the defect category corresponding to the defect feature template with a cosine similarity greater than the similarity threshold as the detection defect category.

[0044] Understandably, there can be multiple defect categories to detect.

[0045] By acquiring images from three different physical imaging modes—transmission, red light reflection, and near-infrared reflection—the limitations of single-band imaging are overcome. The combination of these three images enriches the information source from multiple physical dimensions, providing a foundation for subsequent processing to distinguish defects with different attributes. This improves the signal-to-noise ratio and detectability of defect signals from the source, enhances contrast, and reduces the false negative rate. By filtering out and removing the inherent periodic texture of the shielding film, background texture interference can be specifically and actively suppressed, thereby reducing the probability of misjudging textures as defects. By introducing the feature extraction network, the defect feature vector is obtained and compared with the defect feature template, improving the generalization recognition capability for complex and multifaceted defects.

[0046] Please see Figure 2 The second embodiment of the present invention provides a shielding membrane defect detection system, which is applied to the shielding membrane defect detection method described in the above embodiments, and will not be repeated hereafter. As used below, the terms "module," "unit," "subunit," etc., can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0047] The system includes: The splicing module 10 is used to acquire the transmission image, red light reflection image and near-infrared reflection image corresponding to the shielding film, and to acquire the defect feature image based on the transmission image, the red light reflection image and the near-infrared reflection image; The splicing module 10 includes: The first unit is used to acquire a first difference index map between the red light reflection image and the near-infrared reflection image, and to acquire a second difference index map between the transmission image and the red light reflection image; The second unit is used to obtain a defect saliency image based on the first difference index map and the second difference index map, perform a first adjustment process on the defect saliency image to obtain a first adjusted image, and perform a second adjustment process on the red light reflection image to obtain a second adjusted image. The third unit is used to stack the first adjusted image and the second adjusted image into a defect feature image; The third unit is specifically used to select the minimum pixel value and the maximum pixel value from all the original pixel values ​​of the defect saliency image, map the minimum pixel value to a first preset value, and map the maximum pixel value to a second preset value; Based on the minimum pixel value, the first preset value, the maximum pixel value, and the second preset value, the remaining original pixel values ​​are mapped to updated pixel values ​​to obtain a stage image; The stage image is divided into several grid regions, the histogram distribution of the grid regions is obtained, the cumulative distribution function of the grid regions is obtained through the histogram distribution, and the pixel mapping function corresponding to the grid regions is obtained through the cumulative distribution function. Based on the pixel mapping function, the updated pixel values ​​in the stage image are converted into final pixel values ​​to obtain a first adjusted image; The third unit is also used to select the grid area where its updated pixel value is located as a standard grid, and to select the four grid areas adjacent to the standard grid as neighboring grids; The updated pixel value is mapped to a mapped pixel value based on the pixel mapping function of the neighboring grid; Obtain the x-axis normalized distance and y-axis normalized distance between the updated pixel value and the center pixel value of the standard grid; The final pixel value is obtained based on the x-axis normalized distance, the y-axis normalized distance, and the mapped pixel value; Enhancement module 20 is used to filter out the frequency domain components in the defect feature image that correspond to the inherent periodic texture of the shielding film in order to obtain an enhanced image; The reinforcement module 20 includes: The fourth unit is used to perform a two-dimensional discrete cosine transform on the defect feature image to obtain a frequency domain coefficient matrix; The fifth unit is used to locate the energy peak point of the inherent periodic texture of the shielding film in the energy spectrum of the frequency domain coefficient matrix; The sixth unit is used to determine the stopband range based on the energy diffusion degree of the energy peak point, with the energy peak point as the center, so as to construct an elliptical bandstop filter; The seventh unit is used to combine all the elliptic band-stop filters into a total filter, filter the frequency domain coefficient matrix through the total filter, and perform inverse discrete cosine transform on the filtered frequency domain coefficient matrix to obtain an enhanced image. Extraction module 30 is used to input the enhanced image into a feature extraction network including an encoder, a channel module and a spatial module to obtain a defect feature map; The extraction module 30 includes: The eighth unit is used to input the enhanced image into the encoder to obtain several initial scale feature maps through several convolutional layers; The ninth unit is used to convert several initial scale feature maps into several stage scale feature maps through feature pyramid fusion. The tenth unit is used to input several of the stage-scale feature maps into the channel module and the spatial module respectively to obtain the channel attention weight map and the spatial attention weight map; The eleventh unit is used to obtain the final scale feature map through the stage scale feature map, the channel attention weight map and the spatial attention weight map, and to stitch together several of the final scale feature maps into a defect feature map. Execution module 40 is used to obtain a defect feature vector based on the defect feature map, and compare the defect feature vector with several defect feature templates to obtain the detected defect category; The execution module 40 includes: The twelfth unit is used to obtain the cosine similarity between the defect feature vector and each defect feature template. The thirteenth unit is used to compare the cosine similarity with the similarity threshold, and select the defect category corresponding to the defect feature template with a cosine similarity greater than the similarity threshold as the detection defect category.

[0048] The present invention also provides a computer, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the shielding membrane defect detection method as described in the above technical solutions.

[0049] The present invention also provides a storage medium storing a computer program thereon, which, when executed by a processor, implements the shielding membrane defect detection method as described in the above technical solution.

[0050] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," 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.

[0051] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the appended claims.

Claims

1. A method for detecting defects in a shielding film, characterized in that, Includes the following steps: Acquire the transmission image, red light reflection image, and near-infrared reflection image corresponding to the shielding film, and obtain the defect feature image based on the transmission image, the red light reflection image, and the near-infrared reflection image; Filter out the frequency domain components in the defect feature image that correspond to the inherent periodic texture of the shielding film to obtain an enhanced image; The enhanced image is input into a feature extraction network comprising an encoder, a channel module, and a spatial module to obtain a defect feature map. Based on the defect feature map, a defect feature vector is obtained, and the defect feature vector is compared with several defect feature templates to obtain the detected defect category.

2. The method for detecting defects in a shielding film according to claim 1, characterized in that, The step of obtaining the defect feature image based on the transmission image, the red light reflection image, and the near-infrared reflection image includes: Obtain a first difference index map between the red light reflection image and the near-infrared reflection image, and obtain a second difference index map between the transmission image and the red light reflection image; Based on the first difference index map and the second difference index map, a defect saliency image is obtained. The defect saliency image is subjected to a first adjustment process to obtain a first adjusted image. The red light reflection image is subjected to a second adjustment process to obtain a second adjusted image. The first adjusted image and the second adjusted image are stacked to form a defect feature image.

3. The method for detecting defects in a shielding film according to claim 2, characterized in that, The formula for obtaining the first difference index graph is: , in, This represents the first difference index graph. Represents near-infrared reflectance images. Represents a red light reflection image. Denotes the first constant; The formula for obtaining the second difference index plot is: , in, This represents the second difference index graph. Represents a transmission image. This represents the second constant.

4. The method for detecting defects in a shielding film according to claim 2, characterized in that, The step of performing a first adjustment process on the defect saliency image to obtain a first adjusted image includes: The minimum and maximum pixel values ​​are selected from all the original pixel values ​​of the defect saliency image. The minimum pixel value is mapped to a first preset value, and the maximum pixel value is mapped to a second preset value. Based on the minimum pixel value, the first preset value, the maximum pixel value, and the second preset value, the remaining original pixel values ​​are mapped to updated pixel values ​​to obtain a stage image; The stage image is divided into several grid regions, the histogram distribution of the grid regions is obtained, the cumulative distribution function of the grid regions is obtained through the histogram distribution, and the pixel mapping function corresponding to the grid regions is obtained through the cumulative distribution function. The updated pixel values ​​in the stage image are converted into final pixel values ​​based on the pixel mapping function to obtain the first adjusted image.

5. The method for detecting defects in a shielding film according to claim 4, characterized in that, The step of converting the updated pixel values ​​in the stage image into final pixel values ​​based on the pixel mapping function includes: Select the grid region containing the updated pixel value as the standard grid, and select the four grid regions adjacent to the standard grid as neighboring grids; The updated pixel value is mapped to a mapped pixel value based on the pixel mapping function of the neighboring grid; Obtain the x-axis normalized distance and y-axis normalized distance between the updated pixel value and the center pixel value of the standard grid; The final pixel value is obtained based on the x-axis normalized distance, the y-axis normalized distance, and the mapped pixel value.

6. The method for detecting defects in a shielding film according to claim 1, characterized in that, The step of filtering out the frequency domain components corresponding to the inherent periodic texture of the shielding film in the defect feature image to obtain the enhanced image includes: Perform a two-dimensional discrete cosine transform on the defect feature image to obtain the frequency domain coefficient matrix; Locate the energy peak points of the shielding film due to its inherent periodic texture in the energy spectrum of the frequency domain coefficient matrix; Using the energy peak point as the center, the stopband range is determined by the degree of energy diffusion at the energy peak point in order to construct an elliptical bandstop filter; All the elliptic band-stop filters are combined into a single filter, and the frequency domain coefficient matrix is ​​filtered by the single filter. The filtered frequency domain coefficient matrix is ​​then subjected to an inverse discrete cosine transform to obtain an enhanced image.

7. The method for detecting defects in a shielding film according to claim 1, characterized in that, The encoder includes several convolutional layers, and the step of inputting the enhanced image into a feature extraction network including an encoder, a channel module, and a spatial module to obtain a defect feature map includes: The enhanced image is input into the encoder to obtain several initial scale feature maps through several convolutional layers; The initial scale feature maps are converted into stage scale feature maps by feature pyramid fusion. Several stage-scale feature maps are respectively input into the channel module and the spatial module to obtain the channel attention weight map and the spatial attention weight map. The final scale feature map is obtained by using the stage scale feature map, the channel attention weight map, and the spatial attention weight map, and several final scale feature maps are stitched together to form a defect feature map.

8. The method for detecting defects in a shielding film according to claim 1, characterized in that, The loss function of the feature extraction network is: , in, Represents the loss function. The feature values ​​of the anchor sample image are represented. The feature value represents the positive sample image of the same type as the anchor sample image. The feature values ​​of negative sample images that belong to a different class than the anchor sample image. Represents the distance metric function. Indicates boundary values, This indicates taking the maximum value.

9. The method for detecting defects in a shielding film according to claim 1, characterized in that, The step of comparing the defect feature vector with several defect feature templates to obtain the detected defect category includes: Obtain the cosine similarity between the defect feature vector and each defect feature template; The cosine similarity is compared with a similarity threshold, and the defect category corresponding to the defect feature template with a cosine similarity greater than the similarity threshold is selected as the detection defect category.

10. A shielding film defect detection system, applied to the shielding film defect detection method as described in any one of claims 1 to 9, characterized in that, The system includes: The splicing module is used to acquire the transmission image, red light reflection image and near-infrared reflection image corresponding to the shielding film, and to acquire the defect feature image based on the transmission image, the red light reflection image and the near-infrared reflection image; An enhancement module is used to filter out the frequency domain components in the defect feature image that correspond to the inherent periodic texture of the shielding film, so as to obtain an enhanced image; The extraction module is used to input the enhanced image into a feature extraction network including an encoder, a channel module, and a spatial module to obtain a defect feature map; The execution module is used to obtain a defect feature vector based on the defect feature map, and compare the defect feature vector with several defect feature templates to obtain the detected defect category.