Introduction
Generative Adversarial Networks (GANs) have revolutionized image synthesis, yet precisely controlling their output remains a significant challenge. Traditional approaches to "steering" GANs often necessitate retraining the entire architecture or engineering complex feature-mapping techniques to link latent vectors to specific attributes. This paper addresses the specific challenge of task-based image-to-image translation. For instance, given an image of a handwritten "5," how can a model be directed to produce a "7" while preserving the original's stylistic nuances? The authors propose a novel framework that utilizes a Reinforcement Learning (RL) agent to navigate the latent space of a pre-trained GAN, treating it as a "black box."
Methodology
The proposed pipeline is a multi-stage process integrating dimensionality reduction, generative modeling, and reinforcement learning.
- Auto-Encoder (AE): An auto-encoder compresses 28x28 MNIST images into 32-dimensional latent vectors, simplifying the data representation for subsequent models.
- Latent-space GAN (l-GAN): A Self-Attention GAN (SAGAN) is trained on these 32-dimensional vectors rather than raw pixels, ensuring structural relationships are captured within the latent space.
- RL Agent (TD3): The core of the system is a Twin Delayed Deep Deterministic Policy Gradient (TD3) agent. It receives an encoded image and a specific task (e.g., an arithmetic addition). The agent's "action" is to select a 5-dimensional seed vector for the GAN generator.
- Reward Function: The agent is trained via a reward policy balancing correctness (verified by a pre-trained classifier) and realism (scored by the GAN’s discriminator).
Key Insights
- GAN as a Black Box: The underlying GAN weights remain frozen. To adapt the model to new tasks, only the RL agent’s reward policy needs updating, offering high modularity.
- Navigation vs. Creation: Instead of drawing pixels, the RL agent learns to "whisper" optimal coordinates to the GAN generator, leveraging the generator's pre-existing knowledge of image realism.
- Dynamic Task Handling: By inputting the task directly into the agent, the system functions as a general-purpose transformation model rather than a single-purpose tool.
Results
The framework was evaluated using the MNIST dataset. The RL-controlled GAN achieved a remarkable 95.31% accuracy on the arithmetic addition task. Even when subjected to Gaussian noise, the system maintained an accuracy of 81.79%, demonstrating significant robustness.
In terms of visual fidelity, the generated digits were nearly indistinguishable from real samples. The average discriminator score for generated images (0.70) closely matched that of real images (0.71). Training was found to be stable, with the reward effectively converging toward the theoretical maximum.
Conclusion and Future Work
This research demonstrates that RL can effectively control high-dimensional latent spaces for complex image translation tasks. While the current study focuses on MNIST, the authors acknowledge that scaling to more complex domains like human faces will require further advancements in feature extraction and training stability. Potential future applications include real-time video quality adjustment and privacy-preserving image transformations.
Summary updated