Image2StyleGAN: How to Embed Images Into the StyleGAN Latent Space?
Paper · 2019 · Rameen Abdal, Yipeng Qin and Peter Wonka
Summary
A system that generates convincing faces does not automatically know how to represent a particular photograph. That gap matters if the goal is to change an existing portrait: preserve the person, alter an expression, or blend the portrait with another image. Image2StyleGAN studies how to find a representation of an input image inside a previously trained StyleGAN generator. Its central contribution is an optimization procedure that searches for such a representation while leaving the generator unchanged. The recovered representation can then be manipulated, and the generator converts the modified representation into an edited image.
The crucial design choice is where this search takes place. StyleGAN has an intermediate space called W, whose vectors control image synthesis. The authors find that searching for a shared vector in this space gives inadequate reconstructions. They instead introduce W+, which supplies a separate vector to each generator layer that accepts a style input. This gives the optimization more freedom to reproduce a photograph. Their objective combines direct pixel comparison with comparisons between features extracted by VGG-16. The pixel term rewards agreement in visible values, while the feature terms help preserve structures that pixel matching alone misses.
Using a StyleGAN trained on human faces from FFHQ, the authors reconstruct examples from a collection of 25 images covering 5 categories. Faces give the strongest results, although fine details can disappear and surfaces can become smoother. More surprisingly, the same generator can approximate cats, dogs, paintings, and cars. The paper then asks a harder question: do these successful reconstructions occupy a representation in which simple manipulations have useful meanings? Interpolating between face representations produces convincing transitions, and exchanging selected layer inputs supports style changes. Differences between expression representations can also be applied to another face. Comparable operations on non-face reconstructions are much less reliable.
This distinction between reconstruction and meaningful manipulation is the paper’s most important finding. A face-trained generator can approximate an image of a car without organizing cars into a useful, coherent region of its latent space. Intermediate images during interpolation can reveal facial outlines, and style mixing can lose the structure of non-face content. The authors interpret these observations as evidence that later synthesis layers can conceal an underlying face-oriented arrangement. Their procedure therefore serves both as an editing mechanism and as a probe of what the generator has learned.
The results come with practical and experimental qualifications. Reconstruction is sensitive to image alignment, optimization requires several minutes, and repeated reconstruction gradually removes detail. The authors also inherit circular artifacts from the existing generator. Their experiments support useful face editing and expose considerable representational flexibility, but they do not establish universal image understanding. The paper’s broad claim that different kinds of images can be embedded is best read alongside its small test collection and its finding that convincing reconstruction alone does not guarantee useful semantics.
Interesting ideas
Separate reconstruction from useful representation. A representation may reproduce an observation accurately while behaving poorly when combined with another representation. Image2StyleGAN tests both properties by following reconstruction with interpolation, layer exchange, and expression transfer. This distinction applies to semantic parsing, compression, retrieval, and other tasks where preserving an input is only part of the intended use. Evaluation should exercise the operations the representation is supposed to support.
Relax shared controls selectively. The move from W to W+ replaces a common control vector with layer-specific controls while retaining the learned generator. This makes an existing system more expressive without rebuilding its underlying machinery. Elsewhere, a comparable strategy is to keep a shared core but allow local parameters for components with different responsibilities. The benefit must be checked against the possibility that increased flexibility weakens consistency between components.
Compare observations at several scales. Pixel agreement and feature agreement capture different aspects of an image. The paper combines them because an objective concentrated on a single level can miss structure or erase detail. The broader lesson is to evaluate outputs through several complementary views: surface form, local structure, and larger organization. Such checks are useful when no individual score fully represents what a successful output should preserve.
Use simple interventions to inspect structure. Interpolation, crossover, and difference-vector addition are deliberately uncomplicated operations. Their successes and failures expose properties that a reconstruction score cannot show. This is useful in interpretability research because a controlled manipulation asks a concrete question about a representation. If exchanging a component changes unexpected properties, the component’s apparent role needs qualification.
Choose initial assumptions according to the input. Starting near an average face helps face reconstruction, whereas random starting values work better for the tested non-face categories. An initialization carries assumptions about where a good answer should lie. Systems that handle heterogeneous inputs should test those assumptions separately across input groups instead of treating a successful default as universally appropriate.
Stress-test invariance and repeated use. The authors translate, resize, rotate, damage, and repeatedly reconstruct images. These interventions reveal dependencies and accumulated losses that attractive individual examples can conceal. Similar tests apply to normalization, annotation, conversion, and other processing pipelines: change an irrelevant property, or run the procedure again, and inspect whether the intended information survives.
Keep nuisance variation fixed during optimization. The supplementary experiments distinguish changing noise between complete runs from changing it during every optimization update. The latter produces substantially worse reconstructions. More broadly, when evaluating a proposed update, uncontrolled variation can obscure whether that update helped. Holding irrelevant conditions steady makes the search easier to interpret and its comparisons more informative.
Deep dive: Image2StyleGAN: How to Embed Images Into the StyleGAN Latent Space?
How Image2StyleGAN reconstructs photographs in StyleGAN’s latent space, enables face editing, and tests what those representations preserve. · about 32 minutes to read
How Mova uses it
The connections to Mova concern representation design, controlled search, and evaluation. The supplied implementation evidence does not establish an Image2StyleGAN integration or an application measured against this paper. Mova’s native work centers on explicit rules, linguistic structures, and bounded computation. The proposals below transfer experimental ideas rather than importing the image generator. Their status marks describe correspondence with documented mechanisms; they do not certify that the paper caused an implementation.
Idea: Separate reconstruction from operational meaning. Where: Section 4, especially the morphing experiments. Area: representation evaluation. Mova: частково є (docs/hybrid-system.md, docs/correspondences.md). Mova already distinguishes a successful parse, a compatible observation, and an admitted action. It could also test whether equivalent representations continue to support the same questions and updates. A structure that reproduces a sentence but fails under ordinary reasoning would then have an explicit, separate failure.
Idea: Relax shared controls only where components need independence. Where: Section 3.3 and Figures 5 and 14. Area: architecture. Mova: нове. A proposed experiment could compare shared rule weights with bounded component-specific adjustments while keeping common types and invariants. Why Mova: this could improve local handling of a domain without discarding the transparent shared core. Novelty remains provisional because the digest does not describe every parameter-sharing mechanism.
Idea: Evaluate several representational scales together. Where: Section 5.2 and Figures 9 and 22. Area: evaluation. Mova: частково є (en, prag, world, and docs/architecture.md). Its pipeline already exposes tokens, dependency trees, frames, and world states. A combined diagnostic could identify whether a change improves surface agreement while damaging roles or state updates. The paper motivates complementary checks; it does not establish weights appropriate for language.
Idea: Use controlled component exchange to test responsibility. Where: Section 4.2 and Figures 6, 8, and 23. Area: interpretability. Mova: нове. Owned test fixtures could exchange a frame’s attribution or temporal component while holding other fields fixed, then inspect downstream changes. Why Mova: this would test whether a component affects only the behavior its interface declares. Such interventions would need semantic compatibility checks before their results could be interpreted.
Idea: Test initialization by input family. Where: Section 5.1 and Table 2. Area: search. Mova: частково є (world selfplay, math::steps, and math::deduct). Mova already explores bounded alternatives, but the digest does not establish category-conditioned initialization experiments. A transparent search could compare a standard starting analysis with alternatives selected by declared task family. Any gain would require the same held-out questions and a fixed search budget.
Idea: Test transformation sensitivity explicitly. Where: Section 3.2, Figure 2, and Table 1. Area: robustness evaluation. Mova: частково є (tests/, contrast sets, and en rules-audit). Meaning-preserving changes in wording, punctuation, or presentation could be paired with the original input. The relevant criterion would be stable interpretation where meaning is preserved, alongside deliberate changes where syntax actually changes the reading.
Idea: Check repeated processing for accumulated damage. Where: Section 5.3 and Figure 11. Area: data processing. Mova: частково є (tools/roundtrip, pack, and lossless codec checks). Byte preservation already has explicit checks in storage paths. Repeated parse–frame–render or annotation-normalization cycles could additionally track semantic drift. The important distinction is between an exact storage guarantee and the more demanding claim that interpretation remains stable.
Idea: Hold nuisance conditions fixed when comparing updates. Where: Section 7, “Influence of Noise Channels,” and Figure 16. Area: experimental control. Mova: вже є (README.md principles and deterministic experiment procedures). Fixed seeds, ordered computation, and repeated identical runs already address this concern. The paper supplies another reason to preserve that discipline: variation unrelated to a candidate change can make a search appear unstable or beneficial for the wrong reason.
Idea: Do not confuse flexibility with domain competence. Where: Sections 3.1 and 4.1. Area: evaluation. Mova: вже є (docs/hybrid-system.md and configured capability boundaries). Mova already states that successful parsing does not establish task understanding. The corresponding evaluation should preserve separate records for recognized structure, resolved task, and successful execution. An isolated successful output should not expand the declared supported domain.
Idea: Probe relationships between examples, not only individual outputs. Where: Section 7, “Clustering or Scattering?,” and Figure 20. Area: statistics. Mova: частково є (tools/dictindex, frame statistics, and reviewed selectors). Dictionary evidence already supports explained group proposals. A further analysis could compare within-group and between-group structural similarity, while retaining source strata. As with the paper’s latent distances, compact grouping would be evidence about organization rather than proof of correct meanings.
Idea: Use a reference state as a diagnostic, not a verdict. Where: Section 5.1 and Tables 1–3. Area: anomaly analysis. Mova: нове. A documented reference profile could help identify unusual parse or frame patterns, but distance from that profile must not itself reject a valid rare construction. Why Mova: this could prioritize difficult dictionary or annotation cases for review without turning frequency into a correctness rule.
Idea: Measure damage locally as well as globally. Where: Section 3.2, Figure 3, and Table 3. Area: robustness. Mova: частково є (prag frames and explicit gap reporting in world). Removing an unrelated clause or obscuring an argument could test whether unaffected facts remain usable. A desirable result would preserve supported information and expose the missing part as a gap. The image experiments motivate the test, but cannot predict linguistic performance.
Idea: Keep incomplete evidence incomplete. Where: Section 3.2, defective-image discussion. Area: uncertainty. Mova: вже є (world gap reporting and native deputy missing_context). The embedding procedure does not automatically fill every absent facial part. Mova’s analogous discipline is to avoid manufacturing a missing referent or unsupported fact. Tests should reward faithful retention of uncertainty, even when a plausible completion would make an output look more complete.
Idea: Separate search quality from representational capacity. Where: Section 5.3, iterative embedding. Area: optimization evaluation. Mova: частково є (world selfplay journals and math branch diagnostics). A failed search can reflect poor exploration instead of an impossible representation. Mova could distinguish “no admissible candidate found” from “candidate known to be expressible but not recovered.” Synthetic fixtures with known solutions would make that distinction reviewable.
Idea: Choose stopping rules by observed convergence. Where: Section 5.3 and Figure 10. Area: resource management. Mova: частково є (world/src/knowledge/retention/mice.rs and bounded worker interfaces). The mice already stop after insufficient material change or a hard cap. Further measurements could compare task-specific stopping with a common budget. The criterion should include answer quality and evidence stability instead of treating a flat internal score as sufficient.
Idea: Record quality together with computational cost. Where: Section 5.3 and the conclusion. Area: systems evaluation. Mova: вже є (tools/jobs, tools/twin, and bounded execution records). Mova already records resource estimates and measured runs. The paper reinforces the need to report the cost of obtaining an output beside its quality, especially when a method is proposed for interactive use. Timing alone does not establish that a result meets its semantic contract.
Idea: Test learned machinery against an unlearned control. Where: Figures 5 and 14. Area: negative controls. Mova: частково є (docs/school.md controls and README.md measurement principles). Existing controls test whether apparent competence survives removal of relevant information. A comparable intervention could disable a learned parameter group while preserving interfaces. The test would identify dependence on that component without attributing every remaining success to the intended mechanism.
Idea: Keep domain-specific recommendations domain-specific. Where: Section 5.1 and Section 7’s additional initialization results. Area: reporting. Mova: вже є (tools/dictindex measurement limits and source-stratified reporting). A setting that helps common examples may hurt another category. Mova’s reports should retain language, source, task, and construction strata so that an aggregate improvement cannot silently become a universal recommendation.
Idea: Evaluate matched-domain and mismatched-domain behavior separately. Where: Section 7, the LSUN generator experiments. Area: generalization. Mova: частково є (en evaluations across treebanks and French repair measurements). Separate results can reveal whether a rule reflects a linguistic regularity, an annotation convention, or an input distribution. The paper’s dataset comparisons motivate this separation, while their own confounds warn against assigning a cause from dataset identity alone.
Idea: Treat preprocessing as part of the system being evaluated. Where: Section 3.1’s face registration and Section 7’s resizing comparison. Area: data processing. Mova: частково є (en tokenization, treebank converters, and tools/treeagree token alignment). Mova already depends on declared input conventions. Reports could more consistently isolate changes caused by tokenization or conversion from those caused by parsing and reasoning. A favorable downstream score must not conceal an unsupported preprocessing assumption.
Idea: Check whether detail is lost before the main analysis begins. Where: Section 7 and Figure 12. Area: information preservation. Mova: частково є (tools/dictindex bounded frame features and explicit storage limits). A capped context or compressed feature view can omit evidence needed for a rare sense. Auditing those omissions would help distinguish an inference failure from information discarded upstream. The image resizing result is an analogy, not evidence that any particular linguistic cap is wrong.
Idea: Distinguish a useful heuristic from an established separation. Where: Section 4.3’s thresholded expression differences. Area: statistics. Mova: частково є (tools/dictindex positive-PMI proposals and reviewed labels). Mova already presents statistical selectors as candidates requiring review. Thresholds that suppress apparently weak evidence should be tested for lost minority cases. The authors’ expression threshold motivates such scrutiny but supplies no threshold transferable to dictionary work.
Idea: Test edits for unintended changes. Where: Section 4.3’s treatment of background variation. Area: intervention evaluation. Mova: нове. A rule repair could be assessed both for the relation it intends to change and for unrelated facts it should preserve. Why Mova: this would expose broad side effects that a net accuracy gain can hide. Existing regression gates partly support the idea, but the digest does not establish systematic collateral-change scoring.
Idea: Attribute inherited defects to the appropriate component. Where: Section 7 and Figure 21. Area: diagnosis. Mova: вже є (tools/treeagree evidence, rejected edits, and source-version provenance). Parser errors, annotation conventions, reader errors, and corpus defects require different remedies. The paper’s separation of generator artifacts from embedding errors supports retaining those boundaries. A downstream correction should not erase the record of where the defect originated.
Idea: Use simple operations as a conformance profile. Where: Section 4’s manipulation tests. Area: mathematical modeling. Mova: частково є (docs/groupants.md and docs/correspondences.md). A representation could declare the operations under which its meaning is expected to remain valid. Tests would then target those operations explicitly. This fits Mova’s source-bound observations, while the paper warns that passing a finite collection does not establish unrestricted equivalence.
Idea: Keep evidence for a mechanism separate from a causal explanation. Where: Sections 4.1, 4.2, and 7’s interpretation of non-face embeddings. Area: scientific reasoning. Mova: вже є (docs/hybrid-system.md evidence distinctions and reviewed knowledge admission). A visible failure can support a hypothesis without proving its internal cause. Mova’s reports should preserve observations, proposed explanations, and admitted conclusions as distinct records, especially when several pipeline stages could explain the same output.
The problem and its context
From generating a face to editing a photograph
Image generation and image editing begin from different places. A generator can start with an internal code and produce a picture. Editing a photograph requires the reverse connection: an existing picture must first be associated with a code that reproduces it closely enough. Without that connection, an attractive generated portrait is not necessarily useful for changing the photograph a person actually supplied.
The paper describes this reverse task as embedding an image into the generator’s latent space. A latent code is a collection of values that controls synthesis. The generator translates those values into pixels. Finding a code for a photograph therefore means searching for settings whose generated output resembles that photograph.
The challenge includes identity. The authors report that their early attempts with faces and other GANs produced reconstructions that no longer looked like the same person. A vaguely plausible face is an inadequate reconstruction if the intended application depends on retaining a particular individual’s appearance.
StyleGAN offers a promising setting because its synthesis process exposes an intermediate representation associated with controlled changes. The authors also point to the diversity and image quality of FFHQ. Their question is whether those advantages make it possible to recover existing images faithfully enough for subsequent manipulation.
What earlier generation systems contributed
The related-work discussion places StyleGAN within the development of generative adversarial networks. The paper describes improvements in objectives, normalization, regularization, and architecture as contributing to better generated pictures. Its concern is what those advances make possible once the generator has already been trained.
The authors identify DCGAN as an important architectural step based on convolutional synthesis. They then describe progressive training and the construction of CelebA-HQ as enabling more realistic, high-resolution face generation. In their account, both computational constraints and the available training imagery had limited earlier experiments.
For more varied imagery, they discuss BigGAN and its emphasis on large training batches. They describe it as producing realistic examples and smooth transitions across categories. StyleGAN takes a different place in this discussion: its architecture draws on style-transfer ideas and uses a more varied face collection.
These developments establish the opportunity, but not the solution. Better random samples do not demonstrate that a particular input photograph can be recovered. Nor does an intermediate control space automatically guarantee that the space is suitable for inversion.
Earlier approaches to finding a code
The paper distinguishes encoder-based inversion from direct optimization. An encoder is trained to map an image to a latent representation. Once trained, it can return that representation through a forward computation. The authors cite Auto-Encoding Variational Bayes in this discussion of learned mappings into latent spaces.
The advantage is speed. The limitation identified by the authors is difficulty generalizing beyond the imagery used to train the encoder. Their alternative is to begin with an initial code and repeatedly update it so that the generated picture better matches the target.
This choice replaces the need for a separately learned inverse mapping with a search performed for each image. It is slower at use time, but the authors regard it as a more general and stable basis for their investigation. They also acknowledge the concurrently developed stylegan-encoder repository as demonstrating visually strong optimization-based reconstructions.
Why perceptual comparison matters
A search procedure needs a definition of similarity. Direct pixel comparison is straightforward, but equal pixel errors do not necessarily correspond to equal perceptual errors. A result can have roughly appropriate colors while failing to reproduce recognizable structures.
The related-work discussion connects feature-based comparison to successes in image classification, including ImageNet Classification with Deep Convolutional Neural Networks. The authors describe earlier style-transfer work as showing that features extracted by a classification network can also characterize visual appearance.
They further distinguish feature information at different depths. Earlier approaches used such information to compare content and style, while subsequent work sought faster transfer and support for arbitrary styles. Image2StyleGAN uses this background to construct a reconstruction objective that observes the output at several levels, instead of relying exclusively on pixels.
The method, step by step
The overall procedure
The method takes an image and a previously trained StyleGAN generator. It chooses an initial latent representation, generates a candidate image, measures the discrepancy from the target, and updates the latent representation. The generator’s learned weights remain fixed throughout this search.
This separation is essential. The procedure is asking what an existing generator can express when given suitable controls. If the generator itself were changed for every target, the experiment would answer a different question about adaptation rather than the capacity of its established representation.
Recovering an editable representation
The steps in order.
The final output includes both the optimized code and the picture generated from it. Keeping both matters because the reconstruction is the visible result, while the code is what enables later editing.
Preparing the input
For faces, the authors use the preprocessing distributed with the official StyleGAN implementation. This includes aligning facial images to a standard arrangement. Alignment makes the target more compatible with the organization learned from the face-training distribution.
The method does not learn that alignment during inversion. The transformation experiments show that the generator is sensitive to the position, size, and orientation of facial content. Preprocessing is therefore a meaningful part of the experimental setup.
A separate resolution decision concerns the perceptual objective. The generated output can have a resolution of 1024 × 1024, but the feature comparison is applied after resizing to 256 × 256. The authors choose this because the classification features used for comparison are scale-dependent and originate from a lower-resolution setting.
Pixel comparison and feature comparison consequently serve different observational roles. The former checks image values directly, while the latter evaluates a resized view through a fixed feature extractor. This arrangement improves reconstruction in their examples, although the resizing can remove small details.
Why W+ changes the search
StyleGAN begins with a latent space called Z. A fully connected mapping transforms a 512-dimensional input from Z into a 512-dimensional vector in W. The authors investigate whether an input image can be reconstructed by searching within these ordinary spaces.
Their main departure is to let the style inputs differ across synthesis layers. W+ contains 18 separate 512-dimensional vectors, corresponding to the layers that receive adaptive instance normalization inputs. Rather than requiring every such layer to use a common vector, the optimization can adjust each layer’s vector separately.
This is a relaxation of a constraint. A shared vector ties together the controls delivered to different stages of synthesis. Layer-specific vectors allow those stages to cooperate in ways that the shared representation cannot easily express.
The relaxation is consequential for interpretation as well as reconstruction. More flexible controls can reproduce a broader range of images, but their successful use does not imply that all reconstructed categories become organized like the original training category. The subsequent manipulation experiments investigate precisely that issue.
Choosing a starting point
The authors compare random initialization with initialization from an average-face representation, written w̄. For random initialization, the individual variables are sampled independently from a uniform distribution.
wₖ ∼ U[−1, 1]
Here wₖ denotes an individual variable of the initial latent representation. U[−1, 1] is the uniform distribution between the stated endpoints. The subscript k identifies a variable instead of a generator layer with a particular semantic meaning.
The alternative begins from w̄, the mean latent representation associated with the average face. The motivation comes from a previous observation, discussed by the authors, that distance from this reference can indicate poor-quality faces.
Starting from the mean is not simply a numerically convenient choice. It places the search near a region associated with the generator’s main training domain. That prior expectation helps the tested faces, but the results favor random initialization for the other image categories.
Defining the reconstruction objective
The optimized code minimizes a perceptual discrepancy together with a normalized squared pixel discrepancy. Written with an explicit optimizer, the objective is:
w* = argmin_w [L_percept(G(w), I) + (λ_mse / N) ‖G(w) − I‖₂²]
I is the target image. G is the fixed generator, and G(w) is the image it produces from latent code w. The symbol w* identifies the code selected by optimization. L_percept is the feature-based comparison. The squared norm adds squared differences across corresponding image values. N counts those scalar values, and λ_mse sets the pixel term’s weight.
For a square image with color channels, the normalization count is:
N = n × n × 3
Here n is the image width and height, while 3 is the number of color channels. The normalization makes the pixel term an average over scalar image entries. The authors use λ_mse = 1.
The perceptual component compares outputs from several layers of VGG-16:
L_percept(I₁, I₂) = Σⱼ₌₁⁴ (λⱼ / Nⱼ) ‖Fⱼ(I₁) − Fⱼ(I₂)‖₂²
I₁ and I₂ are the images being compared. Fⱼ extracts the feature output from the selected VGG-16 layer indexed by j. Nⱼ counts scalar entries in that output, and λⱼ weights its contribution. The sum includes the selected feature layers, with λⱼ = 1 throughout the authors’ experiments.
The chosen layers are conv1_1, conv1_2, conv3_2, and conv4_2. Their outputs give the objective several views of the same pair of pictures. Agreement at one feature level cannot compensate for every discrepancy visible at another level.
The authors interpret the perceptual term as guiding the optimization toward a suitable part of the latent space. Pixel matching alone can settle on an image with broadly similar colors while missing the structure needed for a convincing reconstruction. Combining the terms retains direct appearance matching while making structural agreement more influential.
Updating the latent code
The search follows the gradient of the objective with respect to the latent variables. Its update can be expressed as:
w ← w − η F′(∇w L)
L denotes the current combined loss. ∇w L is its gradient with respect to the latent code. η is the learning rate. F′ represents the optimizer’s transformation of the gradient into an update. The authors use Adam, so the update includes its adaptive optimization machinery rather than applying an unmodified gradient.
Their settings are a learning rate of 0.01, β₁ = 0.9, β₂ = 0.999, and ε = 1e−8. The β parameters govern Adam’s running estimates, and ε is its numerical stabilization parameter. These settings remain the same across the reported experiments.
The procedure runs for 5000 optimization steps. The authors inspect convergence curves to motivate this common budget: face reconstruction settles earlier than the more difficult categories, while the painting example continues improving for longer.
StyleGAN’s noise inputs remain constant during a reconstruction. Changing the fixed noise between separate runs produces similar-looking results, but repeatedly resampling it during the search substantially worsens quality. Keeping it fixed gives the latent optimization a steadier problem.
Morphing through interpolation
After reconstruction, the authors combine latent representations using simple vector operations. Morphing interpolates between the representations of a pair of images:
w = λw₁ + (1 − λ)w₂, λ ∈ (0, 1)
w₁ and w₂ are the recovered representations of the endpoint images. λ determines their relative contributions. The resulting w is passed through the generator to produce an intermediate picture.
This operation tests whether a straight path through the representation gives a sensible visual transition. Successful endpoint reconstruction does not guarantee that the intervening representations will remain convincing or preserve the expected category.
Style transfer through layer exchange
For style transfer, the method constructs a new representation from parts of existing representations. In the cross-category experiments, the initial 9 layer inputs come from the content image, and the final 9 come from the style image.
The earlier group corresponds to synthesis resolutions described as 4²–64², while the later group corresponds to 64²–1024². The intended division is between larger-scale organization and lower-level appearance such as color and texture.
The paper also presents stylized-face examples using a style loss associated with VGG-16’s conv4_2 layer. These examples demonstrate another route for obtaining the style representation that is subsequently mixed with face content.
The operation is simple, but its interpretation is conditional. Exchanging later layer inputs can produce useful appearance changes without establishing that content and style are entirely independent. Failures on non-face content make this qualification especially important.
Expression transfer through a difference
Expression transfer uses a reference person shown with different expressions. The difference between those representations is applied to a target face:
w = w₁ + λ(w₃ − w₂)
w₁ is the target representation. w₂ represents the source with a neutral expression, and w₃ represents the source with the more distinctive expression. Their difference supplies a candidate expression direction, while λ controls how strongly it is applied.
A raw difference may also encode unwanted variation, including background changes. The authors suppress difference channels whose L2 norm falls below a threshold of 1, replacing them with zero vectors. They then normalize the remaining vectors to regulate expression intensity.
This processing makes the transferred direction more useful in the shown examples. It remains a heuristic construction: the method does not prove that the difference contains expression alone or that its effects are independent of every target identity.
Experiments and results
What was tested
The main image collection contains 25 examples divided among 5 categories. Human faces are the generator’s intended domain. Cats and dogs provide different appearances with some face-like organization. Paintings introduce a different visual treatment, while cars supply examples without a comparable facial structure.
The main generator is the officially released StyleGAN trained on FFHQ. Additional experiments use generators trained on LSUN-Car, LSUN-Cat, and LSUN-Bedroom. Expression-transfer illustrations use reference images from IMPA-FACES3D.
The study is primarily a controlled visual investigation. It compares reconstruction choices, examines selected numerical losses and distances, and shows the behavior of latent operations. It does not present a large benchmark with a broad ranking of competing inversion systems.
The numerical reconstruction measure is the combined objective defined by the method. The tables also report Euclidean distance between a recovered code and the average-face reference. That distance is an analysis of representation location, rather than an independent measurement of perceived similarity.
Reconstruction quality across categories
The face examples preserve recognizable appearance well, although the authors note smoothing and missing fine detail. The non-face examples are less faithful, yet recognizable reconstructions show that the learned synthesis filters can express more than human faces.
This result is striking because the generator remains fixed. The optimization is not teaching it a new object category. It is finding combinations of existing controls that approximate the target picture.
Initialization behaves differently across domains. For face images, the average-face starting point obtains a lower reported mean loss than random initialization.
Face reconstruction initialization, reported mean objective
Beginning at the average-face representation gives the lower face reconstruction loss.
The numbers
| System or setting | reported L (×10⁵) |
|---|---|
| Random initialization | 0.351 |
| Average-face initialization (this paper) | 0.309 |
The accompanying mean distances to w̄ are 30.67 for average-face initialization and 35.60 for random initialization. Thus the better face reconstruction also remains closer to the reference used to motivate the starting point.
For the non-face categories, random initialization gives the lower reported mean loss in each comparison.
Non-face reconstruction initialization, reported mean objective
Random starting values give lower reported losses across the tested non-face categories.
The numbers
| System or setting | reported L (×10⁵) |
|---|---|
| Cat, average-face initialization | 0.752 |
| Cat, random initialization (this paper) | 0.740 |
| Dog, average-face initialization | 0.922 |
| Dog, random initialization | 0.845 |
| Painting, average-face initialization | 3.530 |
| Painting, random initialization | 3.451 |
| Car, average-face initialization | 1.390 |
| Car, random initialization | 1.269 |
The corresponding distances also place non-face reconstructions farther from the average-face code. For cats, the reported values are 70.86 and 70.97 under average-face and random initialization respectively. For dogs, they are 74.78 and 75.14.
Painting reconstructions have distances of 103.61 and 105.29, while cars have distances of 82.53 and 82.60. These measurements support the authors’ account of faces occupying a more compact region near the reference. They do not establish a universal distance threshold for category membership.
Sensitivity to transformations
The transformation experiment modifies a face’s location, size, and orientation before reconstruction. Translation is particularly disruptive: the authors report that it can prevent recovery of a valid face. Resizing and rotation still produce faces, but with blur and lost detail.
Transformed face inputs, reported reconstruction objective
Altering position, size, or orientation exposes strong dependence on the input arrangement.
The numbers
| System or setting | reported L (×10⁵) |
|---|---|
| Translation, right 140 pixels | 0.782 |
| Translation, left 160 pixels | 0.406 |
| Zoom out, 2X (this paper) | 0.225 |
| Zoom in, 2X | 0.718 |
| Rotation, 90° | 0.622 |
| Rotation, 180° | 0.599 |
The star identifies the lowest reported loss among these transformed settings; it does not recommend resizing as a generally superior preprocessing strategy. The transformations change the target itself, so the chart should be read with the qualitative results.
The latent distances for right and left translation are 48.56 and 44.12. Zooming out and in gives distances of 38.04 and 40.55, while the rotations give 47.21 and 42.93. The paper interprets these experiments as evidence that the learned representation still depends on scale and position.
Defective faces
The authors also remove facial information and reconstruct the damaged inputs. They find that eliminating one feature does not necessarily disrupt the reconstruction of other features. Missing information is not reliably completed into an intact face.
The non-defective example has a reported loss of 0.204. Inputs with eyes, nose, or mouth removed have losses of 0.271, 0.311, and 0.301 respectively. Removing eyes together with the mouth gives 0.233, while removing eyes, nose, and mouth gives 0.285.
These values should not be treated as a direct ranking of how severe each defect looks. The optimization is matching different target images, and those targets contain different visible information.
The distance from the average-face code rises from 29.19 for the intact example to 34.90 for missing eyes, 39.20 for a missing nose, and 37.04 for a missing mouth. The combined-removal cases have distances of 39.62 and 37.59. The authors view this as additional evidence that valid faces cluster around the mean representation.
Editing behavior and runtime
Face morphing gives convincing visual transitions in the shown examples. Morphing between non-face reconstructions fails both within a category and between categories. Facial outlines appearing along some transitions reveal the face-oriented organization that endpoint reconstruction can conceal.
Style mixing transfers appearance properties, including texture and color, but frequently disrupts the structure of non-face content. The painting example is especially problematic. Expression transfer produces visually strong examples on reconstructed faces, including directions applied with varying intensity.
The complete reconstruction uses 5000 steps and takes less than 7 minutes for an image on the reported 32GB Nvidia TITAN V100 GPU. This establishes the practical cost under that hardware configuration. It does not establish interactive performance or equivalent timing on other equipment.
What the ablations show
The representation matters as much as the optimizer
The comparison between W and W+ asks whether failure comes from searching poorly or from using controls that are too restrictive. Direct optimization in W does not yield satisfactory examples in the authors’ comparisons. Allowing independent vectors across layers substantially improves reconstruction.
The authors also repeat reconstruction with randomly initialized generator weights. Those results are poor, including when the more flexible latent space is available. Increasing the number of adjustable latent controls is therefore insufficient on its own.
Together, these comparisons support a specific explanation: successful reconstruction depends on both useful learned synthesis machinery and a sufficiently flexible way to control it. The results do not imply that arbitrary untrained features become useful merely because the search has many parameters.
The visual comparisons are persuasive about the tested examples, but the paper does not supply a comprehensive numerical study of every latent-space choice. W+ is the practical conclusion of these experiments, instead of the endpoint of an exhaustive search over all possible representations.
Pixel agreement needs structural guidance
The loss-function ablation compares pixel-only optimization, a perceptual objective using conv3_2, their combination, a perceptual objective using several layers, and the final combined objective.
Pixel-only optimization captures broad color relationships but tends to smooth faces and miss important non-face structures. In some non-face results, the generated picture retains tendencies associated with the average face. Matching image values does not reliably lead the search towards the intended object arrangement.
Feature-based comparison helps counter that behavior. Using several VGG-16 outputs works better than relying on the selected single layer. The authors attribute this to the need to preserve similarity across different scales of visual organization.
Adding pixel comparison to the multilayer feature objective gives the strongest visual results among the settings shown. This supports the terms’ complementary roles. It does not demonstrate that the same weighting is optimal for every input class or every generator.
The distinction matters because the reported combined loss is also the quantity optimized by the method. The visual ablation provides evidence beyond simply saying that optimizing the chosen objective makes that objective smaller.
Initialization exposes the domain structure
Average-face initialization helps human faces but does not give the best loss for the other categories. This is more informative than a general recommendation to start from a mean.
For faces, the reference supplies a useful location from which the optimizer can refine identity and appearance. For other categories, beginning near a typical face imposes a less helpful starting assumption.
The authors combine this observation with distances between pairs of recovered representations. Faces are relatively close to one another, while other categories, especially paintings, are more dispersed. They interpret the geometry as a concentrated face region surrounded by isolated non-face solutions.
That interpretation fits the manipulation results: nearby, coherently organized face representations support useful transitions, whereas successful non-face endpoints do not imply useful paths between them. Even so, pairwise distances in the collected examples do not fully characterize the topology of W+.
Layer exchange tests the proposed explanation
The style-transfer experiments provide an intervention on the early-versus-late layer account. Retaining earlier content controls and exchanging later style controls can change appearance substantially.
For face content, this frequently gives a useful stylization. For non-face content, the operation can lose the object’s arrangement. The authors interpret the difference as evidence that later layers provide much of the flexibility needed to conceal a face-like foundation.
The important qualification is that this is an explanatory hypothesis supported by visible behavior. The paper does not inspect every internal feature or establish a complete causal decomposition of object structure across all layers.
Its conclusion is nonetheless stronger than an inference from reconstruction quality alone. The crossover experiment actively changes a selected part of the representation and observes what survives.
Convergence and repeated reconstruction reveal search limits
The convergence curves show that difficulty varies by input. The face example settles around 1000 steps. Cat, dog, and car examples settle around 3000 steps. The painting example takes around 5000 steps.
These curves explain the common optimization budget, but they also show that a shared budget is a pragmatic compromise. A method intended for faster operation would need to distinguish genuinely completed searches from cases that merely improve slowly.
Repeated reconstruction is a particularly revealing test. After an image has been generated from a recovered representation, it should be expressible by the generator. Yet reconstructing that output again does not reliably preserve it perfectly.
The authors repeat the process seven times and observe gradual loss of detail. They suggest slow convergence near a local optimum as a possible cause. Random starting values may contribute for the non-face examples.
This shows why generator capacity and inversion accuracy must be separated. A target can be representable while the optimization still fails to recover an equally faithful code.
Noise and feature resolution affect the experiment
Keeping a different noise realization fixed in a separate run gives similar reconstructions. Resampling the noise at every update gives markedly worse quality. The useful control is therefore stability during the search, rather than dependence on a unique noise realization.
The perceptual-resolution comparison provides another control. Computing features from images resized to 256 × 256 works better than computing them directly from 1024 × 1024 images.
The authors connect this to the feature extractor’s training scale. Its filters do not necessarily behave appropriately when the same structures appear at substantially different sizes. Resizing helps the comparison but can erase details that the reconstruction ought ideally to preserve.
Finally, the additional generators produce poorer reconstruction results than the FFHQ generator. Interpolation fails for the tested LSUN-Cat and LSUN-Car settings. The authors attribute this partly to differences in training-data quality, but the comparison also changes domain and resolution. It supports sensitivity to the learned distribution without isolating a single causal factor.
Limitations
Limitations the authors identify
The authors explicitly identify artifacts inherited from the existing StyleGAN generator. Circular patterns appear in reconstructions and also in independently generated pictures. Their presence in both supports the claim that inversion is not their sole source.
A second stated limitation is speed. Several minutes of optimization makes the procedure inconvenient for immediate editing. The authors would prefer inversion in under a second, but the paper does not demonstrate that operating regime.
The perceptual objective has a resolution limitation. The supplementary discussion notes that commonly used classification-based perceptual comparisons originate from ImageNet-scale imagery, with a stated resolution of 224×224. The paper’s larger output images do not automatically match that operating scale.
Resizing before feature extraction helps, but the authors acknowledge that it can smooth the reconstruction by removing fine information. The resulting tradeoff affects exactly the details that can matter when reproducing an existing photograph.
The authors also present video and three-dimensional data as future directions. Their proposed extensions include point clouds and meshes. These are research intentions rather than demonstrated capabilities of the method described here.
Limits visible in the evaluation
The collected reconstruction dataset is small. Its 25 images provide useful diagnostic examples across different visual categories, but they cannot establish reliable performance over all imagery within those categories.
This is particularly relevant to the conclusion’s broad language about embedding any type of image. The experiments demonstrate flexibility across the selected categories. They do not test unrestricted image types, arbitrary acquisition conditions, or every important variation within faces.
The editing evidence is mostly qualitative. The paper judges latent manipulations by whether their outputs look convincing. It does not report a broad identity-preservation benchmark, an expression-recognition measurement, or a controlled human preference study.
As a result, the face-morphing examples support strong visual performance, while the suggestion that they might exceed earlier work remains explicitly unresolved. The authors leave a fuller investigation for future research instead of presenting a conclusive comparative ranking.
The numerical losses also have a limited interpretation. They quantify the method’s own reconstruction objective. A lower value does not independently certify retained identity, successful editing, or a semantically well-organized representation.
What the analyses cannot establish
The distance-to-mean results suggest a concentration of face representations, but they do not prove a complete cluster structure for the generator’s latent space. They describe recovered codes from the tested collection under the chosen optimization procedure.
Similarly, poor interpolation between non-face examples does not show that no useful non-face path could exist. It shows that the tested straight interpolation between recovered representations does not provide the desired behavior.
The early-face, late-overpainting explanation is plausible in light of the crossover and morphing examples. It remains an account of observed behavior, rather than a complete description of internal computation.
Expression differences are also only approximately selective. Thresholding low-norm channels is intended to suppress unwanted changes, but the method does not establish that all remaining variation concerns expression. Normalization controls intensity without guaranteeing that identity, background, or other properties remain fixed.
Finally, the stronger reconstruction performance of the FFHQ generator does not prove that training-data quality alone explains the gap. The additional generators differ in category and image resolution as well. A more tightly controlled comparison would be needed to separate those influences.
What came after
The later citing works include SDEdit: Guided Image Synthesis and Editing with Stochastic Differential Equations from 2021 and InstructPix2Pix: Learning to Follow Image Editing Instructions from 2023. Their titles place them in the continuing effort to make image generation useful for editing supplied content.
SDEdit names guided synthesis and editing through stochastic differential equations as its subject. InstructPix2Pix names the learning of image editing from instructions as its subject. These descriptions indicate different formulations of guidance from the latent interpolation, layer exchange, and expression differences examined by Image2StyleGAN.
The citation relationship alone does not establish that either work retains W+, uses the same reconstruction objective, or builds its main mechanism directly on this optimization procedure. Nor does it support a numerical comparison with Image2StyleGAN. Those details require evidence beyond their titles and citation status.
What Image2StyleGAN contributes to this continuing problem is a clear experimental distinction. Recovering an input and manipulating its representation are separate achievements. A method can be surprisingly flexible at the former while remaining tied to its training domain at the latter.
That distinction remains useful when considering either guided editing or editing from instructions. An edited output must do more than look plausible: its changes must correspond to the requested operation while preserving relevant content from the supplied image. Image2StyleGAN makes that requirement concrete by testing what happens after reconstruction, and by treating the failures of those tests as evidence about the representation itself.
Cite
Cite as Rameen Abdal, Yipeng Qin and Peter Wonka. 2019. Image2StyleGAN: How to Embed Images Into the StyleGAN Latent Space?. IEEE/CVF International Conference on Computer Vision (ICCV).
@inproceedings{abdal2019image2stylegan,
title = {{Image2StyleGAN: How to Embed Images Into the StyleGAN Latent Space?}},
author = {Rameen Abdal, Yipeng Qin and Peter Wonka},
booktitle = {IEEE/CVF International Conference on Computer Vision (ICCV)},
year = {2019},
doi = {10.1109/iccv.2019.00453},
eprint = {1904.03189},
archivePrefix = {arXiv},
url = {https://doi.org/10.1109/iccv.2019.00453}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/abdal-2019-image2stylegan-how-embed-images-into/