ML-powered semiconductor defect prediction dashboard. Uses the UCI SECOM dataset (590 sensor features from real wafer fabrication) to predict pass/fail on wafers, with drift detection to catch when the model starts degrading.
Live demo: chipguardai.com
Stack: PyTorch, Flask, Angular, SQLite, AWS (Amplify + EC2 + ALB)
+----------------+ +----------------+ +----------------+
| Angular |---->| Flask API |---->| SQLite |
| Dashboard |<----| + PyTorch |<----| Database |
+----------------+ +----------------+ +----------------+
|
+-----+-----+
| Trained |
| Model |
| (.pt file)|
+-----------+
- Frontend (Angular) - dashboard with stats cards, charts, drift monitoring, prediction form, and feedback UI
- Backend (Flask) - REST API serving predictions, logging to SQLite, drift detection via KS-test
- Model (PyTorch) - feedforward neural net trained on 562 features (after dropping high-missing columns)
Download the UCI SECOM dataset from Kaggle and put the CSV in data/:
data/uci-secom.csv
cd backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtcd backend
python train.pyThis saves the model, scaler, and metadata to models/.
cd backend
source venv/bin/activate
python app.pyAPI runs on http://localhost:5050.
cd frontend
npm install
npx ng serveDashboard at http://localhost:4200.
| Method | Endpoint | Description |
|---|---|---|
| GET | /health | API status and model info |
| POST | /predict | Run prediction on sensor features |
| GET | /predictions | Recent prediction history |
| GET | /metrics | Prediction stats (pass/fail rates, counts) |
| POST | /feedback | Submit ground truth for a prediction |
| GET | /drift | Run drift detection on recent predictions |
| GET | /sample | Get a random data row for testing |
cd backend
source venv/bin/activate
python -m pytest tests/ -vdocker-compose up --buildBackend on :5050, frontend on :4200.
- Feedforward net: 562 -> 128 -> 64 -> 1
- BCEWithLogitsLoss with pos_weight to handle the ~14:1 class imbalance
- Dropout (0.3) on hidden layers
- Trained for 50 epochs with Adam
- Drift detection uses Kolmogorov-Smirnov test per feature against the training baseline
The app is deployed on AWS. Frontend and backend are separate.
+----------------+ push to main +-------------------+
| GitHub |--------------------->| GitHub Actions |
| Repository | | (CI/CD) |
+----------------+ +-------------------+
| |
tests pass | | auto-trigger
+ deploy | |
v v
+----------+ +-----------+
| EC2 | | Amplify |
| Docker | | Angular |
| Flask | | Frontend |
+----+-----+ +-----------+
| |
+----+-----+ |
| ALB |<-------+
| HTTPS | API calls
+----------+
- Frontend is on AWS Amplify. Pushes to main auto-deploy.
- Backend runs in Docker on an EC2 t3.small instance. An Application Load Balancer handles HTTPS termination in front of it.
- Domain is chipguardai.com via Route 53. ACM provides the SSL certs.
- CI/CD is a GitHub Actions workflow that runs pytest, then SSHes into EC2 to pull and rebuild the container.