Low-light image enhancement algorithm based on improved sparrow search algorithm
By improving the Sparrow Search Algorithm (SSA), the problems of poor low-light image quality and time-consuming and labor-intensive parameter optimization are solved, and automatic image denoising and enhancement are achieved, which is suitable for various application scenarios such as security monitoring and autonomous driving.
Patent Information
- Application Number
- CN202510774171.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-11
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-06-11
AI Technical Summary
The existing technology has poor low-light image quality, and the optimization of parameters of traditional image denoising and enhancement algorithms is time-consuming and labor-intensive, and it is difficult to achieve the best results in different scenarios.
An improved sparrow search algorithm (SSA) is introduced, the population is initialized through logistic mapping, the safety threshold is adaptively adjusted, differential evolution mutation is introduced, and a comprehensive evaluation function is defined by combining PSNR and SSIM to automatically optimize the parameter combination of image denoising and enhancement algorithms.
It achieves efficient and automated parameter optimization of low-light images, ensuring the best enhancement effect in different scenarios, improving image brightness, contrast and noise removal capabilities, and saving time and effort.
Smart Images

Figure CN120318102B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of image detection, and in particular relates to a low-light image enhancement algorithm based on an improved sparrow search algorithm. Background Art
[0002] In many application areas, such as security surveillance, autonomous driving, and medical imaging, image quality under low-light conditions is often poor, manifested by insufficient brightness, low contrast, and severe noise. These issues not only affect the visual experience but also complicate subsequent image analysis and processing. To improve the quality of low-light images, traditional image denoising and enhancement algorithms (such as adaptive histogram equalization (CLAHE), Retinex theory, and bilateral filters) are widely used in real-world scenarios. However, the effectiveness of these algorithms depends heavily on parameter selection, and determining the optimal parameters is often time-consuming and labor-intensive. Manual parameter adjustment is not only inefficient but also difficult to guarantee optimal results in all situations. Therefore, automated optimization of these parameters has become an urgent problem to be solved.
[0003] The Sparrow Search Algorithm (SSA), a novel metaheuristic optimization algorithm based on the foraging behavior of sparrows, has attracted widespread attention for its efficient optimization capabilities and excellent global search performance. SSA simulates the foraging behavior of sparrows in a flock to find the optimal solution to a problem, and performs well in complex optimization problems. It possesses efficient optimization capabilities, capable of quickly finding optimal solutions within a large solution space. Its implementation is simple, making it more intuitive and easier to understand and apply than other swarm intelligence algorithms. Furthermore, SSA maintains good stability and convergence speed across a wide range of optimization problems, demonstrating strong robustness. These characteristics make SSA well-suited for automated parameter optimization of low-light image denoising and enhancement algorithms, overcoming the time-consuming and labor-intensive parameter selection challenges of traditional methods.
[0004] However, traditional SSA also has some shortcomings. First, the quality of the initial population has a significant impact on algorithm performance. Randomly generated initial population positions may lead to insufficient diversity and stability, thus affecting the algorithm's optimization and convergence speed. Second, it is difficult to strike a balance between global search and local exploitation. When the safety threshold is a fixed parameter, the algorithm is prone to falling into local optimality, wasting a large amount of computing power. Finally, the lack of an effective mutation mechanism leads to insufficient population diversity, making it difficult for the algorithm to escape the local optimality in the later stages of iteration, limiting the room for further performance improvement.
[0005] In view of these advantages and disadvantages, the improved SSA can be used to automatically optimize the parameters of the denoising and enhancement algorithms to significantly improve the enhancement effect of low-light images, reduce the time and effort of manual parameter adjustment, and provide more reliable technical support for practical applications. Summary of the Invention
[0006] The purpose of this invention is to provide a low-light image enhancement algorithm based on an improved sparrow search algorithm to address the problems of poor low-light image quality and time-consuming and labor-intensive denoising and enhancement parameter optimization in the prior art. The technical solution adopted is as follows:
[0007] A low-light image enhancement algorithm based on an improved sparrow search algorithm. The main steps are:
[0008] Step 1: Improve the traditional Mahjong search algorithm. Specifically, the improvements include the following three aspects:
[0009] Introducing Logistic Mapping for Population Initialization: Using Logistic Mapping to generate the initial population can improve the diversity and uniformity of the initial population and avoid the edge aggregation problem caused by random generation.
[0010] Adaptive dynamic adjustment of safety threshold: Dynamically adjust the safety threshold according to the number of iterations or the dispersion of the current population to balance global search and local development capabilities and avoid falling into local optimality.
[0011] Introducing differential evolution mutation: Generate new individuals by selecting three different individuals for linear combination to increase the diversity of the population and prevent premature convergence.
[0012] These improvements can improve the stability and robustness of SSA, making it perform better in complex optimization problems.
[0013] Step 2: Determine the combination of image denoising algorithm and enhancement algorithm.
[0014] Specifically, select multiple denoising and enhancement algorithms (including but not limited to CLAHE, Retinex theory, and bilateral filters) and determine how to combine them. These algorithms can be flexibly selected and combined according to specific application scenarios to meet different needs.
[0015] Step 3: Define the comprehensive evaluation function.
[0016] Preferably, a comprehensive evaluation function combining PSNR and SSIM is defined to more comprehensively assess image quality and ensure optimal brightness, contrast, and noise removal. Furthermore, other visual quality assessment metrics, such as visual information fidelity (VIF), can be considered to further improve the evaluation system.
[0017] Step 4: Use the improved SSA to automatically optimize the parameter combination.
[0018] Specifically, the improved SSA automatically optimizes the parameter combinations of various denoising and enhancement algorithms to ensure optimal enhancement results in different scenarios. This automated parameter optimization significantly saves time and effort while ensuring the consistency and reliability of the enhancement results.
[0019] Step 5: Perform image denoising and enhancement on the low-light image.
[0020] The optimized parameter combination is applied to denoise and enhance low-light images, improving the overall image quality and ensuring high-quality image output in various application scenarios.
[0021] The method is applicable to various application scenarios requiring high-quality low-light images, such as security monitoring, autonomous driving, and medical imaging. In addition, the invention can also be applied to other fields, such as drone aerial photography and night photography, to provide users with a clearer and more realistic image experience.
[0022] Compared with the prior art, the advantages of the present invention are:
[0023] 1. Introduce the sparrow search algorithm to automatically select multiple threshold combinations.
[0024] Traditional methods require manual parameter adjustment, which is time-consuming and labor-intensive, and struggles to guarantee optimal results. By introducing the improved SSA, this paper achieves automated parameter optimization for multiple denoising and enhancement algorithms, significantly saving time and effort while ensuring optimal enhancement results in different scenarios. Furthermore, comprehensive evaluation metrics are defined to quantify image enhancement effectiveness, guiding SSA in selecting the optimal parameter combination to ensure optimal image brightness, contrast, and noise removal.
[0025] 2. Aiming at the shortcomings of traditional methods, improve the sparrow search algorithm.
[0026] This paper introduces a logistic map for population initialization to improve the diversity and uniformity of the initial population; adaptively and dynamically adjusts the safety threshold to balance global search and local exploitation capabilities, avoiding being trapped in local optima; and introduces differential evolution to increase population diversity and prevent premature convergence. These improvements significantly enhance the stability and robustness of SSA while maintaining efficient optimization capabilities.
[0027] By introducing the improved SSA, automated optimization of low-light image denoising and enhancement algorithm parameters is achieved, addressing the time-consuming and labor-intensive parameter adjustment issues associated with traditional methods. Leveraging the improved SSA, this invention not only significantly saves time and effort but also ensures optimal enhancement results in various scenarios. By defining comprehensive evaluation metrics, image quality is more comprehensively assessed, ensuring optimal brightness, contrast, and noise removal. These innovations provide an efficient and reliable solution for low-light image enhancement, suitable for a variety of applications, including security surveillance, autonomous driving, and medical imaging. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 This is a flowchart of the low-light image enhancement algorithm based on the improved sparrow search algorithm;
[0029] Figure 2 Schematic diagram for parameter combination optimization;
[0030] Figure 3 Schematic diagram for improving the sparrow search algorithm. DETAILED DESCRIPTION
[0031] The following diagrams describe the low-light image enhancement algorithm based on the improved sparrow search algorithm in more detail, illustrating preferred embodiments of the present invention. It should be understood that those skilled in the art may modify the invention described herein while still achieving its advantageous effects. Therefore, the following description should be understood as a general guide for those skilled in the art and not as a limitation of the present invention.
[0032] like Figure 1 As shown in FIG, the low-light image enhancement algorithm based on the improved Sparrow Search Algorithm (SSA) includes the following steps:
[0033] Step 1: Improve the sparrow search algorithm. Specifically, it includes the following three improvements:
[0034] Logistic mapping is introduced for population initialization to improve the diversity and uniformity of the initial population and avoid edge aggregation problems caused by random generation;
[0035] Adaptively and dynamically adjust the safety threshold according to the number of iterations or the current dispersion of the population to balance global search and local development capabilities and avoid falling into local optimality;
[0036] Differential evolution mutation is introduced to generate new individuals by selecting three different individuals for linear combination, thereby increasing the diversity of the population and preventing premature convergence.
[0037] Step 2: Determine the combination of image denoising algorithm and enhancement algorithm.
[0038] Specifically, multiple denoising and enhancement algorithms (including but not limited to bilateral filter, CLAHE, and Retinex theory) are selected, and their combination methods are determined.
[0039] These algorithms can be flexibly selected and combined according to specific application scenarios to meet different needs.
[0040] Step 3: Define the comprehensive evaluation function.
[0041] A comprehensive evaluation function combining peak signal-to-noise ratio (PSNR) and structural similarity (SSIM) is defined to more comprehensively evaluate image quality and ensure optimal brightness, contrast, and noise removal.
[0042] (1)
[0043] in, and are the weight factors of PSNR and SSIM respectively. Considering the difference in numerical scale, we set .
[0044] In addition, other visual quality assessment indicators, such as visual information fidelity (VIF), can be considered to further improve the evaluation system.
[0045] Step 4: Use the improved SSA to automatically optimize the parameter combination.
[0046] Specifically, the improved SSA is used to automatically optimize the parameter combinations of multiple denoising and enhancement algorithms to ensure the optimal enhancement effect in different scenarios.
[0047] Significantly save time and effort through automated parameter optimization while ensuring consistent and reliable enhancement results.
[0048] Step 5: Perform image denoising and enhancement on new low-light images (images taken in low-light or near-absent conditions).
[0049] The optimized parameter combination is applied to denoise and enhance low-light images, improving the overall image quality and ensuring high-quality image output in various application scenarios.
[0050] Figure 2 Schematic diagram of parameter combination optimization of the present invention, i.e., step 4, specifically comprising the following steps:
[0051] Step 4A: Receive a low-light image and a corresponding high-quality original image as input.
[0052] Low-light images have low contrast and brightness, unclear details, and may contain noise. High-quality images corresponding to low-light images are used as benchmarks for training and evaluation. Collect or generate a dataset containing low-light images and corresponding high-quality original images. These image pairs can come from public datasets (such as the LOL dataset) or be generated through simulation. If simulation generation is used, it is necessary to ensure consistency between each pair of images, that is, the low-light images are generated from the high-quality images in a unified manner (such as reducing brightness, adding noise, etc.). Receive low-light images and the corresponding high-quality original image As input, the input image is normalized and cropped for preprocessing to facilitate the subsequent training process.
[0053] Step 4B: Apply bilateral filtering to the low-light image for denoising to determine the parameters involved in optimization and their value range F1.
[0054] In order to reduce these noises while retaining the important edge information of the image, bilateral filtering is applied for denoising.
[0055] This process requires comprehensive consideration of the spatial proximity of pixels and the similarity of pixel values. The parameters involved in the optimization include:
[0056] Spatial standard deviation : Used to control the size of the spatial neighborhood of pixels, the range is set to [1,3];
[0057] Strength standard deviation : Used to control the influence range of grayscale similarity, the range is set to [0.05, 0.2];
[0058] Window size : Affects the calculation range of the filter, the range is set to [3,7].
[0059] Step 4C: Use Retinex theory to enhance the denoised low-light image to determine the parameters involved in the optimization and their value range F2.
[0060] The Retinex algorithm simulates the way the human visual system processes light, decomposing the image into reflection and illumination components, effectively improving the color fidelity and dynamic range of the image. The parameters involved in the optimization include:
[0061] scale parameter : Used to define illumination estimation at different scales, ranging from [1,8];
[0062] Reflection component weight : Adjust the balance between the reflection component and the illumination component, the range is [0.5,1.0];
[0063] Multi-scale fusion parameters : Used to fuse results of different scales to ensure the improvement of the overall image quality. The range is [0.1, 0.9] and the sum is 1.
[0064] At this stage, the brightness and contrast of the image are significantly improved, and the details in the dark areas are more obvious.
[0065] Step 4D: Further enhance the local contrast of the low-light image based on CLAHE to determine the parameters involved in the optimization and their value range F3.
[0066] In order to further enhance the local contrast of the image while avoiding the over-enhancement problem that may be caused by global methods, CLAHE is introduced. The parameters involved in the optimization include:
[0067] Clipping Limit : Used to control the strength of histogram equalization to prevent artifacts caused by over-enhancement, the range is [2,4];
[0068] Grid size : Used to determine the size of the local area, affecting the equalization effect, and set the square grid in the range of [4,16].
[0069] By adjusting the clipping limits and grid size, you can control the effect of the enhancement, ensuring that the image is neither too flat nor too harsh.
[0070] Step 4E: Obtain peak signal-to-noise ratio (PSNR) and structural similarity (SSIM). This specifically includes the following steps:
[0071] First, calculate the mean squared error (MSE):
[0072] (2)
[0073] in, and Represent the processed low-light image and the original high-quality image, respectively. and are the height and width of the image respectively.
[0074] - Original high-quality image pixels The pixel value at ;
[0075] Then calculate PSNR:
[0076] (3)
[0077] in, The maximum possible value of an image pixel (255 for an 8-bit grayscale image).
[0078] Furthermore, both the original high-quality image and the processed low-light image are divided into 8×8 non-overlapping blocks. The SSIM value of each corresponding block of the two images is calculated using the SSIM formula:
[0079] (4)
[0080] in, Representing an image The average of all pixel values in a small block; Indicates the degree of dispersion of pixel values around their average value, that is, variance; is the covariance, which measures the and The linear relationship between and is a constant used to stabilize the denominator and prevent it from approaching zero. .
[0081] Specifically, include: 、 .
[0082] include: 、 .
[0083] include: .
[0084] average value ,variance and covariance is calculated as follows:
[0085] (5)
[0086] in, It is the first of the small pieces pixel values, is the total number of pixels in the patch.
[0087] (6)
[0088] (7)
[0089] in, and are the first The pixel value at the pixel location.
[0090] In formulas (5) to (7), have the same meaning.
[0091] The SSIM values of all small blocks are summed and averaged to obtain the SSIM value of the entire image.
[0092] In order to find the best parameter combination to achieve the best image quality, the improved sparrow search algorithm is used to search the above parameter combinations { , , , , , , , } for optimization.
[0093] Step 4F: Obtain the optimal parameter combination based on the improved sparrow search algorithm.
[0094] In this optimization process, a comprehensive evaluation function is combined to evaluate the image quality of low-light images under different parameter combination configurations.
[0095] Then, by continuously iteratively updating the positions of individuals in the population, a set of parameter combination settings that can achieve the best image quality is finally found.
[0096] In this way, the conversion process from low-light images to high-quality enhanced images is completed.
[0097] Figure 3 This is a schematic diagram of the improved sparrow search algorithm of the present invention.
[0098] Step 4F1, population initialization.
[0099] In the initialization stage, in order to improve the diversity and uniformity of the initial population and avoid the edge aggregation problem caused by random generation, the logistic map is used to generate the initial population.
[0100] The Logistic mapping formula can be expressed as:
[0101] (8)
[0102] in, is the control parameter that determines the dynamic behavior of the system.
[0103] set up , this value is in the chaotic region, which is used to ensure that the sequence generated by the Logistic mapping has good randomness and uniform distribution characteristics;
[0104] It is the initial value, and the range is set between [0.1, 0.9] to avoid falling into extreme situations;
[0105] Indicates the current iteration number, It is The value of the step, is through The next value calculated.
[0106] Use Selected and , iteratively generates a series of values according to the Logistic mapping formula.
[0107] Since the dimension of the parameter to be optimized is 8, the maximum number of iterations is selected to be 2 to 5 times the dimension of the parameter to be optimized, that is, the maximum number of iterations is set to 16 to 40 times.
[0108] Map the sequence generated by the Logistic Map into the actual optimization parameter space to ensure that the initial values in each dimension are evenly distributed and diverse.
[0109] For the parameter range to be optimized, the generated sequence can be mapped to the actual optimization parameter space through linear transformation. Assume that the value ranges of the parameters to be optimized are ( ), then the linear transformation formula is:
[0110] (9)
[0111] in, It is The actual optimized value of the dimension parameter; It is a value generated by the Logistic map and ranges from [0,1].
[0112] The coordinates composed of these generated values As the position of the initial population, it ensures that the population is distributed more evenly in the solution space, reduces the possibility of edge aggregation, and improves the global search capability.
[0113] Step 4F2: Calculate individual fitness values.
[0114] 1. For each individual, that is, a set of parameter combinations { }, apply this set of parameters to enhance the low-light image to obtain the enhanced image.
[0115] 2. Calculate PSNR and SSIM for the enhanced image and the original high-quality input image, following the same calculations as in step 4E. Then, calculate the comprehensive evaluation function (Formula 1). The result of the comprehensive evaluation function is used as the fitness value of the individual. A higher fitness value indicates a better individual.
[0116] Step 4F3: Calculate the degree of population dispersion.
[0117] In the iterative optimization phase, in order to balance global search and local development capabilities and avoid falling into local optimality, the safety threshold is adaptively adjusted in each iteration according to the current population dispersion:
[0118] First, define the initial safety threshold , used to distinguish between discoverers and followers. Discoverers are responsible for exploring new areas, while followers follow existing paths.
[0119] Then, in each iteration, the dispersion of the current population is calculated to evaluate the diversity of the population and decide whether to strengthen global search or local development.
[0120] Preferably, the average Euclidean distance between all individuals is calculated to characterize the population dispersion. :
[0121] (10)
[0122] in, is the population size, and They are Hedi The position vector of each individual.
[0123] Step 4F4: Dynamically adjust the safety threshold.
[0124] Adaptive adjustment of safety thresholds :
[0125] (11)
[0126] in, Indicates the current safety threshold, is the initial safety threshold, is the initial population dispersion, is the current population dispersion. is the adjustment coefficient, take .
[0127] In the initialization phase, after the initial population is generated using the Logistic map, the dispersion of the population at this time is directly calculated to obtain the initial population dispersion This value serves as a fixed reference point for comparing the current population's dispersion in subsequent iterations. When the population dispersion is high, the safety threshold remains high, encouraging global search; as the population converges, the safety threshold is lowered, emphasizing local development.
[0128] Step 4F5: Distinguish between discoverers and followers.
[0129] Differentiate between discoverers and followers based on fitness value and safety threshold: Sort and select the first 10% of individuals as discoverers and the remaining 90% as followers.
[0130] If you need to further adjust the ratio of discoverers and followers, you can Make dynamic adjustments. When it is higher, more discoverers are selected; when When it is lower, reduce the proportion of discoverers and increase the number of followers.
[0131] Step 4F6: mutation operation.
[0132] To increase the diversity of the population and prevent premature convergence, the differential evolution mutation method is applied to further optimize the population. New individuals are generated by selecting three different individuals and performing linear combinations, and the population is updated based on the fitness.
[0133] Randomly select three different individuals from the current population , and their positions are recorded as .
[0134] Generate a new candidate individual by linearly combining the positions of these three individuals :
[0135] (12)
[0136] in, is the scaling factor, set between [0.5,1].
[0137] Step 4F7: Update individual location.
[0138] The newly generated individuals are compared with the current individuals. If the fitness of the new individuals is better, the current individuals are replaced with the new individuals, thereby updating the population.
[0139] When the termination condition is met, the preset maximum number of iterations is reached Or meet the convergence conditions (such as the best fitness change in multiple consecutive iterations is less than the set threshold When , the iteration stops and the individual with the highest fitness in the current population is output as the optimal parameter combination. Otherwise, continue to calculate the fitness value and repeat the iteration.
[0140] The above description is merely a preferred embodiment of the present invention and does not limit the present invention in any way. Any person skilled in the art who, without departing from the scope of the present invention, makes any equivalent substitution, modification, or other changes to the technical solution and technical content disclosed in the present invention shall be deemed to be within the scope of the present invention and still fall within the scope of protection of the present invention.
Claims
1. A low-light image enhancement method based on an improved sparrow search algorithm, characterized in that: The following steps are involved: Step 1: Improve the sparrow search algorithm, including adaptive dynamic adjustment of the safety threshold; Step 2: Determine the combination of image denoising algorithm and enhancement algorithm; Step 3, define a comprehensive evaluation function; define a comprehensive evaluation function that combines the peak signal-to-noise ratio (PSNR) and the structural similarity (SSIM); Step 4: Use the improved sparrow search algorithm SSA to automatically optimize the parameter combination: Step 4A, receiving a low-light image and a corresponding high-quality original image as input; Step 4B: Apply bilateral filtering to the low-light image for denoising to determine the parameters involved in optimization and their value range F1; The parameters involved in the optimization include: spatial standard deviation, intensity standard deviation, and window size; Step 4C: Enhance the denoised low-light image using Retinex theory to determine the parameters involved in the optimization and their value range F2; The parameters involved in the optimization include: scale parameter, reflection component weight, and multi-scale fusion parameter; Step 4D: Further enhance the local contrast of the low-light image based on CLAHE to determine the parameters involved in the optimization and their value range F3; The parameters involved in the optimization specifically include: shear limit, mesh size; Step 4E, obtaining the peak signal-to-noise ratio (PSNR) and the structural similarity (SSIM); Step 4F: obtaining the optimal parameter combination based on the improved sparrow search algorithm; Adaptive adjustment of safety thresholds : = ; in, Indicates the current safety threshold, is the initial safety threshold, is the initial population dispersion, is the current population dispersion; is the adjustment coefficient, take =1.1; the parameter combination is the set of parameters involved in the optimization determined in steps 4B to 4D; Step 5: Apply the optimized parameter combination to perform image denoising and enhancement on the new low-light image.
2. The low-light image enhancement method based on the improved sparrow search algorithm according to claim 1, characterized in that: The step 1 specifically includes: introducing Logistic mapping to initialize the population and introducing differential evolution mutation.
3. The low-light image enhancement method based on the improved sparrow search algorithm according to claim 2, characterized in that: The differential evolution mutation generates a new individual by selecting three different individuals and performing linear combination.
Citation Information
Patent Citations
Underground fully-mechanized coal mining equipment positioning method based on synchronous positioning and composition
CN115930956A
Image enhancement optimization method based on multi-strategy improved sparrow search
CN119494801A