BookNotesSlidesP-sets Syllabusdraft · v0.2.49.1
◀▲⌂▶
💬Comments welcome. To leave a note, select any text and click the note / highlight button that pops up — or open the panel with the tab at the top-right (‹). Notes are visible only inside our private review group.

7.3 Deep learning⧉

A learned imaging model can predict restored pixels, a geometric quantity, an edit, or a distribution of possible outputs. These targets require different losses and different evidence of success. Chapter 7.2, Machine learning described the training-data problem; here we examine concrete methods and the choices they illustrate.

An encoder–decoder gathers context at reduced resolution, then reconstructs spatial output. U-Net skip connections preserve fine input features alongside that context. A model that predicts local color transforms can be much cheaper than one that synthesizes every output pixel; a model that predicts depth instead needs scene-scale cues. Architecture and training details are in Refreshers#Machine learning and deep learning.

Video 7.3.1. Video: But what is a neural network?, by 3Blue1Brown (YouTube).
Video 7.3.2. Video: What is backpropagation really doing?, by 3Blue1Brown (YouTube).

7.3.1 Low-level learned operators (pixel-to-pixel)⧉

The standard case is an image-to-image network, typically a U-Net Ronneberger et al. 2015 (U-Net) or encoder–decoder, mapping a degraded or partial image to a restored one. Each task below is a task an earlier chapter solved by hand, now learned from examples instead (Figure 7.3.1).

fig-learned-task-zoo
Figure 7.3.1. A small zoo of low-level learned operators, each shown as an input→output pair on one photo: noisy→clean (denoising), Bayer mosaic→full RGB (demosaicking), low-resolution→high-resolution (super-resolution), and grayscale→color (colorization). Every panel is a task an earlier chapter solved by hand; here a single image-to-image network learns the map from data.

Learned denoisers can outperform classical filters on matching evaluation data, but matching the noise alone does not guarantee performance on unfamiliar content. They can also serve inside plug-and-play reconstruction, subject to compatibility and convergence conditions (Chapter 13.11, Denoising as a universal prior). Diffusion requires a noise-conditioned predictor and a defined sampling schedule (Chapter 7.4, Generative AI and diffusion).

Demosaicking, and joint demosaick-plus-denoise. Gharbi and colleagues (2016) trained a single network to go from a Bayer mosaic straight to full RGB, doing the demosaicking and the denoising at once, on hard cases mined automatically from data. The paper reported improvements over its evaluated classical baselines. This is the headline instance of L7.6: learning the operator end to end beat a long-polished pipeline stage. It is also a quiet argument for jointly learning steps the classical pipeline kept apart, since the net is free to trade off demosaicking against denoising however the data rewards, rather than committing to one before the other the way a fixed sequence must.

Super-resolution. Pose low-resolution → high-resolution as a learned map. This is super-resolution (SR). The lineage runs from Freeman's pre-deep, example-based work (Freeman et al. 2002), which stitched in high-frequency detail copied from a dictionary of patches, through to modern networks: SwinIR (Liang et al. 2021), a transformer restoration backbone, and Real-ESRGAN (Wang et al. 2021), an enhanced super-resolution GAN (ESRGAN) trained against a deliberately realistic model of how real photos degrade so that it survives in the wild. The deep treatment, with priors, lives in Chapter 14.1, What can super-resolution actually do?; here it is one entry in the zoo. When measurements leave ambiguity, the model supplies plausible detail from learned statistics. Note the seam this opens: the actual high-resolution scene is generally not uniquely determined by the input, which is exactly why the strongest super-resolvers reach for the generative machinery later in this chapter.

Colorization, classical and learned, side by side. This task shows the contrast clearly, because two paradigms sit right next to each other (Figure 7.3.2). Levin, Lischinski and Weiss (2004) colorize from a few user scribbles, propagated across the image by optimization under one simple rule: neighboring pixels with similar intensity should get similar color. That rule is an affinity prior, the same edge-aware idea as the bilateral filter (big lesson L10.1), and it is entirely hand-designed; it is also, tellingly, the very matrix-free least-squares solve of Chapter 6.7, Image formation as a linear system, run on color instead of sharpness. Zhang, Isola and Efros (2016) instead learn fully automatic colorization from a huge corpus of color photos stripped to gray and back, posed as classification over quantized colors to keep the output from sliding toward desaturated browns. One propagates a human's chosen colors by a human's chosen rule; the other invents plausible colors learned from millions of images. Same task, opposite philosophies.

fig-colorization-classical-vs-learned
Figure 7.3.2. Colorization, classical versus learned. Left, Levin et al. (2004): a few user color scribbles are propagated across the gray image by edge-aware optimization, a hand-designed affinity prior. Right, Zhang et al. (2016): a network colorizes the same gray image fully automatically, the colors learned from a large corpus. Hand-designed propagation versus learned-from-data plausibility, on one image.

Colorization is also where multimodality matters here. A regression loss tends to produce desaturated, averaged colors because it averages the several colors a gray pixel could plausibly be, so colorization gets its own full treatment, gallery and all, as the single-image part's purest prior-driven recovery (Chapter 24.5, Colorization).

Monocular depth. Estimate depth from a single RGB image. This is badly ill-posed, because one photo is consistent with infinitely many 3-D scenes, so the network must lean hard on a learned scene prior about how the world is usually shaped. MiDaS (Ranftl et al. 2019) trained across many incompatible depth datasets at once with a scale- and shift-invariant loss, so that depth maps recorded in different units could all teach the same net; Depth Anything (Yang et al. 2024) pushed the idea to a massive pile of pseudo-labeled images and got zero-shot depth on photos it had never seen (Figure 7.3.3). Distinguish relative-depth models from models trained or calibrated for metric depth, including metric variants of Depth Anything. Metric prediction uses additional assumptions learned from data; its units do not guarantee correct scale on a new camera or scene. Stereo and dual-pixel depth also require inference, but add geometric measurements.

[figure fig-depth-anything not built]
Figure 7.3.3. (Placeholder: figure not yet built.) Monocular depth from a single photo. One ordinary RGB image (left) is mapped by a learned network to a dense depth map (right), near surfaces bright, far ones dark. The problem is ill-posed (a single image fixes no true distances), so the result is driven by a strong learned prior about how scenes are usually arranged, and recovers relative, not metric, depth.
Video 7.3.3. Video: Depth Anything: zero-shot monocular depth from a single image, the learned scene prior recovering relative depth on ordinary photos and video it never trained on. Yang, Kang, Huang, Xu, Feng and Zhao 2024 (Yang et al. 2024), reproduced with permission.

Learned exposure and retouch. Here the "degradation" is taste: learn a photographer's tone and color adjustment from before/after pairs. Bychkovsky and colleagues (2011) built the MIT-Adobe FiveK dataset. It contains the same scenes retouched by five expert editors, which is what made the adjustment learnable at all; the data, once again, is the enabling move. HDRnet (Gharbi et al. 2017) runs fast enough for a phone by predicting not output pixels but the coefficients of a bilateral-grid affine transform, an edge-aware local adjustment (the learned bilateral grid, cross-referenced in the edge-preserving chapter). Exposure (Hu et al. 2018) takes a different and instructive line: it learns a sequence of interpretable operations (curves, white balance, contrast) rather than raw pixels, so the result is an edit a photographer can read and undo. Learn the pixels, or learn the operations: both are on the table, and the choice trades raw quality against the editability and trust of a human-readable result.

Video 7.3.4. Video: Deep Bilateral Learning for Real-Time Image Enhancement (HDRnet). Michaël Gharbi, Jiawen Chen, Jonathan T. Barron, Samuel W. Hasinoff, Frédo Durand 2017 (YouTube).
fig-hdrnet-1
Figure 7.3.4. What learned retouching buys you. A set of ordinary input photos beside HDRnet's enhanced versions, the adjustment learned from expert before/after pairs rather than dialed in by hand. Notice that the correction is content-dependent and varies across each frame (skies, skin, and shadows are pushed differently), which is exactly the sophistication a single global tone curve cannot reach (Gharbi et al. 2017).
fig-hdrnet-2
Figure 7.3.5. How HDRnet runs fast enough for a phone. A schematic of the architecture: the expensive learning happens on a heavily downsampled copy of the image, where the network predicts not output pixels but a small bilateral grid of affine color-transform coefficients; that grid is then applied at full resolution. Notice the division of labor: slow, smart prediction at low resolution and cheap, exact application at full resolution, the best-of-both trick that keeps the heavy compute off the megapixels (Gharbi et al. 2017).
fig-hdrnet-5
Figure 7.3.6. The slicing node, where the low-resolution grid meets the full-resolution image. At each output pixel, the predicted bilateral grid is read by an edge-aware trilinear lookup indexed by the pixel's position $(x,y)$ and its luminance, so the affine transform applied there depends on where the pixel is and how bright it is. Notice that the luminance axis is what makes the adjustment follow edges instead of bleeding across them: pixels of different brightness pull from different slices of the grid (Gharbi et al. 2017).
fig-hdrnet-8
Figure 7.3.7. What the network actually predicts. The per-pixel affine color-transform coefficients visualized as maps: the multipliers and offsets that, applied to each input pixel's color, produce the enhanced output. Notice that these coefficient maps are smooth and slowly varying yet snap to image structure, which is precisely why a compact low-resolution grid can encode a high-resolution edit: the adjustment is simple even when the image is not (Gharbi et al. 2017).
fig-hdrnet-9
Figure 7.3.8. Local, content-dependent edits, reproduced. HDRnet's output beside a reference edit that varies spatially with image content, the same scene corrected differently region by region. Notice how the net tracks where the effect should be strong and where it should back off, reproducing an adjustment that is not one global curve but a field of local ones tied to what each part of the picture contains (Gharbi et al. 2017).
fig-hdrnet-14
Figure 7.3.9. One architecture, many operators. HDRnet trained to mimic a range of expensive image operators (different stylizations and enhancements), each shown as the reference operator's output beside HDRnet's fast approximation. Notice that the same network shape learns to stand in for operators of very different character at real-time speed, the practical advantage of predicting a cheap-to-apply coefficient grid rather than the pixels themselves (Gharbi et al. 2017).

7.3.2 Mid- and high-level learned predictors⧉

Not every learned operator outputs an image. A second family predicts semantic structure from a single photo, such as where things are and what they are, and that structure becomes the input to retouching, autofocus, framing, and selection. These are enabling rather than central, so we keep them brief.

Sky and face detection are the classic "where is the sky, where are the faces" predictors that drive auto-enhance and metering: brighten the faces, deepen the sky, expose for the subject. The lineage runs from pre-deep detectors of the Viola–Jones era (Viola & Jones 2004, the cascade of simple features that first made real-time face detection practical) to modern networks; the point for us is that semantic masks let a retouching pipeline apply different adjustments to selected subjects.

fig-viola-jones-haar-5
Figure 7.3.10. The first two Haar-like rectangle features that AdaBoost selects for the Viola–Jones face detector, overlaid on a face: the first captures that the eye region is darker than the cheeks just below it, and the second that the eyes are darker than the bridge of the nose between them. Notice that boosting picks these two simple, cheap-to-evaluate contrasts first because they alone already separate most faces from non-faces, the front of the cascade that made real-time detection practical (Viola & Jones 2004).

Face landmarks and pose estimate keypoint positions and head orientation for portrait editing and augmented reality. Geometric inconsistencies can be one forensic cue, but plausible landmarks do not authenticate a photograph (Chapter 40.2, Ethics of computational photography).

Saliency and gaze prediction estimate where people look in an image. Pre-deep models built saliency from hand-designed contrast features. The classic Itti, Koch and Niebur (1998) model combined center-surround contrasts of color, intensity, and orientation into one saliency map, while learned models train directly on eye-tracking data. The uses are practical: auto-cropping and reframing, retargeting, aesthetics scoring, and attention-aware compression that spends bits where the eye will actually land.

7.3.3 Generative models: image-to-image translation⧉

Sometimes there is no single correct answer. Ask a network to colorize a gray photo, super-resolve a tiny one, or fill a hole, and many different outputs are equally plausible. The task is one-to-many. Regression handles this badly: minimizing squared error pulls the network toward the average of all plausible answers, and the average of many sharp images is a blurry one. (We pin down exactly why that average looks bad yet scores well when we reach metrics, below.) The cure is to stop averaging and start sampling: model the space of plausible answers and draw one sharp, plausible member. That is the shift from regression to generative modeling.

GANs. A generative adversarial network (GAN) pits two networks against each other: a generator proposes images while a discriminator learns to tell real from generated. Train them in opposition and the generator is pushed to produce output the discriminator cannot distinguish from real, which encourages sharp, plausible detail rather than a blurry mean. This adversarial training (Goodfellow et al. 2014) is the engine behind Real-ESRGAN's realism. We give it one paragraph of intuition; the full generative story, and why diffusion has largely displaced GANs, is Chapter 7.4, Generative AI and diffusion.

The catch with clever losses. The reason to reach for an adversarial or perceptual loss is exactly the one from big lesson L13.4: a plain $L_2$ loss returns the average of plausible answers, so to get sharp, believable detail you must score plausibility instead, with a learned discriminator (GAN) or a deep-feature distance (a VGG/perceptual loss, or LPIPS). But every step away from a simple, fixed loss toward a complex, learned one buys that realism at a real cost, and the main failure modes are: Training gets unstable: the GAN's two networks chase a moving target, and the equilibrium is delicate. If the discriminator is too strong, the generator's gradients vanish. If it is too weak, the generator learns little. It hallucinates: a loss that rewards "looks real" will happily invent texture, teeth, or text that was never in the input, producing detail that is plausible, sharp, and wrong, which is fine for a pretty photo and dangerous for evidence or medicine. It can collapse to a few safe outputs (mode collapse). And a learned loss is a network, and networks can be gamed: the generator learns to exploit the discriminator's blind spots rather than to improve. This is Goodhart's law again (big lesson L9.4). The moment your measure of quality becomes the target you optimize, it stops measuring quality. The practical disciplines all follow from this: combine the adversarial term with a stabilizing reconstruction term rather than using it alone, keep a held-out evaluation (or a human study) you never trained against, and treat any sharp detail a complex loss produces as a hypothesis about the scene, not a measurement of it.

Conditional translation, paired and unpaired. Pix2Pix (Isola et al. 2017) is the generic tool: a conditional GAN that learns to map one image domain to another from paired examples: edges→photo, label-map→street scene, day→night (Figure 7.3.15). When you have no aligned pairs, CycleGAN (Zhu et al. 2017) does the unpaired version, encouraging round-trip reconstruction with a cycle-consistency constraint (translate there and back and you should land where you started): horses↔zebras, summer↔winter, photo↔painting, all without a single matched pair.

Video 7.3.5. Video: Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks (CycleGAN). Jun-Yan Zhu, Taesung Park, Phillip Isola, Alexei A. Efros 2017 (YouTube).

The CycleGAN paper's own results show what unpaired translation, held together by cycle consistency, can do.

fig-cyclegan-1
Figure 7.3.11. Translation without pairs. Monet↔photos, zebras↔horses, summer↔winter, each direction learned from two unmatched piles of images, never a single aligned pair; and below, one photograph rendered in the styles of Monet, Van Gogh, Cézanne, and Ukiyo-e. There is no photograph of the exact scene Monet painted, yet the mapping is learned anyway (Zhu et al. 2017).
fig-cyclegan-10
Figure 7.3.12. One photo, four painters, side by side. A set of landscape photographs each mapped into the collective style of Monet, Van Gogh, Cézanne, and Ukiyo-e prints, style here being membership in a collection of paintings, enforced adversarially, rather than the look of any single reference (Zhu et al. 2017).
fig-cyclegan-12
Figure 7.3.13. The harder direction: paintings→photos. Monet canvases mapped back toward photographic realism: skies, water, and foliage de-painted into plausible photographs. Running the translation the other way stresses cycle consistency, since the model must invent fine detail the painting abstracted away (Zhu et al. 2017).
fig-cyclegan-14
Figure 7.3.14. More unpaired translations on Monet and seasons. A further gallery of photo↔painting and season transfers, each round-trip held true by the cycle-consistency constraint (translate there and back and you should return to the original), which is what keeps content from drifting while the look changes (Zhu et al. 2017).
fig-gan-pix2pix
Figure 7.3.15. Paired image-to-image translation with a conditional GAN. An edge map (left) is the input; the network generates a plausible photo (right) consistent with those edges, having learned the edges→photo mapping from paired examples (Pix2Pix). The same generic recipe maps label-maps to street scenes, sketches to renderings, or day to night ("learn the map between two image domains"), and is the GAN ancestor of the diffusion-based editing in the next chapter.

The Pix2Pix and CycleGAN papers' own figures make the generality, the mechanism, and the role of the adversarial loss concrete.

fig-pix2pix-1
Figure 7.3.16. One recipe, an absurd range of tasks. Labels→street scene, labels→building façade, grayscale→color, aerial photo→map, day→night, edges→photo, all the same conditional-GAN machinery, only the training pairs change. The teaser that made the "learn the map between two image domains" framing land (Isola et al. 2017).
fig-pix2pix-2
Figure 7.3.17. The conditional GAN, drawn. The generator $G$ turns an input edge map into a candidate photo; the discriminator $D$ sees the pair (input, image) and learns to call it fake for the generated photo and real for the true one. Conditioning $D$ on the input is what forces the output to correspond to it, not merely to look like some plausible photo (Isola et al. 2017).
fig-pix2pix-3
Figure 7.3.18. Why the generator is a U-Net. A plain encoder–decoder funnels everything through a narrow bottleneck, losing the low-level alignment between input and output; the U-Net adds skip connections that carry edges and structure straight across, so the output stays registered to the input. The architectural choice behind sharp, aligned translations (Isola et al. 2017).
fig-pix2pix-4
Figure 7.3.19. What the adversarial loss buys, ablated. On façades and street scenes: the input label map, the ground truth, the result with an L1 loss only (blurry, washed-out, the regression mean), with the cGAN only (sharp but sometimes wandering from the truth), and with L2.6 + cGAN (sharp and faithful). The clearest single picture of why fidelity and adversarial terms are combined (Isola et al. 2017).
fig-pix2pix-10
Figure 7.3.20. Photo→labels, the inverse task. Street photographs mapped to semantic label maps, comparing L1 and cGAN losses against the ground-truth segmentation, evidence that the same generic translator runs in either direction across a domain pair (Isola et al. 2017).
fig-pix2pix-14
Figure 7.3.21. Label-map→façade, a gallery. Architectural label maps turned into plausible building façades, each beside its ground truth: windows, cornices, and doors synthesized consistently with the layout the labels specify (Isola et al. 2017).
fig-pix2pix-15
Figure 7.3.22. Day→night. Daytime cityscapes translated to convincing night versions (lit windows, darkened skies, warm street lighting), a look that would be tedious to script by hand but falls out of paired training (Isola et al. 2017).
fig-pix2pix-16
Figure 7.3.23. Edges→handbags. Hand-drawn or extracted edge outlines turned into photoreal bags, the texture and material invented to fit the contours, the playful sketch-to-photo case the method became famous for (Isola et al. 2017).
fig-pix2pix-11
Figure 7.3.24. What the community did with it. A montage of projects built on the released Pix2Pix: #edges2cats, background removal, palette generation, sketch→portrait, sketch→Pokémon, pose-driven "do as I do", credited to their independent creators. The clearest evidence that "learn a paired image translation" became a general-purpose tool the moment it shipped (Isola et al. 2017).

The pre-deep ancestor. "Translate one image into the style of another" predates deep nets. Image Analogies (Hertzmann et al. 2001) learned a filter from a single example pair (given A and its filtered version A′, apply the same transformation to a new B to get B′) by matching patches. The same instinct as Pix2Pix ("A is to A′ as B is to B′"), using a nonparametric patch model instead of a trained deep network (ties to the texture-synthesis and patch-matching material).

Video 7.3.6. Video: Image Analogies. Aaron Hertzmann, Charles E. Jacobs, Nuria Oliver, Brian Curless, David H. Salesin 2001 (YouTube).

Chapter 7.4, Generative AI and diffusion develops noise-based generative models and their use for conditioning on text, images, or physical measurements.

7.3.4 Learned perceptual metrics and losses⧉

There is a question we have been deferring: how do we measure whether a restored or generated image is any good? The answer matters more than it sounds, because the metric you optimize quietly defines what "good" means. The classical metrics break exactly where learned methods are supposed to shine.

MSE and PSNR compare aligned pixel values. They are useful for reconstruction fidelity, but do not fully predict perceived similarity: a small displacement of a texture can produce a large pixel error. SSIM compares local structure, and visual-difference predictors explicitly model aspects of perception, so they should not be grouped as metrics “blind to texture.” The appropriate metric depends on whether exact position, perceived quality, or semantic similarity matters (Chapter 9.3, Image metrics).

fig-perceptual-metric
Figure 7.3.25. Why per-pixel error is the wrong ruler. Two distortions of one image are constructed to have the same mean squared error from the original: one is a tiny spatial shift of a texture (perceptually nearly identical), the other is additive noise (perceptually much worse). MSE and PSNR cannot tell them apart, because they compare pixels at fixed locations. This is the motivation for a learned perceptual metric like the learned perceptual image patch similarity (LPIPS), which compares deep features instead.

A feature loss compares intermediate activations of a fixed network:

$$\ell_{\mathrm{feat}}=\sum_l\|\phi_l(\hat I)-\phi_l(I)\|^2.$$

LPIPS Zhang et al. 2018 normalizes the feature vector across channels at each spatial location, then weights squared channel differences and averages spatially. Writing these normalized vectors as $\bar\phi_l$,

$$d_{\mathrm{LPIPS}}=\sum_l\frac1{H_lW_l}\sum_{h,w,c}a_{l,c}\left(\bar\phi_l(\hat I)_{h,w,c}-\bar\phi_l(I)_{h,w,c}\right)^2.$$

The weights $a_{l,c}$ are fitted to human judgments. This is distinct from a plain feature loss. Features remain spatially indexed; LPIPS is not invariant to arbitrary shifts. State the backbone, preprocessing, and version when reporting scores.

DreamSim Fu et al. 2023 compares whole-image embeddings and is trained on human judgments of synthetic image triplets. It captures differences in layout, pose, color, and semantic content that local patch metrics can miss. It measures a different range of similarities; it is not a universal replacement for LPIPS or a test of photographic truth.

From metric to loss: how perceptual losses buy sharpness. This matters in practice because the metric you train against decides what the network produces. Train a restoration or super-resolution network to minimize per-pixel MSE and it learns to hedge: when several sharp outputs are all plausible, the single image that minimizes average pixel error is their blurry mean, so MSE-trained networks systematically wash out fine texture (Figure 7.3.26). Swap in, or add, a perceptual (feature) loss: push prediction and target through a fixed pretrained network and penalize the distance between their deep features (the plain feature loss, or LPIPS), rewarding the network for reproducing texture and structure rather than exact pixels, so it stops fearing detail it cannot place pixel-perfectly. Add an adversarial (GAN) term, a discriminator trained to tell restored from real, and the output is pushed onto the manifold of real images, crisper still. The caveat is the perception–distortion tradeoff: the sharper and more "real" you push, the more the model invents detail that may not be true; the extra sharpness is bought partly with hallucination, which is why a fidelity anchor stays in the mix.

fig-perceptual-loss-sharpness
Figure 7.3.26. The loss you train on decides the sharpness. The same degraded input restored by the same network under different losses: L2/MSE regresses to the blurry mean (safe, soft, detail-free); adding a perceptual (feature/LPIPS) loss brings back texture; an adversarial term sharpens it onto the manifold of real images. Per-pixel error actually favors the blurry result, which is why fidelity-only training looks washed out, and why the extra sharpness is partly invented (the perception–distortion trade-off, L7.8).

A combined objective can include pixel, feature, and adversarial terms:

$$\mathcal L=\lambda_1\|\hat I-I\|_1+\lambda_p\ell_{\mathrm{feat}}(\hat I,I)+\lambda_a\mathcal L_{\mathrm{adv}}.$$

There are no portable default weights: their scale depends on image normalization, sum versus mean reduction, feature layers, and the adversarial formulation. L1 targets a conditional median, whereas L2 targets a conditional mean. Either can lose uncertain texture. A pixel term encourages agreement with the training target; it is not a hard measurement constraint.

Choose the loss for the use case. Compare pixel fidelity, perceptual scores, data residuals when applicable, and representative held-out images. A metric used for training is insufficient as the sole evaluation. Inspect text, repeated patterns, faces, fine structures, and out-of-distribution content for invented detail.

A small translation illustrates the difference between pixel and feature comparisons. Two photographs can show nearly the same content while an edge moves by a pixel, producing a large set of pixel differences. A feature representation can be less sensitive to that displacement, which can make it useful for judging appearance. That tolerance is also a limitation when exact alignment matters. Combining a pixel loss with a feature loss makes the tradeoff explicit; the weights determine how strongly the training penalizes each kind of disagreement.

The terms in a combined loss serve different purposes. A pixel term penalizes color and spatial disagreement with the reference. A feature term penalizes disagreement in the chosen representation of texture and structure. An adversarial term favors outputs that the discriminator treats as belonging to the reference distribution. Inspect their numerical magnitudes and gradients under the actual normalization before choosing weights. Increasing the adversarial contribution can improve appearance while weakening correspondence to the particular captured scene; no coefficient range alone defines a safe balance.

Learning has now entered both sides of the experiment: the operator that makes an image and the metric used to judge it. The second learned model brings its own training examples and invariances. Agreement between the two models can therefore reflect shared assumptions rather than independent evidence of success. This is why the evaluation should retain measurements or human judgments that were not used to fit either model.