AI & MLPrototype / Researchv1.0.0

Federated Digital Twin — Smart Factory Predictive Maintenance Platform

An end-to-end Smart Factory predictive-maintenance platform combining Remaining Useful Life prediction, visual defect detection, Federated Learning, real-time monitoring, and tamper-evident model verification. Built with React, Flask and PyTorch.

SYSTEM TOPOLOGY

System Architecture.

Examine service boundaries, API contracts, data flows, and infrastructure components. Click to zoom and pan.

ArchitectureFederated Digital Twin — Smart Factory Predictive Maintenance Platform · Component Architecture
Download
Federated Digital Twin — Smart Factory Predictive Maintenance Platform architecture diagram
Click to expand & zoom
SYSTEM WALKTHROUGH

Demo Walkthrough.

Watch an end-to-end execution of the system in action.

demo-recording.mp4 HD Preview
AUDIT & SPECS

Technical Specifications.

Verified parameters and operational benchmarks for this release.

Difficulty
ADVANCED
Architecture complexity
Setup time
120 mins
Documented cold-start run
Security review
Standard Sandbox
Pre-production checks
Release version
1.0.0
Includes all minor updates
Support tier
STANDARD
Engineering assistance
TECHNOLOGIES

Tech Stack.

React 18TypeScriptViteTailwind CSSshadcn/uiRechartsPythonFlaskFlask-SocketIOPyTorchLSTMEfficientNet-B0Federated LearningFedAvgSHA-256Web3.pyEthereumGanacheREST APIWebSocket
DELIVERABLES & CHECKLIST

Features Checklist.

Core capabilities, verified deliverables, and technical assets included with this release.

  • Interactive smart factory monitoring dashboard
  • Real-time factory sensor visualization
  • Remaining Useful Life (RUL) prediction
  • LSTM-based predictive maintenance model
  • Visual surface defect detection
  • EfficientNet-B0 transfer-learning model
  • 6-class defect classification
  • Federated Learning simulation
  • FedAvg model aggregation
  • Multiple simulated factory nodes
  • Local model training per node
  • Federated training progress monitoring
  • Model performance metrics
  • Tamper-evident blockchain logging
  • SHA-256 proof-of-work blockchain simulation
  • Model hash recording
  • Training metrics recording
  • Timestamped blockchain records
  • Previous-hash chain verification
  • Blockchain block verification API
  • Optional Ethereum/Ganache integration
  • REST API
  • WebSocket real-time communication
  • React + TypeScript dashboard
  • Interactive charts and visualizations
  • Synthetic-data training mode
  • NASA C-MAPSS dataset support
  • NEU Surface Defect Database support
  • Docker/deployment ready architecture
  • Comprehensive API endpoints
ENVIRONMENT

System Requirements.

OS
Linux, Windows, or macOS
CPU
4+ cores recommended
GPU
NVIDIA GPU with 8GB+ VRAM recommended for model training
RAM
16GB recommended
npm
9+
Python
3.10+
Browser
Modern Chrome, Firefox, Edge, or Chromium-based browser
Network
Local network or internet connection for multi-node simulation
Node.js
18+
Storage
10GB+ free space
Blockchain
Optional Ethereum/Ganache environment for blockchain integration
PROJECT CONTEXT

About this Project.

Federated Digital Twin — Smart Factory Predictive Maintenance Platform

Build an intelligent smart-factory monitoring and predictive-maintenance system combining machine learning, Federated Learning, computer vision, real-time monitoring, and blockchain-based model verification.

This project demonstrates how multiple factory nodes can collaboratively train machine-learning models while keeping local training separated, with model updates aggregated through Federated Averaging (FedAvg).

The platform also combines sensor-based Remaining Useful Life (RUL) prediction with visual surface-defect classification.


Core Capabilities

Predictive Maintenance

The platform uses a PyTorch LSTM model to estimate Remaining Useful Life (RUL) from machine sensor data.

Supported workflow:

Sensor data → preprocessing → LSTM inference → RUL prediction → dashboard visualization

The implementation supports NASA C-MAPSS sensor datasets and also provides synthetic-data training for quick demonstrations.

Visual Defect Detection

An EfficientNet-B0 model with transfer learning is used for visual surface-defect classification.

The system supports six defect classes using the NEU Surface Defect Database.

Workflow:

Factory image → preprocessing → EfficientNet-B0 → defect classification → API response → dashboard


Federated Learning

The project includes a manual Federated Learning implementation using FedAvg.

Multiple simulated factory nodes independently train local models before their model updates are aggregated.

Example architecture:

Node 1 ─┐ Node 2 ─┤ Node 3 ─┼→ FedAvg Aggregation → Global Model Node 4 ─┘

This provides a practical demonstration of collaborative model training without directly centralizing each node's local training process.

The implementation does not require an external Federated Learning framework.


Blockchain Verification

The platform includes a simulated SHA-256 proof-of-work blockchain for recording model-related information.

Recorded information can include:

  • Model hash
  • Training metrics
  • Timestamp
  • Previous block hash

The blockchain API also provides block verification functionality.

An optional Ethereum/Ganache integration is provided through Web3.py.

Important: the default implementation is a simulated blockchain intended for demonstration and development purposes, rather than a production blockchain network.


Real-Time Monitoring

The frontend communicates with the Flask backend through HTTP APIs and WebSockets.

Real-time events include:

  • Sensor readings
  • RUL updates
  • Federated Learning progress
  • Node status
  • Blockchain updates

This allows the dashboard to display changing factory and training information without requiring constant page refreshes.


Dashboard

The React frontend provides an interactive interface for monitoring:

  • Factory overview
  • RUL predictions
  • Defect detection
  • Federated Learning status
  • Training metrics
  • Factory node status
  • Blockchain records
  • Blockchain verification

Charts and visualizations are implemented using Recharts.


Technology Stack

Frontend

  • React 18
  • TypeScript
  • Vite
  • Tailwind CSS
  • shadcn/ui
  • Recharts

Backend

  • Python
  • Flask
  • Flask-SocketIO
  • REST APIs
  • WebSockets

Machine Learning

  • PyTorch
  • LSTM
  • EfficientNet-B0
  • Transfer Learning

Federated Learning

  • Federated Averaging (FedAvg)
  • Manual implementation
  • Simulated factory nodes

Blockchain

  • SHA-256
  • Proof of Work
  • Simulated blockchain
  • Web3.py
  • Optional Ethereum/Ganache integration

Datasets

  • NASA C-MAPSS
  • NEU Surface Defect Database

API

System

GET /api/health

Returns system health and model status.

Predictive Maintenance

POST /api/predict/rul

Generate an RUL prediction from uploaded sensor data.

Defect Detection

POST /api/predict/defect

Classify a surface-defect image.

Federated Learning

POST /api/federated/start

Start federated training.

GET /api/federated/status

Retrieve federated-training progress.

Factory Nodes

GET /api/nodes/status

Retrieve the current status of simulated factory nodes.

Blockchain

GET /api/blockchain/logs

Retrieve blockchain transaction records.

GET /api/blockchain/verify/<hash>

Verify a blockchain record.


Quick Start

Backend

Install Python dependencies:

pip install -r requirements.txt

Frontend

cd frontend npm install

Train Models

The project includes synthetic-data training:

python -m training.federated_training --model both --synthetic

Run Backend

python app.py

Run Frontend

cd frontend npm run dev

The application can then be accessed through the local development server.


Real Dataset Training

NASA C-MAPSS

Place the C-MAPSS datasets inside:

data/sensor/

Then run:

python -m training.train_rul --data_dir data/sensor --epochs 50

Federated training is also supported.

NEU Surface Defect Database

Place the image classes inside:

data/images/

Then run:

python -m training.train_defect --data_dir data/images --epochs 20


Who Is This For?

This project is suitable for:

  • AI/ML developers
  • Industrial AI developers
  • Predictive-maintenance researchers
  • Computer-vision developers
  • Smart manufacturing projects
  • Industry 4.0 / Industry 5.0 demonstrations
  • Federated Learning research and experimentation
  • Academic research and demonstrations
  • AI proof-of-concept development
  • Developers building smart-factory prototypes

What You Receive

  • Complete project source code
  • React frontend
  • Flask backend
  • Machine-learning models and training code
  • Federated Learning implementation
  • Blockchain implementation
  • REST API implementation
  • WebSocket implementation
  • Synthetic-data training support
  • Dataset integration structure
  • Setup instructions
  • API documentation

Requirements

A basic demonstration can be run using synthetic data.

For practical model training, an NVIDIA GPU is recommended.

Real-world training performance depends on the selected dataset, batch size, model configuration, image resolution, and available hardware.


License

Commercial Single-Project License.

The purchased source code may be used and modified for one project.

Redistribution, resale, sublicensing, or publishing the source code as a standalone product is not permitted.

Custom development, deployment, hosting, dataset preparation, and ongoing maintenance are not included.

CUSTOM SOFTWARE & ARCHITECTURE

Need a custom version or different stack?

Whether you need tailored modifications to this system, enterprise deployment, or an entirely new custom architecture built from scratch, our engineering team can scope and deliver it.