-
-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #962 from alo7lika/dev
GAN-based Art Generator using Deep learning
- Loading branch information
Showing
8 changed files
with
688 additions
and
0 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
GAN-based Art Generator using Deep learning/Dataset/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
583 changes: 583 additions & 0 deletions
583
...Generator using Deep learning/Model/GAN-based Art Generator using Deep learning (2).ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
55 changes: 55 additions & 0 deletions
55
GAN-based Art Generator using Deep learning/Model/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
||
--- |
10 changes: 10 additions & 0 deletions
10
GAN-based Art Generator using Deep learning/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |