{"id":29022930,"url":"https://github.com/saadamir1/vae-gan-comparison","last_synced_at":"2026-04-29T06:38:45.577Z","repository":{"id":299869774,"uuid":"1004490521","full_name":"saadamir1/vae-gan-comparison","owner":"saadamir1","description":"Comprehensive comparison of VAE vs GAN architectures for image generation on CIFAR-10 dataset with quantitative evaluation metrics","archived":false,"fork":false,"pushed_at":"2025-06-18T17:53:34.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-18T18:43:13.142Z","etag":null,"topics":["cifar10","deep-learning","gan","generative-models","image-generation","machine-learning","neural-networks","tensorflow","vae"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saadamir1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-18T17:49:49.000Z","updated_at":"2025-06-18T17:53:37.000Z","dependencies_parsed_at":"2025-06-18T18:53:19.810Z","dependency_job_id":null,"html_url":"https://github.com/saadamir1/vae-gan-comparison","commit_stats":null,"previous_names":["saadamir1/vae-gan-comparison"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/saadamir1/vae-gan-comparison","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saadamir1%2Fvae-gan-comparison","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saadamir1%2Fvae-gan-comparison/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saadamir1%2Fvae-gan-comparison/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saadamir1%2Fvae-gan-comparison/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saadamir1","download_url":"https://codeload.github.com/saadamir1/vae-gan-comparison/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saadamir1%2Fvae-gan-comparison/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261990352,"owners_count":23241188,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cifar10","deep-learning","gan","generative-models","image-generation","machine-learning","neural-networks","tensorflow","vae"],"created_at":"2025-06-26T03:04:19.063Z","updated_at":"2026-04-29T06:38:40.555Z","avatar_url":"https://github.com/saadamir1.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VAE vs GAN: Image Generation Comparison\n\nA comprehensive comparison of Variational Autoencoders (VAE) and Generative Adversarial Networks (GAN) for image generation tasks using CIFAR-10 dataset.\n\n## 🎯 Overview\n\nThis project implements and compares two popular generative models:\n- **Variational Autoencoder (VAE)** with encoder-decoder architecture\n- **Generative Adversarial Network (GAN)** with similarity-based discriminator\n\nThe models are trained on CIFAR-10 cats and dogs subset to generate realistic animal images.\n\n## 🏗️ Architecture\n\n### VAE Components\n- **Encoder**: Convolutional layers with batch normalization\n- **Decoder**: Transposed convolutions for image reconstruction\n- **Latent Space**: 100-dimensional continuous representation\n\n### GAN Components\n- **Generator**: Deep convolutional network with batch normalization\n- **Discriminator**: Siamese-style similarity discriminator with minibatch discrimination\n- **Feature Extractor**: Shared convolutional feature extraction\n\n## 🚀 Features\n\n- Custom VAE implementation with KL divergence regularization\n- Advanced GAN with similarity-based discrimination\n- Minibatch discrimination for diversity promotion\n- Comprehensive quantitative evaluation metrics\n- Visual comparison of generated samples\n- Real-time training loss visualization\n\n## 📊 Results\n\n- **VAE**: Stable training, blurry but structured outputs\n- **GAN**: More detailed generations but training instability\n- **Performance**: VAE achieves lower MSE (0.0901 vs 0.1919)\n\n## 🛠️ Requirements\n\n```bash\ntensorflow\u003e=2.8.0\nnumpy\u003e=1.21.0\nmatplotlib\u003e=3.5.0\n```\n\n## 💻 Usage\n\n```python\npython generative_models_comparison.py\n```\n\nThe script will:\n1. Load and preprocess CIFAR-10 data\n2. Train both VAE and GAN models\n3. Generate comparison visualizations\n4. Output quantitative metrics\n\n## 📈 Evaluation Metrics\n\n- Mean Squared Error (MSE)\n- Reconstruction Loss\n- KL Divergence\n- Similarity Scores\n- Visual Quality Assessment\n\n## 🔧 Configuration\n\nKey hyperparameters:\n- Batch Size: 64\n- Latent Dimension: 100\n- Learning Rate: 1e-4\n- Training Epochs: 30\n\n## 📝 License\n\nMIT License - feel free to use and modify for your projects.\n\n## 🤝 Contributing\n\nContributions welcome! Feel free to submit issues and pull requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaadamir1%2Fvae-gan-comparison","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaadamir1%2Fvae-gan-comparison","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaadamir1%2Fvae-gan-comparison/lists"}