Project Info
Here's a concise hackathon project description for SafeWing AI:
Inspiration
Air India Flight 171's tragic crash in June 2025 killed 280 people due to preventable system failures. We built SafeWing AI to predict potential aircraft subsystem failures to allow pilots to inspect before they become catastrophic.
What it does
Real-time aviation safety dashboard with 3D aircraft visualization that monitors 6 critical subsystems (engine, hydraulic, electrical, control surface, cabin, altimeter) using LSTM neural networks and random forest to predict Remaining Useful Life (RUL) and prevent crashes.
How we built it
Frontend: Next.js with Three.js for 3D aircraft visualization ML Backend: LSTM and random forest models deployed using FastAPI, Docker, and GCP Data: NASA CMAPSS turbofan engine dataset + synthetic subsystem data Integration: Real-time sensor monitoring with color-coded alerts on actual aircraft parts
Challenges we ran into
CORS issues with external ML API requiring proxy implementation Complex 3D model integration and part highlighting Real-time data synchronization between multiple subsystems Matching API data formats with frontend expectations
Accomplishments we're proud of
Successfully integrated live LSTM predictions with 3D visualization Created realistic takeoff simulation with authentic sensor degradation Built comprehensive multi-system monitoring (engines + 5 subsystems) Achieved sub-100ms API response times
What we learned
Real-time ML integration challenges in web applications Three.js 3D visualization and material manipulation Aviation system complexities and failure patterns Importance of predictive maintenance in safety-critical systems
What's next
Integration with real aircraft sensor data streams Advanced anomaly detection algorithms Regulatory compliance for aviation safety standards Partnership with airlines for pilot training simulations
๐ฉ๏ธ SafeWing AI - Aviation Safety Dashboard
Predictive Aircraft Maintenance Using LSTM and Random Forest Neural Networks
Inspired by Air India Flight 171 Crash (June 2025) - A tragic aviation disaster that claimed 280 lives, highlighting the critical need for predictive aircraft maintenance systems.
๐ฏ Mission Statement
SafeWing AI is an advanced aviation safety dashboard that uses Long Short-Term Memory (LSTM) and Random Forest neural networks to predict aircraft component failures before they become catastrophic. Our system monitors 6 critical aircraft subsystems in real-time and provides actionable insights to prevent aviation disasters.
๐๏ธ Architecture Overview
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Next.js UI โโโโโถโ API Proxy โโโโโถโ NGROK โ
โ Dashboard โ โ (CORS Handler) โ โ LSTM Models โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ 3D Aircraft โ โ Real-time โ โ Subsystem โ
โ Visualization โ โ Sensor Data โ โ Predictions โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
๐ง Technical Stack
Frontend
- Framework: Next.js 13+ with App Router
- Language: TypeScript 5+
- Styling: Tailwind CSS + shadcn/ui
- 3D Graphics: Three.js with React Three Fiber
- State Management: React Hooks + Context
Backend
- API Proxy: Next.js API Routes
- ML Models: LSTM and Random Forest Neural Networks
- Deployment: NGROK
- Database: Real-time sensor simulation
AI/ML Components
- Engine System: 24-feature Random Forest and LSTM model
- Subsystem Models: 5 individual LSTM models and Random Forest model.
- Training Data: Synthetic flight data based on C-MAPSS dataset
- Prediction Frequency: Every 3 seconds during simulation
๐๏ธ System Components Monitored
| System | Sensors | Critical Thresholds | LSTM Input |
|---|---|---|---|
| Engine | 24 sensors | RUL < 30 cycles | 24 features |
| Hydraulic | 3 sensors (Pressure, Flow, Temperature) | RUL < 25 cycles | 50 timesteps |
| Electrical | 2 sensors (Voltage, Current) | RUL < 25 cycles | 50 timesteps |
| Control Surface | 1 sensor (Deflection) | RUL < 25 cycles | 50 timesteps |
| Cabin | 1 sensor (Pressure) | RUL < 25 cycles | 50 timesteps |
| Altimeter | 1 sensor (Drift) | RUL < 25 cycles | 50 timesteps |
๐ฎ Key Features
1. Real-Time 3D Aircraft Visualization
- Interactive 3D aircraft model with part-specific highlighting
- Color-coded risk indicators (Green โ Yellow โ Red)
- Dynamic part selection based on subsystem health
2. LSTM-Powered Predictions
- Engine RUL: Remaining Useful Life in flight cycles
- Subsystem Health: Critical failure predictions
- Risk Assessment: Real-time safety scoring
3. 50-Second Takeoff Simulation
- Realistic takeoff sequence (0-175 knots over 45 seconds)
- Dynamic sensor value updates every second
- LSTM predictions every 3 seconds
- Automatic simulation completion
4. Advanced Dashboard Analytics
- Multi-system health monitoring
- Predictive failure alerts
- Historical trend analysis
- Critical condition notifications
๐ Quick Start
Prerequisites
node >= 18.0.0
npm >= 8.0.0
Installation
# Clone the repository
git clone https://github.com/hetpatel-11/SafeWingAI_UCBerkeleyAIHackathon.git
cd SafeWingAI_UCBerkeleyAIHackathon
# Install dependencies
npm install
# Run development server
npm run dev
Available Scripts
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
๐ฌ LSTM Model Architecture
Engine Model
Input: [24 features] โ LSTM(64) โ Dense(32) โ Output: [RUL_cycles]
Features: Temperature, Pressure, Flow, Vibration, etc.
Training: C-MAPSS inspired synthetic data
Subsystem Models (5x)
Input: [50 timesteps ร sensors] โ LSTM(32) โ Dense(16) โ Output: [RUL_prediction]
Hydraulic: [50 ร 3] (Pressure, Flow, Temperature)
Electrical: [50 ร 2] (Voltage, Current)
Control: [50 ร 1] (Deflection)
Cabin: [50 ร 1] (Pressure)
Altimeter: [50 ร 1] (Drift)
๐ Risk Assessment Logic
RUL Processing
// Negative predictions = Critical failure imminent
if (rul < 0) {
processedRUL = Math.max(1, Math.abs(rul) + degradationFactor)
riskLevel = "danger"
}
// Risk thresholds
if (rul < 25) riskLevel = "danger" // Critical
if (rul < 60) riskLevel = "warning" // Caution
else riskLevel = "safe" // Normal
Alert System
- ๐ด Critical: RUL < 25 cycles, immediate attention required
- ๐ก Warning: RUL 25-60 cycles, monitor closely
- ๐ข Safe: RUL > 60 cycles, normal operation
๐ API Endpoints
Local Development
POST /api/predict
Body: {
"subsystem": "engine|hydraulic|electrical|control_surface|cabin|altimeter",
"sequence": [array of sensor values]
}
Production LSTM API
POST https://my-lstm-api-537563823214.us-central1.run.app/predict/{subsystem}
Body: {
"sequence": [sensor_data_array]
}
๐ฑ User Interface
Main Dashboard
- Engine System: Primary RUL analysis with detailed metrics
- Subsystem Grid: 5 subsystem cards with real-time status
- 3D Aircraft: Interactive model with part highlighting
- Control Panel: Simulation controls and settings
Real-Time Simulation
- Pre-flight: System initialization and checks
- Takeoff Roll: 0-45 seconds, 0-175 knots acceleration
- Critical Phase: V1 speed maintenance, maximum sensor stress
- Completion: 50-second simulation cycle with full analysis
๐ Data Flow
graph TD
A[Sensor Data Simulation] --> B[Parameter Updates]
B --> C[LSTM API Calls]
C --> D[RUL Processing]
D --> E[Risk Assessment]
E --> F[UI Updates]
F --> G[3D Visualization]
G --> H[Alert Generation]
๐ ๏ธ Development Workflow
File Structure
UC Hackathon/
โโโ app/ # Next.js app directory
โ โโโ api/predict/ # LSTM API proxy
โ โโโ globals.css # Global styles
โ โโโ layout.tsx # Root layout
โ โโโ page.tsx # Home page
โโโ components/ # React components
โ โโโ ui/ # shadcn/ui components
โ โโโ aircraft-3d-viewer.tsx
โ โโโ aircraft-visualization.tsx
โ โโโ aviation-sidebar.tsx
โ โโโ prediction-panel.tsx
โโโ Dataset/ # Training data
โโโ public/ # Static assets
โโโ styles/ # CSS files
Key Components
- PredictionPanel: Main dashboard logic and LSTM integration
- Aircraft3DViewer: Three.js 3D aircraft visualization
- AviationSidebar: System status and alerts
- AircraftVisualization: Component highlighting and risk display
๐ Future Enhancements
Phase 2 Features
- Multi-Aircraft Fleet Management
- Historical Data Analytics
- Custom Alert Thresholds
- Maintenance Scheduling Integration
Phase 3 Features
- Real Aircraft Sensor Integration
- Advanced ML Models (Transformers)
- Mobile Application
- Regulatory Compliance Module
๐ค Contributing
Development Setup
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- NASA C-MAPSS Dataset: Foundation for synthetic training data
- Next.js Team: Excellent framework for modern web applications
SafeWing AI Team
- Repository: SafeWingAI_UCBerkeleyAIHackathon
- Issues: GitHub Issues
"Every flight matters. Every prediction saves lives." โ๏ธ๐
Built with โค๏ธ for aviation safety at UC Berkeley Hackathon 2025
Analysis
View
Metric
- 1
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- CSSIn code
- Next.jsIn code
- ReactIn code
- Tailwind CSSIn code
- TypeScriptIn code
- DockerClaimed
- FastAPIClaimed
- JavaScriptClaimed
- Node.jsClaimed
- PythonClaimed
5 of 10 appear in the indexed code. 5 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
268 KB
Source files
67
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
hetpatel-11/SafeWingAI_UCBerkeleyAIHackathon
96 files ยท 19.8 MB ยท @ 82f3ae6
Structure
Interface
60 files ยท 63%Screens, components and styles rendered to the user.
API & routing
1 file ยท 1%Request entry points: routes, handlers and controllers.
Application logic
12 files ยท 13%Domain rules, services and shared utilities.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here โ open the file browser to check anything the diagram implies.
Languages
- TypeScript95%
- Markdown3%
- CSS2%
- YAML0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
package.json
npm ยท 59- @hookform/resolvers
- @radix-ui/react-accordion
- @radix-ui/react-alert-dialog
- @radix-ui/react-aspect-ratio
- @radix-ui/react-avatar
- @radix-ui/react-checkbox
- @radix-ui/react-collapsible
- @radix-ui/react-context-menu
- @radix-ui/react-dialog
- @radix-ui/react-dropdown-menu
- @radix-ui/react-hover-card
- @radix-ui/react-label
- @radix-ui/react-menubar
- @radix-ui/react-navigation-menu
- @radix-ui/react-popover
- @radix-ui/react-progress
- @radix-ui/react-radio-group
- @radix-ui/react-scroll-area
- +41 more
Declared in the repositoryโs manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This projectโs features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.