An AI-powered web application that analyzes audio recordings from drone motors to detect motor type and potential faults.
DroneAI Sense is a fault detection system developed to streamline drone maintenance processes. The system converts audio recordings from drone motors into spectrogram images and analyzes them using a Vision Transformer (ViT) model. This enables:
- Motor type automatic identification (Helicopter, Duocopter, Tricopter, Quadcopter)
- Fault type detection (Normal, Balance, Magnet, Propeller, Bearing)
- Confidence score calculation as percentage
- Historical analyses storage and viewing capabilities
The application offers a user-friendly interface for audio file upload, analysis result viewing, and access to historical analyses.
- π― High Accuracy: 90%+ accuracy rate with Vision Transformer model
- π Fast Analysis: Results in seconds
- πΎ Historical Records: All analyses stored in database
- π¨ Modern Interface: User-friendly design with React and TailwindCSS
- π³ Easy Setup: Get running with a single Docker command
- π Detailed Reporting: Date and confidence score information for each analysis
The project consists of three main components in a microservice architecture:
βββββββββββββββββββββββ
β React Frontend β Port 3000
β (Vite + Tailwind) β
ββββββββββββ¬βββββββββββ
β
βΌ
βββββββββββββββββββββββ
β Express API β Port 3001
β (Node.js) β
ββββββββββββ¬βββββββββββ
β
ββββββββββββββββ
βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ
β Python ML β β RethinkDB β
β (FastAPI+PyTorch) β β (NoSQL) β
β Port 5000 β β Port 28015 β
βββββββββββββββββββ βββββββββββββββββββ
- React 18 - UI framework
- Vite - Build tool and dev server
- TailwindCSS - Utility-first CSS framework
- Axios - HTTP client
- Lucide React - Modern icon set
- Node.js & Express.js - RESTful API
- Multer - File upload middleware
- RethinkDB - NoSQL database
- UUID - Unique ID generation
- Python 3.8+ - Programming language
- FastAPI - Async web framework
- PyTorch - Deep learning framework
- timm - Vision Transformer models
- librosa - Audio processing
- Docker & Docker Compose - Container management
- Nginx - Reverse proxy
- Docker (20.10+)
- Docker Compose (1.29+)
- Clone the repository:
git clone https://github.com/yourusername/droneai-sense.git
cd droneai-sense- Start Docker containers:
For Windows:
start.batFor Linux/Mac:
docker-compose up -d- Access the application:
- Frontend: http://localhost:3000
- API: http://localhost:3001
- ML Service: http://localhost:5000
Containers will load ML models on first startup, this process may take a few minutes.
Click to view details
cd drone_fault_detection_api
npm install
npm startcd drone_fault_detection_model
pip install -r requirements.txt
python ml_service.pycd drone_fault_detection_web
npm install
npm run devWith Docker:
docker run -d -p 28015:28015 -p 8080:8080 --name rethinkdb rethinkdb-
Open Main Page: Navigate to
http://localhost:3000in your web browser -
Upload Audio File:
- Click the "Upload Audio" button
- Select drone motor audio recording (supported formats: .wav, .mp3, .ogg, .flac)
- You can also use drag-and-drop feature
-
Review Analysis Results:
- Motor type information
- Fault status
- Confidence score (%)
- Analysis date
-
View Historical Analyses: You can see all your previous analyses at the bottom of the page
droneai-sense/
βββ drone_fault_detection_api/ # Backend API
β βββ src/
β β βββ config/ # Database configuration
β β βββ models/ # Data models
β β βββ routes/ # API endpoints
β β βββ services/ # Business logic services
β β βββ server.js # Main server file
β βββ uploads/ # Uploaded files
β βββ Dockerfile
β βββ package.json
β
βββ drone_fault_detection_model/ # ML Service
β βββ dataset/ # Training dataset
β βββ models/ # Trained model files
β β βββ drone_type/ # Drone type model
β β βββ fault_type/ # Fault type model
β βββ audio_to_spectrogram.py # Audio β Spectrogram conversion
β βββ drone_type.py # Drone type model
β βββ fault_type.py # Fault type model
β βββ main.py # Model training script
β βββ ml_service.py # FastAPI service
β βββ requirements.txt
β
βββ drone_fault_detection_web/ # Frontend
β βββ src/
β β βββ components/ # React components
β β β βββ AnalysisCard.jsx # Analysis card
β β β βββ AnalysisResult.jsx # Result display
β β β βββ FileUpload.jsx # File upload
β β β βββ Header.jsx # Header
β β β βββ RecentAnalyses.jsx # Historical analyses
β β βββ services/
β β β βββ api.js # API client
β β βββ App.jsx # Main application
β β βββ main.jsx # Entry point
β βββ Dockerfile
β βββ nginx.conf # Nginx configuration
β βββ package.json
β
βββ docker-compose.yml # Production configuration
βββ docker-compose.dev.yml # Development configuration
βββ README.md
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/analysis/upload |
Upload new audio file and analyze |
| GET | /api/analysis |
List all analyses |
| GET | /api/analysis/:id |
Get specific analysis |
| DELETE | /api/analysis/:id |
Delete analysis |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/health |
API health status |
| GET | /api/health/ml |
ML service health status |
curl -X POST http://localhost:3001/api/analysis/upload \
-F "audio=@drone_sound.wav"{
"success": true,
"data": {
"id": "abc123-def456-ghi789",
"droneType": "Helicopter",
"faultType": "Balance Fault Type",
"droneTypeConfidence": 98.6,
"faultTypeConfidence": 100.0,
"timestamp": "2026-01-08T10:58:00.000Z",
"filename": "drone_sound.wav"
}
}The project uses two separate ViT models:
-
Drone Type Classifier
- Architecture:
vit_base_patch16_224 - Number of classes: 4 (Helicopter, Duocopter, Tricopter, Quadcopter)
- Accuracy: ~92%
- Architecture:
-
Fault Type Classifier
- Architecture:
vit_base_patch16_224 - Number of classes: 5 (Normal, Balance, Magnet, Propeller, Bearing)
- Accuracy: ~95%
- Architecture:
Audio File (.wav)
β
Spectrogram Conversion (librosa)
β
Image Preprocessing (224x224, normalization)
β
ViT Model Inference
β
Classification Result + Confidence Score
docker-compose -f docker-compose.dev.yml upIn development mode:
- Hot reload active
- Volume mounts enabled
- Debug logs active
# API tests
cd drone_fault_detection_api
npm test
# ML service tests
cd drone_fault_detection_model
pytestTo train a new model:
cd drone_fault_detection_model
python main.py --mode train --epochs 50