Complex light self-adaptive enhancement and recognition method based on image recognition
Patent Information
- Application Number
- CN202611216186.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-12
- Publication Date
- 2026-10-23
AI Technical Summary
这类像素增强手段虽能直观改善画面观感,但易造成目标纹理丢失、边缘过曝、色彩失真,额外引入噪声干扰,且像素处理与特征提取、分类识别流程相互割裂,无法实现光照扰动与识别特征的联动适配
一、本发明通过在骨干特征提取网络中划分光照敏感通道与语义稳定通道并行完成特征提取,分层捕获浅层、中层、深层不同粒度光照扰动信息,依托分区域聚合结合全局编码的光照特征感知模块提取纯粹光照隐式表征向量,规避目标语义信息对光照特征提取的干扰;依托投影矩阵生成网络建立光照扰动与特征通道偏移的定量映射,并按照光照畸变等级匹配差异化权重缩放系数,实现校正力度跟随场景光照畸变程度动态变化;整套校正流程完全运行于高维特征空间,全程不针对原始图像像素实施调整,不会产生过曝、纹理丢失、色彩失真等像素处理带来的负面问题,同时校正操作仅限定于光照敏感通道对应特征区间,最大程度保留承载目标本体轮廓、结构与类别属性的语义特征,从底层保障复杂光照环境下目标识别所需核心特征不被破坏。
Smart Images

Figure CN122966973A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of neural networks and image recognition technology, specifically to a method for adaptive enhancement and recognition of complex lighting based on image recognition. Background Technology
[0002] Image recognition technology is now widely used in security monitoring, industrial quality inspection, autonomous driving, and other scenarios. Actual image acquisition often faces complex lighting distortion problems such as backlighting, strong light, local shadows, and uneven brightness, significantly reducing the accuracy of recognition models. Current mainstream recognition models rely on fixed backbone networks to extract pixel features, and training datasets often use uniformly lit standard samples. The model's generalization ability is severely limited by the difference in lighting distribution between the training and test sets. Traditional solutions often focus on pixel-level preprocessing, directly adjusting the brightness and contrast of the original image through algorithms such as histogram equalization, Retinex delighting, and gamma correction before feeding the processed image into the recognition network. While these pixel enhancement methods can intuitively improve the visual appeal, they easily lead to loss of target texture, edge overexposure, color distortion, and the introduction of additional noise interference. Furthermore, pixel processing is disconnected from feature extraction and classification processes, failing to achieve coordinated adaptation between lighting disturbances and recognition features.
[0003] Existing illumination optimization schemes suffer from two irreconcilable technical flaws: pixel-level enhancement is independent of the recognition network, failing to distinguish between illumination-sensitive information and target semantic information. It uniformly adjusts the brightness of all pixels, weakening illumination distortion while damaging core classification features such as object contours and textures. Shallow pixel distortion propagates layer by layer to higher-level semantic features, ultimately interfering with classification. A few feature-domain illumination correction methods only uniformly compensate global features, failing to differentiate between shallow pixel-level, mid-level region-level, and deep semantic-level multi-scale illumination perturbations. They also lack spatially segmented illumination perception mechanisms, making it difficult to capture non-uniform illumination distributions such as local shadows and light spots. Furthermore, the compensation process lacks gradient constraints, making areas with high gradients, such as object edges and textures, prone to over-correction and feature distortion. Simultaneously, existing schemes lack hierarchical adaptation logic for illumination distortion, using the same set of offset weights for both light and heavy illumination scenes. The correction intensity cannot dynamically match the actual degree of illumination perturbation, and the feature distribution offset problem remains uncorrected.
[0004] In summary, existing technologies remain at the level of preprocessing raw image pixels, separating illumination correction from image recognition processes, which easily damages the semantic features of the target. Using only a single global feature compensation method cannot adapt to multi-scale, non-uniform, and complex lighting scenes, lacking hierarchical illumination perception, dynamic distortion weights, and gradient constraint correction mechanisms. Even after correction, feature distribution shifts still exist, making it difficult to simultaneously suppress illumination distortion and preserve the complete target features. To address these technical challenges, this invention embeds adaptive illumination correction into the intermediate process of feature extraction and classification, constructing a complete link of illumination perception, projection matrix generation, gradient constraint feature shift compensation, and feature distribution calibration. It hierarchically distinguishes between illumination and semantic channels, dynamically adjusts the compensation intensity according to the distortion level, and completes adaptive illumination correction in a high-dimensional feature space, effectively solving the industry problem of decreased image recognition accuracy under complex lighting conditions. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of existing technologies and provide a complex illumination adaptive enhancement and recognition method based on image recognition. This method first normalizes the image and then feeds it into a backbone network, extracting two types of channel features in parallel: illumination-sensitive and semantically stable, and fusing multi-scale illumination perturbation information. Then, an illumination representation vector is generated by a light perception module with regional aggregation and adversarial constraints. A projection matrix for the appropriate channel is generated through a mapping network and the weights are dynamically adjusted according to the distortion level. The features are corrected channel by channel and space by space using an offset compensation module with gradient constraints, without modifying the original image pixels throughout the process. Finally, channel-level distribution calibration is performed on the corrected features, and then classification and recognition are completed.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: a method for adaptive enhancement and recognition of complex illumination based on image recognition, the method comprising: S1. Obtain the complex lighting scene image to be identified, and input it into the backbone feature extraction network after completing the size and numerical normalization process. Extract image features through multi-layer convolution operation and residual connection structure to generate low-level texture features, mid-level contour features and high-level semantic features, and output the original high-dimensional feature map containing multi-dimensional information. S2. Input the original high-dimensional feature map into the illumination feature perception module, perform hierarchical aggregation processing on the spatial and channel dimensions of the feature map, filter and extract feature components related to illumination distortion, and generate an implicit illumination representation vector that simultaneously represents global illumination intensity and local illumination distribution. S3. Input the implicit representation vector of illumination into the projection matrix generation network, and generate an illumination distortion projection matrix that matches the channel dimension of the original high-dimensional feature map through a multi-layer nonlinear mapping structure, and establish a quantitative mapping relationship between the intensity of illumination disturbance and the offset of feature channel. S4. Input the original high-dimensional feature map and the illumination distortion projection matrix into the feature offset compensation module simultaneously. Based on the offset weights corresponding to each channel in the projection matrix, perform channel-by-channel and spatial position-by-spatial feature offset reverse compensation on the original high-dimensional feature map and output the corrected target feature map. S5. Input the corrected target feature map into the image recognition classification head, and output the target category recognition result of the corresponding image through global feature aggregation and fully connected classification operation; complete the illumination adaptive correction in the high-dimensional feature space, without performing enhancement processing on the original image pixels, and embed the illumination correction process between the feature extraction and classification output of image recognition.
[0007] Furthermore, the backbone feature extraction network simultaneously divides the light-sensitive channel and the semantically stable channel during the convolution extraction process. The two types of channels use the same convolution kernel size to perform feature extraction in parallel. The light-sensitive channel carries feature information related to image brightness, contrast, and light-dark gradient, while the semantically stable channel carries feature information related to target body contour, texture structure, and category attributes. The features of the two types of channels are concatenated and integrated in a fixed order before output. The original high-dimensional feature map output by the backbone feature extraction network is stored in partitions according to channel attributes. The scope of subsequent illumination correction operations is limited to the corresponding interval of the light-sensitive channel.
[0008] Furthermore, the outputs of each layer of the backbone feature extraction network correspond to illumination perturbation responses of different granularities: shallow features correspond to pixel-level brightness fluctuations, mid-level features correspond to region-level brightness distribution, and deep features correspond to semantic-level illumination shifts. Independent skip connections are set between each layer to transmit illumination feature information of each layer. The original high-dimensional feature map finally output by the backbone feature extraction network integrates multi-level illumination perturbation features and target semantic features, fully preserving illumination distortion information at different scales.
[0009] Furthermore, the illumination feature perception module generates implicit illumination representation vectors by combining regional aggregation and global encoding. First, the original high-dimensional feature map is divided into multiple equal spatial sub-regions, and global average pooling of the channel dimension is performed on each sub-region to obtain the corresponding number of regional illumination feature vectors. Then, all regional illumination feature vectors are input into the global encoding network for fusion processing. By introducing an auxiliary semantic classification branch and using gradient inversion or adversarial constraint mechanisms, the branch's ability to distinguish semantic categories is weakened. This allows the extracted implicit illumination representation vectors to maintain illumination information while suppressing interference from target semantic information, ultimately outputting a fixed-dimensional implicit illumination representation vector.
[0010] Furthermore, the projection matrix generation network generates the illumination distortion projection matrix through two layers of fully connected nonlinear mapping, and the specific calculation formula is as follows: ,in, This is the implicit representation vector of illumination; For the illumination distortion projection matrix, The total number of channels in the original high-dimensional feature map; , This is the weight matrix corresponding to the two fully connected layers; , These are the bias vectors corresponding to the two fully connected layers. Let be the dimension of the implicit representation vector of illumination. For the hidden layer dimension; It is a linear rectification activation function; This is the Sigmoid activation function.
[0011] Furthermore, the illumination distortion projection matrix output by the projection matrix generation network adopts a hierarchical mapping mechanism. The projection matrix generation network first determines the illumination distortion level of the current image based on the implicit illumination representation vector, dividing it into three level intervals: mild distortion, moderate distortion, and severe distortion. Different distortion levels correspond to different mapping weight scaling coefficients, with the mild distortion interval corresponding to a smaller offset weight adjustment range and the severe distortion interval corresponding to a larger offset weight adjustment range. The offset weight of the illumination distortion projection matrix is dynamically adjusted according to the illumination distortion level to match the degree of illumination disturbance in the current scene.
[0012] Furthermore, the feature offset compensation module performs channel-by-channel, element-by-element feature correction operations, calculated using the following formula: ,in, This is the corrected target feature map; P is the original high-dimensional feature map; J is the illumination distortion projection matrix; J is a matrix of all ones with the same dimension as P. This represents element-wise multiplication; the element range of the illumination distortion projection matrix P is (0,1), and the element range of (J−P) is also (0,1), so as to achieve unidirectional numerical compression correction of the original features; before the operation, the feature offset compensation module first copies and expands the illumination distortion projection matrix along the spatial dimension of the feature map, so that the feature points at each spatial position of the feature map are matched with the offset weight of the corresponding channel; the compensation operation directly acts on the feature values, without changing the spatial size and the total number of channels of the feature map, and without changing the spatial relative position of the feature points.
[0013] Furthermore, the feature offset compensation module introduces feature gradient constraints when performing channel-by-channel compensation. Let be the normalized gradient magnitude of the c-th channel at spatial coordinates (i,j) of the original high-dimensional feature map, with a value range of [0,1]; the formula for the compensation adjustment coefficient is: ,in, Here, λ represents the compensation adjustment coefficient for the c-th channel at spatial coordinates (i,j); λ∈(0,1] is a preset gradient constraint constant used to control the weight of the gradient magnitude on the compensation adjustment coefficient. The larger the value of λ, the more significant the suppression effect of the gradient magnitude on the correction intensity, thus ensuring... ∈[0,1], thus making ∈[0,1]; Then, the feature offset compensation module corrects the channel-by-channel and element-by-element feature correction operation based on the compensation adjustment coefficient. The corrected relationship is as follows: ,in, This is the corrected target feature map; The original high-dimensional feature map is represented by P; P is the illumination distortion projection matrix; J is a matrix of all ones with the same dimension as P; α is the matrix of all ones with the same dimension as P. The compensation adjustment coefficient matrix of the same dimension is composed of each of the aforementioned Arranged according to space and passageways; This indicates element-wise multiplication. In this process, regions with higher gradient magnitudes correspond to smaller α values, thereby reducing the offset correction intensity of the illumination distortion projection matrix P in that region; regions with lower gradient magnitudes correspond to larger α values, maintaining the standard offset correction intensity; the compensation process only adjusts the feature numerical magnitudes and does not change the spatial distribution structure of the features.
[0014] Furthermore, before performing classification operations, the image recognition classification head first performs feature distribution calibration, matching the calibrated target feature map with a preset standard illumination feature distribution benchmark at the channel level to determine the feature distribution offset of each channel. The feature distribution offset is determined according to the following formula: ,in, The characteristic distribution offset of the c-th channel; This is a cosine similarity calculation function, with an output range of [0,1]. This is the standard illumination reference feature vector of channel c, obtained in advance through statistical analysis of a standard illumination sample set. The feature vector of channel c in the corrected target feature map; supplementary numerical calibration is performed on channels whose feature distribution offset exceeds a preset threshold, the preset threshold ranging from 0.1 to 0.3. If the preset threshold is exceeded, it is determined that the value is exceeded; after calibration, the feature map is then input into the global aggregation layer and the fully connected classification layer, and the final target category recognition probability distribution is output.
[0015] Compared with existing technologies, this image recognition-based method for adaptive enhancement and recognition of complex lighting has the following advantages: I. This invention performs feature extraction in parallel by dividing the backbone feature extraction network into a light-sensitive channel and a semantically stable channel. It captures light perturbation information of different granularities at shallow, medium, and deep layers. It extracts pure implicit light representation vectors by relying on a light feature perception module that combines regional aggregation with global encoding, thus avoiding interference from target semantic information on light feature extraction. It establishes a quantitative mapping between light perturbation and feature channel offset by relying on a projection matrix generation network, and matches differentiated weight scaling coefficients according to the level of light distortion, so that the correction intensity dynamically changes with the degree of scene light distortion. The entire correction process runs entirely in a high-dimensional feature space, without adjusting the original image pixels, thus avoiding negative problems caused by pixel processing such as overexposure, texture loss, and color distortion. At the same time, the correction operation is limited to the feature interval corresponding to the light-sensitive channel, preserving the semantic features that carry the contour, structure, and category attributes of the target to the greatest extent, ensuring that the core features required for target recognition in complex lighting environments are not destroyed from the bottom layer.
[0016] Second, this invention introduces a spatial gradient constraint mechanism in the feature offset compensation stage, dynamically adjusting the local correction intensity based on the gradient magnitude at each location in the image. The correction amplitude is weakened for edges and textured areas with high gradient magnitudes, preventing deformation of fine target features during correction. Areas with gentle gradients maintain complete illumination compensation, balancing the elimination of local illumination distortion with the integrity of the target structure. After correction, a channel-level feature distribution calibration process is added to correct channel distribution offsets by comparing with standard illumination baseline features, compensating for feature distribution deviations caused by different illumination scenarios. The entire illumination correction chain is fully embedded within the image recognition process, achieving integrated linkage of illumination perception, feature compensation, distribution calibration, and classification recognition. No additional independent preprocessing module is required, enabling stable adaptation to various complex illumination scenarios such as backlighting, local shadows, and uneven brightness, continuously improving the generalization performance and classification accuracy of the recognition model under varying illumination conditions.
[0017] Other advantages, objectives and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination or study, or may be learned from the practice of the invention. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0019] Figure 1 This is a flowchart illustrating the steps of this method; Figure 2 This is a flowchart of the backbone network subdivision process for this method; Figure 3 This is a detailed link diagram for illumination correction in this method. Detailed Implementation
[0020] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided below. Example 1
[0021] Images of complex lighting components in a closed workshop, characterized by aging lamps and localized backlighting, creating multiple contrasts of light and dark, are collected. After image size and numerical normalization, the images are fed into a backbone feature extraction network. Relying on multi-layer convolutional operations and residual connection structures, the network simultaneously extracts three types of feature information: low-level texture, mid-level contour, and high-level semantic information. This allows the network to fully capture details related to minor scratches, dents, deformations, and other defects on the surface of the components, generating original high-dimensional feature maps that carry multi-dimensional image information. The backbone feature extraction network synchronously distinguishes between the light-sensitive channel and the semantically stable channel throughout the entire convolution operation. Both types of channels use convolution kernels of the same size to perform feature extraction in parallel. The light-sensitive channel specifically collects all feature information related to the global brightness, local contrast, and regional brightness gradient of the image, which can accurately record the changes in brightness and darkness of the image caused by uneven lighting in the workshop. The semantically stable channel separately retains feature information related to the complete outline of the component body, surface texture structure, and inherent category attributes of the product, which can isolate the interference of lighting changes on the inherent features of the component body. The feature data generated by the two types of channels are spliced and integrated at the network output port in a fixed preset order. The original high-dimensional feature map finally output by the backbone feature extraction network is partitioned and stored according to the channel attributes, which facilitates subsequent lighting correction operations to accurately lock the numerical range corresponding to only the light-sensitive channel for calculation, without causing unnecessary changes to the semantically stable channel that carries the component body information. Each layer of the backbone feature extraction network outputs content corresponding to different granularities of illumination perturbation response results. Shallow layer outputs can capture pixel-level minute brightness fluctuations and accurately identify single-point brightness deviations caused by local lighting shadows in the workshop. Mid-layer outputs can cover continuous brightness and darkness distribution at the regional level, completely recording the grayscale difference formed by large backlit areas on the surface of parts. Deep layer outputs can identify semantic-level overall illumination shifts and distinguish between two types of illumination interference caused by global low-brightness environments and local strong light reflections. Independent skip connections are added between adjacent layers of the network to continuously transmit all illumination feature information captured by each layer. This allows the original high-dimensional feature map output by the network to fully integrate multi-level illumination distortion features and semantic features of part defects, completely preserving all illumination distortion details at different scales within the image. This ensures that subsequent illumination compensation stages can accurately locate each area of illumination anomaly, reducing the masking effect of complex illumination on the defect features of parts from the source.
[0022] The generated original high-dimensional feature map is fed into the illumination feature perception module to generate a fixed-dimensional implicit illumination representation vector. The module adopts a composite processing logic of regional aggregation combined with global encoding. First, the entire original high-dimensional feature map is evenly divided into multiple independent spatial sub-regions of equal area. Then, a channel-dimensional global average pooling operation is performed on each sub-region to generate an equal number of independent regional illumination feature vectors. The illumination intensity information corresponding to each local space of the image is retained separately to avoid the loss of illumination information in areas that are too dark or reflective during the fusion process. All regional illumination feature vectors are uniformly fed into a global encoding network for deep fusion processing. An additional auxiliary semantic classification branch structure is built in the module, and a mechanism combining gradient inversion and adversarial constraints is simultaneously enabled to continuously weaken the branch's ability to distinguish between component product categories. This forces the network to actively filter semantic content related to component ontology and defect morphology during information extraction, ensuring that the final generated implicit illumination representation vector fully retains all information related to illumination intensity and brightness distribution in the image. At the same time, it significantly reduces the interference of component ontology semantic information on illumination features, achieving effective separation of illumination features and target semantic features. The output is a fixed-dimensional implicit illumination representation vector with no fluctuation, providing a clean and semantically unaffected illumination judgment basis for the subsequent projection matrix generation network. This ensures that the subsequently generated projection matrix only generates corresponding adjustment weights for illumination distortion, and the accuracy of weight judgment is not affected by the texture and defect morphology of the component itself.
[0023] The implicit illumination representation vector output from the previous step is completely input into the projection matrix generation network. The network, relying on a two-layer fully connected nonlinear mapping structure, completes the generation operation of the illumination distortion projection matrix. During the operation, the linear rectified activation function and the sigmoid activation function are sequentially called to complete multi-layer numerical mapping transformations. The numerical transformation process is completed using the weight matrix and bias vector of the two fully connected layers, generating an illumination distortion projection matrix whose channel dimension perfectly matches the total number of channels in the original high-dimensional feature map. The formula is: ,in, This is the implicit representation vector of illumination; For the illumination distortion projection matrix, The total number of channels in the original high-dimensional feature map; , This is the weight matrix corresponding to the two fully connected layers; , These are the bias vectors corresponding to the two fully connected layers. Let be the dimension of the implicit representation vector of illumination. For the hidden layer dimension; It is a linear rectification activation function; The Sigmoid activation function is used. A stable, quantifiable one-to-one correspondence is established between the intensity of image illumination perturbation and the offset of feature channels, allowing each illumination fluctuation to be matched with a dedicated channel offset adjustment weight. The projection matrix generation network incorporates a hierarchical mapping mechanism, directly relying on the global illumination information contained in the implicit illumination representation vector to determine the illumination distortion level corresponding to the current component image. The mild distortion range is 0 to 0.3 for the implicit illumination representation vector magnitude, corresponding to an offset weight adjustment range of 0 to 0.25; the moderate distortion range is 0.3 to 0.6 for the implicit illumination representation vector magnitude, corresponding to an offset weight adjustment range of 0.25 to 0.6; the severe distortion range is 0.6 to 1 for the implicit illumination representation vector magnitude, corresponding to an offset weight adjustment range of 0.6 to 0.95. The mild distortion range caused by slight light attenuation in the workshop corresponds to a smaller offset weight. The adjustment range only makes small numerical corrections to the light-sensitive channels, without changing the feature values corresponding to minor defects in the parts. The offset weight adjustment range corresponding to the severe distortion range formed by large-area backlighting and reflection overlap is relatively large, which fully offsets the feature value offset caused by extreme lighting. All offset weights inside the lighting distortion projection matrix will dynamically and adaptively adjust according to the lighting distortion level determined in real time, accurately matching the actual lighting disturbance level in the current workshop scene. This prevents insufficient correction force from failing to eliminate lighting interference or excessive correction force from erasing the minor features of component defects, thus balancing the lighting compensation effect and the defect feature preservation effect.
[0024] The original high-dimensional feature map and the generated illumination distortion projection matrix are simultaneously fed into the feature offset compensation module. The module first copies and expands the illumination distortion projection matrix along all spatial dimensions of the feature map, ensuring that each feature point at any spatial coordinate position in the image can accurately match its own channel-specific offset weight, eliminating the imbalance in correction strength caused by uneven illumination distribution at different spatial locations. The core of the module performs channel-by-channel, element-by-element feature correction operations, relying entirely on element-by-element multiplication to complete the unidirectional numerical compression correction of the original features. The formula is: ,in, This is the corrected target feature map; P is the original high-dimensional feature map; J is the illumination distortion projection matrix; J is a matrix of all ones with the same dimension as P. This represents element-wise multiplication; it strictly controls the value range of all elements in the illumination distortion projection matrix to be between 0 and 1, ensuring that the correction process only performs numerical compression and does not result in the reverse amplification of feature values. Simultaneously, feature gradient constraints are introduced to calculate the compensation adjustment coefficient matrix. The coefficients are solved based on the normalized gradient magnitude of the corresponding channel at each spatial coordinate position of the original high-dimensional feature map. The formula for the compensation adjustment coefficient is: ,in, Here, λ represents the compensation adjustment coefficient for the c-th channel at spatial coordinate (i,j); λ∈(0,1] is the preset gradient constraint constant. Smaller compensation adjustment coefficients are generated for component edges and defect corners with higher gradient values, actively reducing the correction intensity applied to these areas by the illumination distortion projection matrix, preventing the key features of component contours and defect edges from being smoothed out by illumination compensation operations. Larger compensation adjustment coefficients are generated for smooth, flat planar areas of components with lower gradient values, maintaining the standard offset correction effect and fully eliminating feature distortion caused by large-area illumination and darkness differences in planar areas. Subsequently, the generated compensation adjustment coefficient matrix is used to perform basic channel-by-channel and element-by-element feature correction operations to complete the correction and optimization. The relationship is: ,in, This is the corrected target feature map; The original high-dimensional feature map is represented by P; P is the illumination distortion projection matrix; J is a matrix of all ones with the same dimension as P; α is the matrix of all ones with the same dimension as P. The compensation adjustment coefficient matrix of the same dimension is composed of each of the aforementioned Arranged according to space and passageways; This represents element-wise multiplication; the entire compensation operation only adjusts the magnitude of the numerical values within the features, without altering the spatial dimensions or total number of channels of the original feature map, nor changing the inherent spatial relative positions of all feature points. The final output is the target feature map with complete global illumination correction. The entire correction process operates entirely within a high-dimensional feature space, without touching or modifying the original image pixels of the components, thus avoiding pixel-level distortion problems such as decreased image clarity or blurred defect textures. Figure 3 As shown.
[0025] The corrected target feature map is then fed into the image recognition classification head to perform component defect identification calculations. Before the classification head officially starts the global aggregation and fully connected classification operations, a feature distribution calibration operation is performed first to quantify the degree of deviation between the current channel features and the features under standard illumination conditions. The formula is as follows: ,in, The characteristic distribution offset of the c-th channel; This is a cosine similarity calculation function, with an output range of [0,1]. This is the standard illumination reference feature vector of the c-th channel, obtained in advance through statistical analysis of a standard illumination sample set; The feature vector of channel c in the corrected target feature map is used. A preset threshold of 0.2 is used. The feature distribution offset of each channel is compared with the preset threshold. If the channel feature distribution offset exceeds 0.2, it indicates that the channel still has a significant numerical deviation due to residual illumination interference. Therefore, supplementary numerical calibration is performed on this channel to reduce the distribution gap between the channel features and the standard illumination reference. After all channels have undergone calibration, the calibrated target feature map is sent to the global feature aggregation layer to integrate global feature information. Then, it is connected to the fully connected classification layer for final classification calculation, outputting the recognition probability distribution results for different defect types such as no defects, surface scratches, internal dents, and shape deformation. The entire illumination adaptive correction process is fully embedded in the intermediate link between the backbone feature extraction network and the classification head output results, eliminating the need for an additional independent image preprocessing module, reducing the hardware computing power overhead of the entire recognition process. Simultaneously, it eliminates complex illumination interference at the feature level, significantly improving the recognition accuracy of minor defects in parts under low-light workshop environments. Figure 1 As shown. Example 2
[0026] The system collects complex lighting images of vehicles under various superimposed conditions, including direct sunlight at tunnel entrances and exits, dim lighting inside tunnels, and reflections from water on the road surface. All images undergo a unified preprocessing process of scaling and numerical normalization. After processing, the images are directly fed into the backbone feature extraction network. By using multi-layer convolutional operations combined with residual connection structures, three types of feature information are extracted simultaneously: the bottom layer of road surface texture, the middle layer of vehicle outline, and the top layer of vehicle model semantics. This fully captures key details that distinguish vehicles, such as headlights, body lines, and vehicle model markings, and generates an original high-dimensional feature map that integrates multi-dimensional spatial and semantic information. In each convolutional extraction operation, the backbone feature extraction network simultaneously divides the image into an illumination-sensitive channel and a semantically stable channel. Both channels use convolutional kernels of identical specifications to perform feature extraction in parallel. The illumination-sensitive channel specifically collects all feature information related to the overall brightness of the image, local contrast, and the light gradient between the road surface and the vehicle body. It can completely record the large-scale light difference formed by the alternation of strong light at the tunnel entrance and the dark light inside the tunnel. The semantically stable channel separately retains feature information related to the complete outline of the vehicle body, the texture structure of the body, and the inherent category attributes of the vehicle type. It can prevent the variable lighting in the tunnel from obscuring the vehicle body recognition features. The feature data extracted independently by the two channels are spliced and integrated at the network output port in a fixed preset order. The original high-dimensional feature map output by the backbone feature extraction network is partitioned and stored according to the attributes of the two channels. All subsequent illumination correction operations are limited to the numerical range corresponding to the illumination-sensitive channel and will not change the features of the semantically stable channel used to distinguish vehicle types, ensuring that the core features of vehicle identification are not affected by the correction operations. The backbone feature extraction network outputs content at each level corresponding to tunnel lighting disturbance responses of different granularities. Shallow layer outputs capture pixel-level instantaneous brightness fluctuations, accurately identifying single-point brightness abrupt changes caused by strong light spots at tunnel entrances and road surface reflections. Mid-layer outputs cover continuous brightness distribution at the region level, completely recording the grayscale discontinuities of the vehicle body formed by large shadow areas within the tunnel. Deep layer outputs identify semantic-level global lighting shifts, distinguishing between two types of differentiated lighting interference: overexposure from strong light at tunnel entrances and underexposure from dark light inside the tunnel. Independent skip connections are established between adjacent layers of the network, continuously transmitting all lighting feature information captured at each level. This allows the final high-dimensional feature map output by the network to fully integrate multi-level tunnel lighting distortion features and vehicle model semantic features, completely preserving all lighting distortion details at different scales within the image. This facilitates accurate positioning of every lighting anomaly area caused by alternating strong and dark light in the subsequent lighting compensation stage, reducing the degree of occlusion of key features of the vehicle body and model markings by extreme tunnel lighting from the feature extraction stage. Figure 2 As shown.
[0027] The generated original high-dimensional feature map is fed into the illumination feature perception module to generate a fixed-dimensional implicit illumination representation vector. The module adopts a collaborative processing logic of regional aggregation combined with global encoding. First, the entire original high-dimensional feature map is equally divided into multiple independent spatial sub-regions of uniform area. Then, a channel-dimensional global average pooling operation is performed on each sub-region to generate an equal number of independent regional illumination feature vectors. The independent illumination intensity data of the strong light area at the tunnel entrance, the dark light area in the middle of the tunnel, and the reflective area on the road surface are retained separately to avoid the average dilution and loss of local extreme illumination information during feature fusion. All regional illumination feature vectors are uniformly fed into a global encoding network for deep fusion processing. The module additionally adds an auxiliary semantic classification branch structure, and simultaneously enables a mechanism combining gradient inversion and adversarial constraints to continuously reduce the branch's ability to distinguish different vehicle models and types. This forces the network to actively strip away semantic content related to vehicle body and model identification during information extraction, ensuring that the final generated implicit illumination representation vector completely retains all relevant information about the global illumination intensity and local brightness distribution of the image. At the same time, it significantly reduces the interference of vehicle ontological semantic information on illumination features, achieving effective separation of tunnel illumination features and vehicle recognition semantic features. The output is an implicit illumination representation vector with constant dimension and no fluctuations, providing a clean illumination level judgment basis without vehicle semantic redundancy interference for the subsequent projection matrix generation network. This ensures that the subsequently generated projection matrix only generates corresponding adjustment weights for illumination distortion in the tunnel scene, and the accuracy of weight judgment is not affected by vehicle body color and model appearance.
[0028] The implicit illumination representation vector output from the previous step is completely input into the projection matrix generation network. The network relies on a two-layer fully connected nonlinear mapping structure to complete the generation operation of the illumination distortion projection matrix. During the operation, the linear rectified activation function and the sigmoid activation function are called in sequence to complete the multi-layer numerical mapping transformation. The numerical transformation process is completed by the weight matrix and bias vector of the two fully connected layers. The illumination distortion projection matrix is generated and the channel dimension is completely matched with the total number of channels of the original high-dimensional feature map. A quantifiable correspondence between the intensity of illumination disturbance in the tunnel image and the offset of the feature channel is stably established, so that each strong light and dark light fluctuation in the tunnel can be matched with a dedicated channel offset adjustment weight. The projection matrix generation network incorporates a hierarchical mapping mechanism. It directly determines the illumination distortion level of the current tunnel driving image based on the global illumination information carried by the implicit illumination representation vector. The mild distortion range corresponds to an implicit illumination representation vector magnitude of 0 to 0.28, with an offset weight adjustment range of 0 to 0.22. The moderate distortion range corresponds to an implicit illumination representation vector magnitude of 0.28 to 0.62, with an offset weight adjustment range of 0.22 to 0.65. The severe distortion range corresponds to an implicit illumination representation vector magnitude of 0.62 to 1, with an offset weight adjustment range of 0.65 to 0.98. The mild distortion range, formed by uniform light attenuation in the middle of the tunnel, corresponds to a smaller offset weight adjustment range, applied only to illumination-sensitive channels. The amplitude correction does not alter the key recognition features corresponding to the vehicle body lines and vehicle identification. The large offset weight adjustment range corresponding to the severe distortion range caused by strong direct light and road surface reflection at the tunnel entrance and exit fully offsets the feature value shift caused by extreme strong light overexposure and dark light underexposure. All offset weights within the illumination distortion projection matrix will adaptively and dynamically adjust according to the real-time determined illumination distortion level, accurately matching the actual illumination disturbance level in the current tunnel driving scenario. This prevents insufficient correction strength from failing to eliminate feature distortion caused by alternating strong and dark light, or excessive correction strength from smoothing out subtle vehicle markings, headlight outlines, and other vehicle identification features, thus balancing the illumination compensation correction effect with the retention effect of core vehicle recognition features.
[0029] The original high-dimensional feature map and the generated illumination distortion projection matrix are simultaneously sent to the feature offset compensation module. The module first copies and expands the illumination distortion projection matrix along all spatial dimensions of the feature map, so that the vehicle body and road surface feature points corresponding to each spatial coordinate position in the tunnel image can accurately match their own channel-specific offset weights, eliminating the problem of imbalance in correction force caused by uneven distribution of local strong light and local dark light in the tunnel. The core module performs channel-by-channel, element-by-element feature correction operations. The entire process relies on element-by-element multiplication to complete the unidirectional numerical compression correction of the original features. It strictly constrains all elements of the illumination distortion projection matrix to be within the 0-1 range, ensuring that the correction process only performs numerical compression and does not result in the reverse amplification and distortion of vehicle feature values. Simultaneously, it introduces feature gradient constraints to calculate the compensation adjustment coefficient matrix. Based on the normalized gradient magnitude of the corresponding channel at each spatial coordinate position of the original high-dimensional feature map, the coefficients are solved. Vehicle body edges, headlight contours, and vehicle identification corners with high gradient magnitudes will generate smaller compensation adjustment coefficients, actively reducing the correction intensity applied by the illumination distortion projection matrix to these areas. This prevents the most distinguishable vehicle contours and identification features from being blurred or flattened by the illumination compensation operation, while features with low gradient magnitudes will be... In areas with smooth road surfaces and large areas of solid-color paint on the vehicle body, a larger compensation adjustment coefficient is generated to maintain the standard offset correction effect and fully eliminate feature value distortion caused by road surface reflection and large-area brightness difference on the vehicle body. Subsequently, the generated compensation adjustment coefficient matrix is used to perform correction and optimization on the basic channel-by-channel and element-by-element feature correction operation. The entire compensation operation only adjusts the magnitude of the internal numerical values of the features, without changing the spatial size or the total number of channels of the original feature map, nor changing the inherent spatial relative position relationship of all feature points. Finally, the target feature map with global illumination correction is output. The entire correction process is performed entirely within the high-dimensional feature space, without changing the original image pixels of the tunnel driving, and will not cause pixel-level image damage problems such as loss of vehicle body color or blurring of marking details.
[0030] The corrected target feature map is fed into the image recognition classification head for tunnel vehicle target recognition. Before the classification head officially starts global aggregation and fully connected classification operations, a feature distribution calibration operation is performed first to quantify the deviation between the current channel features and the vehicle features under standard uniform illumination. A preset threshold of 0.18 is fixed. The feature distribution offset of each channel is compared with the preset threshold individually. Once the channel feature distribution offset exceeds 0.18, it means that the channel still has a significant numerical deviation caused by extreme tunnel illumination. Then, supplementary numerical calibration is performed on this channel to reduce the distribution gap between the channel features and the standard illumination reference. All channels... After completing the calibration process, the calibrated target feature map is sent to the global feature aggregation layer to integrate the global feature information of the whole vehicle. Then, it is connected to the fully connected classification layer to perform the final classification operation, and outputs the recognition probability distribution results corresponding to different vehicle types such as small cars, large buses, and freight vehicles. The entire illumination adaptive correction process is fully embedded in the intermediate link between the backbone feature extraction network and the output results of the classification head. There is no need to build a separate image pixel preprocessing module, which reduces the computing power load of the tunnel vehicle recognition equipment in real time. At the same time, it eliminates the complex illumination interference of backlight at the entrance and exit and alternating dark light inside from the feature dimension, which significantly improves the recognition stability and recognition accuracy of various vehicles in the tunnel driving scenario.
[0031] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.
Claims
1. A method for adaptive enhancement and recognition of complex illumination based on image recognition, characterized in that, The method includes: S1. Obtain the complex lighting scene image to be identified, and input it into the backbone feature extraction network after completing the size and numerical normalization process. Extract image features through multi-layer convolution operation and residual connection structure to generate low-level texture features, mid-level contour features and high-level semantic features, and output the original high-dimensional feature map containing multi-dimensional information. S2. Input the original high-dimensional feature map into the illumination feature perception module, perform hierarchical aggregation processing on the spatial and channel dimensions of the feature map, filter and extract feature components related to illumination distortion, and generate an implicit illumination representation vector that simultaneously represents global illumination intensity and local illumination distribution. S3. Input the implicit representation vector of illumination into the projection matrix generation network, and generate an illumination distortion projection matrix that matches the channel dimension of the original high-dimensional feature map through a multi-layer nonlinear mapping structure, and establish a quantitative mapping relationship between the intensity of illumination disturbance and the offset of feature channel. S4. Input the original high-dimensional feature map and the illumination distortion projection matrix into the feature offset compensation module simultaneously. Based on the offset weights corresponding to each channel in the projection matrix, perform channel-by-channel and spatial position-by-spatial feature offset reverse compensation on the original high-dimensional feature map and output the corrected target feature map. S5. Input the corrected target feature map into the image recognition and classification head, and output the target category recognition result of the corresponding image through global feature aggregation and fully connected classification operation.
2. The method for adaptive enhancement and recognition of complex illumination based on image recognition according to claim 1, characterized in that, In S1, the backbone feature extraction network simultaneously divides the light-sensitive channel and the semantically stable channel during the convolution extraction process. The two types of channels use the same convolution kernel size to perform feature extraction in parallel. The light-sensitive channel carries feature information related to image brightness, contrast, and light-dark gradient, while the semantically stable channel carries feature information related to target body contour, texture structure, and category attributes. The features of the two types of channels are concatenated and integrated in a fixed order before output. The original high-dimensional feature map output by the backbone feature extraction network is stored in partitions according to channel attributes. The scope of subsequent illumination correction operations is limited to the corresponding interval of the light-sensitive channel.
3. The method for adaptive enhancement and recognition of complex illumination based on image recognition according to claim 1, characterized in that, In S1, the output of each layer of the backbone feature extraction network corresponds to the illumination perturbation response of different granularities. The shallow features correspond to pixel-level brightness fluctuations, the medium-level features correspond to region-level brightness distribution, and the deep features correspond to semantic-level illumination shifts. Independent skip connections are set between each layer to transmit the illumination feature information of each layer. The original high-dimensional feature map output by the backbone feature extraction network is fused with multi-level illumination perturbation features and target semantic features, thus fully preserving illumination distortion information at different scales.
4. The method for adaptive enhancement and recognition of complex illumination based on image recognition according to claim 1, characterized in that, In S2, the illumination feature perception module generates implicit illumination representation vectors by combining regional aggregation and global encoding. First, the original high-dimensional feature map is divided into multiple equal spatial sub-regions, and global average pooling of the channel dimension is performed on each sub-region to obtain the corresponding number of regional illumination feature vectors. Then, all regional illumination feature vectors are input into the global encoding network for fusion processing. By introducing an auxiliary semantic classification branch and using gradient reversal or adversarial constraint mechanisms, the branch's ability to distinguish semantic categories is weakened. This allows the extracted implicit illumination representation vectors to maintain illumination information while suppressing interference from target semantic information, and finally outputs a fixed-dimensional implicit illumination representation vector.
5. The method for adaptive enhancement and recognition of complex illumination based on image recognition according to claim 1, characterized in that, In S3, the projection matrix generation network generates the illumination distortion projection matrix through two layers of fully connected nonlinear mapping. The specific calculation formula is as follows: ,in, This is the implicit representation vector of illumination; For the illumination distortion projection matrix, The total number of channels in the original high-dimensional feature map; , This is the weight matrix corresponding to the two fully connected layers; , These are the bias vectors corresponding to the two fully connected layers. Let be the dimension of the implicit representation vector of illumination. For the hidden layer dimension; It is a linear rectification activation function; This is the Sigmoid activation function.
6. The method for adaptive enhancement and recognition of complex illumination based on image recognition according to claim 1, characterized in that, In S3, the illumination distortion projection matrix output by the projection matrix generation network adopts a hierarchical mapping mechanism. The projection matrix generation network first determines the illumination distortion level of the current image based on the implicit illumination representation vector, dividing it into three level intervals: mild distortion, moderate distortion, and severe distortion. Different distortion levels correspond to different mapping weight scaling coefficients. The mild distortion interval corresponds to a smaller offset weight adjustment range, while the severe distortion interval corresponds to a larger offset weight adjustment range. The offset weight of the illumination distortion projection matrix is dynamically adjusted according to the illumination distortion level to match the degree of illumination disturbance in the current scene.
7. The method for adaptive enhancement and recognition of complex illumination based on image recognition according to claim 1, characterized in that, In S4, the feature offset compensation module performs a channel-by-channel, element-by-element feature correction operation, calculated using the following formula: ,in, This is the corrected target feature map; P is the original high-dimensional feature map; J is the illumination distortion projection matrix; J is a matrix of all ones with the same dimension as P. This represents element-wise multiplication; the element range of the illumination distortion projection matrix P is (0,1), and the element range of (J−P) is also (0,1), so as to achieve unidirectional numerical compression correction of the original features; before the operation, the feature offset compensation module first copies and expands the illumination distortion projection matrix along the spatial dimension of the feature map, so that the feature points at each spatial position of the feature map are matched with the offset weight of the corresponding channel; the compensation operation directly acts on the feature values, without changing the spatial size and the total number of channels of the feature map, and without changing the spatial relative position of the feature points.
8. The method for adaptive enhancement and recognition of complex illumination based on image recognition according to claim 1, characterized in that, In S4, the feature offset compensation module introduces feature gradient constraints when performing channel-by-channel compensation. is the normalized gradient magnitude of the c-th channel at spatial coordinate (i,j) of the original high-dimensional feature map, with a value range of [0,1]. The formula for the compensation adjustment coefficient is: ,in, λ is the compensation adjustment coefficient for the c-th channel at spatial coordinate (i,j); λ∈(0,1] is the preset gradient constraint constant. Then, the feature offset compensation module corrects the channel-by-channel and element-by-element feature correction operation based on the compensation adjustment coefficient. The corrected relationship is as follows: ,in, This is the corrected target feature map; The original high-dimensional feature map is represented by P; P is the illumination distortion projection matrix; J is a matrix of all ones with the same dimension as P; α is the matrix of all ones with the same dimension as P. The compensation adjustment coefficient matrix of the same dimension is composed of each of the aforementioned Arranged according to space and passageways; This indicates element-wise multiplication. In this process, regions with higher gradient magnitudes correspond to smaller α values, thereby reducing the offset correction intensity of the illumination distortion projection matrix P in that region; regions with lower gradient magnitudes correspond to larger α values, maintaining the standard offset correction intensity; the compensation process only adjusts the feature numerical magnitudes and does not change the spatial distribution structure of the features.
9. The method for adaptive enhancement and recognition of complex illumination based on image recognition according to claim 1, characterized in that, In S5, the image recognition classification head performs feature distribution calibration before classification calculation, and performs channel-level matching between the corrected target feature map and the preset standard illumination feature distribution benchmark to determine the feature distribution offset of each channel. Supplementary numerical calibration is performed on channels whose feature distribution offset exceeds a preset threshold. The preset threshold ranges from 0.1 to 0.
3. When the feature distribution offset is greater than the preset threshold, it is determined to be excessive. After calibration, the feature map is input into the global aggregation layer and the fully connected classification layer, and the final target category recognition probability distribution is output.