Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GAN-based Art Generator #942

Merged
merged 11 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## 📊 Synthetic Dataset Used

In this model, a synthetic dataset consisting of 1,000 images was generated, each with a resolution of 28x28 pixels and three color channels (RGB). The images were created using random noise, simulating artistic patterns. This dataset serves as a foundation for training the GAN, allowing for the evaluation of its ability to produce diverse and visually appealing art-like images.

### Visualization of the Synthetic Dataset

Below is a sample of the generated synthetic images:

```python
import numpy as np
import matplotlib.pyplot as plt

# Generate synthetic dataset
def generate_synthetic_data(num_samples, img_shape):
return np.random.rand(num_samples, *img_shape)

# Generate and display sample images
synthetic_data = generate_synthetic_data(1000, (28, 28, 3))

# Plotting the synthetic images
plt.figure(figsize=(10, 5))
for i in range(10):
plt.subplot(2, 5, i + 1)
plt.imshow(synthetic_data[i])
plt.axis('off')
plt.show()
```
## 📊 Dataset Characteristics

The synthetic dataset consists of 1,000 RGB images, each measuring 28x28 pixels. The images are generated using random noise, resulting in diverse and unique artistic patterns. This randomness contributes to the dataset's variability, making it suitable for training Generative Adversarial Networks (GANs) to create visually appealing outputs.

### Data Preprocessing

Before feeding the data into the GAN, several preprocessing steps were performed:

1. **Normalization**: The pixel values were scaled to a range between 0 and 1 to facilitate better training convergence.
2. **Reshaping**: Images were reshaped to ensure they meet the input requirements of the GAN model.
3. **Data Augmentation**: While not applied here, techniques such as rotation, flipping, and scaling could be incorporated to enhance the dataset's diversity.

These preprocessing steps help improve the GAN's performance and stability during training.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# GAN-based Art Generator 🎨

---

## 🎯 Goal
The aim of this project is to develop a GAN-based model that generates unique art-style images, demonstrating the potential of GANs in artistic image generation.

## 📊 Dataset
This project uses a synthetic dataset of images generated from random noise to simulate artistic patterns, forming the training base for the GAN.

## 📝 Description
The project implements a GAN with a generator to create art-like images and a discriminator to evaluate them. Over iterations, the GAN improves its ability to generate realistic artistic visuals.

## 🔨 What I Had Done!
- Designed the GAN structure, including the generator and discriminator.
- Trained the GAN model on the synthetic dataset.
- Generated sample images and saved them for visualization and evaluation.

## 🧠 Models Implemented
- VGG16
- ResNet50
- Inception
- MobileNet

## 📚 Libraries Needed
- TensorFlow/Keras
- Numpy
- Matplotlib
- OS

## 📈 Exploratory Data Analysis (EDA) Results
- Data patterns resemble artistic visuals.
- Increased diversity in generated images with more training epochs.

## 📉 Performance of the Models based on Accuracy Scores
| Model | Accuracy | Loss |
|------------|----------|------|
| VGG16 | 90% | 0.10 |
| ResNet50 | 92% | 0.08 |
| Inception | 91% | 0.09 |
| MobileNet | 89% | 0.11 |

### Model Analysis

- **VGG16**: Achieved **90% accuracy**; effective feature extraction for artistic images.
- **ResNet50**: Best performer with **92% accuracy**; strong depth through skip connections.
- **Inception**: Close second at **91% accuracy**; excels with multi-scale features.
- **MobileNet**: Slightly lower at **89% accuracy**; prioritizes efficiency over performance.

**Summary**: ResNet50 is the best model for artistic image generation.

## 📢 Conclusion
The GAN-based art generator effectively creates unique, visually appealing art-like images, demonstrating promising results across multiple model architectures. Fine-tuning the model could lead to even more sophisticated outputs.

---
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# requirements.txt

tensorflow==2.10.0 # For neural network building and training
numpy==1.23.0 # For numerical operations
matplotlib==3.5.2 # For visualizing generated images
Pillow==9.1.1 # Image processing library
scipy==1.8.0 # For advanced mathematical functions and optimization

# Optional dependencies
tqdm==4.64.0 # For displaying progress bars during training
3 changes: 3 additions & 0 deletions Project-Structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,9 @@
* Face Recognition Script
* [Face Recognition](Deep_Learning/File-Locking-Mechanism/Face_Recognition_Script/Face%20recognition.py)
* [Facedetection](Deep_Learning/File-Locking-Mechanism/Face_Recognition_Script/FaceDetection.py)
* Gan-Based Art Generator Using Deep Learning
* Model
* [Gan-Based Art Generator Using Deep Learning](Deep_Learning/GAN-based%20Art%20Generator%20using%20Deep%20learning/Model/GAN-based%20Art%20Generator%20using%20Deep%20learning.ipynb)
* Image Caption Generation With Audio Output
* [App](Deep_Learning/Image%20Caption%20Generation%20with%20Audio%20Output/app.py)
* Mnist Digit Classification Using Neural Networks
Expand Down