An image processing model, a model training method, an image processing method and application

By introducing techniques such as feature extraction networks, wavelet transform, and attention fusion modules, the problem of multi-scale feature collaborative enhancement and cross-scale fusion in image processing models for glass substrate inspection was solved, achieving efficient identification and stable detection of surface defects on glass substrates.

CN122176448APending Publication Date: 2026-06-09GUANGDONG UNIV OF TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGDONG UNIV OF TECH
Filing Date
2026-04-10
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing image processing models for glass substrate detection suffer from insufficient ability to represent high-frequency details in image directionality, poor multi-scale feature synergistic enhancement effect, and limited cross-scale fusion processing capability.

Method used

The system employs a feature extraction network module, a wavelet transform module, a high-frequency information directional sub-band attention fusion module, a feature enhancement fusion module, and a multi-scale fusion neck network module. Through cascaded two-dimensional discrete wavelet transform and attention fusion weighted processing, it achieves synergistic enhancement of backbone features and high-frequency information features, and performs cross-scale feature fusion.

Benefits of technology

It improves the model's adaptability to targets of different scales and image content of varying complexity, enhances the accuracy and stability of image processing, and significantly improves the recognition efficiency of defects on glass substrate surfaces.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122176448A_ABST
    Figure CN122176448A_ABST
Patent Text Reader

Abstract

This invention discloses an image processing model, a model training method, an image processing method, and its applications. The model includes a feature extraction network module, a wavelet transform module, a high-frequency information directional sub-band attention fusion module, a feature enhancement fusion module, a multi-scale fusion neck network module, and a detection head module. This invention obtains high-frequency sub-bands in multiple directions through discrete wavelet transform and uses the high-frequency information directional sub-band attention fusion module to weight the high-frequency features in each direction, thereby enhancing the representation ability of directional high-frequency details in the image. Simultaneously, the feature enhancement fusion module fuses the backbone features and high-frequency information features at corresponding scales, and combines this with the multi-scale fusion neck network module for cross-scale feature fusion, thereby improving the multi-scale feature synergistic enhancement capability and cross-scale fusion processing capability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing, and more specifically, relates to an image processing model, a model training method, an image processing method, and its application. Background Technology

[0002] With the rapid development of display panels, semiconductor packaging, and the photovoltaic industry, glass substrates, as core carrier materials, are increasingly widely used in the electronics manufacturing field. Their surface quality directly affects product performance, reliability, and production yield. Therefore, extremely high requirements are placed on the accuracy and stability of glass substrate surface defect detection during the production process. In the manufacturing, cutting, polishing, coating, cleaning, and handling of glass substrates, various minute defects are inevitably generated, such as scratches, bubbles, debris, cracks, stains, foreign matter residue, and localized contamination. These defects may damage the structural integrity of devices, affecting optical transmittance, electrical performance, or packaging effects. If they are not detected and removed in time, they will lead to decreased yield in subsequent processes, display abnormalities, or even product scrapping, causing significant economic losses. Therefore, how to efficiently and accurately detect and identify glass substrate surface defects in large-scale production has become an important research topic in the optoelectronic manufacturing field.

[0003] Currently, Automated Optical Inspection (AOI) systems have become the mainstream inspection method in the industry. AOI systems acquire images of the glass substrate surface using high-resolution industrial cameras and employ image processing algorithms to locate, identify, and classify defects. Due to their advantages such as high inspection speed, non-contact operation, and high repeatability, they are widely used in production inspection processes. In recent years, with the advancement of artificial intelligence and computer vision technologies, deep learning-based defect detection methods have gradually become a research focus. Models such as Convolutional Neural Networks (CNNs) can automatically learn features from raw images end-to-end, significantly improving the accuracy and generalization ability of defect identification. However, directly applying general deep learning models to glass substrate inspection still has limitations. On the one hand, the smooth texture of the glass surface and the complex background reflection result in insufficient sensitivity of traditional CNN models to edges, frequency domain details, and small targets. On the other hand, the scale differences between different types of defects are significant, making it difficult for single-scale feature extraction networks to balance detection accuracy and stability. Furthermore, under complex lighting or noise interference conditions, network performance is prone to degradation, affecting the reproducibility and engineering applicability of actual inspections.

[0004] The prior art patent CN119006469A proposes an automatic detection method and system for defects on the surface of substrate glass based on machine vision. The method includes acquiring multimodal data of the substrate glass surface and preprocessing it; fusing extracted image features, acoustic features, and thermal imaging features across modalities; inputting the fused feature map into a pre-constructed graph neural network to obtain a topological feature map representing the defect structure; concatenating the topological feature map with the fused feature map and inputting it into a multi-task learning network to obtain segmented suspected defect regions and corresponding defect types; using a pre-trained target detection model for defect localization; and determining the precision of the defect through bounding box regression. The method accurately locates and obtains an image of the target defect region. This image is then uploaded to the cloud, where a cloud-based defect detection model is used to accurately identify the defect type, yielding the final defect detection result. However, this method primarily focuses on multimodal data fusion, topological feature modeling, and segmentation-detection collaborative processing. It does not disclose the cascaded two-dimensional discrete wavelet transform of the image to be processed to output high-frequency directional subbands at multiple scales, nor does it disclose the weighted processing of these high-frequency directional subbands at multiple scales and their corresponding scale fusion with the backbone features at multiple scales. Therefore, it still falls short in areas such as image directional high-frequency detail representation, multi-scale feature collaborative enhancement, and cross-scale fusion processing. Summary of the Invention

[0005] This invention addresses the problems of insufficient ability to represent high-frequency details of image directionality, poor effect of multi-scale feature synergy enhancement, and limited cross-scale fusion processing capability in existing image processing models, and provides an image processing model, model training method, image processing method, and application.

[0006] The primary objective of this invention is to solve the aforementioned technical problems. The technical solution of this invention is as follows: The first aspect of this invention provides an image processing model, including a feature extraction network module, a wavelet transform module, a high-frequency information directional subband attention fusion module, a feature enhancement fusion module, a multi-scale fusion neck network module, and a detection head module, wherein... Feature extraction network module: Extracts features from the image to be processed and outputs backbone features at multiple scales; Wavelet transform module: performs cascaded two-dimensional discrete wavelet transforms on the image to be processed, and outputs high-frequency directional subbands at multiple scales; High-frequency information directional sub-band attention fusion module: performs weighted processing on high-frequency directional sub-bands at multiple scales and outputs weighted high-frequency information features at multiple scales; Feature enhancement and fusion module: fuses the backbone features at multiple scales with the weighted high-frequency information features at the corresponding scales, and outputs enhanced feature maps at multiple scales. Multi-scale fusion neck network module: performs cross-scale feature fusion on enhanced feature maps of multiple scales and outputs multi-scale fused features; Detection head module: Input multi-scale fused features into detection heads of different scales and output image processing results.

[0007] A second aspect of the present invention provides an image processing model training method for training an image processing model, comprising the following steps: The parameters of the image processing model are initialized, and the regularization coefficients are preset. Make the total loss function in the initial stage of training Subject to monotonic regularization Dominantly optimize learnable scalar parameters via backpropagation. proportional relationship; In each training round, the detection error generated by the detection head is processed by the total loss function. Quantization is performed to calculate the composite gradient flow for the learnable parameters of the entire model. The composite gradient flow is driven by an optimization algorithm based on gradient descent and combined with a preset learning rate adjustment strategy to iteratively update the learnable parameters of the model. As the training rounds progress, the regularization coefficient is adjusted using a learning rate strategy. The collaborative learning rate is adjusted downwards to guide the training focus to gradually minimize task loss. This enables the model to adaptively fine-tune all learnable parameters, progressively enhancing its ability to accurately fit the detailed features of defects. During end-to-end training, the model accuracy metrics are monitored and evaluated in real time, and the optimal model parameters are selected from the sequence of model parameters obtained from training to output the trained image processing model.

[0008] A third aspect of the present invention provides an image processing method, comprising the following steps: The image to be processed is subjected to backbone feature extraction to obtain backbone features at multiple scales; the image to be processed is subjected to cascaded two-dimensional discrete wavelet transform to obtain high-frequency directional subbands at multiple scales. Attention fusion and weighting are performed on high-frequency directional subbands at multiple scales to obtain weighted high-frequency information features at multiple scales. The backbone features at multiple scales are fused with the weighted high-frequency information features at the corresponding scales to obtain enhanced feature maps at multiple scales. Cross-scale feature fusion is performed on enhanced feature maps at multiple scales to obtain multi-scale fused features; Multiple scale fusion features are input into detection heads of different scales, and the image processing results are output.

[0009] A fourth aspect of the present invention provides an application of an image processing method for processing images on the surface of a glass substrate, comprising the following steps: The main features of the glass substrate surface image are extracted to obtain main features at multiple scales; the cascaded two-dimensional discrete wavelet transform of the glass substrate surface image is performed to obtain high-frequency directional subbands at multiple scales. Attention fusion and weighting are performed on high-frequency directional subbands at multiple scales to obtain weighted high-frequency information features at multiple scales. The backbone features at multiple scales are fused with the weighted high-frequency information features at the corresponding scales to obtain enhanced feature maps at multiple scales. Cross-scale feature fusion is performed on enhanced feature maps at multiple scales to obtain multi-scale fused features; Multiple scale fused features are input into detection heads of different scales to output defect detection results.

[0010] Compared with the prior art, the beneficial effects of the technical solution of the present invention are: This invention utilizes a feature enhancement fusion module to fuse core features at multiple scales with weighted high-frequency information features at corresponding scales, achieving synergistic enhancement of core features and high-frequency detail features, thus avoiding insufficient image representation caused by insufficient information from a single feature. Furthermore, a multi-scale fusion neck network module performs cross-scale feature fusion on the enhanced feature maps at multiple scales, simultaneously considering local detail information and overall semantic information at different scales, improving the model's adaptability to targets at different scales and image content of varying complexity. In addition, a detection head module inputs the multi-scale fused features into detection heads of different scales, outputting image processing results, which improves the model's processing accuracy and result stability. Therefore, this invention improves image feature extraction capabilities, feature fusion capabilities, and the final image processing effect through the hierarchical processing of multi-scale core features, high-frequency directional features, corresponding-scale fusion features, and cross-scale fusion features. Attached Figure Description

[0011] To make the objectives and technical solutions of this invention clearer, the following drawings are provided and described: Figure 1 A structural diagram of an image processing model provided in an embodiment of the present invention; Figure 2 This is a structural diagram of the high-frequency information directional sub-band attention fusion module provided in an embodiment of the present invention; Figure 3 This is a structural diagram of a composite convolution module provided in an embodiment of the present invention; Figure 4 This is a structural diagram of the feature enhancement fusion module provided in an embodiment of the present invention. Detailed Implementation

[0012] This invention primarily addresses the accuracy and stability bottlenecks faced by semiconductor-grade glass substrates in automated optical inspection (AOI) processes. In existing industrial inspection scenarios, glass substrates exhibit high reflectivity and complex surface textures. Traditional deep learning models, after multi-layer convolutional downsampling, often lose crucial features such as sub-pixel-level micro-scratches and point-like defects, making it difficult to reduce the false negative rate. Simultaneously, fluctuations in lighting, water residue, or mechanical vibrations in the production environment generate a large amount of high-frequency noise that is not defect-related. This noise exhibits a high degree of similarity to real defects in the spatial domain, making conventional convolutional neural networks highly prone to false positives.

[0013] Furthermore, existing multi-scale feature fusion architectures lack effective constraints on the physical distribution of features when handling such precision detection tasks. Without prior guidance, deep semantic features are easily interfered with by noise signals, while shallow detail features may be prematurely smoothed, making it difficult for the model to achieve an optimal balance between feature injection intensities at different scales. This invention aims to address the limitations of feature extraction capabilities and poor adaptability to complex backgrounds by introducing frequency domain analysis and an adaptive fusion mechanism with physical prior constraints, thereby significantly improving defect identification performance in the field of precision glass substrate manufacturing.

[0014] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.

[0015] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.

[0016] Example 1: This invention provides an image processing model, such as Figure 1 The diagram shows the structure of an image processing model, including a feature extraction network module, a wavelet transform module, a high-frequency information directional subband attention fusion module, a feature enhancement fusion module, a multi-scale fusion neck network module, and a detection head module. Feature extraction network module: Extracts features from the image to be processed and outputs backbone features at multiple scales. In this embodiment, the feature extraction network module is a deep residual network (ResNet) or a cross-stage partially connected Darknet network.

[0017] Wavelet transform module: Performs cascaded two-dimensional discrete wavelet transforms on the image to be processed, outputting high-frequency directional subbands at multiple scales.

[0018] High-Frequency Information Directional Subband Attention Fusion Module (HFAFM): This module performs weighted processing on high-frequency directional subbands at multiple scales and outputs weighted high-frequency information features at multiple scales.

[0019] Feature Enhancement Fusion Module (FEFM): This module fuses the backbone features at multiple scales with the weighted high-frequency information features at the corresponding scales to output enhanced feature maps at multiple scales.

[0020] Multi-scale fusion neck network module: performs cross-scale feature fusion on enhanced feature maps of multiple scales and outputs multi-scale fused features. In this embodiment, the multi-scale fusion neck network module is a neck network that combines a feature pyramid network (FPN) and a path aggregation network (PAN).

[0021] Detection head module: Input multi-scale fused features into detection heads of different scales and output image processing results.

[0022] In this embodiment, the number of scales in "multi-scale" can be three to five. Generally, the feature extraction backbone network outputs three backbone features at different resolutions, corresponding to higher-resolution shallow features, medium-resolution mid-level features, and lower-resolution deep features, respectively. In some implementations, the backbone network can also output four or five backbone features at different resolutions to obtain richer scale-level information. Therefore, this invention does not impose a unique limitation on the number of scales, as long as multiple backbone features at different resolutions can be output and used for subsequent multi-scale feature fusion.

[0023] More specifically, such as Figure 2 As shown, the High Frequency Information Directional Subband Attention Fusion Module (HFAFM) includes a first batch normalization module, a first composite convolution module, a second batch normalization module, a second composite convolution module, a third batch normalization module, a third composite convolution module, a first global average pooling module, a second global average pooling module, a third global average pooling module, a first channel stitching module, a multilayer perceptron module, a normalized Softmax module, a first weighting module, a second weighting module, a third weighting module, a mean residual connection module, and a second channel stitching module, wherein: The input terminals of the first batch of normalization modules, the second batch of normalization modules, and the third batch of normalization modules serve as the input terminals of the high-frequency information directional subband attention fusion module. The output of the first batch of normalization modules is connected to the input of the first composite convolution module; The output of the second batch normalization module is connected to the input of the second composite convolution module; The output of the third batch normalization module is connected to the input of the third composite convolution module; The output of the first composite convolution module is connected to the first input of the mean residual connection module, the first input of the first weighting module, and the input of the first global average pooling module, respectively. The output of the second composite convolution module is connected to the second input of the mean residual connection module, the first input of the second weighting module, and the input of the second global average pooling module, respectively. The output of the third composite convolution module is connected to the third input of the mean residual connection module, the first input of the third weighting module, and the input of the third global average pooling module, respectively. The output of the mean residual connection module is connected to the first input of the second channel splicing module; The output of the first global average pooling module is connected to the first input of the first channel splicing module; The output of the second global average pooling module is connected to the second input of the first channel splicing module; The output of the third global average pooling module is connected to the third input of the first channel splicing module; The output of the first channel splicing module is connected to the input of the multilayer sensor module; The output of the multilayer perceptron module is connected to the input of the normalized Softmax module; The output of the normalized Softmax module is connected to the second input of the first weighting module, the second input of the second weighting module, and the second input of the third weighting module, respectively. The output of the first weighting module is connected to the second input of the second channel splicing module; The output of the second weighting module is connected to the third input of the second channel splicing module; The output of the third weighting module is connected to the fourth input of the second channel splicing module; The output of the second channel splicing module serves as the output of the high-frequency information directional sub-band attention fusion module.

[0024] More specifically, such as Figure 3 As shown, the first, second, and third composite convolution modules all include... Local feature convolution module, batch normalization module, non-linear activation function module and Channel-adjusted convolution module, wherein: The output of the local feature convolution module serves as the input of the composite convolution module; The output of the local feature convolution module is connected to the input of the batch normalization module; The output of the batch normalization module is connected to the input of the nonlinear activation function module; The output of the nonlinear activation function module and The input connection of the channel-adjustable convolution module is configured; The output of the channel-adjustable convolution module is used as the output of the composite convolution module.

[0025] More specifically, such as Figure 4 As shown, the feature enhancement and fusion module includes a convolutional attention module, an element-wise multiplication module, and an element-wise addition module, wherein: The input of the convolutional attention module, the second input of the element-wise multiplication module, and the first input of the element-wise addition module are used as the input of the feature enhancement and fusion module. The output of the convolutional attention module is connected to the first input of the element-wise multiplication module; The second input of the element-level multiplication module is connected to the output of the high-frequency information directional subband attention fusion module; The output of the element-level multiplication module is connected to the second input of the element-level addition module; The output of the element-level addition module is used as the output of the feature enhancement fusion module.

[0026] More specifically, the multi-scale fusion neck network module is a neck network that combines a feature pyramid network and a path aggregation network.

[0027] Example 2: This embodiment provides an image processing method, including the following steps: S1: Extract the backbone features of the image to be processed to obtain backbone features at multiple scales; perform cascaded two-dimensional discrete wavelet transforms on the image to be processed to obtain high-frequency directional subbands at multiple scales.

[0028] More specifically, in the feature extraction stage, this invention constructs a multi-scale frequency domain directional feature extraction architecture, utilizing Discrete Wavelet Transform (DWT) to decompose the input feature map into low-frequency components carrying the global structure and high-frequency components carrying edge details. The cascaded two-dimensional discrete wavelet transform of the image to be processed includes the following steps: S1.1: The image to be processed As the current layer performs a one-dimensional discrete wavelet transform in the row direction, where... , Let x and y represent the x and y coordinates of a pixel in the image to be processed, respectively. For each row of pixel sequences, convolution operations are performed using a low-pass filter and a high-pass filter, combined with downsampling processing, to obtain the low-frequency component in the row direction. High-frequency components in the direction of the line The The horizontal outline has been preserved. It captured the vertical edge. The expression is as follows:

[0029] The expression is as follows:

[0030] Where p represents the summation window index in the row direction of the image. Indicates a low-pass filter. Indicates a high-pass filter. This indicates that the result of the convolution in the row direction is downsampled.

[0031] S1.2: Low-frequency components in the horizontal direction A one-dimensional discrete wavelet transform is performed along the column direction, and convolution operations are performed using the low-pass and high-pass filters respectively. Combined with downsampling processing, the low-frequency subband is obtained. and horizontal detail sub-band The expression is as follows:

[0032]

[0033] Where m represents the summation window index along the column direction of the image. This indicates that the result of the convolution in the column direction is downsampled.

[0034] S1.3: The high-frequency components in the row direction A one-dimensional discrete wavelet transform is performed along the column direction, and convolution operations are performed using the low-pass and high-pass filters respectively. Combined with downsampling processing, the vertical detail subband is obtained. and diagonal detail sub-band The expression is as follows:

[0035]

[0036] S1.4: Will , as well as The result is determined as the output of the two-dimensional discrete wavelet transform of the current layer.

[0037] S1.5: The low-frequency subband obtained by the two-dimensional discrete wavelet transform of the current layer As the input for the next layer of two-dimensional discrete wavelet transform, the above steps are repeated until the preset number of decomposition layers is reached, outputting horizontal detail subbands, vertical detail subbands, and diagonal detail subbands at multiple scales.

[0038] S1.6: Combine the horizontal detail subbands, vertical detail subbands, and diagonal detail subbands of multiple scales to obtain high-frequency directional subbands of multiple scales.

[0039] S2: Attention fusion and weighting are performed on high-frequency directional subbands at multiple scales to obtain weighted high-frequency information features at multiple scales.

[0040] More specifically, such as Figure 2 As shown, the High Frequency Information Directional Subband Attention Fusion Module (HFAFM) performs normalization preprocessing on the high frequency subbands in the horizontal, vertical, and diagonal directions, then uses a directional weighting mechanism to generate dynamic attention weights, and introduces directional bias priors in the Softmax layer for weight generation. and temperature parameters Attention fusion weighting is performed on high-frequency directional subbands at multiple scales, including the following steps: S2.1: Obtain the horizontal detail subband of the wavelet transform output at the current scale. Vertical detail sub-band and diagonal detail sub-band .

[0041] S2.2: Will After feature preprocessing by the first batch of normalization modules and the first compound convolution module, the horizontal edge features are output. The expression is as follows:

[0042] in, This represents compound convolution.

[0043] Will After feature preprocessing by the second batch normalization module and the second composite convolution module, the vertical edge features are output. The expression is as follows:

[0044] Will After feature preprocessing by the third batch normalization module and the third composite convolution module, the high-frequency texture features of the diagonal are output. The expression is as follows:

[0045] S2.3: Will Input the first global average pooling (GAP) module and output the global statistical vector of the level detail subband. The expression is as follows:

[0046] Will Input the second global average pooling module and output the global statistical vector of the vertical detail subband. The expression is as follows:

[0047] Will Input the third global average pooling module and output the global statistical vector of the diagonal detail subband. The expression is as follows:

[0048] in, and These represent the height and width of the feature map at the current scale, respectively.

[0049] S2.4: Will , and The first channel is used for stitching to obtain complete global statistical features. The expression is as follows:

[0050] S2.5: Will The input is a multilayer perceptron for orientation weight scoring, and the output is an unnormalized orientation weight score vector. This represents the model's initial estimate of the importance of this direction, expressed as follows:

[0051] in, , This is the horizontal weight score vector. This is the vertical weight score vector. This is the diagonal weight score vector. , These represent the first and second learnable weight matrices, respectively, used to learn the contribution of features in different directions to defect identification; These represent the first and second bias terms, respectively, used to increase the model's fitting ability and ensure the flexibility of the mapping process; This represents a nonlinear activation function used to introduce nonlinear mappings.

[0052] S2.6: Will Input the normalized Softmax module and output the horizontal weight ratio coefficients. Vertical weight ratio coefficient Diagonal weighting coefficient The expression is as follows:

[0053]

[0054]

[0055] in,

[0056] This is a temperature parameter used to adjust the smoothness of the weight distribution. , , These are the horizontal offset term, the vertical offset term, and the diagonal offset term, respectively. Used to reduce the initial weight of the diagonal subband to reduce high-frequency noise interference; This is the structural preservation factor, which is usually set to 0 to ensure that the model prioritizes horizontal and vertical edges with clear physical meaning during the initialization phase. This represents normalized summation; This represents an exponential function.

[0057] S2.7: will and Input the first weighting module and output the horizontally weighted refined features. The expression is as follows:

[0058] Will and Input the second weighting module and output the vertically weighted refined features. The expression is as follows:

[0059] Will and Input the third weighting module and output the diagonally weighted refined features. The expression is as follows:

[0060] , , This indicates that after weighted filtering, important directions are amplified, while unimportant directions are suppressed.

[0061] S2.8: Will , , The input mean residual connection module extracts the mean residual and outputs the average residual feature. This is used as a global high-frequency background supplement to prevent feature fragmentation caused by excessive suppression of a certain direction in the attention mechanism. The expression is as follows:

[0062] S2.9: Will The second channel stitching module performs stitching and outputs the weighted high-frequency information features at the current scale. The expression is as follows:

[0063] in, This indicates a channel splicing operation, which combines three sets of weighted features with one set of average residual features on the channel axis to obtain weighted high-frequency information features at the current scale.

[0064] S2.10: Repeat the above steps for multiple scales to obtain the weighted high-frequency information features of multiple scales.

[0065] More specifically, a compound convolution module is used to extract directional edge features. The expression is as follows:

[0066] Where z is the input feature, This indicates a batch normalization layer, used to align the distribution of subbands in each direction; This represents local feature convolution, used to extract local spatial correlation features from high-frequency signals. Represents a non-linear activation function. This indicates channel-adjustable convolution, used to adjust the channel dimensions while maintaining the spatial resolution.

[0067] S3: The backbone features at multiple scales are fused with the weighted high-frequency information features at the corresponding scales to obtain enhanced feature maps at multiple scales.

[0068] More specifically, in the feature enhancement and fusion stage, this invention proposes a Feature Enhancement and Fusion Module (FEFM) to coordinate the coupling relationship between spatial domain attention and frequency domain details, achieving precise mapping of "where it is important, enhance it," and avoiding high-frequency noise amplification across the entire image. The backbone features are first extracted using the CBAM module to extract spatial and channel attention weights, serving as a "spatial gate" for locating the injection point of high-frequency information. Subsequently, they are fused element-wise with the weighted high-frequency information features processed by HFAFM. For example... Figure 4 As shown, the feature enhancement and fusion module includes a convolutional attention module (CBAM), an element-wise multiplication module, and an element-wise addition module. The feature enhancement and fusion module fuses the backbone features at multiple scales with the corresponding weighted high-frequency information features at the corresponding scale, including the following steps: S3.1: Input the backbone features of multiple scales into the convolutional attention module (CBAM) and output the backbone attention enhancement features of multiple scales.

[0069] More specifically, the core attention enhancement features at multiple scales are extracted using a convolutional attention module (CBAM), including the following steps: S3.1.1: Obtain the backbone features at multiple scales output by the feature extraction network module, and use the backbone features at one of the scales as the input features. .

[0070] S3.1.2: Apply average pooling and max pooling to the input features respectively. Compression is performed in the spatial dimension to obtain the average pooling channel features. and maximum pooling channel features .

[0071] S3.1.3: The average pooling channel features and the maximum pooling channel features Input-shared multilayer perceptron, output channel attention mapping The expression is as follows:

[0072] in, These are the first and second fully connected parameters of the multilayer perceptron. This represents the Sigmoid function, used to normalize the attention score to... Interval.

[0073] S3.1.4: Mapping Channel Attention With main characteristics Perform element-wise multiplication to obtain intermediate features enhanced by channel attention. The expression is as follows:

[0074] in, This represents element-wise multiplication.

[0075] S3.1.5: Utilize channel average pooling and channel max pooling to process the intermediate features. Compression is performed along the channel dimension to obtain the corresponding spatial description features. These spatial description features are then concatenated by channel and input into the convolutional kernel with a size of [missing value]. The convolutional layer outputs a spatial attention map. The expression is as follows:

[0076] in, This represents channel-average pooling, used to calculate the pixel mean along the channel direction and extract spatial background information. This represents channel max pooling, used to extract the maximum pixel value along the channel direction, capturing spatially significant features. This indicates a channel splicing operation; Indicates the kernel size as Convolutions are used to model the correlations of local spatial regions. This represents the Sigmoid function.

[0077] S3.1.6: Will and Perform element-wise multiplication to obtain the backbone attention enhancement features at the current scale. The expression is as follows:

[0078] S3.1.7: Repeat the above steps for multiple scales to obtain the backbone attention enhancement features for multiple scales.

[0079] More specifically, the element-wise multiplication module introduces a multi-scale adaptive weighting mechanism to achieve further feature enhancement, as shown in the following expression:

[0080] in, This represents the scale index, indicating the level in the multi-scale feature pyramid. The smaller the value, the higher the resolution of the feature map (shallow layer). The larger the value, the more abstract (deeper) the meaning. Representing scale The input backbone features are used as the basis for residual connections. Representing scale The learnable scalar parameters, independent at each scale, are used to dynamically adjust the injection ratio of frequency domain features. Representing scale The backbone attention enhancement features generated after CBAM processing have spatial location guidance capabilities; This represents a scale generated after HFAFM processing, containing details in multiple physical directions. Weighted high-frequency information features Representative scale Enhanced features below.

[0081] S3.2: Input the backbone attention enhancement features at multiple scales and the weighted high-frequency information features at the corresponding scales into the element-level multiplication module to perform element-level multiplication operations, and output the high-frequency enhancement features at multiple scales.

[0082] S3.3: Input the high-frequency enhancement features at multiple scales and the corresponding backbone features at the same scale into the element-level addition module and add them element by element to output the enhancement features at multiple scales.

[0083] S4: Perform cross-scale feature fusion on enhanced feature maps of multiple scales to obtain multi-scale fused features.

[0084] In this embodiment, a neck network combining a Feature Pyramid Network (FPN) and a Path Aggregation Network (PAN) is used to perform cross-scale feature fusion on enhanced feature maps of multiple scales.

[0085] S5: Input the multi-scale fused features into the detection heads of different scales respectively, and output the detection results of defects on the glass substrate surface.

[0086] Example 3: To achieve high-precision surface defect detection of semiconductor glass substrates, this invention, after building an image processing model as described in Example 1, conducted targeted training and optimization. The training samples were derived from data collected from multiple batches of real glass substrates, covering various typical defect types such as scratches, cracks, debris, and stains, and were combined with some artificially synthesized defect samples to enhance the model's recognition diversity. During training, data augmentation was performed through image rotation, mirroring, brightness adjustment, and noise perturbation to improve the model's generalization ability.

[0087] This embodiment provides an image processing model training method for training the image processing model described in Embodiment 1, including the following steps: S1: Acquire multiple batches of images to be processed. In this embodiment, the data is collected from real glass substrates. Combined with samples of artificially synthesized defects, a training dataset and a validation dataset are constructed. The training dataset is subjected to data augmentation processing such as image rotation, mirroring, brightness adjustment, and noise perturbation to obtain enhanced training samples, which are used to improve the recognition diversity and generalization ability of the model. The training dataset covers scratches, cracks, debris, and stain defect types.

[0088] S2: Initialize the model parameters, including the following steps: In this embodiment, the horizontal offset term is... Vertical offset term Initialize to 0, and include a diagonal bias term that is prone to noise. Set a negative bias (in this embodiment, it is...) By establishing a noise suppression prior, the model is forced to prioritize capturing vertical and horizontal edge features with clear physical structural significance. The generated attention weights are then applied to the high-frequency subbands to obtain directionally refined weighted high-frequency information features.

[0089] Learnable scalar parameters of the feature enhancement fusion module Assign initial values ​​that conform to the pyramid prior in a proportionally decreasing manner, where s is the scale index, s=1 is the highest resolution layer, and let... (In this embodiment, the initial sequence is...) ) Set the temperature parameter to a fixed constant. (In this embodiment, for) This is used to maintain the local saliency of attention distribution in the early stages of training.

[0090] S3: Construct a joint loss function based on the detection task loss and the monotonic regularization term, and the total loss function. The expression is as follows:

[0091] in, This represents classification loss, localization loss, and confidence loss. is the regularization coefficient, used to balance the task loss and monotonic constraints of the hyperparameter, controlling the intensity of prior knowledge's intervention in training.

[0092]

[0093] in, The first, second, and third weighting coefficients are preset. , , These are classification loss, localization loss, and confidence loss, respectively.

[0094] The formula for the monotonic regularity term is shown below:

[0095] in, The threshold for monotonic step size. Representing the total number of scales, the weights of adjacent scale layers are forced to maintain a certain decreasing interval, and it is a very small normal number (in this embodiment, it is...). ), For hinge loss, only when the deep weights A penalty value is only generated when the weight is greater than that of shallow layers. To precisely control the detail injection intensity at different levels, this invention introduces a learnable scalar parameter at each scale. This parameter is subject to a monotonically decreasing regularization term during training. The constraints force the model to follow the physical prior of the image pyramid, which is "shallow layers enhance details and deep layers preserve semantics", thereby avoiding feature disorder caused by redundant high-frequency information in deep networks.

[0096] S4: At the start of training, set the regularization coefficients. Set to a large value (1.0 in this embodiment) to make the total loss function In the initial stage, it is subject to a monotonic regularization term. Dominant; utilizing the total loss function Perform backpropagation, prioritizing the optimization of learnable scalar parameters. By focusing on proportional relationships rather than blindly fitting local noise, a robust physical structure is built for the model, ensuring that each feature scale strictly follows the image pyramid principle of "shallow layer enhancing details and deep layer preserving semantics".

[0097] S5: In each training round, the composite gradient flow for the learnable parameters of the entire network is calculated using the detection error generated by the model detection head and the total loss function L. The composite gradient flow is driven by an optimization algorithm based on gradient descent, and the learnable parameters are iteratively updated in combination with a preset learning rate adjustment strategy (in this embodiment, a cosine annealing decay strategy with a warm-up phase is adopted); (in this embodiment, the optimization algorithm is the AdamW optimizer).

[0098] S6: As the training rounds progress, the regularization coefficient is adjusted using a learning rate adjustment strategy. The collaborative learning rate is gradually reduced (in this embodiment, a cosine annealing strategy is used to gradually reduce it to around 0.1) to reduce the influence of prior knowledge on training; while maintaining a stable physical structure, the training focus is gradually shifted to minimizing task loss. and take advantage of mission losses All learnable parameters are adaptively fine-tuned to enhance the fitting ability to detailed defect features and capture more complex defect morphologies.

[0099] S7: The entire training task aims to optimize classification accuracy and bounding box localization accuracy. During the end-to-end training process, the mean precision (mAP), accuracy, and recall are monitored and evaluated in real time on the validation dataset. The optimal model parameters that achieve global optimality and have high repeatability are selected from the trained model parameter sequence, and the trained image processing model is output.

[0100] The entire detection system employs an end-to-end training strategy, integrating frequency domain constraints into the task loss function for object detection. This physics-based prior training logic not only enhances the model's ability to capture minute, low-contrast defects but also significantly improves the model's retraining repeatability and algorithm robustness when faced with different production batches of data. Compared to traditional random weight feature fusion, this invention introduces layer weights. and its monotonically decreasing regularization term This design forcibly injects the physical prior, which focuses on "shallow details and deep semantics," into the training process. This effectively prevents deep semantic features from being contaminated by high-frequency redundant noise, ensuring the orderly transmission of information in the feature pyramid. This not only significantly improves the model's detection accuracy and feature resolution but also greatly enhances the model's retraining repeatability and training stability when faced with different production batches of data.

[0101] Example 4: This embodiment provides an application of an image processing method for processing images on the surface of a glass substrate, including the following steps: The main features of the glass substrate surface image are extracted to obtain main features at multiple scales; the cascaded two-dimensional discrete wavelet transform of the glass substrate surface image is performed to obtain high-frequency directional subbands at multiple scales. Attention fusion and weighting are performed on high-frequency directional subbands at multiple scales to obtain weighted high-frequency information features at multiple scales. The backbone features at multiple scales are fused with the weighted high-frequency information features at the corresponding scales to obtain enhanced feature maps at multiple scales. Cross-scale feature fusion is performed on enhanced feature maps at multiple scales to obtain multi-scale fused features; Multiple scale fused features are input into detection heads of different scales to output the detection results of defects on the glass substrate surface.

[0102] Example 5: This embodiment provides an automatic optical inspection method, including the following steps: S1: Acquire real-time images of the glass substrate surface, input the glass substrate surface images into the semiconductor glass substrate surface defect detection model described in Example 1, output the feature response results of the glass substrate surface images, and obtain the type, location and confidence level of each defect based on the feature response results.

[0103] S2: Use the non-maximum suppression (NMS) algorithm to remove overlapping and redundant detection boxes from the feature response results and output candidate detection results.

[0104] S3: Filter the candidate detection results according to the preset confidence threshold, determine the target defect area, and output the filtered defect detection results.

[0105] S4: Extract features from the target defect regions corresponding to the screened defect detection results to obtain the area, grayscale distribution and shape parameters of each target defect region.

[0106] S5: Perform statistical analysis and classification of the area, grayscale distribution, and shape parameters of each target defect region to obtain optimized defect identification results.

[0107] This invention utilizes the multi-directional decomposition characteristics of Discrete Wavelet Transform (DWT) and refines high-frequency subbands in different physical directions through a High-Frequency Information Directional Subband Attention Fusion Module (HFAFM). It fully leverages the differences in physical meaning of high-frequency subbands in horizontal, vertical, and diagonal directions to construct an adaptive attention mechanism oriented towards directional subbands. This enables differentiated modeling and selective enhancement of high-frequency details in different directions, effectively improving the model's ability to represent directionally sensitive targets such as weak edges, fine cracks, scratches, and point defects, and enhancing defect recognition stability in complex backgrounds and low signal-to-noise ratio scenarios. Furthermore, the proposed FEFM (Feature Enhancement Fusion Module) changes the traditional blind superposition mode of feature fusion. Using a spatial attention map generated from backbone features as a "spatial gating," it achieves precise injection of high-frequency details in specific suspected defect regions, avoiding background interference amplification across the entire image. This dual-domain interaction mechanism ensures that the model can utilize spatial semantic information for macroscopic localization and frequency domain details for microscopic discrimination, significantly enhancing the robustness of identifying low-contrast, sub-pixel-level defects.

[0108] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the implementation of the present invention. Those skilled in the art can make other variations or modifications based on the above description. It is neither necessary nor possible to exhaustively describe all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the claims of the present invention.

Claims

1. An image processing model, characterized in that, It includes a feature extraction network module, a wavelet transform module, a high-frequency information directional subband attention fusion module, a feature enhancement fusion module, a multi-scale fusion neck network module, and a detection head module. Feature extraction network module: Extracts features from the image to be processed and outputs backbone features at multiple scales; Wavelet transform module: performs cascaded two-dimensional discrete wavelet transforms on the image to be processed, and outputs high-frequency directional subbands at multiple scales; High-frequency information directional sub-band attention fusion module: performs weighted processing on high-frequency directional sub-bands at multiple scales and outputs weighted high-frequency information features at multiple scales; Feature enhancement and fusion module: fuses the backbone features at multiple scales with the weighted high-frequency information features at the corresponding scales, and outputs enhanced feature maps at multiple scales. Multi-scale fusion neck network module: performs cross-scale feature fusion on enhanced feature maps of multiple scales and outputs multi-scale fused features; Detection head module: Input multi-scale fused features into detection heads of different scales and output image processing results.

2. The image processing model according to claim 1, characterized in that, The high-frequency information directional sub-band attention fusion module includes a first batch normalization module, a first composite convolution module, a second batch normalization module, a second composite convolution module, a third batch normalization module, a third composite convolution module, a first global average pooling module, a second global average pooling module, a third global average pooling module, a first channel stitching module, a multilayer perceptron module, a normalized Softmax module, a first weighting module, a second weighting module, a third weighting module, a mean residual connection module, and a second channel stitching module, wherein: The input terminals of the first batch of normalization modules, the second batch of normalization modules, and the third batch of normalization modules serve as the input terminals of the high-frequency information directional subband attention fusion module. The output of the first batch of normalization modules is connected to the input of the first composite convolution module; The output of the second batch normalization module is connected to the input of the second composite convolution module; The output of the third batch normalization module is connected to the input of the third composite convolution module; The output of the first composite convolution module is connected to the first input of the mean residual connection module, the first input of the first weighting module, and the input of the first global average pooling module, respectively. The output of the second composite convolution module is connected to the second input of the mean residual connection module, the first input of the second weighting module, and the input of the second global average pooling module, respectively. The output of the third composite convolution module is connected to the third input of the mean residual connection module, the first input of the third weighting module, and the input of the third global average pooling module, respectively. The output of the mean residual connection module is connected to the first input of the second channel splicing module; The output of the first global average pooling module is connected to the first input of the first channel splicing module; The output of the second global average pooling module is connected to the second input of the first channel splicing module; The output of the third global average pooling module is connected to the third input of the first channel splicing module; The output of the first channel splicing module is connected to the input of the multilayer sensor module; The output of the multilayer perceptron module is connected to the input of the normalized Softmax module; The output of the normalized Softmax module is connected to the second input of the first weighting module, the second input of the second weighting module, and the second input of the third weighting module, respectively. The output of the first weighting module is connected to the second input of the second channel splicing module; The output of the second weighting module is connected to the third input of the second channel splicing module; The output of the third weighting module is connected to the fourth input of the second channel splicing module; The output of the second channel splicing module serves as the output of the high-frequency information directional sub-band attention fusion module. The first, second, and third composite convolution modules all include Local feature convolution module, batch normalization module, nonlinear activation function module and Channel-adjusted convolution module, wherein: The output of the local feature convolution module serves as the input of the composite convolution module; The output of the local feature convolution module is connected to the input of the batch normalization module; The output of the batch normalization module is connected to the input of the nonlinear activation function module; The output of the nonlinear activation function module and The input connection of the channel-adjustable convolution module is configured; The output of the channel-adjustable convolution module is used as the output of the composite convolution module.

3. The image processing model according to claim 1, characterized in that, The feature enhancement and fusion module includes a convolutional attention module, an element-wise multiplication module, and an element-wise addition module, wherein: The input of the convolutional attention module, the second input of the element-wise multiplication module, and the first input of the element-wise addition module are used as the input of the feature enhancement and fusion module. The output of the convolutional attention module is connected to the first input of the element-wise multiplication module; The second input of the element-level multiplication module is connected to the output of the high-frequency information directional subband attention fusion module; The output of the element-level multiplication module is connected to the second input of the element-level addition module; The output of the element-level addition module is used as the output of the feature enhancement fusion module.

4. A training method for the image processing model according to any one of claims 1-3, characterized in that, Includes the following steps: The parameters of the image processing model are initialized, and the regularization coefficients are preset. This makes the total loss function in the initial training phase... Subject to monotonic regularization Dominantly optimize learnable scalar parameters via backpropagation. proportional relationship; In each training round, the detection error generated by the detection head is processed by the total loss function. Quantization is performed to calculate the composite gradient flow for the learnable parameters of the entire model. The composite gradient flow is driven by an optimization algorithm based on gradient descent and combined with a preset learning rate adjustment strategy to iteratively update the learnable parameters of the model. As the training rounds progress, the regularization coefficient is adjusted using a learning rate strategy. The collaborative learning rate is adjusted downwards to guide the training focus to gradually minimize task loss. This enables the model to adaptively fine-tune all learnable parameters, progressively enhancing its ability to accurately fit the detailed features of defects. During end-to-end training, the model accuracy metrics are monitored and evaluated in real time, and the optimal model parameters are selected from the sequence of model parameters obtained from training to output the trained image processing model.

5. The training method for an image processing model according to claim 4, characterized in that, Total loss function The expression is as follows: in, This represents classification loss, localization loss, and confidence loss. The regularization coefficient is used. in, The first, second, and third weighting coefficients are preset. , , These are classification loss, localization loss, and confidence loss, respectively. The formula for the monotonic regularity term is shown below: in, The threshold for monotonic step size. Represents the total number of scales. This is for hinge loss.

6. An image processing method, characterized in that, Includes the following steps: The image to be processed is subjected to backbone feature extraction to obtain backbone features at multiple scales; A cascaded two-dimensional discrete wavelet transform is performed on the image to be processed to obtain high-frequency directional subbands of multiple scales; Attention fusion and weighting are performed on high-frequency directional subbands at multiple scales to obtain weighted high-frequency information features at multiple scales. The backbone features at multiple scales are fused with the weighted high-frequency information features at the corresponding scales to obtain enhanced feature maps at multiple scales. Cross-scale feature fusion is performed on enhanced feature maps at multiple scales to obtain multi-scale fused features; Multiple scale fusion features are input into detection heads of different scales, and the image processing results are output.

7. The image processing method according to claim 6, characterized in that, Performing cascaded two-dimensional discrete wavelet transforms on the image to be processed includes the following steps: Image to be processed As the current layer performs a one-dimensional discrete wavelet transform in the row direction, where... , Let x and y represent the x and y coordinates of a pixel in the image to be processed, respectively. For each row of pixel sequences, convolution operations are performed using a low-pass filter and a high-pass filter, combined with downsampling processing, to obtain the low-frequency component in the row direction. High-frequency components in the direction of the line The expression is as follows: Where p represents the summation window index in the image row direction, Indicates a low-pass filter. Indicates a high-pass filter. This indicates that the result of the convolution in the row direction is downsampled; Low-frequency components in the direction of movement A one-dimensional discrete wavelet transform is performed along the column direction, and convolution operations are performed using low-pass and high-pass filters respectively. Combined with downsampling processing, the low-frequency subband is obtained. and horizontal detail sub-band The expression is as follows: Where m represents the summation window index along the column direction of the image. This indicates downsampling of the convolution result in the column direction; High frequency components in the direction of movement A one-dimensional discrete wavelet transform is performed along the column direction, and convolution operations are performed using low-pass and high-pass filters respectively. Combined with downsampling processing, the vertical detail subband is obtained. and diagonal detail sub-band The expression is as follows: Will , as well as The result is determined to be the output of the two-dimensional discrete wavelet transform of the current layer. The low-frequency subband of the current layer As the input to the next layer of two-dimensional discrete wavelet transform, repeat the above steps until the preset number of decomposition layers is reached, and output horizontal detail subbands, vertical detail subbands and diagonal detail subbands of multiple scales; By combining horizontal, vertical, and diagonal detail subbands of multiple scales, high-frequency directional subbands of multiple scales are obtained.

8. The image processing method according to claim 6, characterized in that, Attention fusion weighting of high-frequency directional subbands at multiple scales includes the following steps: Obtain the wavelet transform output horizontal detail subband at the current scale Vertical detail sub-band and diagonal detail sub-band ; Will After feature preprocessing by the first batch of normalization modules and the first compound convolution module, the horizontal edge features are output. The expression is as follows: in, Represents compound convolution; Will After feature preprocessing by the second batch normalization module and the second composite convolution module, the vertical edge features are output. The expression is as follows: Will After feature preprocessing by the third batch normalization module and the third composite convolution module, the high-frequency texture features of the diagonal are output. The expression is as follows: Will Input the first global average pooling module and output the global statistical vector of the level detail subband. The expression is as follows: Will Input the second global average pooling module and output the global statistical vector of the vertical detail subband. The expression is as follows: Will Input the third global average pooling module and output the global statistical vector of the diagonal detail subband. The expression is as follows: in, and These represent the height and width of the feature map at the current scale, respectively. Will , and The first channel is used for stitching to obtain complete global statistical features. The expression is as follows: Will The input is a multilayer perceptron for orientation weight scoring, and the output is an orientation weight score vector. The expression is as follows: in, , This is the horizontal weight score vector. This is the vertical weight score vector. This is the diagonal weight score vector. , These represent the first learnable weight matrix and the second learnable weight matrix, respectively. These represent the first bias term and the second bias term, respectively. Represents a non-linear activation function; Will Input the normalized Softmax module and output the horizontal weight ratio coefficients. Vertical weight ratio coefficient Diagonal weighting coefficient The expression is as follows: in, , Indicates temperature parameter, , , These represent the horizontal offset term, the vertical offset term, and the diagonal offset term, respectively. This represents normalized summation. Represents an exponential function; Will and Input the first weighting module and output the horizontally weighted refined features. The expression is as follows: Will and Input the second weighting module and output the vertically weighted refined features. The expression is as follows: Will and Input the third weighting module and output the diagonally weighted refined features. The expression is as follows: Will , , The input mean residual connection module extracts the mean residual and outputs the average residual feature. The expression is as follows: Will The second channel stitching module performs stitching and outputs the weighted high-frequency information features at the current scale. The expression is as follows: in, This indicates a channel splicing operation; Repeat the above steps for multiple scales to obtain weighted high-frequency information features at multiple scales.

9. The image processing method according to claim 6, characterized in that, The core features at multiple scales are fused with weighted high-frequency information features at corresponding scales to enhance features, including the following steps: Input the backbone features at multiple scales into the convolutional attention module, and output the backbone attention enhancement features at multiple scales. The backbone attention enhancement features at multiple scales and the weighted high-frequency information features at the corresponding scales are input into the element-level multiplication module for element-level multiplication operations, and the high-frequency enhancement features at multiple scales are output. The high-frequency enhancement features at multiple scales are input into an element-wise addition module and added element by element to the corresponding backbone features, outputting enhancement features at multiple scales. The process of extracting multi-scale backbone attention enhancement features using a convolutional attention module includes the following steps: Obtain the backbone features at multiple scales output by the feature extraction network module, and use the backbone features at one of the scales as the input features. ; Applying average pooling and max pooling to the input features respectively Compression is performed in the spatial dimension to obtain the average pooling channel features. and maximum pooling channel features ; The average pooling channel features and the maximum pooling channel features Input-shared multilayer perceptron, output channel attention mapping The expression is as follows: in, These are the first and second fully connected parameters of the multilayer perceptron. Represents the Sigmoid function; Channel attention mapping With main characteristics Perform element-wise multiplication to obtain intermediate features enhanced by channel attention. The expression is as follows: in, Represents element-wise multiplication; The intermediate features are processed using channel average pooling and channel max pooling. Compression is performed along the channel dimension to obtain the corresponding spatial description features. These spatial description features are then concatenated by channel and input into the convolutional kernel with a size of [missing value]. The convolutional layer outputs a spatial attention map. The expression is as follows: in, Indicates channel average pooling. Indicates channel max pooling, This indicates a channel splicing operation; Indicates the kernel size as convolution, Represents the Sigmoid function; Will and Perform element-wise multiplication to obtain the backbone attention enhancement features at the current scale. The expression is as follows: Repeat the above steps for multiple scales to obtain backbone attention enhancement features at multiple scales; The element-wise multiplication module introduces a multi-scale adaptive weighting mechanism to achieve further feature enhancement, as shown in the following expression: in, Indicates scale index. Representing scale The main features of the input are as follows. Representing scale Learnable scalar parameters below Representing scale The main attention enhancement features below, Representing scale Weighted high-frequency information features Representative scale Enhanced features below.

10. An application of the image processing method according to any one of claims 6-9, characterized in that, The processing of images applied to the surface of a glass substrate includes the following steps: The main features of the glass substrate surface image are extracted to obtain main features at multiple scales; the cascaded two-dimensional discrete wavelet transform of the glass substrate surface image is performed to obtain high-frequency directional subbands at multiple scales. Attention fusion and weighting are performed on high-frequency directional subbands at multiple scales to obtain weighted high-frequency information features at multiple scales. The backbone features at multiple scales are fused with the weighted high-frequency information features at the corresponding scales to obtain enhanced feature maps at multiple scales. Cross-scale feature fusion is performed on enhanced feature maps at multiple scales to obtain multi-scale fused features; Multiple scale fused features are input into detection heads of different scales to output the detection results of defects on the glass substrate surface.