A visual, drag-and-drop interface for building and training neural networks. Built for beginners to learn machine learning concepts without writing code.
- Drag-and-Drop Interface: Scratch-style puzzle piece connectors for intuitive block stacking
- 4 Workflow Zones: Sequential zones guide users through the entire ML workflow
- 20+ Building Blocks: Organized by category (Data, Architecture, Activation, Configuration, Actions)
- Real-time Training: Live training metrics with WebSocket updates
- Interactive Chat Assistant: AI-powered explanations using Gemini API
- Project Management: Save and load projects with Supabase
- Model Export: Export trained models and Python code
- Beginner-Friendly: No coding required, visual interface
- Real-time Validation: Immediate feedback on architecture validity
- Visual Feedback: Progress tracking, error indicators, and success states
- Dark Mode: Dashboard always in dark mode, playground supports theme switching
- Auto-save: Automatic project saving every 30 seconds
- Manual Save: Save button for immediate progress saving
- Data Blocks: Load Dataset, Train/Test Split, Normalize
- Architecture Blocks: Input Layer, Dense, Conv2D, Flatten, MaxPooling2D, Dropout
- Activation Blocks: ReLU, Sigmoid, Tanh, Softmax
- Configuration Blocks: Optimizer (7 types), Loss Function (3 types), Training Settings
- Action Blocks: Train Model, Make Prediction
- Node.js 18+ and npm
- Python 3.8+
- Supabase Account (for authentication and database)
- Gemini API Key (optional, for chat assistant)
git clone https://github.com/yourusername/NeuroBlock.git
cd NeuroBlockcd backend
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On macOS/Linux:
source venv/bin/activate
# On Windows:
venv\Scripts\activate
# Install dependencies
pip install -r requirements.txtcd frontend
# Install dependencies
npm installBackend (backend/.env):
GEMINI_API_KEY=your-gemini-api-key-hereFrontend (frontend/.env):
VITE_SUPABASE_URL=your-supabase-project-url
VITE_SUPABASE_ANON_KEY=your-supabase-anon-key- Create a Supabase project at supabase.com
- Go to SQL Editor in your Supabase dashboard
- Copy and paste the entire contents of
supabase_schema.sql - Click "Run" to execute the SQL
- Verify tables were created:
profiles,projects,trained_models - Copy your project URL and anon key to
frontend/.env
- Get an API key from Google AI Studio
- Add it to
backend/.envasGEMINI_API_KEY - Install the package:
pip install google-genai python-dotenv
cd backend
source venv/bin/activate # On Windows: venv\Scripts\activate
python main.pyBackend runs on http://localhost:8000
cd frontend
npm run devFrontend runs on http://localhost:5173
- Navigate to the landing page
- Click "Get Started" or "Sign Up"
- Create an account with email and password
- In the dashboard, click "New Project"
- Enter a project name
- Click "Create"
- Expand "Data Blocks" in the left panel
- Drag "Load Dataset" to Zone 1
- MNIST dataset loads automatically
- Drag blocks to Zone 2 in order:
- Input Layer (must be first)
- Architecture blocks (Dense, Conv2D, etc.)
- Activation functions (ReLU, Softmax, etc.)
Example Simple Network:
Input Layer
β Flatten
β Dense (128 neurons)
β ReLU
β Dense (10 neurons)
β Softmax
Example CNN:
Input Layer
β Conv2D (32 filters, 3Γ3)
β ReLU
β MaxPooling2D (2Γ2)
β Flatten
β Dense (128 neurons)
β ReLU
β Dense (10 neurons)
β Softmax
- Drag blocks to Zone 3:
- Optimizer (click to configure: Adam, SGD, RMSprop, etc.)
- Loss Function (click to configure: Categorical Crossentropy, etc.)
- Training Settings (set epochs, batch size, learning rate)
- Drag "Train Model" to Zone 4
- Click "Start Training" in the right panel
- Watch real-time metrics update
- View training progress in graphs and console
- After training completes, go to "Predict" tab
- Draw a digit on the canvas
- Click "Predict" to see the model's prediction
- Go to "Explain" tab
- Ask questions about your architecture
- Get AI-powered explanations in simple terms
- React 18 with TypeScript
- Tailwind CSS for styling
- Zustand for state management
- React DnD for drag-and-drop
- Recharts for data visualization
- Socket.IO Client for real-time updates
- React Router for navigation
- Supabase Client for authentication and database
- FastAPI for REST API and WebSocket
- TensorFlow/Keras for model building and training
- Socket.IO for real-time training updates
- NumPy for data processing
- Google Gemini API for AI chat assistant
- Supabase (PostgreSQL) for:
- User authentication
- Project storage
- Trained model storage
- Workflow data persistence
NeuroBlock/
βββ backend/
β βββ main.py # FastAPI server
β βββ model_builder.py # Block-to-Keras translation
β βββ dataset_loader.py # MNIST dataset loading
β βββ requirements.txt # Python dependencies
βββ frontend/
β βββ src/
β β βββ components/ # React components
β β βββ pages/ # Page components
β β βββ store/ # Zustand state management
β β βββ utils/ # Utility functions
β β βββ api/ # API client
β βββ package.json
βββ landing_page/ # Landing page components
βββ supabase_schema.sql # Database schema
βββ README.md
- Adam (default)
- SGD
- RMSprop
- Adagrad
- Adamax
- Nadam
- Ftrl
- Categorical Crossentropy (multi-class classification)
- Binary Crossentropy (binary classification)
- Mean Squared Error (regression)
- Train/Test Split: Configurable ratio (default: 0.2)
- Normalization: Min-Max (0-1) or Standard (mean=0, std=1)
Load Dataset β Normalize
Input β Flatten β Dense(128) β ReLU β Dense(10) β Softmax
Adam optimizer, Categorical Crossentropy, 10 epochs
Load Dataset β Normalize
Input β Conv2D(32,3Γ3) β ReLU β MaxPool(2Γ2) β Flatten β Dense(128) β ReLU β Dense(10) β Softmax
Adam optimizer, Categorical Crossentropy, 10 epochs
Load Dataset β Normalize
Input β Flatten β
Dense(256) β ReLU β Dropout(0.3) β
Dense(128) β ReLU β Dropout(0.3) β
Dense(64) β ReLU β
Dense(10) β Softmax
cd backend
source venv/bin/activate
python main.pycd frontend
npm run dev# Frontend
cd frontend
npm run build
# Backend
# Deploy FastAPI app using uvicorn, gunicorn, or similarGET /- Health checkPOST /api/datasets/load- Load MNIST datasetPOST /api/model/build- Build and validate modelPOST /api/train- Start trainingPOST /api/chat- AI chat assistantPOST /api/predict- Make predictions
training_started- Training has begunepoch_end- Epoch complete with metricstraining_complete- Training finished with test accuracytraining_error- Error occurred
- Port 8000 in use: Change port in
main.pyor kill the process using port 8000 - TensorFlow errors: Make sure TensorFlow is installed:
pip install tensorflow - Gemini API errors: Check that
GEMINI_API_KEYis set correctly
- Cannot connect to backend: Ensure backend is running on port 8000
- Supabase errors: Check environment variables in
frontend/.env - Build errors: Delete
node_modulesand reinstall:rm -rf node_modules && npm install
- Authentication errors: Verify Supabase URL and anon key
- RLS policy errors: Make sure you ran
supabase_schema.sql - Project not saving: Check browser console for errors
Future areas for improvement:
- More Blocks: Add LSTM, GRU, BatchNormalization, etc.
- More Datasets: Support for CIFAR-10, Fashion-MNIST, etc.
- Model Export: Export trained models in different formats
- Templates: Pre-built example architectures
- Documentation: Improve docs and add tutorials
MIT License - feel free to use for educational purposes
- Inspired by Scratch's visual programming interface
- TensorFlow Playground for the educational approach
- Built for HackUMass 2025