metadata
license: mit
tags:
- gan
- dcgan
- image-generation
- chess
- generative-ai
datasets:
- niteshfre/chessman-image-dataset
metrics:
- fid
library_name: tensorflow
Chessman DCGAN - Chess Piece Generator
This is a Deep Convolutional Generative Adversarial Network (DCGAN) trained to generate images of chess pieces.
Model Description
- Architecture: DCGAN (Deep Convolutional GAN)
- Framework: TensorFlow/Keras
- Input: 100-dimensional random noise vector
- Output: 64x64 RGB images of chess pieces
- Training Data: 552 images from the Chessman Image Dataset (6 chess piece types)
Training Details
- Epochs: 50
- Batch Size: 128
- Optimizer: Adam (lr=1e-4, beta_1=0.5)
- Loss: Binary Cross-Entropy with label smoothing
- Data Augmentation: Random flips, rotations, and zoom
Model Architecture
Generator
- Input: 100-dim latent vector
- Dense layer → 8×8×256
- Conv2DTranspose layers: 256→128→64→3
- Output: 64×64×3 RGB image
Discriminator
- Input: 64×64×3 RGB image
- Conv2D layers: 64→128→256
- Output: Binary classification (real/fake)
Usage
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
# Load the model
generator = tf.keras.models.load_model('dcgan_generator.keras')
# Generate random noise
noise = tf.random.normal([1, 100])
# Generate image
generated_image = generator(noise, training=False)
# Display
img = ((generated_image[0, :, :, :] * 127.5) + 127.5).numpy().astype("uint8")
plt.imshow(img)
plt.axis('off')
plt.show()
Limitations
- Images are 64×64 resolution (relatively low)
- Model trained on only 552 images (small dataset)
- Generated pieces may not always be perfectly recognizable
- No control over which piece type is generated
Citation
Dataset: Chessman Image Dataset on Kaggle
License
MIT License