A semi-supervised low-light image enhancement method based on contrastive learning

By combining contrastive learning and semi-supervised learning frameworks with the CutMix method, the problem of scarce and highly variable paired datasets in low-light image enhancement is solved, and the model achieves efficient enhancement results under different scenes and cameras.

CN118446915BActive Publication Date: 2026-11-27TONGJI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410523697.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-28
Publication Date
2026-11-27
Estimated Expiration
2044-04-28

AI Technical Summary

Technical Problem

In the field of low-light image enhancement, the scarcity of paired datasets and the large differences between datasets lead to difficulties in model training and insufficient generalization performance.

Method used

A semi-supervised learning method based on contrastive learning is adopted. The CutMix method is used to stitch unpaired low-light images with paired low-light images. Combined with the Mean-Teacher semi-supervised learning framework and multiple loss functions, the model is trained using unpaired low-light images to gradually transfer knowledge and improve the generalization ability of the model.

Benefits of technology

It significantly improves the dataset utilization and generalization performance of the low-light image enhancement model, and enhances the model's performance in different scenes and cameras.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118446915B_ABST
    Figure CN118446915B_ABST
Patent Text Reader

Abstract

The technical problem to be solved by the present application is to solve the problems of small paired data set and large difference in the field of low-light image enhancement by using a semi-supervised learning method based on contrast learning.A semi-supervised low-light image enhancement method based on contrast learning, characterized in that it comprises the following steps: step 1, collection and preprocessing of training data set; step 2, selection of model, selection of deep neural network, including two models, respectively called student model and teacher model; step 3, training stage of model, using multiple loss functions to control the whole training process, divided into two parts of supervised learning loss function and semi-supervised learning loss function; step 4, deployment and application stage of model, inputting low-light images into the model trained in step 3 to derive enhanced images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of low-light image enhancement, and more specifically to a semi-supervised low-light image enhancement method based on contrastive learning. Background Technology

[0002] With the development of photographic technology, human production and daily life are often accompanied by the generation of a large amount of image data. Among such massive amounts of image data, there are inevitably images with unsatisfactory image quality due to various reasons. Low-light images are one type of unsatisfactory image that is unavoidable in modern production and daily life. Low-light images typically refer to images where all or part of the image is insufficiently bright, with lost details in dark areas, affecting their normal use; due to the interference of complex electromagnetic and thermal environments on the camera's imaging elements during imaging, dark areas are often accompanied by a lot of high-frequency noise, affecting the overall visual quality and usability of the image. There are generally three situations that cause low-light images:

[0003] The first scenario is that the lighting is sufficient, but due to objects blocking the light, some details in the shadows are lost.

[0004] The second scenario is that the lighting is sufficient, but the overall image is too dark due to camera settings.

[0005] The third scenario is insufficient lighting, which leads to image distortion.

[0006] These low-light images are typically noisy, dim, and have blurred textures, making them quite unusable. However, these less-than-ideal images are not entirely useless; they still contain a considerable amount of information and have some practical value. To address this, researchers proposed the Low Light Image Enhancement (LLIE) task, attempting to computationally enhance low-light images to normal lighting conditions, restoring obscured details. How to enhance low-light images is a common and crucial problem in computational photography.

[0007] Low-light image enhancement has a wide range of applications and is of great importance. Firstly, this technology can improve the visibility of some videos, facilitating scene monitoring and inspection. In poor lighting conditions (such as at night), the image quality of recording devices such as surveillance cameras and dashcams is greatly affected; and data from these devices is often related to legal disputes and public safety, making it particularly important. Low-light image enhancement technology can significantly improve the usability of such video images. Secondly, in live streaming or video calls, users often want to be able to clearly see the other person's face even in low light conditions. The application of this technology can also improve the user experience to some extent. Furthermore, this technology can serve as the front end of other AI content recognition pipelines, assisting other AI in better recognizing faces and other objects in low-light images without needing to develop a new model specifically for low-light scenes.

[0008] The common approach to low-light image enhancement based on deep learning involves using a low-light image as input and employing a neural network to adaptively generate a normal-light image, which can be represented as:

[0009]

[0010] Where F represents the neural network, θ represents the weight parameters of the neural network, and x represents the input low-light image. This represents an adaptively generated image with normal lighting.

[0011] The key to this method lies in obtaining the neural network weight parameters θ, i.e., training the neural network F. Training typically requires a low-light-normal-light paired dataset S, consisting of multiple sets of one-to-one paired low-light images x. i and normal lighting image y i Both scenarios involve shooting in the same scene, requiring identical perspectives, scene elements, and other characteristics, so that the neural network can directly learn the mapping from low-light scenes to normal-light scenes. The optimization objective can be expressed as:

[0012] θ * =argmin θ L(F(x i ;θ),y i (2)

[0013] Here, L represents the loss function, which measures the similarity between two input images. A lower output value indicates a higher similarity, such as Least Squares Error (MSE) and Learning Perceptual Image Patch Similarity (LPIPS).

[0014] Research on low-light image enhancement began as early as 1977 and has experienced a resurgence with the explosion of deep learning technology in this century, making significant progress in recent years. Generally speaking, deep learning-based methods typically outperform traditional methods; however, applying deep learning to low-light image enhancement still faces the following challenges:

[0015] (1) Difficulty in obtaining paired datasets: Training deep neural networks often requires a certain amount of data support, among which paired training sets are particularly important. Paired training data is theoretically the most ideal training data, namely low-light images and normal-light images taken for the same scene. This type of paired data allows the neural network to directly learn the mapping from low-light scenes to normal-light scenes, and is the simplest and most ideal training data. However, obtaining such data is often very difficult: it is difficult to keep the scene unchanged when taking images, and it is even more difficult to cover as many application scenarios as possible. For this reason, compared with image denoising and image super-resolution tasks, which are also low-level image restoration tasks, the available paired datasets in the field of low-light image enhancement are very scarce. This problem can be seen from the research work related to low-light image enhancement: most models in this field use only a few paired datasets such as LOL, LOLv2, and SID, and the dataset size is relatively small, far less rich than the datasets in fields such as image classification and object recognition.

[0016] (2) Large differences between datasets: Images from different datasets often exhibit significant domain gaps. Domain gaps refer to the performance loss of deep learning models due to inconsistencies in the distribution characteristics of the training and test sets. Furthermore, low-light images are often accompanied by significant noise, and different cameras produce different noise distributions in low-light scenes. Some current models only perform well when processing low-light images taken with specific camera models. Additionally, low-light image datasets typically only cover a specific scene, and traditional supervised learning-based low-light image enhancement models often suffer severe performance losses in scenes different from the training set, affecting the model's generalization performance. Low-light image enhancement models usually need to process images from different scenes and different cameras, which often leads to unstable model performance. Summary of the Invention

[0017] The technical problem to be solved by this invention is

[0018] We utilize a semi-supervised learning method based on contrastive learning to address the problem of scarce and highly variable paired datasets in the field of low-light image enhancement.

[0019] Technical solution

[0020] A semi-supervised low-light image enhancement method based on contrastive learning, characterized by the following steps:

[0021] Step 1: Collection and Preprocessing of Training Dataset

[0022] Data sets were collected, using a low-light-normal-light paired dataset and a low-light unpaired dataset as training datasets.

[0023] Preprocessing: After acquiring the desired image, it is cropped to a specific size, and the data in a random area of ​​the unpaired low-light image is replaced with the data in a random area of ​​the same size of the paired data.

[0024] Step 2: Model Selection

[0025] We choose a deep neural network, which includes two models, referred to as the student model and the teacher model.

[0026] Step 3: Model Training Phase

[0027] The entire training process is controlled by multiple loss functions, which can be broadly divided into two parts: supervised learning loss function and semi-supervised learning loss function.

[0028] Semi-supervised learning based on contrastive learning is carried out on the basis of supervised learning.

[0029] 3.1 Supervised Learning of Deep Neural Networks

[0030] Two models are used: a student model that participates in backpropagation and gradient descent, and a teacher model that updates weights after each iteration using EMA (Exponential Moving Average). After initializing the weights of the neural network, the student model undergoes supervised learning, trained on a paired dataset, to learn basic mapping relationships during this step.

[0031] 3.2 Semi-supervised learning based on contrastive learning

[0032] 3.2.1 Building upon the supervised learning completed in step 3.1, the model will undergo semi-supervised learning based on contrastive learning. To conserve GPU memory during training, gradient accumulation will be used.

[0033] 3.2.2 Two models are input into the same paired low-light image to obtain a normal-light image. In this invention, the output of the student model is used as the anchor point, the corresponding paired normal-light image is used as the positive sample, and the output of the teacher model is used as the negative sample. Comparative learning training is carried out, the loss function is calculated, backpropagation is performed, and gradients are accumulated.

[0034] 3.2.3 Two models are input into the same unpaired low-light image to obtain a normal-light image. In this invention, the output of the student model is used as the anchor point, the output of the teacher model is used as the positive sample, and the unpaired low-light image with simple brightness adjustment is used as the negative sample. Contrastive learning training is carried out, the loss function is calculated, backpropagation is performed, gradients are accumulated, and weights are updated.

[0035] Step 4: Deployment and Application Phase of the Model

[0036] Using the low-light image as input to the model trained in step 3.2.3, the enhanced image can be derived without preprocessing.

[0037] In the application phase, unlike the training phase which requires random cropping and pasting of the input image, the model directly inputs the entire image into the model for derivation.

[0038] During the deployment phase, only one trained deep neural network is involved. Attached Figure Description

[0039] Figure 1 This is a flowchart illustrating the overall framework of the present invention;

[0040] Figure 2 This is a visual comparison of the SID cross-database test in the embodiments of the present invention; Detailed Implementation

[0041] This invention proposes a semi-supervised low-light image enhancement method based on contrastive learning. By using a Mean-Teacher semi-supervised learning framework and a contrastive learning method, it effectively utilizes relatively readily available unpaired low-light images during training, effectively solving the problems of difficult acquisition and small datasets for paired low-light images. Simultaneously, based on the CutMix method, data within a random region of the unpaired low-light image is replaced with data from a randomly located region of the same size in the paired image, achieving adaptation from the paired image domain to the unpaired image domain. Furthermore, through a series of carefully designed contrastive learning loss functions and supervised / semi-supervised learning loss functions, the low-light image enhancement and generalization capabilities of the deep neural network are effectively improved. Extensive experimental validation has further validated this method.

[0042] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.

[0043] A semi-supervised low-light image enhancement method based on contrastive learning includes the following steps:

[0044] Step 1: Collection and preprocessing of the training dataset

[0045] This step involves acquiring and preprocessing the images used for training the deep neural network. The paired and unpaired low-light images used in training need to be cropped to a specific size. Simultaneously, to address the issue of large differences between datasets, this invention introduces the CutMix method, which crops portions of the paired low-light images onto the unpaired low-light images.

[0046] Preprocessing includes the following two steps:

[0047] Step 1.1 Crop the image to a specific size

[0048] This step randomly crops the input image to a specific uniform width and height, which can be represented as:

[0049]

[0050] in, The image represents the cropped image, P represents the number of horizontal / vertical pixels in the training image, and i represents the number of pixels in the training image. start and j start These represent the x and y coordinates of the starting point of the cropped image, which will be randomly selected within the range of the original image. Images marked with a cap in this text and below... Both represent the cropped image I.

[0051] Step 1.2 Image stitching and mask calculation

[0052] Image stitching, also known as the CutMix method, stitches random portions of low-light images from paired datasets to random positions on low-light images from unpaired datasets, using the combined images as the input image for a neural network. This method aims to guide the neural network to gradually transfer the knowledge learned from the paired datasets to the unpaired datasets. At the same time, to facilitate the calculation of the loss function, it is also necessary to label the regions from the paired images in the stitched image, which are calculated in the form of a mask.

[0053] Image stitching and mask calculation consist of the following four steps:

[0054] Step 1.2.1 Calculate the proportion p

[0055] The CutMix ratio p satisfies the following formula and is provided to step 1.2.2:

[0056] p = clamp(prop, 0.1, 0.9)

[0057] prop ~ N(1-epoch) c / epoch t ,1) (4)

[0058] Here, `clamp(x, a, b)` restricts the range of input `x` to the interval [a, b], and `epoch` represents the number of epochs. c This represents the current epoch number. t Let p represent the total number of epochs, and N represent the normal distribution. It is easy to see that the expected value of the CutMix ratio p gradually decreases as training progresses until it reaches 0. However, the ratio p still has a certain degree of randomness. The position and size of the CutMix region in the input images used for training in each epoch are not exactly the same. That is, the proportion of unpaired low-light images in these inputs is increasing, but some paired low-light images are still retained. The model will gradually transfer the knowledge it has learned in supervised learning to the unpaired image domain, and eventually achieve better performance in the unpaired image domain.

[0059] Step 1.2.2 Determine the cutting area

[0060] The width of the cropping box for paired images is determined based on the ratio p. len_x High box len_y and the vertex position of the cropped portion on the unpaired image (box) x_0 box y_0 ) and (box) x_1 box y_1 ):

[0061]

[0062] box x_0 ~U(0, W-box len_x ), box y_0 ~U(0, H-box len_y (5)

[0063] box x_1 =box x_0 +box len_x box y_1 =box y_0 +box len_y

[0064] Where W is the number of pixels in the horizontal direction of the paired low-light image, H is the number of pixels in the vertical direction of the paired low-light image, and U represents uniform distribution.

[0065] The calculated position is then used to proceed to step 1.2.3.

[0066] Step 1.2.3 Calculate the mask

[0067] Calculate the mask based on the above data:

[0068]

[0069] Here, mask(x, y) represents the value of the mask at the horizontal coordinate x and the vertical coordinate y.

[0070] The calculated mask will be used in step 1.2.4 to calculate the splicing result and in step 3 to participate in the calculation of the loss function.

[0071] Step 1.2.4 Stitching Images

[0072] Finally, based on the mask and paired low-light images Unpaired low-light images The final splicing result is calculated. Here, ⊙ represents element-level multiplication:

[0073]

[0074] Step 2 Network Framework

[0075] The entire framework primarily consists of two identical neural networks (called the "skeleton network"), referred to as the student model and the teacher model, respectively. The skeleton network can utilize models that perform well in image restoration, such as Restormer and NAFNet. Figure 1 As shown.

[0076] Step 3 Training Phase

[0077] This method uses multiple loss functions to control the entire training process, which can be broadly divided into two parts: supervised learning loss function and semi-supervised learning loss function.

[0078] Semi-supervised learning based on contrastive learning is carried out on the basis of supervised learning.

[0079] 3.1 Supervised Learning of Deep Neural Networks

[0080] The student model parameters are trainable, while the teacher model does not participate in backpropagation. Instead, its parameters are obtained from the student model using an exponential moving average (EMA) method, which can be represented by the following formula:

[0081] θ′ t =α×θ′ t-1 +(1-α)×θ t-1 (8)

[0082] Where, θ′ t θ represents the parameters of the teacher model at iteration number t. t This represents the parameters of the student model at iteration number t, where α is an adjustable hyperparameter responsible for controlling the proportion of the original parameters during one EMA.

[0083] Supervised learning part loss sup L only s One item is:

[0084] Loss sup =L s

[0085]

[0086]

[0087]

[0088] Among them, S L Represents a paired dataset, (x i y i ) represents the paired low-light / normal-light image pairs extracted from it. S (·;θ) represents the student model with parameter θ, F LPIPS (y i f S (x i ;θ)) represents inputting the student model into the low-light image x i The resulting output is compared with the corresponding normal illumination image y. i Calculate LPIPS loss, F SSIM (y i f S (x i Similarly, θ))

[0089] 3.2 Semi-supervised learning based on contrastive learning

[0090] The loss function that controls this process is called the semi-supervised learning function, which can be expressed as:

[0091]

[0092]

[0093] in, and λ0 is a fixed hyperparameter, and λ0 is a hyperparameter that increases with increasing epoch. c This represents the current epoch number. t This represents the total number of epochs.

[0094] Consistency loss L c for:

[0095]

[0096] y s_c =fS (x c ;θ)

[0097] y t_c =f T (x c ;θ′) (11)

[0098]

[0099]

[0100] in, Represents the dataset S of unpaired low-light images U Low-light images extracted from the image. Indicates the pairing dataset S L The low-light image extracted from the input images, CutMix(a, b), represents the patching and cropping operation mentioned above performed on the input images a and b. S (·;θ) represents the student model with parameter θ, f T (·;θ) represents a teacher model with parameter θ. F BML1 The consistency loss between the unpaired dataset portions of the output images of the two models is calculated within a batch scale. (1-mask) represents subtracting the mask from a matrix of all 1s of the same size, which is equivalent to inverting the mask.

[0101] Contrast similarity loss and for:

[0102]

[0103]

[0104]

[0105]

[0106]

[0107]

[0108]

[0109]

[0110] in, This represents the output of the student model after inputting paired low-light images. This represents the output of the teacher model after inputting a paired low-light image; This represents the output of the student model after inputting the CutMix image. This represents the output of the teacher model after inputting the CutMix image. mean(·) represents calculating the average value for each pixel in the image, F... RA The range of the L1 loss is surjected onto the interval [0, 1], F MaskL1 Calculate the mean square error from the effective region of the mask within a single image.

[0111] As can be seen from the above formula, this training algorithm uses the output of the student model as the anchor point, the output of the teacher model as the positive sample, and the unpaired low-light image with simple brightness adjustment as the negative sample to carry out comparative learning training.

[0112] Step 4: Application Deployment Phase

[0113] Unlike the random cropping and pasting operations required during training, the model trained in step 3 will not perform the above operations on the input low-light image during the deployment and application stage. Instead, the entire image will be directly input into the model for derivation.

[0114] During the deployment phase, the network that performs better between the student model and the teacher model is selected for low-light image enhancement. The choice is as follows:

[0115]

[0116] Where x represents the input image of the model, The output image represents the model and is identical to the input image; F(·θ) represents the deep neural network, where θ represents the trained model parameters. Many deep neural network parameters can be generated during a single training iteration, and the parameters used during inference are determined by the image quality evaluation metrics of the output results on the validation set.

[0117] Advantages of the present invention

[0118] (1) Effective Utilization of Unpaired Low-Light Images. To effectively utilize unpaired low-light images, which contain a wealth of feature information but cannot be directly used for supervised learning tasks, this invention constructs a training method based on a Mean-Teacher semi-supervised learning framework and contrastive learning. Unpaired low-light images are introduced into the training of deep learning models and deeply participate in contrastive learning-based semi-supervised learning. This invention significantly increases the number of datasets available for training deep learning models for low-light image enhancement; simultaneously, after introducing unpaired low-light images, the model's low-light image enhancement capability and generalization performance are significantly improved.

[0119] (2) Training methods to improve model generalization. This invention combines the CutMix method, the Mean-Teacher semi-supervised learning framework, and the contrastive learning method to establish an effective linkage mechanism between different datasets, i.e., different feature spaces. This gradually induces the model to transfer the knowledge learned from the paired dataset to the unpaired dataset to adapt to the features of the latter, thereby significantly improving the model's generalization ability, especially its performance under similar scene features.

[0120] Key points of the invention

[0121] 1. Effective utilization of unpaired low-light images

[0122] Unpaired low-light images cannot be directly applied to traditional low-light image enhancement training tasks, but they often contain a wealth of exploitable information. This invention combines the CutMix method, the Mean-Teacher semi-supervised learning framework, and the contrastive learning method. Using the student model's output as the anchor point, paired normal-light images and unpaired normal-light images output by the teacher model are considered positive samples, while paired normal-light images output by the teacher model and unpaired low-light images with slightly adjusted brightness are considered negative samples. By reasonably setting the training objective and applying a loss function validated through extensive experiments, the effective utilization of unpaired low-light images is achieved, significantly improving the model's low-light image enhancement and generalization capabilities.

[0123] 2. Cross-dataset generalization mechanism

[0124] To address the issue of varying scenes and inconsistent feature distributions in low-light image enhancement, which cause many models to perform well on one dataset but poorly on another, this invention combines the CutMix method, the Mean-Teacher semi-supervised learning framework, and the contrastive learning method to establish an effective linkage mechanism between different datasets, i.e., different feature spaces. This gradually induces the model to transfer knowledge learned from paired datasets to unpaired datasets to adapt to the latter's features, resulting in a significant improvement in the model's generalization ability, especially under similar distributions in the latter dataset.

[0125] Example

[0126] Dataset

[0127] Experiments were conducted on the LOLv2 and SID datasets. To demonstrate the model's cross-database testing capability, the LOLv2 dataset was used as the paired dataset, and the low-light image portion of the SID dataset was used as the unpaired low-light image dataset. To demonstrate the model's generalization ability, the SDSD dataset was additionally used as an supplementary dataset and rotated with the LOLv2 and SID datasets for testing.

[0128] Method Application

[0129] This invention uses Transformer-based Restormer and traditional CNN-based NAFNet as backbone networks for experiments to demonstrate the effectiveness of the proposed method across various neural network architectures. The training batch size (BS) was set to 2, and the patch size (PS) was set to 192. During training, the Adam optimizer was used with β1 of 0.9 and β2 of 0.999. The initial learning rate was 2e-4, gradually decaying using cosine annealing, decreasing to 1e-6 at 350 epochs. Semi-supervised learning began after 100 epochs. The exponential moving average decay (EMA decay) was 0.99.

[0130] Comparison of Implementation Results

[0131] Table 1. Comparative experimental results of this invention with other models on the LOLv2 dataset and the cross-database SID dataset.

[0132]

[0133] For ease of comparison, this invention selects several advanced low-light image enhancement methods for comparison, among which LIME is a traditional statistical method, Zero-DCE and EnlightenGAN are unsupervised learning methods, and the rest are supervised learning methods. The following mainly reports the performance comparison of this invention with several other methods on PSNR and SSIM in the LOLv2 dataset and the cross-database SID dataset.

[0134] Table 1 presents quantitative results on the LOLv2 dataset and the cross-database SID dataset. The present invention performs excellently in most experimental settings. For clarity, the first and second performing methods are indicated by bold and underline, respectively.

[0135] Table 2 presents the quantitative results of testing the Restormer backbone network of this invention on multiple datasets. The results are divided into three parts: the first row of each part shows benchmark results without using this invention, and the second row shows experimental results using this invention. It is evident that this invention can significantly improve the model's performance on unpaired datasets while maintaining or even improving its performance on paired datasets. It can also improve performance to some extent on datasets not used in training and validation within unseen domains.

[0136] Table 2 shows the comparative experimental results of this invention using Restormer as the backbone network on multiple dataset combinations.

[0137]

[0138] Figure 2 Visual comparison results of the present invention and previous methods on the SID dataset are presented. It can be seen that the output color reproduction capability of the present invention is significantly superior and most closely approximates the target image. Compared to other outputs, the results from the present invention… Figure 2 The image retains the most detail in the dark areas, with clearer font boundaries and less smearing. While LLFlow's output appears better than this invention in this example, its enhancement of dark areas is too aggressive, resulting in lower text clarity. Furthermore, in other test examples, the overall tone of LLFlow's output differs significantly from the target image. Compared to its own previous version, Figure 2 Compared to Restormer without this invention, k provides better enhancement in dark areas, retains more detail, and has no noticeable smearing effect.

Claims

1. A semi-supervised low-light image enhancement method based on contrastive learning, characterized in that, Includes the following steps: Step 1: Collection and preprocessing of the training dataset; Step 2 Model Selection We choose a deep neural network, which includes two models, referred to as the student model and the teacher model. Step 3: Model Training Phase The entire training process is controlled by multiple loss functions, which are divided into two parts: supervised learning loss function and semi-supervised learning loss function. Step 4: Deployment and Application Phase of the Model Using the low-light image as input to the model trained in step 3, the enhanced image is derived. Step 3 includes: 3.1 Supervised Learning of Deep Neural Networks Two models are used, with the student model participating in backpropagation and gradient descent, and the teacher model updating the weights after each iteration using exponential moving average (EMA). After initializing the weights of the neural network, the student model will undergo supervised learning, trained using a paired dataset, in order for the model to learn the basic mapping relationships in this step. 3.2 Semi-supervised learning based on contrastive learning 3.2.1 Based on the supervised learning completed in step 3.1, the model will undergo semi-supervised learning based on contrastive learning; 3.2.2 Two models are input with the same paired low-light image to obtain normal-light image; the output of the student model is used as the anchor point, the corresponding paired normal-light image is used as the positive sample, and the output of the teacher model is used as the negative sample. Comparative learning training is carried out, the loss function is calculated, backpropagation is performed and gradients are accumulated. 3.2.3 Two models are input into the same unpaired low-light image to obtain a normal-light image; the output of the student model is used as the anchor point, the output of the teacher model is used as the positive sample, and the unpaired low-light image with brightness adjustment is used as the negative sample. Comparative learning training is carried out, the loss function is calculated, backpropagation is performed, gradients are accumulated, and weights are updated. 3.1 Supervised Learning of Deep Neural Networks The student model parameters are trainable, while the teacher model does not participate in backpropagation. Instead, its parameters are obtained from the student model using an exponential moving average (EMA) method, as shown in the following formula: (8) in, This represents the parameters of the teacher model at iteration number t. This represents the parameters of the student model at iteration number t. It is an adjustable hyperparameter, responsible for controlling the proportion of the original parameters during one EMA process; Supervised learning section Include One item is: (9) in, Represents a paired dataset. This represents the paired low-light / normal-light image pairs extracted from it; The parameter is Student model, This indicates that the student model is input into a low-light image. The resulting output and the corresponding normal lighting image Calculate LPIPS loss. Similarly; 3.2 Semi-supervised learning based on contrastive learning The loss function that controls this process is called the semi-supervised learning function, and is expressed as: (10) in, and For fixed hyperparameters, These are hyperparameters that increase with increasing epoch. Indicates the current epoch number. This represents the total number of epochs; Consistency loss for: (11) in, Represents a dataset of unpaired low-light images Low-light images extracted from the image. Indicates from paired dataset Low-light images extracted from the image. Represents the input image and images Perform the collage and cut operation mentioned above. The parameter is Student model, The parameter is Teacher model; Calculate the consistency loss between the unpaired dataset portions of the output images of the two models within a batch scale; This means subtracting the mask from a matrix of all ones of the same size. This is equivalent to reversing the mask. ; Contrast similarity loss and for: (12) in, This represents the output of the student model after inputting a paired low-light image. This represents the output of the teacher model after inputting paired low-light images; This represents the output of the student model after inputting the CutMix image. This represents the output of the teacher model after inputting the CutMix image; This indicates that the average value is calculated for each pixel of the image. Surround the range of L1 loss to Within the interval, Calculate the mean square error from the effective region of the mask within a single image.

2. The semi-supervised low-light image enhancement method based on contrastive learning as described in claim 1, characterized in that, In step 1, The collected dataset uses a low-light-normal-light paired dataset and a low-light unpaired dataset as training datasets. The preprocessing involves cropping the desired image to a specific size after acquisition and replacing the data in a random region of the unpaired low-light image with data from a random region of the same size in the paired data.

3. The semi-supervised low-light image enhancement method based on contrastive learning as described in claim 2, characterized in that, Preprocessing includes the following two steps: Step 1.1 Crop the image to a specific size This step randomly crops the input image to a specific uniform width and height, and is represented as: (3) in, This represents the cropped image. This represents the number of horizontal / vertical pixels in the training image. and The x and y coordinates represent the starting point of the cropped image, and are randomly selected within the range of the cropped image without exceeding the original image. Step 1.2 Image stitching and mask calculation Image stitching employs the CutMix method, which stitches random portions of low-light images from paired datasets to random positions on low-light images from unpaired datasets, combining the two as the input image for the neural network. This method aims to guide the neural network to gradually transfer the knowledge learned from the paired datasets to the unpaired datasets. Simultaneously, to facilitate the calculation of the loss function, regions from the paired images in the stitched image need to be labeled and calculated in the form of a mask.

4. The semi-supervised low-light image enhancement method based on contrastive learning as described in claim 3, characterized in that, The image stitching and mask calculation consists of the following four steps: Step 1.2.1 Calculate the proportion CutMix Ratio The following formula must be satisfied and provided to step 1.2.2: (4) in, Indicates that you will input The range is limited to an interval Inside, Indicates the current epoch number. This represents the total number of epochs. Represents a normal distribution; CutMix proportion The expected value of the equation gradually decreases as training progresses, until it reaches 0, and the proportion... There is a certain degree of randomness; the location and size of the CutMix region in the input image used for training are not exactly the same in each epoch. Step 1.2.2 Determine the cutting area Based on proportion Determine the width of the paired image cropping frame ,high Vertex positions of the cropped portion on the unpaired image and : (5) in, To match the number of pixels in the horizontal direction of the low-light image, To match the number of pixels in the vertical direction of the low-light image, Indicates a uniform distribution; The calculated position is then used to proceed to step 1.2.3; Step 1.2.3 Calculate the mask Calculate the mask based on the above data. : (6) in, Indicates mask In the horizontal coordinate and vertical coordinates The value at; Calculated mask This will proceed to step 1.2.4 for calculating the splicing result and to step 3 for calculating the loss function; Step 1.2.4 Stitching Images Finally, based on the mask and paired low-light images Unpaired low-light images The final splicing result is calculated. , here Element-level multiplication: (7)。

Citation Information

Patent Citations

  • Carrier roller monitoring method and device based on three-light fusion and inspection robot

    CN115239652A

  • Semi-supervised target detection method and system based on multistage pseudo label enhancement

    CN117253071A