![]() |
VOOZH | about |
CycleGAN is a GAN architecture used for image-to-image translation without requiring paired training data. It uses two generators and two discriminators to transform images between domains and reconstruct the original image using cycle consistency loss.
CycleGAN uses two generators and two discriminators to perform image translation between two domains without paired data.
Create new images in the target style.
CycleGAN has two generators G and F:
The generator mapping functions are as follows:
where is the input image distribution and is the desired output distribution such as Van Gogh styles.
Decide if images are real (from dataset) or fake (generated). There are two discriminators and .
Cycle Consistency Loss
To further regularize the mappings the CycleGAN uses two more loss function in addition to adversarial loss.
1. Forward Cycle Consistency Loss: Ensures that when we apply G and then F to an image we get back the original image
For example: .
2. Backward Cycle Consistency Loss: Ensures that when we apply F and then G to an image we get back the original image.
For example:
Each CycleGAN generator consists of an encoder, transformer and decoder for image translation.
Generator Structure:
c7s1-64 β d128 β d256 β R256 (Γ6 or 9) β u128 β u64 β c7s1-3
In CycleGAN the discriminator uses a PatchGAN instead of a regular GAN discriminator.
Discriminator Structure
C64 β C128 β C256 β C512 β Final Convolution
CycleGAN uses a combined loss function to train generators and discriminators effectively. The total cost function consists of adversarial loss and cycle consistency loss.
Adversarial loss helps generators produce realistic images that can fool the discriminators.
Cycle consistency loss ensures that translating an image to another domain and back reconstructs the original image.
The Cost function we used is the sum of adversarial loss and cyclic consistent loss:
and our aim is :
1. Collection Style Transfer: CycleGAN can learn styles from entire artwork collections such as Van Gogh, Monet and Cezanne, allowing it to generate diverse artistic image styles.
2. Object Transformation: CycleGAN can transform objects between different classes, such as apples to oranges or zebras to horses, making it useful for image editing and content generation.
3. Seasonal Transfer: CycleGAN can transform images between different seasons, such as converting winter scenes into summer landscapes and vice versa.π Image
4. Photo Generation from Paintings: CycleGAN can transform paintings into realistic photos and convert photos into artistic paintings, making it useful for artistic and image editing applications. This loss can be defined as
5. Photo Enhancement: CycleGAN can enhance smartphone photos to resemble DSLR-quality images by improving visual quality and depth effects.π Image
CycleGAN performance is evaluated using both human perception and quantitative metrics.
CycleGAN is effective for texture and style transformation but has limitations in handling major structural changes.