Git Product home page Git Product logo

sameer-ahmed7 / cyclegan Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 884 KB

This GitHub repo features a Cycle GAN model for Zebra and Horse Dataset image translation. It uses Wasserstein loss instead of L1 norm loss for improved stability, realism, and fidelity in the generated images. The goal is to achieve accurate and high-quality transformations between the two domains.

Jupyter Notebook 100.00%
cyclegan pytorch

cyclegan's Introduction

Project Title:

CycleGAN (Horse-to-Zebra & Zebra-to-Horse Image Translation)

Overview:

Open In Colab

This repository details the implementation of CycleGAN, a model that stands at the forefront of image translation technology. CycleGAN operates as a generative adversarial network (GAN) that facilitates bidirectional image translation between horse and zebra domains without the need for paired examples. This innovative model allows for the seamless transformation of horse images to zebra images and vice versa. The project was developed as part of the VISION AND PERCEPTION course within my Master’s in Artificial Intelligence and Robotics at the Sapienza University of Rome, showcasing the practical application of advanced concepts in a real-world scenario.

Dataset:

The dataset used for this implementation consists of paired horse and zebra images. Unfortunately, we cannot provide the dataset directly within this repository due to size and licensing constraints. However, you can acquire the dataset from public sources or repositories and organize it accordingly. Or download the dataset from Kaggle repository Horse2zebra Dataset

Losses:

In CycleGAN, three distinct loss functions are utilized: adversarial loss, cycle consistency loss, and optional identity loss.

  • The adversarial loss aims to train the generator to produce realistic images by distinguishing them from the real images using Mean Squared Error (MSE) loss.
  • For the cycle consistency loss, the Wasserstein loss is employed instead of the traditional L1 norm loss. It ensures that translating an image from one domain to another and then back again generates a reconstructed image that closely resembles the original.
  • Lastly, the identity loss, although optional, aims to preserve the identity of an input image from the target domain. Notably, the original paper did not utilize identity loss, leaving it as an optional component.

Results:

Here are some samples of the translated images generated by the trained CycleGAN model:

  • Zebra-to-Horse
  • Zebra-to-Horse

  • Horse-to-Zebra
  • Horse-to-Zebra

Training Limitations:

Due to limitations in the training environment (e.g., computational resources, time constraints, or limitations in the Google Colab platform), the model was trained for a reduced number of epochs, stopping at 128 epochs instead of the originally intended 200 epochs. That's the main reason, the model is not quite good.

Acknowledgments:

This implementation is based on the original CycleGAN paper:

Zhu, J., Park, T., Isola, P., & Efros, A. A. (2017). Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks. In Proceedings of the IEEE International Conference on Computer Vision (ICCV).

cyclegan's People

Contributors

sameer-ahmed7 avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.