SocialFace-Restore-GAN
A Component-Based Hybrid GAN architecture designed to restore high-fidelity facial features (eyes, nose, mouth) in images degraded by social media compression, motion blur, and sensor noise.
π― Goal
The primary objective is to achieve perceptual realism while strictly preserving the subject's unique identity. This model leverages specialized discriminators for local facial components and an identity-consistency module.
π§΅ Dataset
The model was trained using paired training data generated via synthetic distortion from:
- CelebA: Large-scale face attributes dataset.
- FFHQ: Flickr-Faces-HQ dataset.
π§Ύ Description
Images on social media often suffer from aggressive lossy compression. This project implements a Hybrid GAN featuring:
- Generator (U-Net): A symmetric encoder-decoder with residual learning.
- Global Discriminator (PatchGAN): For full-image texture realism.
- Local Feature Discriminator: Specialized networks focusing on eyes, nose, and mouth.
- Identity Preserver: VGG-based feature extraction for identity-consistency loss.
π Performance Metrics
The model achieves the following target benchmarks:
- PSNR: > 28dB
- SSIM: > 0.85
- LPIPS: < 0.15 (indicating high human-perceived realism)
π Usage
You can load the model in PyTorch using:
import torch
# Assuming your model architecture class 'Generator' is defined
model = Generator()
model.load_state_dict(torch.load("socialface_restore_gan.pth", map_location="cpu"))
model.eval()