Skip to content

An attempt to ustilise Super Resolution Generative Adversarial Networks (SRGANs) on QR codes to enhance images

License

Notifications You must be signed in to change notification settings

PsVenom/QR-code-enhancement-using-SRGANs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QR code enhancer

An attempt to ustilise Super Resolution Generative Adversarial Networks (SRGANs) on QR codes to enhance images.

Most qr scanners require the scanning image to be greater than 2cms x 2cms. However, I believe we can shrink the size by a respectable factor. This can be made possibile by artificial resolution-enhancement. This application opens a lot of possibilities for significantly quicker realtime detection

References

Link to dataset- https://www.kaggle.com/datasets/coledie/qr-codes

Link to the original paper- https://arxiv.org/abs/1609.04802

Excellent repo I based my work on - https://github.com/bnsreenu/python_for_microscopists/tree/master/255_256_SRGAN

Files in repository

main.py ---> contains the main model architecture

Superresolution.ipynp ---> A detailed notebook for downloading the model, augmenting image data, preparing and compiling the final model, and finally running it

Understanding SRGAN architecture

SRGAN is a generative adversarial network for single image super-resolution. It uses a perceptual loss function which consists of an adversarial loss and a content loss. The adversarial loss pushes the solution to the natural image manifold using a discriminator network that is trained to differentiate between the super-resolved images and original photo-realistic images.

The Generator

image

The generator architecture of the SRRESNET generator network consists of the low-resolution input, which is passed through an initial convolutional layer of 9×9 kernels and 64 feature maps followed by a Parametric ReLU layer. The reason for choosing the Parametric ReLU is because it is one of the best non-linear functions for this particular task of mapping low-resolution images to high-resolution images.

The Discriminator

image

The discriminator architecture is constructed in the best way to support a typical GAN procedure. Both the generator and discriminator are competing with each other, and they are both improving simultaneously. While the discriminator network tries to find the fake images, the generator tries to produce realistic images so that it can escape the detection from the discriminator. The working in the case of SRGANs is similar as well, where the generative model G with the goal of fooling a differentiable discriminator D that is trained to distinguish super-resolved images from real images.

Hence the discriminator architecture shown in the above image works to differentiate between the super-resolution images and the real images.

Performance so far

Epoch one

download

Epoch two

image

Epoch three

image

image

we can safely say that the results are nearly identical to the actual image

About

An attempt to ustilise Super Resolution Generative Adversarial Networks (SRGANs) on QR codes to enhance images

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages