A real-time epileptic seizure detection system using EEG signals. The application processes EEG data via MQTT, uses a machine learning model for prediction, and displays results through an interactive web interface.

This system consists of three main components:
- Node-RED Flow: Processes incoming EEG data from MQTT
- Python Flask Backend: Hosts the web application and ML model
- Web Interface: Real-time visualization dashboard
- Python 3.8+
- Node.js and npm
- Node-RED
- MQTT broker (Mosquitto recommended)
First, install and start the Mosquitto MQTT broker:
# Ubuntu/Debian
sudo apt-get install mosquitto mosquitto-clients
sudo systemctl start mosquitto
sudo systemctl enable mosquitto # Start on boot
# For macOS with Homebrew
brew install mosquitto
brew services start mosquittoInstall Node-RED globally:
npm install -g node-redStart Node-RED:
node-redAccess the Node-RED editor at http://localhost:1880.
- In the Node-RED interface, click on the menu (≡), then "Import"
- Click "select a file to import"
- Choose the
flows.jsonfile from this repository - Click "Import"
- Deploy the flow by clicking the "Deploy" button
# Create virtual environment
python3 -m venv venv
# Activate virtual environment
# On Windows
venv\Scripts\activate
# On Unix or MacOS
source venv/bin/activatepip install flask flask-socketio paho-mqtt numpy pandas scikit-learn tensorflowpython3 webapp/app.pyAccess the web application at http://localhost:5000.
- Start the Simulator: Click "Start the EEG Simulation" on the web interface to begin generating test data
- Adjust Parameters:
- Use the interval dropdown to set the speed of data generation
- Adjust the threshold slider to change the seizure detection sensitivity
- View Results: Monitor real-time EEG signals, detection status, and history
- Stop Simulation: Click "Stop Simulation" when finished