Skip to content

End-to-end AI solutions for manufacturing: defect detection, predictive maintenance, and supply chain forecasting, tailored for Pakistan's industrial context.

License

Notifications You must be signed in to change notification settings

sfarrukhm/pakindustry-4.0

Repository files navigation

🌍 PakIndustry 4.0 AI Suite

🚀 End-to-end AI solutions for Pakistan’s manufacturing industry — developed for the Uraan AI Techathon 1.0.

We built a modular Industry 4.0 platform tackling three of the biggest challenges in local manufacturing:

  1. 🏭 Defect Detection → Reduce wastage with automated visual inspection
  2. 🔧 Predictive Maintenance → Prevent equipment breakdowns before they happen
  3. 📊 Supply Chain Forecasting → Optimize inventory and demand planning

Together, these modules form a practical, deployable AI suite that directly addresses production inefficiency, unplanned downtime, and supply chain uncertainty.


✨ Executive Summary

Pakistan’s manufacturing sector struggles with:

  • High production defects → wasted raw material, loss of export contracts
  • Unexpected machine failures → costly downtime and emergency repairs
  • Poor demand forecasting → overstocking, stockouts, and inefficiency

👉 Our AI Suite provides:

  • Computer Vision QC (casting defects)
  • Deep Learning RUL estimation (engine maintenance)
  • Time-series forecasting (warehouse demand)

⚠️ Note on Limitations:

  • Defect Detection is highly accurate (99.6%) but trained on one dataset → retraining needed for new materials/lighting conditions.
  • Supply Chain Forecasting performs exceptionally (1.97% sMAPE), but relies on historical demand patterns → disruptive events could reduce accuracy.
  • Predictive Maintenance currently underfits (flat predictions ~21 cycles) → framework works, but model accuracy is limited.

🧩 Modules Overview

1. 🏭 Defect Detection

  • Goal: Detect casting defects in industrial parts
  • Model: EfficientNet-B0 (transfer learning)
  • Performance: 99.6% accuracy, 100% precision, 99.7% F1
  • Deployment: Streamlit dashboard for easy factory-floor use
  • Limitations: Lighting-sensitive, optimized for cast parts only

➡️ Read full Defect Detection README

2. 🔧 Predictive Maintenance

  • Goal: Predict Remaining Useful Life (RUL) of turbofan engines
  • Dataset: NASA C-MAPSS (FD001 subset)
  • Model: LSTM/GRU sequence models
  • Performance: MAE ~13, MAPE ~22%, conservative flat predictions (~21 cycles)
  • Deployment: Inference pipeline + Streamlit app for uploading test data
  • Limitations: Underfits complex degradation patterns, needs further training on larger dataset

➡️ Read full Predictive Maintenance README ➡️ Watch the demo


3. 📊 Supply Chain Forecasting

  • Goal: Daily order forecasting across 7 European warehouses (Rohlik dataset)
  • Model: LightGBM with engineered lag/rolling features + calendar integration
  • Performance: RMSE 208, MAE 127, sMAPE 1.97%, NRMSE 3.2%
  • Deployment: Train/inference/evaluation scripts with reproducibility
  • Limitations: Reliant on historical continuity, not yet tested for extreme disruptions

➡️ Read full Forecasting README ➡️ Watch the demo


🏗️ Repository Structure

pakindustry-4.0/
├── docs/                       # Contains project documentation
├── defect-detection/           # Module 1: Vision-based defect detection
├── predictive-maintenance/     # Module 2: RUL estimation
├── forecast/                   # Module 3: Supply chain demand forecasting
├── test_samples/               # Contains sample datasets for testing
├── LICENSE                     # MIT license file
├── README.md                   # Root overview
└── requirements.txt            # Project dependencies

🔄 Reproducibility & Setup

We’ve prioritized clear, reproducible pipelines for all modules.

1. Clone Repository

git clone https://github.com/sfarrukhm/pakindustry-4.0.git
cd pakindustry-4.0

2. Create Environment

python -m venv .venv
source .venv/bin/activate       # Linux/Mac
.venv\Scripts\activate          # Windows

3. Install Dependencies

pip install -r requirements.txt

4. Run Individual Modules

  • Defect Detection:

    cd defect-detection
    python train.py
    streamlit run app.py
  • Predictive Maintenance:

    cd predictive-maintenance
    python train.py
    streamlit run app.py
  • Forecasting:

    cd forecast
    python train.py
    python inference.py

📊 Results Snapshot

Module Metric Highlights Status
🏭 Defect Detection Accuracy 99.6%, Precision 100% ✅ Ready for demo
🔧 Predictive Maint. MAE 13, MAPE 22%, flat ~21-cycle outputs ⚠️ Underfitting
📊 Forecasting sMAPE 1.97%, NRMSE 3.2% ✅ Exceeds target

🌟 Why This Matters

  • For Judges: Demonstrates 3 distinct, deployable AI solutions under one cohesive suite.
  • For Industry: Provides a foundation for Pakistan’s manufacturers to experiment with AI tools that reduce costs and boost competitiveness.
  • For Developers: Modular, reproducible pipelines that can be extended with better models, data, or deployment strategies.

🚧 Future Roadmap

  1. Defect Detection → Multi-class defect classification, ONNX edge deployment
  2. Predictive Maintenance → Attention/Transformer models, uncertainty quantification
  3. Forecasting → Warehouse-specific models, time-series CV, real-time dashboards

🎤 Closing Note

PakIndustry 4.0 AI Suite is not just a hackathon project — it’s a vision for accessible AI in Pakistani manufacturing.

About

End-to-end AI solutions for manufacturing: defect detection, predictive maintenance, and supply chain forecasting, tailored for Pakistan's industrial context.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published