Image Processing & Computational Photography
Low-Light Image Enhancement
Recovering a well-exposed, natural-looking image from one taken in poor light; global curves, Retinex illumination estimation with max-RGB and edge-aware refinement, Zero-DCE's light-enhancement curves and non-reference losses, Retinexformer, and raw-to-RGB learning in the dark, with the benchmarks and metrics used to compare them.
intermediate
Low-light image enhancement takes a photograph made with too little light and produces one that looks properly exposed: dark regions brought up to a visible level, colours kept, noise and artefacts held down, and regions that were already well lit left alone. It is an enhancement task in the sense of image processing: for a given dark photograph there is no single correct output, only a reference that someone captured or chose. It matters both for photographs that people look at and as preprocessing for vision systems that must work at night, such as face and object detectors.
Three things go wrong together in a dark image. The signal is small, so after amplification the noise that was already there becomes visible. Light can be uneven, so a picture can be under-exposed in its shadows and well exposed elsewhere. And, as Retinexformer (§1) puts it, enhancement must also deal with colour distortion hidden in the dark or introduced by brightening. A brightening operation that ignores any one of these produces a familiar failure: grainy shadows, washed-out highlights, or colour casts.
This article covers the problem and its formulation as illumination estimation under the Retinex model, the curve-based and Retinex-based classical methods, the main learned families (supervised, unpaired, zero-reference and raw-to-RGB), the benchmarks and metrics, and an example that compares global curves with illumination division on a scene with a hard shadow.
Problem Definition
The common formulation, which Zero-DCE (Guo et al., 2020, §2) describes for the classical methods and Retinexformer (Cai et al., 2023, §3.1) starts from, is the Retinex model attributed to Land (1977): an image is the element-wise product of a reflectance and an illumination,
In Retinexformer’s notation and have three colour channels and one, and is regarded as the well-exposed image. Zero-DCE summarizes the classical consequence: the reflectance is assumed to be the same under any lighting, so enhancement becomes a problem of estimating the illumination. Once is known, is an estimate of the reflectance.
The model is too clean for real dark images. Retinexformer adds perturbations to both factors,
and multiplies by a light-up map with . The lit-up image is then , where the corruption collects noise hidden in the dark and amplified by , and the under- or over-exposure and colour distortion that an error in causes (Cai et al., 2023, Eqs. 2–4). The task is therefore two problems in one: estimate how much to brighten each pixel, and remove what the brightening exposes.
Input and Output
The input is a single under-exposed image, either 8-bit sRGB from a camera’s processing pipeline, or the camera’s raw sensor data. The output is an sRGB image of the same size. Some methods also expose an intermediate: an illumination or light-up map (Retinex methods), a set of curve parameter maps (Zero-DCE), or a brightness factor chosen by the user (SID’s amplification ratio).
Variants
- By supervision. Paired methods train on low- and normal-light pairs of the same scene; Zero-DCE (§2) describes how such pairs are made by simulating darkness, by changing exposure time and ISO during capture (as for the LOL dataset), or by expert retouching (as for MIT-Adobe FiveK). Unpaired methods such as EnlightenGAN learn from unrelated sets of dark and bright images with a discriminator, which Zero-DCE notes usually requires careful selection of the unpaired data. Zero-reference methods, Zero-DCE first among them by its own account, use no reference images at all, only losses computed on the output.
- By input. sRGB enhancement works after the camera has already quantized, tone-mapped and partly denoised the signal. Raw-to-RGB methods such as Learning to See in the Dark (SID; Chen et al., 2018) replace the camera pipeline and see the linear sensor values.
- By output target. Some methods aim at a reference photograph (PSNR and SSIM against a long exposure or an expert’s edit); others aim at an output that looks well exposed by no-reference criteria or by user studies.
- Related tasks. Multi-frame capture in the dark, such as burst merging, is covered in computational photography; compressing a well-exposed but high-dynamic-range scene is tone mapping; HDR imaging records such scenes in the first place.
Challenges
- Noise amplification. Brightening multiplies the signal and the noise together. A point operation cannot change their ratio, as point operations explains; Retinexformer (§1) criticizes traditional Retinex methods for assuming noise-free inputs, which leads to severe noise and local colour distortion. SID (§1) makes the same point about scaling or histogram stretching of a dark image, which does not resolve the low signal-to-noise ratio caused by low photon counts.
- Non-uniform light. A back-lit face and a bright window in one frame need opposite corrections. A single curve maps equal input values to equal output values wherever they are, so it cannot brighten a shadowed surface without also brightening an equally dark but correctly exposed one. Zero-DCE (§3.1) observes that a global mapping tends to over- or under-enhance local regions, which is why its curves are per pixel.
- Edges of shadows. An illumination estimate that is smooth across a hard shadow boundary produces a band of wrong brightness along it, the same mechanism that causes halos in local tone mapping. Edge-aware smoothing reduces it.
- Colour. Retinexformer (§1) lists colour distortion among the corruptions to be restored, and Zero-DCE (§4.1) found severe colour casts when its colour constancy loss, below, was removed.
- No ground truth. A long exposure of the same scene is a reference, not the answer: it has its own noise, motion and exposure choice. Some benchmarks with references are small (LOL-v1 has 15 test pairs, below), and the no-reference test sets have none.
Approaches
Global curves and histogram methods
The simplest methods brighten through a single monotone curve: a power law as in gamma correction, a logarithm or another point operation, or the data-driven curve of histogram equalization, applied globally or in tiles as in CLAHE. Retinexformer (§2.1) calls these plain methods and notes that they directly amplify visibility and contrast while barely considering the illumination, so the result can be perceptually inconsistent with a real normal-light scene. In our reading, their strengths are speed, predictability and the absence of halos.
Retinex decomposition and illumination estimation
Retinex methods estimate and divide. Single- and multiscale retinex do so with a Gaussian surround in the log domain; frequency domain filtering treats them, and homomorphic filtering, as filters, including their noise amplification in dark regions. Methods built for enhancement differ mainly in how they estimate the illumination.
LIME (Guo, Li and Ling, 2017) is the example that the learned papers cite. As Zero-DCE (§2) describes it, LIME first estimates a coarse illumination map as the maximum of the three colour channels at each pixel and then refines it with a structure prior; Retinexformer (§2.1) likewise describes it as refining an initial illumination map by imposing a structure prior on it. The max-RGB estimate
follows from the model: with grey illumination, , so dividing by it recovers , the reflectance with its brightest channel scaled to one. It keeps hue but discards the lightness differences between surfaces, and it inherits every texture edge of the scene. A refinement step smooths within surfaces while keeping it sharp at illumination boundaries. Zero-DCE also lists a weighted variational model that estimates reflectance and illumination together (Fu et al., 2016) and a Retinex model with a noise term (Li et al., 2018), both of which it compares with.
The guided filter of He, Sun and Tang (2013) is an edge-aware smoother of this kind: it fits a local linear model of the output in terms of a guide image within each window, so the output has an edge only where the guide does; the authors list dehazing among its applications. The example below uses it as a readable stand-in for LIME’s refinement, not as LIME’s own method.
Zero-DCE: curve estimation without references
Zero-DCE (Guo et al., 2020) recasts enhancement as estimating an image-specific curve rather than mapping images to images. Its light-enhancement curve (LE-curve) is a quadratic,
applied separately to each RGB channel of an image normalized to . The design goals in §3.1 are that outputs stay in , that the curve is monotone to preserve the differences (contrast) of neighbouring pixels, and that it is simple and differentiable. Applied iteratively,
with in the paper, it forms a higher-order curve with stronger curvature, and replacing the scalar by a parameter map with one value per pixel makes it a pixel-wise curve, since, as §3.1 puts it, a global curve tends to over- or under-enhance local regions. A small network, DCE-Net (seven 3×3 convolutional layers of 32 channels with ReLU, symmetric concatenations, and a final tanh), outputs the 24 maps for 8 iterations and 3 channels; the paper gives 79,416 trainable parameters and 5.21 GFLOPs for a 256×256×3 input.
Training uses four losses, none of which needs a reference image (§3.3):
- Spatial consistency keeps the differences between each 4×4 region and its four neighbours the same in the output as in the input.
- Exposure control pulls the mean intensity of each of non-overlapping 16×16 regions toward a well-exposedness level :
with ; the authors report little difference for between 0.4 and 0.7.
- Colour constancy penalizes squared differences between the mean values of each pair of channels, following the gray-world hypothesis.
- Illumination smoothness is a total-variation penalty on each parameter map.
The total loss is . The network was trained on 2,422 images from Part 1 of the SICE multi-exposure dataset, with over-exposed as well as under-exposed images; in the ablation, training without the over-exposed images led the model to over-enhance well-lit regions such as faces, removing the exposure loss failed to recover low-light regions, removing the colour loss produced severe colour casts, and reducing to 1 lowered quality visibly (§4.1). The paper names noise as future work (§5).
Supervised Retinex networks and Retinexformer
Wei et al.’s RetinexNet (2018), the work that Zero-DCE and Retinexformer cite for the LOL dataset, and follow-up works combine a Retinex decomposition with convolutional networks; Retinexformer (§1, §2.1) describes them as multi-stage, with separate networks to decompose the image, denoise the reflectance and adjust the illumination, trained independently and then fine-tuned together. Retinexformer (Cai et al., 2023) trains one stage end to end. Its illumination estimator takes the image and an illumination prior , the per-pixel mean over channels, and predicts a three-channel light-up map and a light-up feature. The lit-up image then goes to a corruption restorer, a three-scale U-shaped Transformer whose attention treats each channel’s feature map as a token, so that its cost grows linearly with the number of pixels, and uses the light-up feature to weight the values (Eq. 9). The authors estimate rather than because division by small illumination values is numerically fragile (§3.1). In their ablation on SDSD-outdoor (Table 4b), feeding the restorer itself gave 28.86 dB PSNR, divided by an estimated (with a constant of added) 28.97 dB, 29.26 dB, and adding the light-up feature to the attention 29.84 dB.
Unpaired and adversarial methods
EnlightenGAN (Jiang et al.) learns from unpaired low- and normal-light images with discriminators and purpose-designed losses, as Zero-DCE (§2) describes it. Zero-DCE notes that such methods remove the need for paired data but depend on the choice of unpaired images.
Raw-to-RGB in extreme low light
Chen et al. (2018) address the darkest regime: the illuminance at the camera in their Figure 1 is below 0.1 lux and the exposure 1/30 s. Their pipeline packs Bayer raw data into four half-resolution channels, subtracts the black level, multiplies by an amplification ratio supplied from outside (like an ISO setting, and the user’s brightness control), and runs a U-net trained with an L1 loss that outputs sRGB directly. In their controlled experiments (Table 3), the default pipeline reached 28.88 dB PSNR and 0.787 SSIM on the Sony set; applying the same network to sRGB images from the traditional pipeline instead of raw data gave 17.40 dB and 0.554 there (on the Fuji set, 26.61 dB against 25.11 dB). The raw route connects low-light enhancement to the digital camera pipeline and to raw image denoising.
Example: global curves against illumination division
The script builds a scene whose reflectance and illumination are known and compares two families: global curves, which brighten every pixel by the same rule, and max-RGB illumination division, raw or smoothed. It is an illustration, not a benchmark: the scene, the shadow’s strength and the smoothing parameters were fixed when the example was planned so that the effect of a hard shadow shows, and the parameters of the two smoothers (Gaussian pixels; guided filter radius and ) were taken from a planning feasibility check and not tuned afterwards.
Scene. The reflectance is a 256×256 image of 8×8-pixel colour blocks, each channel drawn uniformly from 0.2 to 0.9; the right half is an exact copy of the left half, so every surface appears once in light and once in shadow, in the same rows. The illumination is grey, , with on the left and 0.04 on the right, a hard shadow a factor of 20 darker with its edge between columns 127 and 128, and a smooth gradient down the rows. The image is , without noise; the noise that brightening exposes is the subject of frequency domain filtering’s example and of image denoising, and is left out here so that the measures see only the illumination.
Methods.
- A global gamma, , with chosen by Zero-DCE’s exposure loss (, 16×16 regions) on a grid from 0.010 to 1.000 in steps of 0.001.
- Zero-DCE’s LE-curve with and one for every pixel, channel and iteration, chosen by the same loss on a grid from −1 to 1 in steps of 0.001. This single global is a simplification of the paper’s 24 per-pixel maps, and no network is trained; only the curve family and one of the four losses are used.
- Raw max-RGB division, .
- smoothed by a Gaussian filter.
- smoothed by the self-guided filter (Algorithm 1 of He et al., 2013, with box means), the stand-in for LIME’s structure-aware refinement.
Zero-DCE describes as the average intensity value of a region; the code takes intensity to be the mean of the three channels, which is our reading. The curves are applied to each channel, as in Zero-DCE.
Measures.
- Log error to the reflectance up to a global scale. The RMS over pixels and channels of after subtracting its mean. Which target is right is a choice the sources leave open: a curve aims at a well-exposed picture, while max-RGB division recovers exactly. Both are printed, against and against .
- Lit-to-shadow ratio. The geometric-mean brightness of the lit copy of each surface divided by that of its shadowed copy; 1 means the shadow has been removed.
- Edge band. The mean log error of each column, compared with its side’s far-field level (the median over columns 32–95 on the lit side and 160–223 on the shadow side); the band is the number of columns between 64 and 191 that differ from their level by more than a threshold . The threshold is a free choice, so and are both printed.
The checks C1–C9 were fixed in advance, and so were the hypotheses:
- H1: both global curves leave a lit-to-shadow ratio of at least 1.2.
- H1b: the raw and guided max-RGB ratios lie between 0.95 and 1.05.
- H2: the Gaussian’s band against is at least 20 columns at , and the guided filter’s band is at most half the Gaussian’s at both thresholds.
- H2b: the Gaussian’s ratio is farther from 1 than the guided filter’s.
- H3: neither curve has a band wider than 8 columns at .
- H4: the guided max-RGB output has a lower log error against than the gamma, the LE-curve and the Gaussian outputs.
The script uses NumPy 2.3.5 and SciPy 1.16.3, runs in about 5 seconds, and printed identical output on two runs.
import os
for v in ["OMP_NUM_THREADS", "OPENBLAS_NUM_THREADS", "MKL_NUM_THREADS", "VECLIB_MAXIMUM_THREADS"]:
os.environ[v] = "1" # one BLAS thread, before NumPy loads
import numpy as np
from numpy.lib.stride_tricks import sliding_window_view
from scipy import ndimage
# --- Scene: colour blocks, the right half a copy of the left, under a hard shadow ---
N, B, EDGE = 256, 8, 128
rng = np.random.default_rng(0)
left = rng.uniform(0.2, 0.9, (N // B, EDGE // B, 3)).repeat(B, 0).repeat(B, 1)
r = np.concatenate([left, left], axis=1) # reflectance, per channel
x, y = np.arange(N), np.arange(N)
s = np.where(x < EDGE, 0.8, 0.04) # lit / shadow, a factor of 20
g = 0.75 + 0.25 * np.cos(np.pi * y / N) # smooth gradient down the rows
L = g[:, None] * s[None, :] # achromatic illumination
I = r * L[..., None] # I = R (.) L, noise-free
rmax = r / r.max(2, keepdims=True) # what max-RGB division recovers
# --- Zero-DCE pieces: LE curve (Eq. 1-2, one global alpha) and exposure loss (Eq. 5) ---
def le(z, a, n=8):
for _ in range(n):
z = z + a * z * (1 - z)
return z
def l_exp(Y, E=0.6): # mean |region mean - E|, 16x16 regions
m = Y.mean(2).reshape(N // 16, 16, N // 16, 16).mean((1, 3))
return np.abs(m - E).mean()
# --- Guided filter (He et al. 2013, Algorithm 1) with box means ---
box = lambda z, rad: ndimage.uniform_filter(z, 2 * rad + 1, mode="reflect")
def guided(G, p, rad, eps):
mG, mp = box(G, rad), box(p, rad)
a = (box(G * p, rad) - mG * mp) / (box(G * G, rad) - mG * mG + eps)
return box(a, rad) * G + box(mp - a * mG, rad)
def guided_brute(G, p, rad, eps): # one ridge regression per window (Eqs. 7, 8, 10)
k = 2 * rad + 1
wG = sliding_window_view(np.pad(G, 2 * rad, mode="symmetric"), (k, k))
wp = sliding_window_view(np.pad(p, 2 * rad, mode="symmetric"), (k, k))
mu, pm = wG.mean((2, 3)), wp.mean((2, 3))
a = ((wG * wp).mean((2, 3)) - mu * pm) / (wG.var((2, 3)) + eps)
b = pm - a * mu
return sliding_window_view(a, (k, k)).mean((2, 3)) * G + sliding_window_view(b, (k, k)).mean((2, 3))
# --- Measures ---
def logrmse(R, target): # log error after removing a global scale
d = np.log(R) - np.log(target)
return np.sqrt(((d - d.mean()) ** 2).mean())
def ratio(R): # lit copy / shadowed copy, geometric mean
return np.exp((np.log(R[:, :EDGE]) - np.log(R[:, EDGE:])).mean())
def band(R, target, tau): # columns 64-191 off their side's level by > tau
e = (np.log(R) - np.log(target)).mean(axis=(0, 2))
level = np.where(x < EDGE, np.median(e[32:96]), np.median(e[160:224]))
return int((np.abs(e - level)[64:192] > tau).sum())
# --- Checks on data and components ---
print(f"C1 data: r {r.min():.4f}-{r.max():.4f}, halves differ by {np.abs(r[:, :EDGE] - r[:, EDGE:]).max():.1e}, "
f"|s ratio - 20| {abs(s[0] / s[-1] - 20):.1e}, I {I.min():.5f}-{I.max():.5f}")
z = np.linspace(0, 1, 10001)
curves = [le(z, a) for a in np.linspace(-1, 1, 2001)]
print(f"C2 LE curve n=8, 2001 alphas: monotone {all(np.all(np.diff(c) >= 0) for c in curves)}, "
f"max |LE(0)|,|LE(1)-1| {max(max(abs(c[0]), abs(c[-1] - 1)) for c in curves):.1e}, "
f"in [0,1] {all(c.min() >= 0 and c.max() <= 1 for c in curves)}")
R_or = I / L[..., None]
print(f"C3 oracle I/L: logRMSE(r) {logrmse(R_or, r):.1e}, |ratio-1| {abs(ratio(R_or) - 1):.1e}, band {band(R_or, r, 0.1)}")
Iu = 0.3 * r
print(f"C6 uniform light, gamma 0.5: logRMSE(r) - 0.5 std(log r) = {logrmse(Iu ** 0.5, r) - 0.5 * np.log(r).std():.1e}")
t = np.random.default_rng(1).uniform(0, 1, (24, 20))
print(f"C7 guided filter vs brute force: {np.abs(guided(t, t, 3, 1e-3) - guided_brute(t, t, 3, 1e-3)).max():.1e}, "
f"constant input changed by {np.abs(guided(np.full((40, 40), 0.3), np.full((40, 40), 0.3), 8, 1e-4) - 0.3).max():.1e}")
# --- Methods ---
gammas = np.round(np.arange(10, 1001) / 1000, 3)
alphas = np.round(np.arange(-1000, 1001) / 1000, 3)
gam = gammas[np.argmin([l_exp(I ** v) for v in gammas])]
alp = alphas[np.argmin([l_exp(le(I, v)) for v in alphas])]
print(f"C8 gamma {gam:.3f} in ({gammas[0]}, {gammas[-1]}): {gammas[0] < gam < gammas[-1]}; "
f"alpha {alp:.3f} in ({alphas[0]}, {alphas[-1]}): {alphas[0] < alp < alphas[-1]}")
T0 = I.max(2)
Tg = ndimage.gaussian_filter(T0, 8, mode="reflect")
Tf = guided(T0, T0, 8, 1e-4)
print(f"C9 smoothed illuminations: min Gaussian {Tg.min():.2e}, min guided {Tf.min():.2e} (both > 0: {Tg.min() > 0 and Tf.min() > 0})")
out = {f"gamma {gam:.3f}": I ** gam, f"LE n=8 alpha {alp:.3f}": le(I, alp),
"max-RGB raw": I / T0[..., None], "max-RGB Gaussian": I / Tg[..., None],
"max-RGB guided": I / Tf[..., None]}
print(f"C4 raw max-RGB: logRMSE(r/max) {logrmse(out['max-RGB raw'], rmax):.1e}, |ratio-1| {abs(ratio(out['max-RGB raw']) - 1):.1e}")
print(f"C5 gamma: |ratio - 20^gamma| {abs(ratio(out[f'gamma {gam:.3f}']) - 20 ** gam):.1e}")
print(f"\n{'method':22s} {'L_exp':>6s} {'logRMSE':>8s} {'logRMSE':>8s} {'lit/shade':>9s} band vs r band vs r/max")
print(f"{'':22s} {'':>6s} {'(r)':>8s} {'(r/max)':>8s} {'ratio':>9s} t=0.1 t=0.2 t=0.1 t=0.2")
for k, R in out.items():
le_s = f"{l_exp(R):6.4f}" if k[0] in "gL" else f"{'':>6s}"
print(f"{k:22s} {le_s} {logrmse(R, r):8.4f} {logrmse(R, rmax):8.4f} {ratio(R):9.4f}"
f" {band(R, r, 0.1):5d} {band(R, r, 0.2):5d} {band(R, rmax, 0.1):5d} {band(R, rmax, 0.2):5d}")
C1 data: r 0.2001-0.8997, halves differ by 0.0e+00, |s ratio - 20| 0.0e+00, I 0.00404-0.71844
C2 LE curve n=8, 2001 alphas: monotone True, max |LE(0)|,|LE(1)-1| 0.0e+00, in [0,1] True
C3 oracle I/L: logRMSE(r) 4.9e-17, |ratio-1| 0.0e+00, band 0
C6 uniform light, gamma 0.5: logRMSE(r) - 0.5 std(log r) = -2.8e-17
C7 guided filter vs brute force: 6.7e-16, constant input changed by 0.0e+00
C8 gamma 0.128 in (0.01, 1.0): True; alpha 0.683 in (-1.0, 1.0): True
C9 smoothed illuminations: min Gaussian 1.32e-02, min guided 8.76e-03 (both > 0: True)
C4 raw max-RGB: logRMSE(r/max) 7.7e-17, |ratio-1| 0.0e+00
C5 gamma: |ratio - 20^gamma| 2.2e-16
method L_exp logRMSE logRMSE lit/shade band vs r band vs r/max
(r) (r/max) ratio t=0.1 t=0.2 t=0.1 t=0.2
gamma 0.128 0.1399 0.4088 0.3895 1.4673 0 0 0 0
LE n=8 alpha 0.683 0.2369 0.4322 0.4263 1.7581 0 0 0 0
max-RGB raw 0.1910 0.0000 1.0000 0 0 0 0
max-RGB Gaussian 0.3787 0.4110 1.2322 32 26 29 26
max-RGB guided 0.1430 0.0999 1.0152 0 0 0 0
Checks. All nine held. The data have the planned properties (C1), the LE-curve is monotone and fixes 0 and 1 for every on the grid (C2), the oracle division and raw max-RGB recover their targets to rounding error (C3, C4), the gamma output’s ratio equals (C5), on a uniformly lit scene the log-error measure of the gamma 0.5 output equals 0.5 times the standard deviation of , as predicts (C6), the box-filter guided filter matches a per-window ridge regression and leaves a constant unchanged (C7), both chosen parameters lie inside their grids (C8), and neither smoothed illumination reaches zero (C9).
Global curves (H1 held, H3 held). The exposure loss chose and , and both outputs keep the shadow: the lit copy of each surface stays 1.47 times brighter under the gamma and, as a geometric mean, 1.76 times under the LE-curve. For the gamma the ratio is exactly (C5): a power law maps a factor of 20 to a factor of at every brightness, so no gamma can remove a shadow without flattening everything else to the same degree. Neither curve has an edge band, because a point operation treats a pixel next to the shadow edge exactly like one far from it: its error depends on a pixel’s reflectance and on the side of the edge it lies on, not on its distance from the edge. The shift between the two halves is what the ratio measures, and the band, which compares each column with its own side’s level, by construction does not. Neither curve reaches the exposure target either: the LE-curve’s exposure loss stays at 0.2369. One maps equal inputs to equal outputs, and the lit and shadowed copies of a surface differ by a factor of 20 in input, so they cannot both be brought to the target level. That is what Zero-DCE’s per-pixel maps are for.
Raw max-RGB (H1b held). Dividing by the per-pixel channel maximum removes the shadow exactly, with a ratio of 1.0000 and zero error against , as the model predicts for grey light. Against its error (0.1910) is not small: every block’s brightest channel becomes 1, so a dark grey block and a light grey block come out the same. In our reading, on a real image with noise and illumination that is not grey, the raw estimate would also carry the noise into the division.
Gaussian smoothing (H2 held, H2b held). In our reading, smoothing averages the channel maxima of neighbouring blocks instead of dividing each block by its own, but it also spreads the 20-fold step across the edge. Near the edge on the lit side the estimate is too low and the output too bright; on the shadow side it is too high and the output too dark. The result is a band of 32 columns at (26 at 0.2) and a lit-to-shadow ratio of 1.2322. This is the halo of local tone mapping in another guise, and the hard-shadow pitfall that frequency domain filtering describes for homomorphic filtering: a smoother cannot tell a shadow edge from a reflectance edge.
Guided filter (H1b held, H2 held, H2b held, H4 held). The self-guided filter has no band at either threshold and a ratio of 1.0152, and the lowest error against of all five outputs (0.1430). In a window that straddles the shadow edge the variance of is far larger than , so the local linear model passes the edge through. In our reading, the small departure of the ratio from 1 comes from the same constant: is an absolute variance, and the shadowed half has 20 times less contrast, or 400 times less variance, than the lit half, so the filter smooths the shadowed copy of each surface more than the lit one. An edge-aware refinement on a dark image therefore behaves differently in its darkest parts unless its parameters scale with the signal.
The other target. Against , the target that max-RGB division recovers exactly, the outcomes are the same: the guided output’s error (0.0999) is again below those of the gamma, the LE-curve and the Gaussian outputs, the Gaussian’s band is 29 columns at and 26 at 0.2, and the guided filter and both curves have none. Which target is chosen therefore does not decide H2, H3 or H4 here.
The example shows the trade-off between the two classical families: global curves are halo-free but cannot remove a shadow, illumination division removes it but needs an illumination estimate that is smooth within surfaces and sharp at shadow edges. No setting of the example was changed after its first run.
Datasets and Benchmarks
- LOL (Wei et al., 2018), pairs of low- and normal-light images collected by altering exposure time and ISO, according to Zero-DCE (§2). Retinexformer (§4.1) uses LOL-v1 with 485 training and 15 test pairs, and LOL-v2 (Yang et al.) with a real subset (689:100) and a synthetic subset (900:100).
- SID (Chen et al., 2018): 5,094 raw short-exposure images with 424 distinct long-exposure references, from a Sony α7S II (Bayer, 4240×2832) and a Fujifilm X-T2 (X-Trans, 6000×4000). Input exposures are 1/30 to 1/10 s and references 100 to 300 times longer; the illuminance at the camera was generally 0.2–5 lux outdoors and 0.03–0.3 lux indoors; about 20% of the images in each condition form the test set and 10% the validation set (§3).
- SMID and SDSD. Retinexformer also evaluates on SMID (20,809 short- and long-exposure raw pairs, 15,763 for training) and the static version of SDSD, captured with a Canon EOS 6D Mark II and an ND filter, with indoor and outdoor subsets (§4.1).
- MIT-Adobe FiveK: 5,000 raw images, each retouched by five experts, according to Zero-DCE (§2). Retinexformer uses 4,500 for training and 500 for testing, with expert C’s version as the reference. Zero-DCE did not use FiveK, since it is not primarily designed for under-exposed photographs (§4.2).
- SICE: multi-exposure sequences with a reference per sequence. Zero-DCE trains on Part 1 and tests on 767 low/normal pairs from Part 2, resized to 1200×900 (§4.2).
- No-reference sets: NPE (84 images), LIME (10), MEF (17), DICM (64) and VV (24), with the counts as Zero-DCE gives them. They have no ground truth and are judged visually, by user studies or by no-reference indices.
- Detection in the dark: DARK FACE (10,000 night images; Zero-DCE evaluates face detection on its 6,000 training and validation images) and ExDark (7,363 under-exposed images with boxes for 12 object categories; Retinexformer trains YOLO-v3 on 5,890 and tests on 1,473).
Evaluation Metrics
- Full-reference. PSNR, SSIM and mean absolute error against the reference. On SICE Part 2, Zero-DCE (Table 2) reports 16.57 dB, 0.59 and 98.78 for itself, against 16.17 dB, 0.57 and 108.12 for LIME and 16.21 dB, 0.59 and 102.78 for EnlightenGAN, each run from public code with recommended parameters. On LOL-v1, Retinexformer (Table 1) reports 25.16 dB and 0.845 against 24.61 dB and 0.842 for SNR-Net, the next best in its table. These numbers come from different test sets and different reruns of the baselines and are not comparable across the two papers.
- No-reference. Zero-DCE uses the perceptual index (PI), a no-reference measure from super-resolution, where lower is better; image quality assessment covers such measures.
- User studies. Zero-DCE asked 15 people to score results on a 1–5 scale for exposure, colour, texture and noise; Retinexformer asked 23 people to score 156 images.
- Downstream tasks. Zero-DCE fed enhanced DARK FACE images to a fixed face detector (DSFD) and compared precision-recall curves; in its Figure 8, average precision rose from 0.231 on the raw images to 0.303 with Zero-DCE and 0.304 with RetinexNet. Retinexformer reports 66.1 mean AP on ExDark with its enhancement as a fixed preprocessing step, against 65.6 for SCI and 65.3 for SNR-Net (Table 3b).
A metric chosen for a reference rewards matching that reference’s exposure, and different datasets use different notions of correct exposure (an expert’s edit, a long exposure, a multi-exposure fusion). In our reading, this is one reason papers report several kinds of metric at once.
Applications
- Photography: enhancement of dark photographs; phone night modes also capture several frames, as computational photography describes.
- Preprocessing for recognition: face detection and object detection at night, as in the DARK FACE and ExDark experiments above.
- Surveillance, driving and robots, where cameras must work at dusk and at night and the illumination is set by streetlights and headlights.
Open Problems
- Noise and artefacts together with brightness. Zero-DCE leaves noise to future work; Retinexformer’s corruption term is one answer, raw-domain learning another. A curve or a division alone cannot raise the signal-to-noise ratio.
- Generalization. Supervised methods learn their training set’s sensor, noise and exposure style; Zero-DCE argues that paired data risks overfitting, and its own ablation shows that its result depends on what its unlabelled training set contains.
- What counts as correct. Benchmarks disagree on the target exposure, and different scores rank methods differently: in Zero-DCE’s Table 1, SRIE has the second-best average PI but the second-lowest average user-study score.
- Shadows and mixed lighting. As the example shows, removing a hard shadow requires an illumination estimate that follows the shadow’s edge; mixed coloured light also needs colour handling that a grey illumination model does not provide.
Related
- Frequency Domain Filtering
Designing and applying linear filters as transfer functions on the discrete Fourier grid; ideal, Gaussian and Butterworth low-pass filters compared at a matched cutoff for ringing, edge width and passed noise, the two Butterworth gain conventions, and homomorphic filtering of illumination and reflectance in the log domain.
- Histogram Equalization
A contrast enhancement method that maps each intensity level through the image's cumulative histogram so that output levels are used approximately uniformly, with adaptive variants such as CLAHE that equalize local regions.
- Image Denoising
Estimating a clean image from a noisy observation, removing random variation while keeping edges, texture, and fine detail.
- Computational Photography
Making photographs by combining capture and computation, from burst align-and-merge, HDR, multi-frame denoising and super-resolution to synthetic depth of field, panoramas, flash/no-flash pairs, light-field cameras and coded apertures and exposures; how these reached phones, and why phone images break the single-exposure assumptions of vision methods.
- Tone Mapping
Compressing a high-dynamic-range radiance map into the range a display or print can show, with global curves such as Reinhard's photographic operator, local operators such as automatic dodging-and-burning, and base–detail decompositions such as Durand and Dorsey's bilateral-filter method, and why local operators produce halos.
- Exposure
How much light a camera records in one frame, set by shutter time, aperture and gain; how exposure is counted in stops, metered and controlled automatically, and what each setting costs a vision system in motion blur, noise, depth of field and clipping.
References
- Guo, C., Li, C., Guo, J., Loy, C. C., Hou, J., Kwong, S. & Cong, R. (2020). Zero-Reference Deep Curve Estimation for Low-Light Image Enhancement. IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR).
- Cai, Y., Bian, H., Lin, J., Wang, H., Timofte, R. & Zhang, Y. (2023). Retinexformer: One-stage Retinex-based Transformer for Low-light Image Enhancement. IEEE/CVF International Conference on Computer Vision (ICCV).
- Chen, C., Chen, Q., Xu, J. & Koltun, V. (2018). Learning to See in the Dark. IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR).
- He, K., Sun, J. & Tang, X. (2013). Guided Image Filtering. IEEE Transactions on Pattern Analysis and Machine Intelligence, 35(6), 1397–1409 (read in the authors' preprint, from the archived copy of the authors' publication list).
- Guo, X., Li, Y. & Ling, H. (2017). LIME: Low-Light Image Enhancement via Illumination Map Estimation. IEEE Transactions on Image Processing, 26(2), 982–993 (not read).
- Land, E. H. (1977). The Retinex Theory of Color Vision. Scientific American, 237(6), 108–128 (not read).
- Wei, C., Wang, W., Yang, W. & Liu, J. (2018). Deep Retinex Decomposition for Low-Light Enhancement. British Machine Vision Conference (BMVC) (not read).
- Jiang, Y., Gong, X., Liu, D., Cheng, Y., Fang, C., Shen, X., Yang, J., Zhou, P. & Wang, Z. (2021). EnlightenGAN: Deep Light Enhancement without Paired Supervision. IEEE Transactions on Image Processing (not read).