A method for image illumination correction based on support vector regression

By combining DenseNet201 and FLA-optimized SVR models, the problems of low prediction accuracy and overfitting of image lighting correction models in the prior art are solved, efficient and accurate lighting correction effects are achieved, the real color of the object is restored, and accurate color information is provided for computer vision tasks.

CN117151998BActive Publication Date: 2025-08-19BEIJING JIAXINYUAN TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310940154.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-28
Publication Date
2025-08-19
Estimated Expiration
2043-07-28

AI Technical Summary

Technical Problem

The existing image lighting correction model has low prediction accuracy, is prone to overfitting, and has weak generalization ability. It cannot effectively eliminate the impact of external ambient lighting on photography and imaging, resulting in inaccurate recovery of object color.

Method used

The DenseNet201 model based on transfer learning is used for image lighting feature extraction, and combined with Fick's Law algorithm (FLA) to optimize the support vector regression (SVR) model, and the stability and prediction performance of the model are improved by optimizing the penalty factor, kernel parameters and soft boundaries.

Benefits of technology

It realizes the efficiency and accuracy of image lighting correction, restores the real color of the object, provides accurate color information for computer vision engineering tasks, and has excellent prediction accuracy and good convergence.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117151998B_ABST
    Figure CN117151998B_ABST
Patent Text Reader

Abstract

This invention discloses a method for image illumination correction based on support vector regression. The method comprises the following steps: preparing and preprocessing a dataset; performing dataset preprocessing; extracting image features using DenseNet201; training a FLA-SVR model; and outputting the illumination correction results. This method eliminates the effects of ambient lighting on photographic imaging, restoring the true color of objects, and thus providing accurate color information for computer vision-related engineering tasks. The model exhibits excellent prediction accuracy, good convergence, and stability, improving the efficiency and accuracy of illumination correction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image illumination correction, and in particular relates to an image illumination correction method based on support vector regression. Background Art

[0002] Currently, the application scope of photographic imaging is expanding, and in many engineering tasks, the requirements for photographic quality are becoming increasingly stringent. However, photographic imaging is affected by environmental factors and other factors. Most images captured by image sensors contain color errors, which significantly disrupts engineering operations. Therefore, it is crucial to eliminate the influence of external lighting on photographic imaging, restore the true color of objects, and provide accurate color information for computer vision-related engineering tasks.

[0003] Currently, in the field of image illumination correction technology, the following convolutional neural networks are commonly used, such as ResNet, EfficientNet, GooleNet and other typical neural networks. ResNet has the advantages of a deeper network structure and efficient use of resources, but it is prone to overfitting, poor interpretability, and a large number of parameters. GooleNet's neural structure is relatively simple and may not be able to meet production needs. EfficientNet has the characteristics of high precision, high efficiency, and scalability, but it also has the disadvantages of long training time, unsuitability for small data sets, and a large number of parameters. The SVR (support vector regression) model has good robustness to noise and outliers in the data, but if the hyperparameters are not well adjusted, it is easy to fall into overfitting, affecting its prediction performance. Therefore, it is urgent to propose an image illumination correction method based on support vector regression with excellent prediction performance. Summary of the Invention

[0004] The purpose of this invention is to address the problems of low prediction accuracy, easy overfitting, and weak generalization ability of existing illumination correction models. An image illumination correction method based on support vector regression (SVR) optimized by the Fick's Law Algorithm (FLA) is proposed to achieve high efficiency and accuracy in illumination correction work and provide real object color data for computer vision engineering tasks.

[0005] The present invention provides an image illumination correction method based on support vector regression, comprising the following steps:

[0006] Step 1: Acquire images, form a dataset and perform preprocessing

[0007] The images include photos taken indoors, outdoors, under cloudy and sunny conditions. The length and width of the photos are all set to 224×224, regularized, mapped to the normal distribution function, and then converted into a matrix for input into the DenseNet201 model;

[0008] Step 2: Get the DenseNet201 feature extraction network based on transfer learning

[0009] Use the ImageNet dataset to pre-train to obtain the weight parameters of the initial network model DenseNet201.

[0010] Performing transfer learning on the initial network model DenseNet201 and fine-tuning the network parameters of the initial network model DenseNet201 to obtain a DenseNet201 feature extraction network;

[0011] Step 3: Use the DenseNet201 feature extraction network to extract image features

[0012] The data set obtained in step 1 is divided into a training set and a test set, the data in the training set is input into the DenseNet201 feature extraction network obtained in step 2, and PCA dimension reduction is performed, and finally the image illumination features are saved;

[0013] The dimension of the PCA dimensionality reduction is a parameter that needs to be adjusted. By adjusting the dimension of the dimensionality reduction, the dimension of the PCA dimensionality reduction that minimizes the error of the prediction result is found;

[0014] Step 4: Optimize the SVR model using the FLA algorithm

[0015] (4.1) Obtain the parameters of the FLA algorithm, and use the FLA algorithm to optimize the SVR model to obtain the penalty factor, kernel parameters, and soft margin of the SVR model;

[0016] The FLA algorithm parameters include population size and number of iterations;

[0017] The penalty factor is used to ensure the performance and stability of SVR. The kernel parameter is a parameter used to define the kernel function in SVR. Selecting an appropriate kernel parameter can improve the generalization performance of the model. The soft margin is a feature of SVR that allows a certain amount of error to exist between the support vector and the decision boundary.

[0018] (4.2) Using the image illumination features obtained in step 3 in combination with the FLA algorithm, the penalty factor, kernel parameters, and soft margin of the SVR model are set to the values obtained in step (4.1) to obtain a FLA-SVR model, and training the FLA-SVR model to obtain a trained FLA-SVR model;

[0019] Step 5: Obtain the image to be processed and process it using the trained FLA-SVR model to obtain the R, G, and B values of the image to be processed. Restore the image through diagonal matrix transformation and output the illumination correction result.

[0020] Preferably, in step 1, the image obtained is from the Cube++ dataset;.

[0021] Preferably, in step 1, the dimension of the PCA dimensionality reduction with the minimum error is 60.

[0022] Preferably, in step 4, obtaining the FLA algorithm parameters includes the following steps:

[0023] The population size is set to 10, 20, 30, 40, 50, and the number of iterations is set to 10, 15, 20, 25, 30. Different combinations of population size and iteration number are performed to obtain the effects of different combinations on the prediction accuracy error.

[0024] The mean square error of the R and G values of the images in the test set is selected to judge the accuracy of the algorithm prediction; the root mean square error of the R and G values is used as the fitness function:

[0025]

[0026]

[0027]

[0028] Among them, R Value Test Err is the mean square error of R value, G Value Test Err is the mean square error of G value, n is the number of samples, r i-pt and g i-pt is the predicted value of R value and G value, r i-rl and g i-rl is the true value of R value and G value; the smaller the mean square error of R value and G value and the smaller Fitness is, the closer the predicted R value and G value are to the true R value and G value.

[0029] Preferably, in step 4, the FLA algorithm parameters are specifically: population size 30, number of iterations 25.

[0030] The algorithm proposed in this invention combines the DenseNet201 model and the FLA-SVR model to perform RGB prediction on the image illumination dataset. It not only has the rich feature extraction capability of DenseNet201, but also has the excellent prediction performance of FLA-SVR. The DenseNet201-FLASVR algorithm is mainly divided into two parts. The first part is to use the DenseNet201 feature extractor to extract the image illumination feature information of the global average pooling layer. The second part is to use the FLA-SVR model to predict the extracted features. Because the FLA-SVR model uses the FLA algorithm to optimize the kernel parameters, soft boundaries, and penalty factors of SVR, it avoids the problem of unstable and inaccurate prediction results due to the randomness of SVR parameters.

[0031] The present invention has the beneficial effects:

[0032] This paper proposes an image illumination correction model that combines the transfer learning-based DenseNet201 with support vector regression (SVR) optimized using Fick's Law Optimization (FLA). First, the transfer learning-based DenseNet201 is used to extract image illumination feature information, reducing computational complexity and improving performance. Furthermore, the FLA optimization algorithm is introduced for SVR optimization. The optimized SVR is used to estimate image illumination, and finally, image restoration is performed. Because FLA has a superior gradient-free mechanism and high local optimum avoidance capability compared to other traditional optimization algorithms, it is used to iteratively search for the optimal configuration combination of the penalty factor, kernel parameter, and soft boundary parameters in SVR, thereby obtaining a FLA-SVR illumination correction model with improved prediction performance. After obtaining the predicted illumination information using the optimized model, the image is restored using a diagonal transformation method. Experimental results show that compared to the other nine models, the DenseNet201-FLASVR proposed in this paper has smaller average angular and chromaticity errors and better convergence and stability.

[0033] The present invention uses DenseNet201 to extract image illumination features. Since the neural network adopts a dense connection method and the model has the characteristics of reducing the amount of calculation, requiring fewer adjustment parameters, having good anti-overfitting performance, and strong generalization ability, the number of extracted features is richer and the performance is better than ResNet.

[0034] This paper uses SVR optimized using the FLA algorithm. Since SVR performance is heavily dependent on the kernel parameter and the penalty factor, the introduction of soft margins can make the model more robust and overcome the effects of small amounts of noise and outliers. Furthermore, soft margins increase the model's flexibility, allowing samples that do not meet strict boundary conditions to be considered, thereby improving the model's predictive capabilities. Therefore, the FLA algorithm is used to find the optimal configuration of these three parameters to improve prediction accuracy.

[0035] This method can perform illumination correction on original images, eliminating the effects of ambient lighting on photographic imaging and restoring the true color of objects, thereby providing accurate color information for computer vision-related engineering tasks. The model boasts excellent prediction accuracy, good convergence, and stability, improving the efficiency and accuracy of illumination correction, and is widely applicable to computer vision-related engineering tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 is a flow chart of the present invention;

[0037] Figure 2 It is a model diagram of the DenseNet201-FLASVR algorithm constructed by the present invention;

[0038] Figure 3 This is the image illumination feature information extraction process in the present invention;

[0039] Figure 4 It is the Densenet201 feature extraction network structure in the present invention;

[0040] Figure 5 This is a box plot of the chromaticity value error between DenseNet201-FLASVR and other algorithms;

[0041] Figure 6 This is a box plot of the angle value error between DenseNet201-FLASVR and other algorithms;

[0042] Figure 7 It is the iterative convergence curve of DenseNet201-FLASVR of the present invention and other algorithms; DETAILED DESCRIPTION

[0043] The present invention will be further described below with reference to the accompanying drawings.

[0044] like Figure 1As shown in the figure, an image illumination correction model based on support vector regression (SVR) is described. First, a dataset is prepared and preprocessed, a DenseNet feature extraction network is obtained through transfer learning, and then the DenseNet is used as a feature extractor to extract image features. The FLA-SVR model is trained and finally the illumination correction result is output. The model includes the following steps:

[0045] The present invention comprises the following steps:

[0046] Step 1: Prepare the dataset and perform preprocessing

[0047] (1.1) Selecting a Dataset

[0048] The present invention requires the use of a corresponding dataset suitable for illumination correction, so the Cube++ dataset is used. It contains photos taken in various situations such as indoors, outdoors, on cloudy days, and on sunny days. The Cube++ dataset is an extension of the Cube+ dataset, which is mainly used to estimate illumination and thus solve the problem of color constancy. The dataset contains 4,890 images of different scenes under different conditions, 200GB of raw data and preprocessed data. In order to calculate the ground truth illumination, the researchers placed a calibration object with a known surface color in each scene. This dataset can be used to train and test single-light source or dual-light source estimation methods, which is superior to many existing similar datasets.

[0049] (1.2) Dataset preprocessing

[0050] The images in the dataset were all resized to 224×224. The images were normalized and mapped to a normal distribution function. These images were then converted into high-order matrices and fed into the DenseNet201 model for inference. To maximize efficiency, 32 images were processed in parallel at a time.

[0051] With the development of convolutional neural networks, typical neural networks such as DenseNet, ResNet, EfficientNet, and GoogleNet have been proposed. ResNet has the advantages of a deeper network structure and efficient resource utilization, but it is prone to overfitting, poor interpretability, and a large number of parameters. GoogleNet has a relatively simple neural network structure and may not be suitable for production needs. EfficientNet is characterized by high accuracy, efficiency, and scalability, but it also has the disadvantages of long training time, unsuitability for small datasets, and a large number of parameters.

[0052] The DenseNet model has the characteristics of reduced computational effort, fewer parameter adjustments, good resistance to overfitting, and strong generalization capabilities. It also uses dense connections, which may improve performance efficiency compared to other networks. This network directly connects all layers, effectively ensuring a greater degree of complete transmission between layers. If there are L layers in a DenseNet network, that is, there will be L*(L+1) / 2 connections, the formula is as follows:

[0053] x l =H l ([x0,x1,...,x l-1 ])

[0054] Among them, x l is the output feature map of layer l, [x0,x1,...,x l-1 ] is the concatenation of the feature maps of all layers before layer l. Therefore, compared with other traditional convolutional neural networks, DenseNet can effectively improve the propagation and utilization efficiency of features, thereby enriching the extracted features and further improving the accuracy of the final result.

[0055] Step 2: Get the DenseNet201 feature extraction network based on transfer learning

[0056] First, we pre-trained the ImageNet dataset to obtain the weight parameters of the initial network model DenseNet201. Then, we migrated the weight parameters to our initial network model through transfer learning and fine-tuned the network parameters to obtain the DenseNet201 feature extraction network. This network was used as the feature extractor for subsequent image feature extraction.

[0057] Step 3: DenseNet201 for image feature extraction

[0058] The proposed algorithm combines the DenseNet201 model with the FLA-SVR model to perform RGB prediction on image illumination datasets. This algorithm combines the rich feature extraction capabilities of DenseNet201 with the excellent prediction performance of FLA-SVR. The previous step generates a DenseNet201 feature extraction network based on transfer learning. This step details how to use the DenseNet201 feature extraction network for image feature extraction.

[0059] The present invention uses DenseNet201 to extract image features. The specific process is as follows: Figure 3To perform illumination correction, the dataset must first be prepared and preprocessed. The dataset is then divided into training and test sets, and labels and feature data are extracted. The training set is then processed using DenseNet201 to extract image illumination features, followed by PCA (Principal Component Analysis) dimensionality reduction. Finally, the image illumination features are saved for subsequent model training.

[0060] (3.1) DenseNet201 extracts image illumination features

[0061] First, in this experiment, we used the DenseNet201 feature extraction network based on transfer learning and adjusted its parameters. Since this experiment was a prediction experiment rather than a classification experiment, the classification head parameter value was set to False. The image illumination data was input into the network model, and the output features of the global average pooling layer were extracted. Figure 4 It is the feature extraction backbone structure of the DenseNet201 network.

[0062] (3.2) PCA (Principal Component Analysis) Dimensionality Reduction

[0063] DenseNet201 extracts high-dimensional features, but the final output image is three-dimensional. SVR can only be used for further feature processing, not dimensionality reduction or feature fusion. Furthermore, SVR cannot process such high-dimensional feature information all at once. Therefore, feature fusion and dimensionality reduction are necessary for the features extracted by DenseNet201. A commonly used dimensionality reduction method is PCA. The idea behind PCA is to find a coordinate system that maps n-dimensional features to m-dimensional features while preserving the most feature information.

[0064] In this experiment, the dimension of PCA dimensionality reduction is also a parameter that needs to be adjusted. By continuously adjusting the dimension of dimensionality reduction, we can find the most suitable situation to minimize the error of the final prediction result.

[0065] (3.2.1) Obtaining PCA parameters

[0066] Here we specifically explain how to obtain PCA parameters through experiments.

[0067] The feature dimension of the image obtained by DenseNet201 is 7*7*1920, which is too large to be directly processed by the SVR model. Therefore, PCA technology is used to reduce the number of extracted features. However, if the dimensionality is reduced too low, some information will be lost, which cannot ensure the full utilization of feature information and may lead to a loss of accuracy. However, if the dimensionality is too large, the computational complexity may be too large for the SVR model to handle directly. To find the appropriate PCA parameters, the PCA parameters are set to 10, 20, 30, 40, 50, 60, 70, 80, 90, and 100.

[0068] Table 1 Effect of PCA parameters on prediction accuracy

[0069]

[0070]

[0071] As shown in Table 1, when the PCA parameter is set to 60, the fitness is the smallest and the prediction accuracy is the highest. Therefore, the PCA parameter is set to 60. In subsequent experiments, the PCA parameter will be set to 60.

[0072] (3.3) Save image lighting features

[0073] The image illumination features are extracted by DenseNet201 and PCA (principal component analysis) is used for dimensionality reduction to obtain the required training set features and save them for later use in training the FLA-SVR model.

[0074] Step 4: Train the FLA-SVR model

[0075] The ultimate goal of this invention is to use the FLA-SVR model to predict the extracted features, so a trained FLA-SVR model must be obtained first. This model uses the FLA algorithm to optimize the kernel parameters, soft margins, and penalty factors of SVR, avoiding the problem of unstable and inaccurate prediction results caused by the randomness of SVR parameters. Figure 2 As shown in the figure, the algorithm first uses DenseNet201 to extract the image illumination features of the training set, and then combines the obtained training set features with the FLA optimization algorithm to obtain the optimal penalty factor (C), kernel parameter (σ) and soft boundary (epsilon) combination, further completing the training of the FLA-SVR model and obtaining the required FLA-SVR model weight coefficient.

[0076] This step mainly explains how to obtain the required FLA algorithm parameters and SVR model parameters through experiments, as well as the final FLA-SVR model weight coefficients, thereby obtaining a trained model.

[0077] First, the FLA algorithm and SVR model are briefly introduced.

[0078] 1.FLA algorithm

[0079] The present invention introduces a physics-based meta-heuristic algorithm, the Fick's Law Optimization Algorithm, or FLA for short. The algorithm is mainly based on Fick's first law of diffusion, which is the rule that molecules diffuse towards equilibrium due to concentration differences. Compared with other traditional optimization algorithms, the algorithm has a gradient-free mechanism and a high degree of local optimal avoidance ability. It can search for agents covering a large part of the search space in the early iteration to avoid local solutions, and then conduct continuous exploration and development, switching to local search to select the optimal solution from a large number of candidate solutions, thereby improving accuracy. The algorithm idea is to find a solution close to the optimal solution by simulating the diffusion movement of molecules. The algorithm regards the solution to the problem to be optimized as the position of each molecule, the objective function as the energy of the molecule, and uses Fick's law of diffusion to describe the movement process between molecules. In each iteration, the molecule chooses the movement direction and step size according to probability, and decides whether to accept the new position based on the change of the objective function. Through continuous iterative updates, the algorithm can gradually converge to the global optimal solution.

[0080] In order to verify the feasibility and performance of the FLA algorithm for lighting correction, this paper uses five complex test functions to test the performance.

[0081] The dimension of the five test functions is D = 30. The parameters of the FLA algorithm are set as follows: population size m = 30, dimension D = 30, maximum number of iterations k = 500, c1 = 0.5, c2 = 2, c3 = 0.1, c4 = 0.2, c5 = 2.

[0082] The results show that the FLA optimization algorithm also has high convergence accuracy on five different test functions. When the number of iterations reaches 60, the FLA algorithm finally reaches the minimum directly on the Griewank and Rastrigin functions. Therefore, the FLA algorithm has a good solution effect.

[0083] 2.SVR Model

[0084] Support Vector Regression (SVR) is a supervised learning algorithm used for prediction and classification. Its fundamental goal is to find one or more hyperplanes that maximize data classification. The data classification problem in SVR can be described as: the system generates a hyperplane and continuously adjusts it until a point belonging to two types in the data set lies on both sides of the hyperplane, and the distance between the two sides of the hyperplane is as large as possible. In the sample space, the classification of the hyperplane can be described by a linear equation function:

[0085] ωT x+b=0

[0086] In the above formula, ω is the normal vector of the hyperplane, which represents the direction of the hyperplane. b is a displacement term, which represents the distance between the origin and the hyperplane. i ,y i )∈D, where x i Represents the input value, y i To represent the output value, we have the following expression:

[0087] ω T x i +b≥1,y i =+1

[0088] ω T x i +b≤1,y i =-1

[0089] However, since the data points in the data set may be discretely distributed, a slack variable ξ is introduced i and This transforms the mathematical problem into a corresponding constrained optimization problem as follows:

[0090]

[0091] In the above formula, C is the penalty factor, one of the parameters of the SVR that needs to be optimized in this paper. C is a predefined balance parameter used to balance the conflict between empirical risk and structural risk. Furthermore, SVR performance is also affected by the kernel function, which is primarily used to address overfitting. Kernel functions are categorized into linear kernels and Gaussian kernels. The Gaussian kernel parameters used in this paper can be expressed as follows:

[0092]

[0093] Among them, σ is the kernel parameter and is also one of the parameters that need to be optimized in this paper, which can adjust the complexity of the model.

[0094] To avoid the problem of unstable and inaccurate predictions caused by the randomness of SVR parameters, this paper uses the FLA algorithm to optimize the optimal combination of SVR penalty factor, kernel parameters, and soft margin. The results are shown in the figure, with the population size set to 10, 20, 30, 40, and 50, respectively. The average value is taken as the final result after 10 runs.

[0095] The optimal combination of penalty factor, kernel parameter and soft margin is in the range of [0, 1], so the value range of penalty factor, kernel parameter and soft margin of the FLA-SVR model proposed in this paper is set in [0, 1].

[0096] The following are the specific model training steps.

[0097] (4.1) FLA algorithm optimizes the SVR model

[0098] The penalty factor (C), kernel parameter (σ), and soft margin (epsilon) of the SVR model affect predictive performance. The penalty factor influences the complexity and error tolerance of the SVR model. If the penalty factor is set too high, the model prioritizes accuracy, potentially leading to overfitting. If the penalty factor is set too low, the model prioritizes generalization, potentially leading to underfitting. Therefore, selecting an appropriate penalty factor is crucial for ensuring SVR performance and stability. The kernel parameter defines the kernel function in SVR. Different kernel functions produce different decision boundaries. Different kernel functions also correspond to different kernel parameters. For example, the kernel parameter of the radial basis kernel is γ. Selecting an appropriate kernel parameter can improve the generalization performance of the model. A soft margin is a feature of SVR that allows a certain amount of error between the support vector and the decision boundary. The introduction of a soft margin makes the model more robust and can overcome the effects of small amounts of noise and outliers. Furthermore, a soft margin increases the model's flexibility, allowing for the inclusion of samples that do not meet the strict boundary conditions, thereby improving the model's predictive power. Therefore, to improve the predictive power of SVR, we can use the FLA algorithm to optimize these two parameters and introduce a soft margin to avoid overfitting. The following details how to obtain the FLA algorithm parameters through experiments and use the FLA algorithm to optimize the SVR model, obtaining the optimal combination of SVR model parameters such as the penalty factor (C), kernel parameter (σ), and soft margin (epsilon).

[0099] (4.1.1) Obtaining the optimal parameters of the FLA algorithm

[0100] This step experimentally determines the optimal parameters for the FLA algorithm for subsequent model optimization. Two key parameters in the optimization algorithm are the population size and the number of iterations. In this experiment, the population size was set to 10, 20, 30, 40, and 50, and the number of iterations was set to 10, 15, 20, 25, and 30, for a total of 25 combinations. This was done to examine the impact of these two parameters on prediction accuracy. The FLA-SVR model was run with each combination, and the final results were averaged across 10 runs.

[0101] In order to judge the accuracy of the algorithm prediction, the mean square error (MSE) of the R and G values of the test set in the data set and the root mean square error (RMSE) of the R and G values are selected as the fitness function:

[0102]

[0103]

[0104]

[0105] Among them, R Value Test Err is the mean square error of R value, G Value Test Err is the mean square error of G value, n is the number of samples, r i-pt and g i-pt is the predicted value of R value and G value, r i-rl and g i-rl is the true value of R and G. The smaller the mean square error of R and G and the smaller Fitness, the closer the predicted R and G values are to the true label.

[0106] Table 2 Effects of population size and iteration times on prediction accuracy

[0107]

[0108] As shown in Table 2, the algorithm's illumination estimation error is minimized when the parameter combination is 30 populations and 25 iterations. Subsequent increases in the population size and maximum number of iterations did not effectively improve the algorithm's prediction performance. Instead, they increased the amount of data computation and led to a decrease in accuracy. Therefore, the optimal parameters for the FLA algorithm are 30 populations and 25 iterations. This setting will be used in subsequent experiments.

[0109] (4.1.2) Obtain the optimal combination of SVR model parameters

[0110] The FLA algorithm is used to optimize the SVR model and obtain the optimal combination of SVR model parameters. Specifically, we randomly generate an initial population, then calculate the mean squared error (MSE) of the R and G values for each molecule and use the FLA algorithm to update the molecule's position. If the sum of the mean squared errors of the current R and G values is smaller than the sum of the mean squared errors of the historically optimal R and G values, the historically optimal solution is updated. These steps are repeated until the predetermined stopping condition is met. Finally, the individual with the best fitness function is selected as the final kernel parameter and penalty factor. By optimizing the objective function and constraints, we can select appropriate slack variables to achieve the optimal soft margin effect. This results in the final trained FLA-SVR model.

[0111] After obtaining and setting the FLA algorithm parameters, to avoid the problem of unstable and inaccurate prediction results caused by the randomness of the SVR parameters, the FLA algorithm was used to optimize the optimal combination of the SVR penalty factor, kernel parameters, and soft margin. The results were averaged 10 times with population sizes set to 10, 20, 30, 40, and 50, as shown in Table 3.

[0112] Table 3 Optimal combination of SVR model parameters

[0113]

[0114] It can be concluded from Table 3 that the optimal combination of penalty factor, kernel parameter and soft margin is in the range of [0, 1]. Therefore, the value range of penalty factor, kernel parameter and soft margin of the FLA-SVR model proposed in the present invention is set in [0, 1].

[0115] In this way, the optimal combination of parameters such as penalty factor, kernel parameter and soft margin of the SVR model is obtained and set accordingly in subsequent experiments.

[0116] (4.1.3) Obtain the weight coefficient of the FLA-SVR model

[0117] By using the training set features in the previously saved image illumination features and combining them with the FLA optimization algorithm, the penalty factor, kernel parameters, and soft boundary parameters of the SVR model are set to the optimal combination obtained in the previous step. The model is trained to further obtain the required FLA-SVR model weight coefficients, thereby obtaining the trained FLA-SVR model.

[0118] Step 5: Output the lighting correction results

[0119] After training the FLA-SVR model, the test set is fed into the trained FLA-SVR model to obtain the final predicted RGB values, which are then restored. Based on the predicted RGB values, the image is restored using a diagonal matrix transformation and the error from the label values is calculated.

[0120] Then a comparative analysis of algorithm performance is conducted.

[0121] 1. Other algorithm parameter settings

[0122] To compare the prediction accuracy of our DenseNet201-FLASVR model, we compared it with nine other models: DenseNet201-MFOSVR, DenseNet201-ChOASVR, DenseNet169-FLASVR, DenseNet121-FLASVR, ResNet50-FLASVR, DenseNet201-SVR, ResNet50-SVR, DenseNet121-SVR, and DenseNet169-SVR. DenseNet201, ResNet50, DenseNet121, and DenseNet169 all used weight parameters derived from networks pre-trained on the ImageNet dataset and fine-tuned. The parameter settings for the FLA, ChOA, and MFO optimization algorithms are shown in Table 4.

[0123] Table 4 Optimization algorithm and feature extractor parameter settings

[0124]

[0125] 2. Experimental results of algorithm model angle error and chromaticity error

[0126] To compare the prediction performance of our DenseNet201-FLASVR model, we compared it with nine other models: DenseNet201-MFOSVR, DenseNet201-ChOASVR, DenseNet169-FLASVR, DenseNet121-FLASVR, ResNet50-FLASVR, DenseNet201-SVR, ResNet50-SVR, DenseNet121-SVR, and DenseNet169-SVR. To obtain reliable experimental results, we repeated the experiment 10 times on the same dataset, calculating the chromaticity and angular errors of each image in the test set. Finally, we took the mean and median of the chromaticity and angular errors of all photos in the 10 results, as well as the average of the best 25% and worst 25% of the error results for all images. These four values were used as the evaluation criteria.

[0127]

[0128] The above formula is the definition equation of chromaticity error, where (r c ,g c ) are the true red and green illuminance values, (r u ,g u ) are the estimated red and green illuminance values. The angular error is defined as the angle between the actual value of the illumination and the estimated value of each color component, which is mainly used to judge the directional difference between the two. Assume that the actual illumination of the image is represented by e c =(R c ,G c ,B c ), and the predicted illumination is expressed as e u =(R u ,G u ,B u ), the calculation formula of the angle error is as follows:

[0129]

[0130] Table 5 Comparison of chromaticity value errors of DenseNet201-FLASVR and other algorithms (the best value is bolded)

[0131]

[0132] Table 6 Comparison of angle value errors of DenseNet201-FLASVR and other algorithms (the best value is shown in bold)

[0133]

[0134] According to Table 5 and Table 6, it can be seen that DenseNet201-FLASVR is better than ResNet50-SVR, DenseNet201-ChOASVR, DenseNet201-MFOSVR, DenseNet169-FLASVR, ResNet50-FLASVR, DenseNet121-FLASVR, DenseNet201-SVR, DenseNet169-SVR, DenseNet The average chromaticity error of 121-SVR is smaller by 0.0263, 0.0049, 0.0069, 0.0141, 0.0123, 0.0165, 0.0256, 0.0270, and 0.0305, and the average angle error is smaller by 1.5782, 0.2420, 0.3040, 0.7073, 0.1011, 0.9308, 1.7109, 1.8184, and 1.9311. The Mean and Best25% of the angle and chromaticity errors are the smallest.

[0135] 3. Algorithm Stability Analysis

[0136] To compare the stability of the DenseNet201-FLASVR, DenseNet201-MFOSVR, DenseNet201-ChOASVR, DenseNet169-FLASVR, DenseNet121-FLASVR, ResNet50-FLASVR, DenseNet201-SVR, ResNet50-SVR, DenseNet121-SVR, and DenseNet169-SVR algorithms, we ran the models 10 times, calculated the angular and chromatic errors for each run, and plotted box plots. In the figure, the upper and lower horizontal lines outside the box represent the maximum and minimum error values, the upper and lower boundaries of the box represent the two quartiles of error, and the middle horizontal line represents the median.

[0137] 4. Algorithm convergence analysis

[0138] exist Figure 7This figure shows the iterative convergence curves for the fitness of the DenseNet201-FLASVR, DenseNet201-MFOSVR, DenseNet201-ChOASVR, DenseNet169-FLASVR, DenseNet121-FLASVR, ResNet50-FLASVR, DenseNet201-SVR, ResNet50-SVR, DenseNet121-SVR, and DenseNet169-SVR models. Fitness is the root mean square error of R and G chromaticity. Due to its good initial population position distribution, the DenseNet201-FLASVR model has the lowest fitness at the beginning of the iteration. Compared with the other models, DenseNet201-FLASVR converges the fastest and ultimately has the lowest fitness.

[0139] According to experiments, it can be concluded that the average chromaticity value and angle error of the model proposed by the present invention are smaller than those of other algorithm models, and it has excellent prediction performance.

Claims

1. A method for image illumination correction based on support vector regression, characterized in that: The method comprises the following steps: Step 1: Acquire images, form a dataset and perform preprocessing The images include photos taken indoors, outdoors, under cloudy and sunny conditions. The length and width of the photos are all set to 224×224, regularized, mapped to the normal distribution function, and then converted into a matrix for input into the DenseNet201 model; Step 2: Get the DenseNet201 feature extraction network based on transfer learning Use the ImageNet dataset to pre-train to obtain the weight parameters of the initial network model DenseNet201. Performing transfer learning on the initial network model DenseNet201 and fine-tuning the network parameters of the initial network model DenseNet201 to obtain a DenseNet201 feature extraction network; Step 3: Use the DenseNet201 feature extraction network to extract image features The data set obtained in step 1 is divided into a training set and a test set, the data in the training set is input into the DenseNet201 feature extraction network obtained in step 2, and PCA dimension reduction is performed, and finally the image illumination features are saved; The dimension of the PCA dimensionality reduction is a parameter that needs to be adjusted. By adjusting the dimension of the dimensionality reduction, the dimension of the PCA dimensionality reduction that minimizes the error of the prediction result is found; Step 4: Optimize the SVR model using the FLA algorithm (4.1) Obtain the parameters of the FLA algorithm, and use the FLA algorithm to optimize the SVR model to obtain the penalty factor, kernel parameters, and soft margin of the SVR model; Combining different population sizes and iteration times to determine the impact of different combinations on prediction accuracy, the mean square error of the R and G values of the images in the test set is used to determine the accuracy of the algorithm prediction; the root mean square error of the R and G values is used as the fitness function; and the individual with the best fitness is selected as the final kernel parameter and penalty factor. The FLA algorithm parameters include population size and number of iterations; The penalty factor is used to ensure the performance and stability of SVR. The kernel parameter is a parameter used to define the kernel function in SVR. Selecting an appropriate kernel parameter can improve the generalization performance of the model. The soft margin is a feature of SVR that allows a certain amount of error to exist between the support vector and the decision boundary. (4.2) Using the image illumination features obtained in step 3 in combination with the FLA algorithm, the penalty factor, kernel parameters, and soft margin of the SVR model are set to the values obtained in step (4.1) to obtain a FLA-SVR model, and training the FLA-SVR model to obtain a trained FLA-SVR model; Step 5: Get the image to be processed and process it using the trained FLA-SVR model to obtain the R, G, and B values of the image to be processed. Restore the image through diagonal matrix transformation and output the illumination correction result.

2. The image illumination correction method based on support vector regression according to claim 1, characterized in that: In step 1, the image obtained is from the Cube++ dataset.

3. The image illumination correction method based on support vector regression according to claim 2, characterized in that: In step 1, the dimension of the PCA dimensionality reduction with the minimum error is 60.

4. The image illumination correction method based on support vector regression according to claim 3, characterized in that: In step 4, obtaining the FLA algorithm parameters includes the following steps: The population size is set to 10, 20, 30, 40, 50, and the number of iterations is set to 10, 15, 20, 25, 30. Different combinations of population size and iteration number are performed to obtain the effects of different combinations on the prediction accuracy error. The mean square error of the R and G values of the images in the test set is selected to judge the accuracy of the algorithm prediction; the root mean square error of the R and G values is used as the fitness function: Among them, R Value Test Err is the mean square error of R value, G Value Test Err is the mean square error of G value, n is the number of samples, r i-pt and g i-pt is the predicted value of R value and G value, r i-rl and g i-rl is the true value of R value and G value; the smaller the mean square error of R value and G value and the smaller Fitness is, the closer the predicted R value and G value are to the true R value and G value.

Citation Information

Patent Citations

  • Color constancy calculating method and system based on derivative structure of image

    CN101706964A

  • A mineral flotation foam image color correction method and a foam color detection system

    CN109671124A