Skip to content

hiteshmaurya99/SR-GAN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 

Repository files navigation

SR-GAN

This is pytorch implementation of Super Resolution Gan which enhances the resloution of input images (given they were low resolution) to higher resolution. The dataset used is taken form kaggle and its consists of 12k high resolution images, i transformed these images into low-res and high-res images using torch transforms here highres has 4 times thep pixel count of lowres.I could have used the original images as target but using them would be too taxing on the limited hardware. sample of training data after transformation in comparision with original , lowres(input), highres(target) sample 2

The model architecture consists of Convolution block, Upsampling block, Dense-residual block(skip connections) repeated and connnected to form Generator and Discriminator just uses conv blocks with increasing channels.The network contains eight convolutional layers with of 3×3 filter kernels, increasing by a factor of 2 from 64 to 512 kernels. Strided convolutions are used to reduce the image resolution each time the number of features is doubled.

Model architecture- model_architecture_of_sr_gan

Loss function

for generator L1 loss, VGG loss, Adversarial loss --> gen_loss = l1_loss + loss_for_vgg + adversarial_loss for discriminator is a combination of Gradient penalty and mean loss.

Training

Model was trained on 12k images for 131 epochs with batch size of 16 and implementing pytorch mixed precision for improved performance in training time. During the training, A high-resolution image (HR) is downsampled to a low-resolution image (LR). The generator architecture than tries to upsample the image from low resolution to super-resolution, discriminator and tries to distinguish between a super-resolution and High-Resolution image and generate the adversarial loss* gradient penalty which then backpropagated into the generator. Results i got could be better with more epochs and training with higher-res target images.

Low resolution input image-

High resolution output image-

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published