NebulAI is a full-stack web application built with Django (backend) and React (frontend) that allows users to generate synthetic galaxy images using a combined K-Means and Conditional GAN (cGAN) approach. This project provides an intuitive interface for exploring AI-generated astronomical content.
- Secure authentication (JWT) with Login / Signup pages
- Galaxy image generation powered by K-Means + cGAN
- Smooth user interface built with React
- Django REST API for backend logic
- On-demand download of generated images
- Image voting (like,dislike)
Users can generate synthetic galaxies without necessarly signing in but only vote when use signs in.
Image Generation & Evaluation
-
User Interaction
-
After clicking the Generate button, a synthetic galaxy image is produced using the CGAN+KMeans model and rendered on the screen. Users can then:
- Like or Dislike the generated image
- Download the image manually
- Re-generate a new variation if unsatisfied with the current one
-
-
Model Evaluation – FID & KID Metrics
To assess the quality of generated images, two evaluation metrics are computed:
- FID: Fréchet Inception Distance
- KID: Kernel Inception Distance
Metric Interpretation:
- A KID score close to 0 indicates that the generated images are perceptually similar to real images — this is the desired outcome.
- The FID score is relatively high, which is expected given the small and limited training dataset.
- As such, KID is a more trustworthy indicator of model performance in this specific case.
Further Reading:
Kernel Inception Distance (KID) – Original Paper by Bińkowski et al. (2018)
The dashboard provides a quick overview of user interactions and image generation statistics and it is displayed only for authenticated users with admin privileges.:
- Total Generated Images: Displays the count of all images generated.
- Liked & Disliked Images: Shows how many images have been liked or disliked, helping track user preferences.
- Generation History: A log of previously generated images with timestamps.
The model pipeline includes:
- Clustering latent space features using K-Means.
- Conditioning a cGAN on cluster labels.
- Generating high-resolution galaxy images based on user-selected conditions.
| Frontend | Backend | ML / Deep Learning |
|---|---|---|
| ReactJS | Django + DRF | TensorFlow |
| Bootstrap / CSS | SimpleJWT (JWT Auth) | cGAN, K-Means |
cgan.1.webm
cd backend
pip install -r requirements.txt
python manage.py migrate
python manage.py runservercd frontend
npm install
npm run devJWT (via SimpleJWT) is used to:
- Create access and refresh tokens
- Protect private routes (dashboard, generation)
- Assign admin roles for privileged access
- OURAHMA Maroua
- Linkedin : link
- Github : link
- Email : Send me an email
This project is open-source under the MIT License.




