CATastrophe is a Generative Adversarial Network (GAN) model for image inpainting. It generates realistic images by filling in missing regions based on the surrounding content. The model consists of a generator and a discriminator, trained in an adversarial setting to improve over time.
- Generator: A U-Net style network with an encoder-decoder architecture and skip connections. It takes an image with missing parts and reconstructs the missing content.
- Discriminator: A CNN that distinguishes between real and generated images, encouraging the generator to produce realistic inpainted results. The generator uses a combination of adversarial loss and L1 loss to ensure realistic image generation, while the discriminator's binary cross-entropy loss helps improve realism.
The model is trained on masked images from the Animal Faces Dataset, which contains photos of animals with varied facial features. During training, random masks are applied to images, and the generator learns to fill in these masked areas. The training uses mini-batch gradient descent with the Adam optimizer, and both the generator and discriminator are updated iteratively.
After training, the generator is able to fill in missing regions, producing inpainted images. The model is evaluated by comparing generated images to real ones, and it steadily improves as training progresses.
You can interact with the trained model: https://huggingface.co/spaces/akrasi/CATastrophe


