Image illumination correction method based on regularization extreme learning machine
By using the RELM method optimized by WOA-SHO in the illumination correction model, the problems of low prediction accuracy and overfitting of the existing illumination correction model are solved, and efficient and accurate illumination correction is achieved, which is suitable for image processing of dyed fabrics.
Patent Information
- Application Number
- CN202410627801.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-21
- Publication Date
- 2024-09-06
AI Technical Summary
The existing illumination correction models have low prediction accuracy, are prone to over-fitting, have weak generalization capabilities, and have little research on dye applications, making it difficult to effectively handle image errors under different light sources.
The Regularized Extreme Learning Machine (RELM) method based on Spotted Hyena Algorithm (SHO) and Whale Algorithm (WOA) optimization is used to correct the illumination of the image by optimizing the input weights and biases, combined with the WOA-SHO model, to improve the convergence of the model. and predictive performance.
It achieves efficient and accurate lighting correction, eliminates the impact of external environmental lighting on photographic imaging, provides accurate object color information, improves the efficiency and accuracy of lighting correction for dyed fabrics, and reduces over-fitting phenomena.
Smart Images

Figure CN118608403A
Abstract
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 a regularized extreme learning machine. Background Art
[0002] At present, many color difference detections need to rely on manual inspection by manpower, but there are many subjective factors, such as fatigue caused by too long work, different angles of looking at the object to be measured, etc., which will cause large errors in the results of color difference detection. In order to deal with this problem, computers are used to solve it, because computers are objective and not affected by subjective factors. However, because color is affected by many factors, such as its own "attributes", and different scene light sources will also cause objects to present different colors. In practical applications, there are various factors in the on-site environment, such as uneven lighting, unstable lighting, etc. When the scene light source is different, the color difference of the same object to be measured will also be greatly affected, which will cause a large error. Therefore, it is necessary to perform light correction to adjust the collected images to the same standard light source, so that the problem of different light sources can be handled.
[0003] Currently, in the field of image illumination correction technology, many people are trying to simulate color constancy with computers and apply it to practical applications. Turgay Celik and Zeki Yetgin proposed an algorithm to unify the grayscale world and gray edge color constancy. Gijsenij Arjan et al. proposed to use weighted edges of light to improve the ability of color constancy. Liu Xiangqi et al. proposed a random vector function chain network for color constancy calculation optimization of dyed fabrics based on the improved marine predator algorithm, which is also designed to reproduce the ability of color constancy. In terms of illumination correction, Zhang Jianxin et al. proposed illumination correction for color difference detection of dyed products based on spherical harmonic theory.
[0004] Neural networks have been widely used in various fields, and various algorithms are used to optimize neural networks. Gaurav Dhiman et al. proposed a framework for solving nonlinear economic load power dispatch problems using the spotted hyena optimization algorithm. Krishna Madugula Murali used a hybrid rider optimization and spotted hyena optimization algorithm to solve the traveling salesman problem. Diwania Sourav et al. applied the WOA algorithm to single-channel glazed photovoltaic thermal modules to improve their performance. Eslam.M.Hassib et al. proposed an unbalanced big data classification framework based on WOA and deep neural networks. Qianqian Wu et al. proposed a hybrid model for predicting China's power grid investment demand based on variational mode decomposition, regularized extreme learning machine and support vector machine. Li Jianqiang et al. proposed a regularized extreme learning woven fabric wrinkle evaluation model based on improved Harris Hawks optimization. However, there are few studies on the application of illumination correction for dyed fabrics. Although there have been many studies on illumination correction, there are almost no studies on the application of dyed fabrics. Therefore, it is urgent to propose an image illumination correction method based on regularized extreme learning machine with excellent prediction performance. Summary of the invention
[0005] The purpose of the present invention is to address the problems of low prediction accuracy, easy overfitting and weak generalization ability of existing illumination correction models, and propose an image illumination correction method based on a regularized extreme learning machine (RELM) optimized by a spotted hyena algorithm (SHO) and a whale algorithm (WOA), so as to achieve high efficiency and accuracy of illumination correction work and provide real object color data for computer vision engineering tasks.
[0006] The present invention provides an image illumination correction method based on a regularized extreme learning machine, comprising the following steps:
[0007] Step 1: Get images and build a dataset
[0008] When acquiring images, the illumination light source used has uniform brightness distribution within the illumination area to avoid capturing abnormal areas of reflected light on the dyed fabric;
[0009] The abnormal reflected light area on the dyed fabric refers to the area on the dyed fabric where the reflected light intensity is significantly higher or lower than other parts of the dyed fabric in the illuminated area under the illumination of the illumination light source, so as to prevent the detection accuracy from being reduced or the detection from being unavailable. In some industrial applications, the light source and the lighting scheme should be closely combined to highlight specific feature quantities to enhance the contrast, while ensuring that the overall brightness is sufficient and the imaging quality is not affected by changes in the position of the object.
[0010] When acquiring images, several different light sources are used to illuminate the dyed fabric to collect images under different light sources;
[0011] The several different light sources are specifically: D65, D50 and A light sources;
[0012] When acquiring an image, the light emitted by the light source is made to illuminate perpendicularly to the surface of the dyed fabric, and the image acquisition device is used to acquire the reflected light from the surface of the dyed fabric. The image acquisition device acquires the reflected light from the surface of the dyed fabric, and the direction of the reflected light forms an angle of 45 degrees with the surface of the dyed fabric; the distance between the image acquisition device and the surface of the dyed fabric is set to 0.7 meters;
[0013] The dyed fabric is any one of the following two types: chemical fiber fabric and cellulose fiber fabric;
[0014] Step 2: Use the WOA algorithm to optimize the SHO algorithm
[0015] The initial population of the SHO algorithm is optimized by the WOA algorithm, making the initial population closer to the optimal solution, so that the SHO algorithm can find the optimal solution more quickly and improve the convergence of the algorithm.
[0016] Step 3: Set the number of search agents and the maximum number of iterations of the SHO algorithm, and use the initial population of the SHO algorithm to find the optimal solution by calculating the fitness of the search agents using the SHO algorithm;
[0017] Step 4: Optimize the RELM model using SHO after WOA optimization
[0018] Introduce a regular term into the ELM model, and use the SHO algorithm to optimize the input weights and biases of the RELM model to obtain the WOA-SHO-RELM model, and train it using the data set described in step 1;
[0019] The optimization includes processing by using a mapping method of a search agent, and mapping the SHO algorithm to find the optimal solution to the RELM network for prediction by searching the mapping model of the agent to the RELM model. The input weight and hidden layer bias are determined by whether to activate, thereby achieving the optimization effect.
[0020] Step 5: Get the image to be processed, process it using the trained WOA-SHO-RELM model, obtain the R, G, and B values of the image to be processed, restore the image through the diagonal mapping model, and output the illumination correction result.
[0021] Preferably, in step 1, the data set is obtained by a feature extraction framework of the Gray-Edge algorithm.
[0022] Assume n∈{0,1,2}, p∈{1,2,…,10}, σ∈{1,3,5,7,9}, and realize 150 different combinations through the permutation and combination of the three parameters. Then, according to the following formula, convert to the rg chromaticity space to obtain 300-dimensional data as the data in the data set;
[0023]
[0024] The r and g represent chromaticity, expressed as hue and saturation respectively, and b represents brightness.
[0025] Preferably, in step 2, the process of optimizing the initial population of the SHO algorithm by the WOA algorithm includes: using the WOA algorithm to screen the initial population of the SHO algorithm from a randomly generated population.
[0026] Preferably, in step 3, the number of search agents of the SHO algorithm is 20, and the maximum number of iterations is 40;
[0027] The fitness calculation is performed by using a root mean square error formula, that is, calculating the root mean square error between the r and g chromaticity and the true value.
[0028] Preferably, in step 4, the maximum number of hidden layer nodes of the RLEM model is 20.
[0029] The test set is selected to be calculated using the root mean square error, that is, the root mean square error of the chromaticity of r and g and the true value is calculated:
[0030]
[0031] RGB is also often used in computers to represent a color. RGB can basically represent most colors. Divide the original RGB value by their sum, and you can get a set of normalized values, which is the chromaticity coordinates. The r and g are chromaticity, which can be expressed as hue and saturation respectively. The two together reflect the properties of the object itself related to lighting. The remaining b is brightness. In the process of lighting correction, what we need is the "property" of the object itself, that is, chromaticity, not brightness. Through the conversion of rg chromaticity, the original three-dimensional color can be reduced to two dimensions to represent it, thereby reducing the data that needs to be processed, improving the performance of the calculation, and making the lighting correction system more efficient. The conversion formula for converting RGB to rg chromaticity is generally:
[0032]
[0033] Since r+g+b=1, knowing two numbers can directly represent another number. Therefore, by retaining only r and g to represent the RGB value, the b value can be directly omitted using this equation, thereby reducing the three-dimensional color attribute to the two-dimensional rg chromaticity. In this way, the data will be converted between 0 and 1, which is convenient for subsequent data processing and model algorithms.
[0034] The algorithm proposed in the present invention combines the WOA-optimized SHO model and the RELM model to perform RGB prediction on the image illumination data set. It not only has the fast convergence ability of WOA-SHO, but also has the excellent prediction performance of RELM. The WOA-SHO-RELM algorithm is mainly divided into two parts. The first part is to use the WOA-optimized SHO to find the optimal solution, and after a certain number of iterations, to continuously find the best parameters. The second part is to use the RELM model to predict the extracted parameters. Because the ELM model introduces regularization, it avoids the problem that the ELM may have a fitting phenomenon due to too much data, resulting in unstable and inaccurate prediction results.
[0035] The present invention has the beneficial effects:
[0036] Dyed fabrics display different colors when illuminated by different light sources. In order to make the computer detect color differences with higher accuracy, it is necessary to overcome the influence of different light sources. To this end, it is necessary to perform light correction processing on the dyed image. Unsupervised light correction was often used in the past, but it has many limitations and lacks certain learning capabilities. The method of this article is to use a neural network to perform light correction, learn through an existing training set with correct results, and then perform light prediction on unknown images to achieve light correction for unknown images.
[0037] The present invention uses RELM based on WOA-SHO optimization. The performance of traditional neural networks is not good enough and the effect is not good enough, so this paper proposes a new illumination correction model. A regularization term is introduced into ELM, and the input weight and bias of RELM are optimized by SHO algorithm, and then the initialization of SHO algorithm is optimized by WOA algorithm, thereby greatly improving the performance and accuracy of the illumination correction model and eliminating the overfitting phenomenon to a certain extent.
[0038] The present invention can perform illumination correction on the original image, eliminate the influence of external ambient illumination on photographic imaging, and restore the true color of the object, thereby providing accurate color information for related engineering tasks of computer vision. The model has excellent prediction accuracy, good convergence and stability, and improves the efficiency and accuracy of illumination correction work for dyed fabrics. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a model diagram of the WOA-SHO-RELM algorithm constructed by the present invention;
[0040] Figure 2 It is a mapping model diagram from search agent to RELM constructed by the present invention;
[0041] Figure 3 is a graph showing the fitness of WOA-SHO-RELM and other algorithms in different numbers of search agents; DETAILED DESCRIPTION
[0042] The present invention will be further described below in conjunction with the accompanying drawings.
[0043] like Figure 1 As shown in FIG. 1 , an image illumination correction model based on a regularized extreme learning machine is to prepare a data set and perform preprocessing first, use the optimization method mentioned above to perform training, obtain the desired W and b, then calculate the output weights through the formula, build an illumination correction model, obtain the estimated r and g chromaticity values, and convert them into RGB values, and then use the diagonal mapping model to achieve image correction to obtain the final result, including the following steps:
[0044] The present invention comprises the following steps:
[0045] Step 1: Get the image and use the GrayEdge algorithm to extract image features to form a data set
[0046] When acquiring images, the illumination source must ensure that there is no color distortion, and the brightness should be sufficient and the brightness distribution in the illuminated area is uniform. In addition, the light source and the lighting system must avoid highly reflective areas of the inspection object to prevent reduced inspection accuracy or failure to detect. In some industrial applications, the light source and the lighting scheme should be closely combined to highlight specific features to enhance contrast, while ensuring that the overall brightness is sufficient and the image quality is not affected by changes in the position of the object. In order to perform illumination correction on images acquired under different light sources, D65, D50 and A light sources were used. When acquiring images, the distance between the lens and the cloth surface was set to 0.7 meters, and the lighting and observation conditions were vertical / 45 degrees. The lens remained stationary to capture the image, and the movement of the camera or the cloth was not considered. Our research subjects were polyester and cotton dyed fabrics, and all experimental data were obtained under this condition.
[0047] (1.1) Dyeing feature extraction algorithm
[0048] The final mathematical model of the algorithm framework is:
[0049]
[0050] where f nRepresents the convolution of image f and Gaussian filter; Represents the nth-order derivative process. Different algorithms are included by selecting different n, p, σ parameters. Assume n∈{0,1,2}, p∈{1,2,…,10}, σ∈{1,3,5,7,9}, and 150 different combinations can be achieved through the permutation and combination of the three parameters. Then, according to the formula, it is converted to the rg chromaticity space, so that 300-dimensional data can be obtained.
[0051] (1.2) Dataset segmentation
[0052] Get the corresponding data set, and then divide the data set into a training set and a test set, generally using a 10 to 1 method for classification.
[0053] Step 2: Use the WOA algorithm to optimize and screen the randomly generated population
[0054] At the beginning, the WOA algorithm is used to initialize the initial population of the SHO algorithm. Originally, the initialization is randomized. The SHO algorithm itself is prone to boundary problems, that is, exceeding the upper and lower limits of the range, and the SHO algorithm is easy to cause the situation of constantly searching for the optimal solution at the boundary, which will cause problems in the final result because the solution has been found at the boundary, but it cannot explore further. Optimizing the initial population through the WOA algorithm can make the initial population closer to the optimal solution from the beginning, so that the SHO algorithm can find the optimal solution more quickly and improve the convergence of the algorithm.
[0055] Step 3: Use SHO to find the best fitness and population
[0056] (3.1) Basic steps of the SHO algorithm
[0057] (3.1.1) For the population P i Initialization is performed, where i = 1, 2, 3, …, N.
[0058] (3.1.2) Select various parameters of the SHO algorithm: h, B, E and N, and define a reasonable maximum number of iterations as a termination condition. The number of iterations will affect whether the algorithm is fully converged. If the number of iterations is too small, the algorithm may end before it fully converges. If the number of iterations is too large, it will greatly affect the running speed of the algorithm. The maximum number of iterations used in this invention is 40.
[0059] (3.1.3) Use the fitness value algorithm determined in advance to judge the quality of the current search agent position, calculate the fitness of each search agent, and complete the initialization of the initial search population. The test set of the present invention uses the root mean square error for calculation, that is, calculates the root mean square error of the r and g chromaticity with the true value:
[0060]
[0061] (3.1.4) Search for the optimal solution in the determined search space and find the optimal search agent.
[0062] (3.1.5) Define a set of optimal solutions, that is, clustering using equations.
[0063] class until the optimal result is found, that is, the position of the current best search population is found.
[0064]
[0065] Indicates the best position, represents the location of other spotted hyenas, where N is the number, is a group or
[0066] The optimal solution for clustering is:
[0067]
[0068] in, A random vector between 0.5 and 1. nos defines the number of solutions to the solution and will
[0069] All candidate solutions are evaluated.
[0070] (3.1.6) Use the equation to update the position of the search agent.
[0071]
[0072] The best solution is retained, and the positions of other search agents are updated based on the position of the search agent with the best solution.
[0073] The algorithm allows the search agent to attack the prey while updating its position.
[0074] (3.1.7) Perform boundary judgment on the search agent within the range to see if it exceeds the set maximum or minimum value, and then make corresponding adjustments.
[0075] (3.1.8) Calculate the fitness value of the search agent and determine whether it is better than the previously saved optimal solution. If there is a better solution, perform vector P h Update of value.
[0076] (3.1.9) Spotted hyena C h The group is updated to the best search agent attribute result value that has been obtained.
[0077] (3.1.10) If the stopping condition is reached, such as reaching the maximum number of iterations, the algorithm ends. Otherwise, it returns to step (1.5) and continues to run the algorithm.
[0078] (3.1.11): After stopping the algorithm, the best solution obtained so far is returned, that is, the optimal solution. It can be found that P h holds the best search agent, and C h It is the group or cluster of all optimal solutions.
[0079] (3.2) Get search proxy parameters
[0080] Here we explain in detail how to use experiments to obtain search proxy parameters.
[0081] The number of search agents will have a relatively large impact on the algorithm, so a relatively detailed comparison of the numerical changes in the number of search agents is made. In this experiment, the number of search agents is set to increase from 1 to 40, and each judgment is made. The average value is taken as the final result after 10 runs each time. If an unreasonable result appears, it will be rerun three times and a reasonable value will be taken as the result of the experiment. The completed experimental results are shown in Table 1.
[0082] Table 1 Effect of different number of search agents on fitness value
[0083]
[0084]
[0085]
[0086] As can be seen from Table 1, the impact of the number of search agents on fitness can be clearly found that the fitness will change dramatically between the number of search agents 0 and 5, almost falling down, and then constantly fluctuating up and down, but the overall trend is constantly decreasing, that is, after the number of search agents is 5, although the fitness of most algorithms will decrease, the magnitude of the change is not particularly large, but some algorithms will still have a relatively large change between 10 and 20. And it can be found that the fitness value of WOA-SHO-RELM is obviously below that of other algorithms, which can show that the performance of this algorithm is much better than other algorithms. After the number of search agents is 15 to 20, the downward trend of the fitness of basically all algorithms will become smaller. Although the fitness of some algorithms will become smaller later, the gap is not particularly obvious. In order to pursue faster computing speed and obtain corresponding experimental results faster, this paper adopts the default number of search agents as 20. Through the above analysis, it can be known that the default number is reasonable.
[0087] (3.3) Get the number of iterations
[0088] The number of iterations will affect whether the algorithm is fully converged. If the number of iterations is too small, the algorithm may end before it fully converges. If it is too large, it will greatly affect the running speed of the algorithm. Of course, some algorithms themselves will also be affected by the number of iterations and change the accuracy. In this experiment, the number of iterations was set to 20, 40, 60, 80, and 100. Each run was performed 10 times and the average value was taken as the final result. The experimental results are shown in Table 2.
[0089] Table 2 Effect of different iteration numbers on fitness value
[0090]
[0091]
[0092] It can be clearly seen from Table 2 that when the number of iterations is greater than 20, the impact of the number of iterations on the fitness of the algorithm is not particularly large. Although some algorithms will fluctuate up and down, the gap is not particularly obvious. It can be said that except for the WOA-SHO-RELM algorithm and the ALO-RELM algorithm, there is no particularly large drop. In order to prevent non-convergence and considering the problem of operation time, the default maximum number of iterations in this paper is set to 40. When the number of iterations is 40, most algorithms have achieved relatively good performance, which can be said to be reasonable. At the same time, it can also be found that no matter how many iterations there are, the fitness of the WOA-SHO-RELM algorithm is much lower than that of other algorithms, and it is more excellent in performance.
[0093] Step 4: Optimize the RELM model using SHO after WOA optimization
[0094] The ultimate goal of the present invention is to use the WOA-SHO-RELM model to predict the extracted features, so a trained WOA-SHO-RELM model must be obtained first. The model uses the SHO algorithm optimized by the WOA algorithm to optimize the parameters of RELM. First, the image is processed using the dye feature extraction algorithm to obtain the corresponding data set, and then the data set is divided into a training set and a test set, and the classification is generally carried out in a 10 to 1 manner. Then the optimization method mentioned above is used for training to obtain the desired W and b, and then the output weight is calculated by the formula, and the illumination correction model is constructed to obtain the estimated r and g chromaticity values, and converted into RGB values, and then the diagonal mapping model is used to realize the correction of the image to obtain the final result.
[0095] This step mainly explains the specific SHO algorithm and RELM model.
[0096] 1.SHO algorithm
[0097] The present invention introduces a social relationship optimization algorithm between spotted hyenas and their cooperative behaviors, referred to as SHO. The algorithm simulates the hunting behavior of spotted hyenas. When hunting prey, spotted hyenas will seek help from their relatives and friends, making hunting simple and efficient. The behavior of the spotted hyena is converted into an algorithm, and the corresponding mathematical models of encirclement, hunting, attack and search are established. The performance of the algorithm is better than other competitive metaheuristic algorithms.
[0098] Surrounding prey: The location of the prey will be increasingly familiar to the spotted hyenas, and they will surround it little by little. This behavior can be applied to the algorithm, that is, it can be used to find the optimal solution. In order to mathematically model this behavior, it is necessary to create the best candidate solution. This is because it is limited by the current conditions, that is, the size of the search space cannot be determined, and the current local optimal solution is obtained. If you want to get the real optimal solution, you still need to explore step by step. After defining the best search candidate solution, other search agents also need to change their positions according to the position of the best search candidate solution, so that their positions are close to the best search candidate solution little by little.
[0099] To this end, the position of the spotted hyena needs to be digitized, and the position vector of the spotted hyena can be expressed as:
[0100]
[0101]
[0102] in, Define the distance between the prey and the spotted hyena, is the coefficient vector, Let represent the position vector of the prey, represents the position vector of the spotted hyena, is the coefficient vector. The calculation formula of the vector is:
[0103]
[0104]
[0105]
[0106] Where, iteration = 1, 2, 3, ..., maximum value 迭代 , is a random vector in [0,1].
[0107] Hunting prey: Spotted hyenas will identify the location of prey by looking at other spotted hyenas. In order to establish this behavior with a mathematical model, we set the best search agent. No matter which search agent is the optimal solution, all search agents can know the location of the prey. In this way, each search agent can update its own position towards the best search agent. The corresponding mathematical formula is as follows:
[0108]
[0109]
[0110]
[0111] Indicates the best position, represents the location of other spotted hyenas, where N is the number, is the optimal solution for a group or cluster, and the corresponding formula is:
[0112]
[0113] in, A random vector between 0.5 and 1, nos defines the number of solutions to the solution, and all candidate solutions will be calculated.
[0114] Attacking prey: In order to realize the mathematical model of spotted hyena attack, the model is established by the following formula:
[0115]
[0116] The best solution is retained, and the positions of other search agents are updated based on the position of the search agent with the best solution. This algorithm allows the search agents to attack the prey while updating their positions.
[0117] Searching for prey: Spotted hyenas mainly search for prey based on the location of spotted hyena groups or groups. Therefore, we use random values greater than 1 or less than -1 to keep the search agent away from the prey, thus expanding the search range. middle, There are random values in the calculation of These random values provide random weights. This makes the explored values more reasonable and can also surface local optimal situations. According to the position of the spotted hyena, the weight of the prey can be made random, although this may exceed the maximum upper and lower limits and cause special situations in the final value. However, this random mechanism can effectively solve the problem of local optimal solutions.
[0118] 2. RELM model
[0119] RELM is an improvement based on ELM. ELM is a learning algorithm and a neural network for a single hidden layer.
[18] , which is suitable for supervised learning and unsupervised learning. It can start by randomly setting the input weights and biases, and then obtain the corresponding output weights.
[0120] Assume there are N samples (X i ,y i ), where y i =[y i1 ,y i2 ,......,y im ] T ∈R m , X i =[x i1 ,x i2 ,......,x in ] T ∈R n , n and m represent the dimensions of each vector. If a neural network has L hidden nodes, it can be expressed as
[20] :
[0121]
[0122] where β j =[β j1 ,β j2 ,......,β jm ] T is the output weight, g(x) is the activation function, W j =[w j1 ,w j2 ,......,w jn ] T is the input weight, X is the variable, b j =[b j1 ,b j2 ,......,b jn ] T is the bias. The goal of the neural network is to make the output error as small as possible, so we can get:
[0123]
[0124] According to the second formula, the first formula can be converted into:
[0125] Hβ=Y
[0126] Among them, H is the output of the hidden layer, β is the output weight, and Y is the expected output. Through these formulas, we can find that once W and b are determined, the output H has been determined and is the only determined value. Then, by solving β, we can get in is the generalized inverse of the matrix H.
[0127] RELM introduces a regularization term based on ELM, so that the solution formula becomes:
[0128]
[0129] Among them, g is the weight coefficient used to adjust the regularization effect, and I is the unit matrix. Regularization reduces the parameters by reducing the impact on the output instead of deleting some neurons, which can help to achieve the stability of ELM. If regularization is not introduced, the original ELM is likely to have fitting phenomenon due to too much data.
[0130] The following are the specific model training steps.
[0131] (4.1) SHO algorithm optimizes RELM model
[0132] To optimize RELM, we need to determine the input weights and hidden layer biases, so we need to find the appropriate number of input nodes and hidden layer nodes. If we also use these two as optimization parameters, the change in the number of nodes will lead to a change in the dimension, that is, the elements of the matrix will also change during the calculation process, and it is difficult to calculate between matrices of different rows and columns, which will make the calculation very complicated or even difficult to achieve. Therefore, we need to use a search agent mapping method to process it. At the beginning, we first determine the maximum dimension, so that the size of the matrix is fixed, and then determine the input weight and bias by whether to activate the node, so as to achieve the optimization effect.
[0133] At the beginning, the number of input nodes and the maximum number of hidden layer nodes of the RELM network are determined, thereby determining the dimensions of InputWeight and Hidden Biases. In order to indicate whether the node is to be activated, the values of the input layer and the hidden layer are required, and the values of both are binarized, that is, the values are processed into 0 or 1, 0 represents inactivation, and 1 represents activation. When the input layer and the hidden layer are both 1, it indicates that the node is activated, and the regularization coefficient is converted into a number from -100 to 100 by enlarging or shrinking, and then the absolute value is processed to convert it into a value from 0 to 100. Taking the example of 2 input nodes and 3 hidden layer nodes, the corresponding mapping process diagram is shown in the attached figure. Figure 2 .
[0134] (4.2) Obtaining the optimal parameters of the RLEM algorithm
[0135] When using the search agent method, the maximum number of hidden layer nodes will affect the choice of dimension size, which can be said to have a considerable impact on the accuracy of the algorithm. If it is set too small, the algorithm will perform poorly. If it is set too large, the algorithm will operate too slowly, and sometimes overfitting will occur, so a more suitable value needs to be found. In this experiment, the maximum number of hidden layer nodes is set to 10, 20, 30, 40, 50, 60, 70, 80, 90, and 100. Each run is performed 10 times and the average value is taken as the final result. The experimental results are shown in Table 3.
[0136] Table 3 Effect of different maximum number of hidden layer nodes on fitness value
[0137]
[0138]
[0139] As shown in Table 3, the impact of the number of hidden layer nodes on fitness shows that the fitness of many algorithms will change significantly with the change of the maximum number of hidden layer nodes. Generally speaking, the more nodes there are, the lower the fitness will be. However, except for the fitness of the WOA-SHO-RELM algorithm, the difference in the number of nodes after 20 is not particularly large. Although some of them fluctuate greatly, the difference is not particularly significant. Moreover, it can be found that no matter how many nodes are in the maximum hidden layer, the fitness of WOA-SHO-RELM is the lowest, and it can be said that the performance is the best. Although it can be set to 60 from the figure, in order to pursue the algorithm's computing speed and get results faster, this paper sets the number of nodes to 20.
[0140] Step 5: Get the image to be processed, process it using the trained WOA-SHO-RELM model, obtain the R, G, and B values of the image to be processed, restore the image through the diagonal mapping model, and output the illumination correction result.
[0141] In order to achieve the effect of illumination correction, it is necessary to adjust the current illumination to the standard illumination. To do this, the diagonal mapping model is needed. The function of this model is to convert the estimated illumination results into standard illumination conditions, so as to eliminate the influence of different light sources. The method of processing RGB colors evolved based on the diagonal mapping model allows images under different light sources to be converted, which is the processing method of this article. The uncorrected image is converted into an image under standard illumination through the diagonal mapping model. Because the dye feature extraction method in this article obtains r and g chromaticity, but it is essentially converted from RGB, the diagonal mapping model can be used to achieve image illumination correction. The required formulas are as follows:
[0142]
[0143] Among them (R 标 , G 标 , B 标 ) T It is standard lighting The image below (R 测 , G 测 , B 测 ) T Is the estimated illumination Since we already know the image and the standard light source at the beginning, we only need to calculate the value of the estimated light to calculate the image under the standard light according to the formula.
[0144] Then a comparative analysis of algorithm performance is conducted.
[0145] 1. Analysis of chromaticity and angle error results
[0146] In order to study the effect of illumination correction of the WOA-SHO-RELM model, the comparative experimental comparison method was adopted. The comparative experimental algorithm models used included the WOA-RELM algorithm model, the SHO-RELM algorithm model, the SCA-RELM algorithm model, the EO-RELM algorithm model, the DA-RELM algorithm model, the ALO-RELM algorithm model, and the RELM algorithm model.
[0147] The maximum value (Max), minimum value (Min), average value (Avg) and standard deviation (Stdv) of the angle error and chromaticity error of each algorithm are calculated. Each algorithm is run ten times and the average value is taken as the corresponding result. The results obtained are as follows:
[0148] Table 4 Chromaticity error experimental results (minimum value is in bold)
[0149]
[0150] Table 4 shows the results of the chromaticity error of each algorithm. It can be found that the error value of WOA-SHO-RELM is the lowest in terms of maximum value, average value and standard deviation. The maximum value is at least 0.1 lower than other algorithms, the average value is at least 0.015 lower than other algorithms, and the standard deviation is 0.0003 lower than other algorithms. Only the minimum value is nearly 0.001 higher than the EO-RELM algorithm, while the maximum value, average value and standard deviation of WOA-SHO-RELM are 0.12, 0.016 and 0.0003 lower than EO-RELM respectively. Overall, the effect of WOA-SHO-RELM is the best among these algorithms.
[0151] Table 5 Angle error experimental results (minimum value is in bold)
[0152]
[0153] Table 5 shows the results of the angle errors of each algorithm. It can be found from the table that the error values of WOA-SHO-RELM are the lowest in terms of maximum value, average value and standard deviation. The maximum value is nearly 10 lower than other algorithms, the average value is about 0.2 lower than other algorithms, and the standard deviation is at least 0.2 lower than other algorithms. Only the minimum value is nearly 0.11 higher than the EO-RELM algorithm, while the maximum value, average value and standard deviation of WOA-SHO-RELM are 0.88, 0.22 and 0.25 lower than those of EO-RELM respectively. Overall, the effect of WOA-SHO-RELM is the best among these algorithms.
[0154] 2. Algorithm Significance Analysis
[0155] In order to test whether there is a significant difference between WOA-SHO-RELM and other algorithms, the Mann-Whitney U test is used for analysis, and WOA-SHO-RELM is tested with WOA-RELM, SHO-RELM, SCA-RELM, EO-RELM, DA-RELM, ALO-RELM, and RELM respectively. This test method requires that the number of samples should not be too small, and at least more than 20, and this test method explicitly considers the rank of each measured value in each sample, which can be used to test whether there is a significant difference in the center position of the sample, and can be used to test whether there is a significant difference between the two algorithms. The final result is Table 6, which can clearly find that the p value values obtained are far less than 0.05, indicating that the WOA-SHO-RELM algorithm has a very obvious significant difference with other algorithms.
[0156] Table 6 Mann-Whitney U test
[0157]
[0158] The above descriptions are only some specific implementation methods of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by any person familiar with the art within the technical scope disclosed in the present invention should be covered within the protection scope of the present invention.
Claims
1. A method for illumination correction of dyed fabric images based on regularized extreme learning machine, characterized in that: The method comprises the following steps: Step 1: Get images and build a dataset When acquiring images, the illumination light source used has uniform brightness distribution within the illumination area to avoid capturing abnormal areas of reflected light on the dyed fabric; The abnormal reflected light area on the dyed fabric refers to an area on the dyed fabric where the reflected light intensity formed under the illumination of the illumination light source is obviously higher or lower than that of other parts of the dyed fabric within the illumination area; When acquiring images, several different light sources are used to illuminate the dyed fabric to collect images under different light sources; The several different light sources are specifically: D65, D50 and A light sources; When acquiring an image, the light emitted by the light source is made to illuminate perpendicularly to the surface of the dyed fabric, and the image acquisition device is used to acquire the reflected light from the surface of the dyed fabric. The image acquisition device acquires the reflected light from the surface of the dyed fabric, and the direction of the reflected light forms an angle of 45 degrees with the surface of the dyed fabric; the distance between the image acquisition device and the surface of the dyed fabric is set to 0.7 meters; The dyed fabric is any one of the following two types: chemical fiber fabric and cellulose fiber fabric; Step 2: Use the WOA algorithm to optimize the SHO algorithm The initial population of the SHO algorithm is optimized by the WOA algorithm, making the initial population closer to the optimal solution, so that the SHO algorithm can find the optimal solution more quickly and improve the convergence of the algorithm; Step 3: Set the number of search agents and the maximum number of iterations of the SHO algorithm, and use the initial population of the SHO algorithm to find the optimal solution by calculating the fitness of the search agents using the SHO algorithm; Step 4: Optimize the RELM model using SHO after WOA optimization Introduce a regular term into the ELM model, and use the SHO algorithm to optimize the input weights and biases of the RELM model to obtain the WOA-SHO-RELM model, and train it using the data set described in step 1; The optimization includes processing by using a mapping method of a search agent, and mapping the method of the SHO algorithm to find the optimal solution to the RELM network for prediction through a mapping model from the search agent to the RELM model; The input weight and hidden layer bias are determined by whether to activate, thereby achieving optimization effect; Step 5: Get the image to be processed, process it using the trained WOA-SHO-RELM model, obtain the R, G, and B values of the image to be processed, restore the image through the diagonal mapping model, and output the illumination correction result.
2. The method for dyed fabric image illumination correction based on regularized extreme learning machine according to claim 1, characterized in that: In step 1, the data set is obtained through the feature extraction framework of the Gray-Edge algorithm. Assume n∈{0,1,2}, p∈{1,2,…,10}, σ∈{1,3,5,7,9}, and realize 150 different combinations through the permutation and combination of the three parameters. Then, according to the following formula, convert to the rg chromaticity space to obtain 300-dimensional data as the data in the data set; The r and g represent chromaticity, expressed as hue and saturation respectively, and b represents brightness.
3. The method for dyed fabric image illumination correction based on regularized extreme learning machine according to claim 1, characterized in that: In step 2, the process of optimizing the initial population of the SHO algorithm by the WOA algorithm includes: using the WOA algorithm to screen the initial population of the SHO algorithm from the randomly generated population.
4. The method for dyed fabric image illumination correction based on regularized extreme learning machine according to claim 3, characterized in that: In step 3, the number of search agents of the SHO algorithm is 20, and the maximum number of iterations is 40; The fitness calculation is performed by using a root mean square error formula, that is, calculating the root mean square error between the r and g chromaticity and the true value.
5. The method for dyed fabric image illumination correction based on regularized extreme learning machine according to claim 4, characterized in that: In step 4, the maximum number of hidden layer nodes of the RLEM model is 20.
Citation Information
Cited By
Wood block color detection method based on machine vision
CN119762602A
