Industrial image reflection elimination method and device based on hybrid network
Patent Information
- Application Number
- CN202610752352.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-28
- Publication Date
- 2026-10-09
AI Technical Summary
然而,现有方法仍存在明显不足:传统图像处理方法对复杂光照与强反光适应性差
[0023]本申请提供的基于混合网络的工业图像反光消除方法和装置,先利用卷积神经网络提取局部特征图,保留了反光区域周边的边缘、纹理等细微信息,解决了纯Transformer模型局部细节建模弱的缺陷;再通过分层Transformer编码器提取全局上下文特征,能够捕获大面积连片反光或跨区域反光的长距离依赖,弥补了纯卷积神经网络感受野有限的不足;引入可学习动态权重调节网络生成自适应融合权重,根据输入图像的反光分布特征动态调节局部与全局特征的贡献,避免了固定融合方式对不同反光场景适应性差的问题,实现了对点状强反光、连片反光等多种情形的灵活适配;获得多级融合特征后,采用渐进式上采样解码并嵌入多尺度卷积增强模块,在恢复分辨率的同时并行提取局部、中尺度、全局特征,进一步细化解码特征,增强了纹理和边缘的保真度;最后通过卷积式输出重建头生成反光残差分量并与原图相加,以残差学习方式简化了优化目标,降低了训练难度。整个过程无需额外先验信息或高光掩膜,端到端地实现了强反光去除与细节保持的协同优化,显著提升了工业图像反光消除的彻底性、结构一致性和视觉质量。
Smart Images

Figure CN122887706A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of industrial visual inspection technology, and in particular to a method and apparatus for eliminating reflections in industrial images based on hybrid networks. Background Technology
[0002] In industrial visual inspection, the surfaces of workpieces such as metals, glass, and adhesives are prone to strong specular reflections. These reflections can cause problems such as localized overexposure, texture loss, and blurred edges in the acquired images, severely impacting the accuracy and stability of subsequent tasks such as defect detection, dimensional measurement, and character recognition. Therefore, eliminating reflections in industrial images and restoring clear surface texture and structural information is a crucial preprocessing step for improving the reliability of industrial visual inspection systems.
[0003] Currently, reflection removal methods are mainly divided into two categories: traditional image processing methods and deep learning-based methods. Traditional methods rely on thresholding, filtering, and morphological processing to remove reflections by detecting highlight areas and performing pixel repair or replacement. In recent years, deep learning-based methods have made significant progress, with representative networks including RDNet, TASHR, UIENet, and DHAN-SHR. These methods utilize convolutional neural networks (CNNs) to extract local features or use Transformers to capture global dependencies, achieving reflection removal through end-to-end learning. However, existing methods still have significant shortcomings: traditional image processing methods have poor adaptability to complex lighting and strong reflections. Pure CNN models have limited receptive fields, making it difficult to model the global context of large-scale reflective areas; pure Transformer models have weak local detail modeling capabilities, easily leading to texture blurring and edge distortion; general image enhancement models lack the ability to distinguish between reflections and real textures, often mistakenly treating normal textures as reflections; furthermore, existing methods are relatively simple in multi-scale feature fusion and loss function design, resulting in frequent problems such as reflection residue, excessive smoothing of details, and structural distortion.
[0004] Therefore, there is an urgent need for a method to achieve high-precision, high-fidelity reflection elimination in industrial images. Summary of the Invention
[0005] In view of this, this application provides a method and apparatus for eliminating reflections in industrial images based on hybrid networks, so as to achieve high-precision and high-fidelity reflection elimination in industrial images.
[0006] Specifically, this application is implemented through the following technical solution:
[0007] The first aspect of this application provides a method for eliminating reflections in industrial images based on a hybrid network, wherein the hybrid network includes a convolutional neural network and a hierarchical Transformer encoder, and the method includes:
[0008] Acquire industrial images to be processed;
[0009] The industrial image is input into the convolutional neural network to extract local texture features and obtain a local feature map;
[0010] The local feature map is input into a learnable dynamic weight adjustment network to generate adaptive fusion weights.
[0011] The local feature map is embedded after being patched and then input into the hierarchical Transformer encoder to extract global context features;
[0012] Based on the adaptive fusion weights, the local feature map and the global context features are dynamically fused to obtain multi-level fused features;
[0013] The multi-level fused features are progressively upsampled and decoded. In the decoding path, the decoded features are refined at multiple scales through a multi-scale convolution enhancement module to obtain refined features.
[0014] The refined features are input into the convolutional output reconstruction head to generate a reflective residual component. The industrial image is then added pixel by pixel to the reflective residual component to obtain the output image after reflective removal.
[0015] A second aspect of this application provides an industrial image reflection elimination device based on a hybrid network, wherein the hybrid network includes a convolutional neural network and a hierarchical Transformer encoder, and the device includes an acquisition module, an extraction module, a generation module, a fusion module, and a processing module.
[0016] The acquisition module is used to acquire the industrial image to be processed.
[0017] The extraction module is used to input the industrial image into the convolutional neural network, extract local texture features, and obtain a local feature map;
[0018] The generation module is used to input the local feature map into a learnable dynamic weight adjustment network to generate adaptive fusion weights.
[0019] The extraction module is also used to input the patched local feature map into the hierarchical Transformer encoder to extract global context features;
[0020] The fusion module is used to dynamically fuse the local feature map and the global context feature according to the adaptive fusion weight to obtain multi-level fused features;
[0021] The processing module is used to perform progressive upsampling decoding on the multi-level fused features, and to refine the decoded features at multiple scales through a multi-scale convolution enhancement module in the decoding path to obtain refined features.
[0022] The processing module is further configured to input the refined features into the convolutional output reconstruction head to generate a reflective residual component, and add the industrial image and the reflective residual component pixel by pixel to obtain the output image after reflective removal.
[0023] The industrial image reflection removal method and apparatus based on hybrid networks provided in this application first utilizes a convolutional neural network to extract local feature maps, preserving subtle information such as edges and textures around the reflective area, thus overcoming the weakness of pure Transformer models in modeling local details. Then, a hierarchical Transformer encoder extracts global contextual features, capturing long-distance dependencies in large-area continuous reflections or cross-regional reflections, compensating for the limited receptive field of pure convolutional neural networks. A learnable dynamic weight adjustment network is introduced to generate adaptive fusion weights, dynamically adjusting the contribution of local and global features based on the reflection distribution characteristics of the input image. This avoids the problem of poor adaptability of fixed fusion methods to different reflection scenarios, achieving flexible adaptation to various situations such as point-like strong reflections and continuous reflections. After obtaining multi-level fusion features, progressive upsampling decoding is employed, and a multi-scale convolutional enhancement module is embedded. While restoring resolution, local, mesoscale, and global features are extracted in parallel, further refining the decoded features and enhancing the fidelity of textures and edges. Finally, a convolutional output reconstruction head generates a reflection residual component, which is added to the original image. This residual learning method simplifies the optimization objective and reduces training difficulty. The entire process requires no additional prior information or specular masks, achieving end-to-end synergistic optimization of strong reflection removal and detail preservation, significantly improving the thoroughness, structural consistency, and visual quality of reflection removal in industrial images. Attached Figure Description
[0024] Figure 1 A flowchart of an industrial image reflection elimination method based on a hybrid network provided in Embodiment 1 of this application;
[0025] Figure 2 A schematic diagram of the hybrid network provided in this application;
[0026] Figure 3 A schematic diagram of the convolutional neural network provided in this application;
[0027] Figure 4 A schematic diagram of the residual block provided in this application;
[0028] Figure 5 A schematic diagram of the multi-scale convolution enhancement module provided in this application;
[0029] Figure 6 A schematic diagram of the convolutional output reconstruction head provided in this application;
[0030] Figure 7 This is a schematic diagram of the structure of the industrial image reflection elimination device based on a hybrid network provided in Embodiment 2 of this application. Detailed Implementation
[0031] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application.
[0032] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used herein are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0033] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0034] The following specific embodiments are given to illustrate the technical solution of this application in detail.
[0035] Figure 1 The flowchart illustrates an industrial image reflection reduction method based on a hybrid network provided in Embodiment 1 of this application. The hybrid network includes a convolutional neural network and a hierarchical Transformer encoder. Please refer to... Figure 1 The method provided in this embodiment may include:
[0036] S101. Obtain the industrial image to be processed.
[0037] Specifically, industrial images refer to raw images of highly reflective workpiece surfaces, such as metal, glass, adhesives, and coatings, captured by industrial cameras on production lines or inspection stations. Industrial images have the following typical characteristics: First, strong specular reflection interference. Due to the smooth surface of the workpiece and complex lighting conditions (such as ring light, strip light, coaxial light, etc.), localized high-brightness overexposure areas are easily generated, forming specular reflective patches. Second, texture and edge information are masked. The original surface texture (such as scratches, characters, frosted texture) and geometric edges of the reflective areas are covered by bright spots, resulting in the complete loss of details in local areas of the image. Third, reflections take many forms. Reflections may appear as localized dots (such as solder joints, screw heads), large areas of continuous reflections (such as metal plates, glass panels), or dispersed across regions (such as the surfaces of multiple components). Fourth, they have a significant impact on subsequent inspection tasks. Reflections can directly lead to false defect detection (identifying reflections as defects), missed detections (masking real defects), and dimensional measurement errors, making them a key interference factor in industrial visual inspection. This application is designed specifically to address the unique reflection problem in industrial images, aiming to remove specular reflections of different types and intensities while preserving the texture, edge, and structural information obscured by reflections, thus providing high-quality, reflection-free input images for subsequent processes.
[0038] In practice, industrial cameras are used to capture images of the workpiece surface on the production line or inspection station. The captured raw images are then input into the memory of the computing device in digital format (such as BMP, JPEG, PNG, etc.) as industrial images to be processed.
[0039] S102. Input the industrial image into the convolutional neural network to extract local texture features and obtain a local feature map.
[0040] Specifically, Figure 2 A schematic diagram of the hybrid network provided in this application. Figure 3 A schematic diagram of the convolutional neural network provided in this application. Figure 4 This is a schematic diagram of the residual block provided in this application. Please refer to... Figure 2The hybrid network refers to a hybrid model combining convolutional neural networks (CNNs) and Transformer encoder-decoder structures, with an overall U-shaped architecture. The front end is a lightweight CNN used to extract local texture features. The middle section is a patch embedding layer used to convert the feature maps output by the CNN into serialized embedding vectors. The encoder is a hierarchical Transformer encoder containing three layers: a first-level transformer module (a shallow Local Hybrid Attention Transformer (LHD Transformer), a second-level transformer module (a mid-to-high-level Channel-Level Context Attention Transformer (CCA Transformer), and a third-level transformer module (a bottleneck layer Global Dual Attention Transformer (G-DAT)). The decoder is a progressive upsampling structure symmetrical to the encoder, containing a multi-scale convolutional enhancement module (MSCBlock) and skip connections. The output is a convolutional output reconstruction head used to generate reflective residual components and add them to the original input image to obtain the final output.
[0041] Please refer to Figure 3 and Figure 4 Convolutional Neural Networks (CNNs) are lightweight feature extraction networks, consisting of two convolutional layers (a first and a second convolutional layer, connected sequentially, used for initial extraction of local texture information from an image) and two optimization residual blocks (a first and a second optimization residual block, concatenated after the two convolutional layers, used for further extraction of deeper local features). Each optimization residual block employs a dual-path parallel structure, including a main path (containing a first convolutional layer, a SiLU activation function layer, and a second convolutional layer, used for extracting deep features), an identity mapping path (directly passing the input features to the output without any transformation), a fusion operation (adding the output of the main path to the output of the identity mapping path element-wise), and a residual scaling factor (multiplying the sum by the residual scaling factor to obtain the final output of the residual block).
[0042] Furthermore, local texture features refer to detailed information such as pixel grayscale variation patterns, edge directions, and microstructures within local areas of an industrial image. Examples include scratches on a metal surface, character strokes on a glass panel, and frosted particles on a rubber surface. These features exhibit locality, repeatability, and scale relevance, serving as crucial criteria for distinguishing different materials and defects. Local feature maps are multi-channel feature maps output by a convolutional neural network after extracting local texture features from an input industrial image. Each channel corresponds to a specific type of local texture response (such as horizontal edges, vertical edges, corners, etc.), with a spatial resolution similar to or slightly lower than the input image, but with an increased number of channels. Local feature maps preserve the local structural information at various locations in the original industrial image while converting high-dimensional image data into an intermediate representation more suitable for subsequent Transformer modeling.
[0043] In specific implementation, the industrial image is sequentially input into a first convolutional layer and a second convolutional layer to extract primary local features. These primary local features are then input into a first optimized residual block. The first optimized residual block propagates the input features along the main path and the identity mapping path, respectively. The main path sequentially performs a first convolution operation, a SiLU activation function operation, and a second convolution operation to obtain the main path output. The identity mapping path directly propagates the input features to obtain the identity mapping output. The main path output and the identity mapping output are added element-wise to obtain the sum. The sum is multiplied by a residual scaling factor to obtain the output features of the first optimized residual block. The residual scaling factor is a positive number less than 1. The output features of the first optimized residual block are then input into a second optimized residual block. The second optimized residual block performs the same steps as the first optimized residual block to obtain the output features of the second optimized residual block, which serve as the local feature map.
[0044] Specifically, an industrial image is used as input, and convolution operations are performed sequentially through a first convolutional layer and a second convolutional layer to extract primary local features. The stride and padding of each convolutional layer are set to maintain the same spatial resolution of the output feature map as the input image. The primary local features are then input into a first optimized residual block. In this residual block, the input features are simultaneously passed to two paths: the main path performs convolution, SiLU activation, and another convolution operation sequentially to obtain the main path output; the identity mapping path directly passes the input features to obtain the identity mapping output. The main path output and the identity mapping output are added element-wise, and the sum is multiplied by a residual scaling factor less than 1 to obtain the output features of the first optimized residual block. The output features of the first optimized residual block are then input into a second optimized residual block, which performs the same operations as the first optimized residual block to obtain the output features of the second optimized residual block, which are used as the local feature map. In the above process, all convolution operations use a set number of convolutional kernels, and the stride and padding maintain the same spatial resolution of the feature map.
[0045] S103. Input the local feature map into the learnable dynamic weight adjustment network to generate adaptive fusion weights.
[0046] Specifically, the learnable dynamic weight adjustment network automatically generates two fused weight parameters based on the reflectivity distribution characteristics of the input image. Internally, it consists of a fully connected layer and a sigmoid activation function. The parameters of the fully connected layer are updated and optimized along with the main network during training, allowing the weight parameters to adaptively fit different reflectivity scenarios. Furthermore, the output weight parameters differ for different input industrial images, depending on the intensity, range, and distribution characteristics of the reflectivity in the input image.
[0047] Furthermore, the adaptive fusion weights are the first and second weight parameters output by the aforementioned learnable dynamic weight adjustment network. The adaptive aspect is manifested in the following ways: when there are localized strong point reflections in the input industrial image, the network automatically outputs a larger first weight parameter and a smaller second weight parameter, thus emphasizing local detail features and enhancing texture capture around the reflective area in subsequent fusion; when there are large areas of continuous reflections or cross-regional reflections in the input image, the network automatically outputs a smaller first weight parameter and a larger second weight parameter, thus emphasizing global contextual features and enhancing overall illumination consistency in subsequent fusion; the values of the two weight parameters are entirely determined by the reflective characteristics of the input image itself, requiring no manual setting or additional prior information, thus achieving adaptive adjustment of the fusion strategy to reflective scenes.
[0048] In specific implementation, global average pooling is performed on the local feature map to obtain a pooled feature vector; the feature vector represents the reflectivity distribution characteristics of the industrial image; the pooled feature vector is sequentially input into a weight generation network composed of a fully connected layer and a sigmoid activation function, and outputs a first weight parameter and a second weight parameter, the sum of the first weight parameter and the second weight parameter being a constant value; wherein, the weight generation network dynamically adjusts the first weight parameter and the second weight parameter based on the reflectivity intensity and range information in the feature vector; when there is local point-like reflectivity in the industrial image, the first weight parameter is increased; when there is continuous reflectivity or cross-regional reflectivity in the industrial image, the second weight parameter is increased.
[0049] Specifically, a global average pooling operation is performed on the local feature map, averaging all pixel values in each channel to obtain a pooled feature vector. This feature vector is used to characterize the reflectivity distribution features of the industrial image. The pooled feature vector is then input into a weight generation network, which consists of a fully connected layer and a sigmoid activation function connected sequentially. The fully connected layer maps the input feature vector to two intermediate values, and the sigmoid activation function maps these two intermediate values to the range of 0 to 1, outputting a first weight parameter and a second weight parameter. The sum of the first and second weight parameters is a constant value of 1. In the weight generation network, the parameters of the fully connected layer are learned through network training, enabling the weight generation network to dynamically adjust the values of the first and second weight parameters based on the reflectivity intensity and range information implicit in the feature vector: when the feature vector indicates the presence of localized point-like reflectivity in the industrial image, the first weight parameter output by the weight generation network automatically increases, and the second weight parameter decreases accordingly; when the feature vector indicates the presence of continuous or cross-regional reflectivity in the industrial image, the second weight parameter output by the weight generation network automatically increases, and the first weight parameter decreases accordingly. Finally, the first and second weight parameters are output as adaptive fusion weights.
[0050] The method provided in this embodiment determines a first weight parameter and a second weight parameter through a learnable dynamic weight adjustment network and constrains their sum to 1. It can dynamically adjust the fusion ratio of local detail features and global context features based on the reflective distribution characteristics in industrial images (such as localized strong point reflections, large-area continuous reflections, or cross-regional reflections). When localized strong point reflections exist, the first weight parameter is automatically increased, making the hybrid network focus more on the local texture and edge information extracted by the convolutional neural network, thereby accurately capturing the subtle structures around the reflection and avoiding detail loss. When continuous or cross-regional reflections exist, the second weight parameter is automatically increased, making the hybrid network focus more on the global dependencies modeled by the Transformer, thereby maintaining the consistency of illumination and structure between the reflective area and the background, preventing local structural distortion or texture breakage. This allows the hybrid network to adaptively match different reflective scenes without manual setting or reliance on external priors, improving the thoroughness of reflection removal while preserving high-fidelity details, significantly enhancing the robustness and generalization ability of the hybrid network in complex industrial environments.
[0051] S104. The local feature map is embedded after being patched and then input into the hierarchical Transformer encoder to extract global context features.
[0052] Specifically, patch embedding involves dividing a local feature map into multiple non-overlapping local patches and converting the feature vector within each patch into a fixed-length embedding vector through a linear mapping (such as a fully connected layer). This transforms the spatially arranged two-dimensional feature map into a sequence of embedding vectors. This process allows local feature maps, originally suitable for convolutional networks, to be input into a hierarchical Transformer encoder for sequence modeling using self-attention mechanisms. Global context features refer to high-level features extracted by the hierarchical Transformer encoder after performing self-attention computation on the entire image (or a large region). These features reflect the overall illumination distribution, large-scale structural relationships, and long-distance pixel dependencies of the image. These features are no longer limited to local textures or small neighborhoods but can describe the relationship between large, contiguous reflective areas and the background, the trend of brightness variation across regions, and the overall structural consistency.
[0053] In specific implementation, the local feature map is segmented into multiple image blocks, and each image block is converted into a serialized embedding vector through linear mapping. The embedding vector is input into a first-level transformer module, which uses a window attention mechanism to limit the self-attention calculation range, introduces convolution operations to enhance local spatial information, captures the local non-uniform dependency features of the reflective area in the industrial image, and outputs a first intermediate feature. The first intermediate feature is input into a second-level transformer module, which calculates self-attention in the channel dimension, models the correlation between each feature channel, strengthens the feature discrimination between the reflective area and the background area, and outputs a second intermediate feature. The second intermediate feature is input into a third-level transformer module, which calculates the distance dependency between pixel positions in the spatial dimension, calculates the global correlation between feature channels in the channel dimension, extracts the global context features of continuous reflections or cross-regional reflections, and outputs global context features.
[0054] Specifically, a patch embedding operation is performed on the local feature map: The local feature map is uniformly divided into multiple non-overlapping image patches in both height and width directions according to a preset patch size. For each image patch, the pixel values of all channels within it are flattened into a one-dimensional vector. Then, this one-dimensional vector is linearly mapped to a fixed-length embedding vector through a fully connected layer. The embedding vectors corresponding to all image patches are arranged in order of their spatial position in the original feature map, forming a two-dimensional embedding vector sequence (i.e., the sequence length is equal to the number of image patches, and the dimension of each vector is the preset embedding dimension).
[0055] The sequence of embedded vectors is input into the first-level transformer module (local hybrid attention transformer) of the hierarchical Transformer encoder. In this level, the input sequence is first layer-normalized. Then, the sequence is divided into multiple non-overlapping local windows, each containing a fixed number of consecutive embedded vectors. Within each window, the query, key, and value matrix is computed, and self-attention computation is performed (i.e., the dot product of the query and key is normalized by Softmax and then multiplied by the value) to obtain the window attention output. This output is then subjected to a convolution operation (e.g., depthwise separable convolution) to enhance local spatial information, and the convolution result is added to the window attention output. Finally, it is processed through a feedforward network (consisting of two fully connected layers with an activation function in between) and again uses residual connections to obtain the first intermediate feature. The sequence length of this first intermediate feature is the same as the input, but the dimension of each embedded vector may vary.
[0056] The first intermediate feature is input into the second-level transformer module (channel-level context attention transformer). In this level, layer normalization is performed first, and then self-attention is calculated along the channel dimension: the feature is reshaped into a two-dimensional matrix (sequence length × number of channels), the matrix product of query and key is calculated to obtain the channel correlation matrix, and then this matrix is multiplied by the value matrix to recalibrate the channel dimension. The output is followed by a feedforward network and a residual connection to obtain the second intermediate feature.
[0057] The second intermediate feature is input into the third-level transformer module (global dual attention transformer). In this level, two types of attention are computed simultaneously: spatial global self-attention, which calculates long-distance dependencies between pixel locations over the entire sequence length (without window division); and channel self-attention, which, similar to the second level, calculates global correlations along the channel dimension. The outputs of the two attentions are weighted and fused (e.g., summed or weighted averaged) using learnable weight parameters. Then, after layer normalization, a feedforward network, and residual connections, the final global context features are output. Self-attention computation in all the above levels uses scaled dot products, and each level includes residual connections and layer normalization operations. Throughout the encoding process, the length of the feature sequence remains constant (equal to the number of image patches), but the number of channels (embedding dimension) may vary with the level.
[0058] S105. Based on the adaptive fusion weights, the local feature map and the global context features are dynamically fused to obtain multi-level fused features.
[0059] Specifically, multi-level fusion features refer to multiple fusion features with different spatial resolutions and semantic abstraction levels obtained by dynamically fusing the local feature maps and global context features of the current level with adaptive fusion weights in different levels (at least two levels) of the hierarchical Transformer encoder. These features preserve both low-level local texture details (such as edges, corners, and microstructures) and high-level global context information (such as illumination distribution and large-scale structural relationships), forming a multi-scale feature representation from fine-grained to coarse-grained.
[0060] In specific implementation, the first weight parameter and the second weight parameter generated by the learnable dynamic weight adjustment network are obtained; in each layer of the hierarchical Transformer encoder, the local feature map of the current layer is multiplied by the first weight parameter to obtain weighted local features; the global context feature of the current layer is multiplied by the second weight parameter to obtain weighted global features; the weighted local features and the weighted global features are added element-wise to form the fusion feature of the current layer; wherein, the first weight parameter and the second weight parameter share the same value in different layers, and the fusion operation is repeatedly performed on at least two different layers of the hierarchical Transformer encoder to output the fusion features of the corresponding layers, which are then summarized to form multi-level fusion features.
[0061] Specifically, two weight parameters are obtained from the learnable dynamic weight adjustment network: a first weight parameter and a second weight parameter. For each layer in the hierarchical Transformer encoder that needs to be fused, the local feature map of that layer is extracted, and each value in the feature map is multiplied by the first weight parameter to obtain a weighted local feature map. Simultaneously, the global context feature map of that layer is extracted, and each value in the feature map is multiplied by the second weight parameter to obtain a weighted global context feature map. The values at corresponding positions in these two weighted feature maps are added one by one to generate the fused feature map for that layer. In the above operations, the first and second weight parameters maintain the same values in all layers that need to be fused, and do not change with the layer. The above fusion operation is performed independently at at least two different layers of the hierarchical Transformer encoder, with each layer outputting a fused feature map. The spatial resolution and number of channels of these fused feature maps may vary with different layers, reflecting information at different scales. The fused feature maps of all layers that have undergone fusion operations are aggregated in hierarchical order (e.g., from shallow to deep) to form multi-level fused features.
[0062] S106. The multi-level fused features are progressively upsampled and decoded. In the decoding path, the decoded features are refined at multiple scales through a multi-scale convolution enhancement module to obtain refined features.
[0063] Specifically, Figure 5 This is a schematic diagram of the multi-scale convolutional enhancement module provided in this application. Please refer to... Figure 5The multi-scale convolutional enhancement module is a parallel multi-branch feature extraction module, including: a first branch (a 3×3 convolutional layer for extracting local details and texture features), a second branch (a 5×5 convolutional layer for extracting mesoscale structural features), a third branch (a dilated convolutional layer with an inflation rate of 2, used to expand the receptive field and extract global context features without increasing computational cost), a feature fusion part (concatenating the output feature maps of the three branches along the channel dimension, and then performing channel compression and feature integration through a 1×1 convolutional layer), and residual connections (adding the integrated features element-wise to the input feature map of the module to obtain the final output of the module).
[0064] Decoded features refer to the intermediate features obtained after each level of the decoder upsamples and fuses the input features during progressive upsampling decoding, but before entering the multi-scale convolutional enhancement module. These features have incorporated spatial detail information from the corresponding encoder level, but have not yet undergone multi-scale refinement; their spatial resolution gradually recovers to the original image size as the decoding process progresses. Refined features refer to the features output after the decoded features are input into the multi-scale convolutional enhancement module, where information at different scales is extracted through three parallel convolutional branches, then fused and residually connected. Compared to the input decoded features, these features have richer multi-scale representation capabilities, enhancing local texture, mesoscale structure, and global contextual information, resulting in clearer edges and more detailed textures, providing higher-quality feature input for subsequent convolutional output reconstruction heads.
[0065] In specific implementation, the bottleneck layer feature with the lowest resolution and highest semantic level among the multi-level fused features is input into the starting layer of the decoder. In the decoder, upsampling operations are performed level by level, doubling the spatial resolution of the current feature map at each upsampling level. After each upsampling operation, the feature map of the current decoding layer is concatenated with the feature map of the corresponding layer in the encoder along the channel dimension via skip connections. Channel compression and feature alignment are then performed using a 1x1 convolutional layer to obtain the fused decoded features. The fused decoded features are input into a multi-scale convolutional enhancement module, which includes three parallel branches. The first branch uses a 3x3 convolutional kernel to extract local features. For detail and texture features, the second branch uses a 5x5 convolution kernel to extract target-scale structural features, and the third branch uses a dilated convolution kernel with a dilation rate of 2 to extract global context features. The target-scale structural features are between local detail and texture features and global context features. The output feature maps of the three branches are concatenated along the channel dimension and integrated through a 1x1 convolution layer. The integrated features are then added element-wise with the input feature map of the multi-scale convolution enhancement module through residual connections to output the refined decoded features. The steps of upsampling, skip connections, and multi-scale refinement are repeated until the spatial resolution of the decoded features is restored to the same level as the industrial image, thus obtaining the refined features.
[0066] Specifically, the feature with the lowest spatial resolution and highest semantic level (i.e., the bottleneck layer feature) is extracted from the multi-level fused features and used as the starting input of the decoder. An upsampling operation is performed on this starting feature, doubling both the height and width of the feature map. Upsampling can be achieved using bilinear interpolation or transposed convolution. After upsampling, the decoded feature of this level is concatenated with the feature map of the corresponding level in the encoder along the channel dimension using skip connections (i.e., the two feature maps are connected side-by-side along the channel direction). After concatenation, a 1×1 convolutional layer is used to perform channel compression and feature alignment on the concatenated feature, resulting in the fused decoded feature. The fused decoded feature is then input into the multi-scale convolutional enhancement module. In this module, the feature map simultaneously passes through three parallel convolutional branches: the first branch uses a 3×3 convolutional kernel to extract local details and texture features; the second branch uses a 5×5 convolutional kernel to extract mid-scale structural features between local and global features; and the third branch uses a dilated convolutional kernel with a dilation rate of 2 to extract global contextual features. The output feature maps of the three branches are concatenated along the channel dimension and then integrated through a 1×1 convolutional layer. The integrated features are then added element-wise with the input feature map of this module (i.e., the fused decoded features) through residual connections, outputting the refined decoded features. After completing the first-level decoding and multi-scale refinement, the currently obtained refined features are used as the input to the next level of the decoder, and the above upsampling, skip connections, and multi-scale refinement operations are repeated. Each repetition doubles the spatial resolution of the feature map until the spatial resolution of the decoded features is restored to the same level as the industrial image; the resulting decoded features are the refined features. Throughout the process, the upsampling factor and the number of repetitions are determined by the total downsampling factor of the encoder, ensuring that the final resolution matches the original input image.
[0067] S107. Input the refined features into the convolutional output reconstruction head to generate a reflective residual component. Add the industrial image and the reflective residual component pixel by pixel to obtain the output image after reflection elimination.
[0068] Specifically, Figure 6 This is a schematic diagram of the convolutional output reconstruction head provided in this application. Please refer to... Figure 6The convolutional output reconstruction head is a lightweight convolutional network module used to convert the refined features obtained from decoding into reflective residual components. It includes: a first convolutional layer (a 3×3 convolutional layer for initial transformation of the input features), an activation function layer (a SiLU activation function layer introducing non-linearity), a residual block (a residual module containing two convolutional layers and skip connections for further feature optimization), and a second convolutional layer (a 3×3 convolutional layer that maps the features to a single-channel output, i.e., the reflective residual components). Furthermore, this reconstruction head utilizes a global spatial attention map generated by a front-end hierarchical attention mechanism to spatially differentiate and weight the residual learning process.
[0069] Furthermore, the reflection residual component is a single-channel image (or scalable to multi-channel) of the same size as the input industrial image. The value of each pixel represents the amount of brightness offset or texture restoration that needs to be corrected at the corresponding location. This component is learned by the network and represents the difference between the reflective interference in the input image and the ideal diffuse image. Specifically, in overexposed highlight areas, the residual value is larger (positive or negative) to suppress overly bright pixels; in areas lacking texture, the residual value is used to restore masked details. The final output image is the result of adding the original industrial image and this residual component pixel by pixel, thereby achieving the removal of reflections and the restoration of details.
[0070] In specific implementation, the refined features are sequentially input into the first 3x3 convolutional layer, the SiLU activation function layer, and the residual block in the convolutional output reconstruction head to obtain preliminary residual features; global context features generated by the third-level transformer module in the hierarchical Transformer encoder are obtained, where the response values of pixels in the global context features indicate the reflection intensity at the corresponding position; the preliminary residual features are spatially differentiated and weighted using the global context features, and residual learning weights are determined based on the response values of pixels in the global context features, multiplying each pixel by the element at the corresponding position in the preliminary residual features to obtain weighted residual features; wherein, positions with higher pixel response values are assigned higher residual learning weights, and positions with lower pixel response values are assigned lower residual learning weights; the weighted residual features are input into the second 3x3 convolutional layer in the convolutional output reconstruction head to output a single-channel reflection residual component, the spatial resolution of which is the same as that of the industrial image; the industrial image and the reflection residual component are added pixel by pixel to obtain the output image after reflection elimination.
[0071] Specifically, the refined features are input into the first convolutional layer of the convolutional output reconstruction head. This convolutional layer uses a set number of kernels, with stride and padding set to maintain the spatial resolution of the feature map. The output is activated element-wise by the SiLU activation function and then input into a residual block. This residual block contains two convolutional layers, each followed by a non-linear activation, and has an identity mapping path, directly adding the input to the output to obtain the preliminary residual features. The global context features of the output are obtained from the third-level transformer module of the hierarchical Transformer encoder. The preliminary residual features are spatially differentiated and weighted using these global context features: traversing each spatial location and each channel of the preliminary residual features, the pixel value at the same location in the global context features is used as a weight and multiplied by the channel values of the preliminary residual features at that location. Specifically, for each spatial location, the weight value at that location is multiplied by the channel values of the preliminary residual features at that location to obtain the weighted result. This operation preserves or even enhances residual features in regions with high reflectivity (weights close to 1), while suppressing residual features in regions with low reflectivity (weights close to 0), thus generating weighted residual features. These weighted residual features are then input into the second convolutional layer of the convolutional output reconstruction head. This layer uses a set number of convolutional kernels (output channel number 1), with stride and padding maintaining the same spatial resolution, outputting a single-channel feature map, which is the reflectivity residual component. The spatial resolution of this reflectivity residual component is the same as that of the industrial image. The original input industrial image and the reflectivity residual component are added pixel-by-pixel. For each spatial location, the values of all channels of the industrial image at that location are added to the value of the reflectivity residual component at that location (single-channel broadcast to multiple channels), obtaining the output pixel value for that location. After processing all locations, the output image after reflectivity removal is obtained.
[0072] The method provided in this embodiment utilizes pixel response values from the global context features output by the front-end hierarchical attention as spatial differential weights to perform pixel-by-pixel weighting on the initial residual features (positions with higher response values are assigned higher residual learning weights, and positions with lower response values are assigned lower residual learning weights). This allows the network to automatically focus on overexposed highlight areas and texture-deficient areas for targeted enhancement and correction when fitting the overall reflective interference residuals, while suppressing unnecessary residual adjustments in non-reflective areas. This approach not only continues the lightweight and easy-to-converge advantages of global residual learning but also solves the problems of insufficient targeting and incomplete reflection removal in industrial strong reflective scenes caused by traditional undifferentiated residual fitting. At the same time, it effectively reduces the optimization burden on irrelevant areas of the model in complex scenes, improves training stability and convergence speed, and ultimately achieves more thorough highlight removal and more accurate texture restoration.
[0073] Optionally, the method further includes: performing end-to-end training on the convolutional neural network and the hierarchical Transformer encoder using an adaptive hybrid loss function; the adaptive hybrid loss function includes an L1 loss term, a perceptual loss term, and a structural similarity loss term; based on the local brightness distribution of the industrial image, pixel regions in the industrial image with brightness exceeding a preset value are identified as highlight regions and assigned a first weight value, and pixel regions with brightness below a preset value are identified as non-highlight regions and assigned a second weight value, wherein the first weight value is greater than the second weight value, and the first weight value and the second weight value are used to weight the loss values of corresponding pixel positions in the L1 loss term and the perceptual loss term, respectively.
[0074] Optionally, the training process can be divided into three stages: early stage, middle stage, and late stage. In the early stage of training, the L1 loss term is used as the dominant weight. In the middle stage of training, the weight of the perceptual loss term is increased. In the late stage of training, the weight of the structural similarity loss term is increased.
[0075] Specifically, by assigning greater loss weights to highlight areas and smaller weights to non-reflective areas based on the local brightness distribution of industrial images, the L1 loss and perceptual loss focus on correcting highly reflective areas during training, avoiding the problems of incomplete reflection removal and insufficient detail restoration under traditional global average constraints. Simultaneously, the training process is divided into three phases: an early phase where L1 loss is dominant to quickly achieve basic correction of the overall reflective areas; a mid-term phase where the perceptual loss weight is increased to enhance structural semantics and texture restoration; and a late phase where the structural similarity loss weight is increased to finely optimize brightness, contrast, and structural fidelity. This progressive scheduling strategy aligns with the network's coarse-to-fine reconstruction process, enabling the model to achieve targeted optimization at each stage. Ultimately, this synergistic approach comprehensively improves pixel accuracy, structural consistency, and visual quality, effectively addressing the shortcomings of uneven restoration, blurred edges, and poor perceptual quality caused by a single loss function or fixed weight combination.
[0076] The method provided in this embodiment, firstly, utilizes a convolutional neural network to extract local feature maps, preserving subtle information such as edges and textures around the reflective area, thus overcoming the weakness of pure Transformer models in modeling local details. Secondly, it extracts global contextual features through a hierarchical Transformer encoder, enabling the capture of long-distance dependencies in large-area continuous reflections or cross-regional reflections, compensating for the limited receptive field of pure convolutional neural networks. Thirdly, it introduces a learnable dynamic weight adjustment network to generate adaptive fusion weights, dynamically adjusting the contribution of local and global features according to the reflection distribution characteristics of the input image, avoiding the problem of poor adaptability of fixed fusion methods to different reflection scenarios, and achieving flexible adaptation to various situations such as point-like strong reflections and continuous reflections. After obtaining multi-level fusion features, it employs progressive upsampling decoding and embeds a multi-scale convolutional enhancement module, extracting local, mesoscale, and global features in parallel while restoring resolution, further refining the decoded features and enhancing the fidelity of textures and edges. Finally, it generates a reflection residual component through a convolutional output reconstruction head and adds it to the original image, simplifying the optimization objective and reducing the training difficulty through residual learning. The entire process requires no additional prior information or specular masks, achieving end-to-end synergistic optimization of strong reflection removal and detail preservation, significantly improving the thoroughness, structural consistency, and visual quality of reflection removal in industrial images.
[0077] Secondly, by using a learnable dynamic weight adjustment network to determine the first and second weight parameters and constrain their sum to 1, the network can dynamically adjust the fusion ratio of local detail features and global context features based on the reflective distribution characteristics in industrial images (such as localized strong point reflections, large-area continuous reflections, or cross-regional reflections). When localized strong point reflections exist, the first weight parameter is automatically increased, making the network focus more on the local texture and edge information extracted by the convolutional neural network, thereby accurately capturing the subtle structures around the reflection and avoiding detail loss. When continuous or cross-regional reflections exist, the second weight parameter is automatically increased, making the network focus more on the global dependencies modeled by the Transformer, thereby maintaining the consistency of illumination and structure between the reflective area and the background, preventing local structural distortion or texture breakage. This allows the network to adaptively match different reflective scenes without manual setting or reliance on external priors, improving the thoroughness of reflection removal while preserving high-fidelity details, significantly enhancing the network's robustness and generalization ability in complex industrial environments.
[0078] Thirdly, a multi-scale convolution enhancement module is introduced into the decoding path. This module employs three parallel branches (3×3 convolution, 5×5 convolution, and dilated convolution with a dilation rate of 2) to extract local details and texture features, mesoscale structural features, and global contextual features, respectively. The outputs of the three branches are concatenated and integrated through a 1×1 convolution, and then added to the input through residual connections. This allows the decoded features to simultaneously obtain fine-grained texture information, mesoscale structural information, and a wide range of contextual information without significantly increasing the computational load, effectively solving the problem of insufficient expressive power of single-scale convolution kernels. The features refined through multi-scale processing have clearer edges and more detailed textures, providing higher-quality feature inputs for subsequent output reconstruction heads. This significantly improves the edge fidelity and texture restoration quality of the image after reflection removal, avoiding the edge blurring and excessive texture smoothing problems caused by single-scale processing in traditional methods.
[0079] Corresponding to the aforementioned embodiment of an industrial image reflection elimination method based on hybrid networks, this application also provides an embodiment of an industrial image reflection elimination device based on hybrid networks.
[0080] Figure 7 This is a schematic diagram of the structure of the industrial image reflection elimination device based on a hybrid network provided in Embodiment 2 of this application. The hybrid network includes a convolutional neural network and a hierarchical Transformer encoder. Please refer to... Figure 7 The apparatus provided in this embodiment includes an acquisition module 210, an extraction module 220, a generation module 230, a fusion module 240, and a processing module 250.
[0081] The acquisition module 210 is used to acquire the industrial image to be processed;
[0082] The extraction module 220 is used to input the industrial image into the convolutional neural network, extract local texture features, and obtain a local feature map.
[0083] The generation module 230 is used to input the local feature map into a learnable dynamic weight adjustment network to generate adaptive fusion weights.
[0084] The extraction module 220 is also used to input the patched local feature map into the hierarchical Transformer encoder to extract global context features;
[0085] The fusion module 240 is used to dynamically fuse the local feature map and the global context feature according to the adaptive fusion weight to obtain multi-level fused features;
[0086] The processing module 250 is used to perform progressive upsampling decoding on the multi-level fused features, and to refine the decoded features at multiple scales through a multi-scale convolution enhancement module in the decoding path to obtain refined features.
[0087] The processing module 250 is further configured to input the refined features into the convolutional output reconstruction head to generate a reflective residual component, and add the industrial image and the reflective residual component pixel by pixel to obtain the output image after reflective removal.
[0088] The apparatus of this embodiment can be used to perform... Figure 1 The steps of the method embodiment shown are similar in principle and process, and will not be repeated here.
[0089] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0090] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this application according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0091] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A method for eliminating reflections in industrial images based on a hybrid network, wherein the hybrid network comprises a convolutional neural network and a hierarchical Transformer encoder, characterized in that, The method includes: Acquire industrial images to be processed; The industrial image is input into the convolutional neural network to extract local texture features and obtain a local feature map; The local feature map is input into a learnable dynamic weight adjustment network to generate adaptive fusion weights. The local feature map is embedded after being patched and then input into the hierarchical Transformer encoder to extract global context features; Based on the adaptive fusion weights, the local feature map and the global context features are dynamically fused to obtain multi-level fused features; The multi-level fused features are progressively upsampled and decoded. In the decoding path, the decoded features are refined at multiple scales through a multi-scale convolution enhancement module to obtain refined features. The refined features are input into the convolutional output reconstruction head to generate a reflective residual component. The industrial image is then added pixel by pixel to the reflective residual component to obtain the output image after reflective removal.
2. The method according to claim 1, characterized in that, The local feature map is input into a learnable dynamic weight adjustment network to generate adaptive fusion weights, including: Global average pooling is performed on the local feature map to obtain the pooled feature vector; the feature vector represents the reflectivity distribution characteristics of the industrial image; The pooled feature vector is sequentially input into a weight generation network consisting of a fully connected layer and a sigmoid activation function, outputting a first weight parameter and a second weight parameter, the sum of which is a constant value. The weight generation network dynamically adjusts the first and second weight parameters based on the reflectivity and range information in the feature vector. When localized point reflections exist in the industrial image, the first weight parameter is increased; when continuous or cross-regional reflections exist in the industrial image, the second weight parameter is increased.
3. The method according to claim 1, characterized in that, The local feature maps are embedded after patching and then input into a hierarchical Transformer encoder to extract global contextual features, including: The local feature map is segmented into multiple image blocks, and each image block is converted into a serialized embedding vector through linear mapping; The embedded vector is input into the first-level transformer module. The first-level transformer module uses a window attention mechanism to limit the self-attention calculation range, introduces a convolution operation to enhance local spatial information, captures the local non-uniformity dependent features of the reflective area in the industrial image, and outputs the first intermediate feature. The first intermediate feature is input into the second-level transformer module. The second-level transformer module calculates self-attention in the channel dimension, models the correlation between each feature channel, enhances the feature discrimination between the reflective area and the background area, and outputs the second intermediate feature. The second intermediate feature is input into the third-level transformer module. The third-level transformer module calculates the distance dependency between pixel positions in the spatial dimension, calculates the global correlation between feature channels in the channel dimension, extracts the global context features of continuous reflection or cross-regional reflection, and outputs the global context features.
4. The method according to claim 1, characterized in that, Based on the adaptive fusion weights, the local feature map and the global context features are dynamically fused to obtain multi-level fused features, including: Obtain the first and second weight parameters generated by the learnable dynamic weight adjustment network; In each layer of the hierarchical Transformer encoder, the local feature map of the current layer is multiplied by the first weight parameter to obtain weighted local features; Multiply the global context features of the current level by the second weight parameter to obtain the weighted global features; The weighted local features and the weighted global features are added element by element to form the fusion features of the current level; wherein, the first weight parameter and the second weight parameter share the same value across different levels, and the fusion operation is repeatedly performed on at least two different levels of the hierarchical Transformer encoder to output the fusion features of the corresponding level, which are then summarized to form multi-level fusion features.
5. The method according to claim 1, characterized in that, The multi-level fused features are progressively upsampled and decoded. In the decoding path, a multi-scale convolutional enhancement module refines the decoded features at multiple scales to obtain refined features, including: Input the bottleneck layer feature with the lowest resolution and highest semantic level in the multi-level fusion features into the starting layer of the decoder; In the decoder, upsampling operations are performed step by step, with each upsampling step doubling the spatial resolution of the current feature map; After each upsampling operation, the feature map of the current decoding level is concatenated with the feature map of the corresponding level in the encoder in the channel dimension through a skip connection. Channel compression and feature alignment are performed through a 1x1 convolutional layer to obtain the fused decoding features. The fused decoded features are input into a multi-scale convolutional enhancement module, which includes three parallel branches. The first branch uses a 3x3 convolutional kernel to extract local details and texture features, the second branch uses a 5x5 convolutional kernel to extract target-scale structural features, and the third branch uses a dilated convolutional kernel with a dilation rate of 2 to extract global context features. The target-scale structural features are located between the local details and texture features and the global context features. The output feature maps of the three branches are concatenated along the channel dimension, and the features are integrated through a one-to-one convolutional layer. The integrated features are then added element-wise with the input feature map of the multi-scale convolutional enhancement module through residual connections to output the refined decoded features. Repeat the steps of upsampling, skip connections, and multi-scale refinement until the spatial resolution of the decoded features is restored to the same level as the industrial image, thus obtaining the refined features.
6. The method according to claim 1, characterized in that, The refined features are input into a convolutional output reconstruction head to generate a reflection residual component. The industrial image is then added pixel by pixel to the reflection residual component to obtain the reflection-reduced output image, including: The refined features are sequentially input into the first 3x3 convolutional layer, the SiLU activation function layer, and the residual block in the convolutional output reconstruction head to obtain preliminary residual features; Obtain the global context features generated by the third-level transformer module in the hierarchical Transformer encoder. The response values of the pixels in the global context features are used to indicate the reflectivity at the corresponding positions. The preliminary residual features are spatially differentiated and weighted using the global context features. The residual learning weights are determined based on the response values of the pixels in the global context features. Each pixel is multiplied by the element at the corresponding position in the preliminary residual features to obtain the weighted residual features. Among them, the position with the higher pixel response value is assigned a higher residual learning weight, and the position with the lower pixel response value is assigned a lower residual learning weight. The weighted residual features are input into the second 3x3 convolutional layer in the convolutional output reconstruction head, which outputs a single-channel reflective residual component. The spatial resolution of the reflective residual component is the same as that of the industrial image. The industrial image is added pixel by pixel to the reflective residual component to obtain the output image after reflective removal.
7. The method according to claim 1, characterized in that, The method further includes: An adaptive hybrid loss function is used to train the convolutional neural network and the hierarchical Transformer encoder end-to-end; the adaptive hybrid loss function includes an L1 loss term, a perceptual loss term, and a structural similarity loss term; Based on the local brightness distribution of the industrial image, pixel areas in the industrial image with brightness exceeding a preset value are identified as highlight areas and assigned a first weight value, while pixel areas with brightness below the preset value are identified as non-highlight areas and assigned a second weight value. The first weight value is greater than the second weight value. The first weight value and the second weight value are used to weight the loss values of the corresponding pixel positions in the L1 loss term and the perception loss term, respectively.
8. The method according to claim 7, characterized in that, The method further includes: dividing the training process into three stages: early stage, middle stage and late stage; in the early stage of training, the L1 loss term is used as the dominant weight; in the middle stage of training, the weight of the perceptual loss term is increased; and in the late stage of training, the weight of the structural similarity loss term is increased.
9. The method according to claim 1, characterized in that, The industrial image is input into a convolutional neural network to extract local texture features, resulting in a local feature map, including: The industrial image is sequentially input into the first convolutional layer and the second convolutional layer to extract primary local features; The primary local features are input into the first optimized residual block. The first optimized residual block passes the input features along the main path and the identity mapping path, respectively. The main path sequentially performs a first convolution operation, a SiLU activation function operation, and a second convolution operation to obtain the main path output. The identity mapping path directly passes the input features to obtain the identity mapping output. The main path output and the identity mapping output are added element-wise to obtain the sum. The sum is multiplied by the residual scaling factor to obtain the output features of the first optimized residual block. The residual scaling factor is a positive number less than 1. The output features of the first optimized residual block are input into the second optimized residual block. The second optimized residual block performs the same steps as the first optimized residual block to obtain the output features of the second optimized residual block, which are used as a local feature map.
10. An industrial image reflection removal device based on a hybrid network, wherein the hybrid network includes a convolutional neural network and a hierarchical Transformer encoder, characterized in that, The device includes an acquisition module, an extraction module, a generation module, a fusion module, and a processing module; The acquisition module is used to acquire the industrial image to be processed. The extraction module is used to input the industrial image into the convolutional neural network, extract local texture features, and obtain a local feature map; The generation module is used to input the local feature map into a learnable dynamic weight adjustment network to generate adaptive fusion weights. The extraction module is also used to input the patched local feature map into the hierarchical Transformer encoder to extract global context features; The fusion module is used to dynamically fuse the local feature map and the global context feature according to the adaptive fusion weight to obtain multi-level fused features; The processing module is used to perform progressive upsampling decoding on the multi-level fused features, and to refine the decoded features at multiple scales through a multi-scale convolution enhancement module in the decoding path to obtain refined features. The processing module is further configured to input the refined features into the convolutional output reconstruction head to generate a reflective residual component, and add the industrial image and the reflective residual component pixel by pixel to obtain the output image after reflective removal.