PredMaint_System: PredMaint System: The Predictive Maintenance Repo That Closes the Loop

A digital twin, a hybrid anomaly engine, and a work-order schema turn machine telemetry into maintenance operations, not just prettier dashboards.

9 min read • View on GitHub • More from JetkumarGaikwad

A wide industrial control room scene where a machine on the left sends a live stream of signals through a middle layer of simulation, inference, and storage blocks, then into a work-order tray on the right. The image explains how telemetry becomes an operational action instead of stopping at a dashboard.
PredMaint System is built around a loop: simulate, infer, persist, and route the result into maintenance work.
Key Takeaways

The Factory Nervous System

Most predictive maintenance repos stop when they can label a failure. PredMaint System keeps going. It simulates sensor data, scores it, writes state to SQLite, and pushes the result into a live maintenance workflow.

That is the whole story. The interesting unit is not the model. It is the loop between machine, inference, storage, and human verification.

The repo’s real design choice is a decision pipeline. Telemetry fans out into rules, novelty detection, and classification, then returns as a work order and a verification signal.

Why the Loop Matters More Than the Model

A failure score has no value on its own. It becomes useful when it changes state: a machine becomes broken, a work order opens, and someone can confirm the cause later. That is why fields like threshold_sensitivity, work_orders, and root_cause_verified matter more than a nicer chart.

QuestionDashboard-only demoPredMaint System
What is the output?A chart or scoreA maintained operational state
What triggers action?Usually a visual thresholdRules, anomaly detection, and classification
Where does the result go?A screenSQLite state and work orders
Can a human verify it?Often noYes, through workflow state
Does it support feedback?RarelyIt points toward future retraining

That is also the subtle product insight here. The repo treats maintenance as a workflow with memory, not a one-off prediction event.

Inside the Inference Stack

The backend’s intelligence layer is deliberately layered. In ml_engine.py, obvious rule violations are checked first, novelty is detected next, and supervised classification comes last. The order matters because industrial systems need something that is explainable when the input is messy and the stakes are real.

def run_inference(sample):
    features = calculate_features(sample)

    if features['temperature'] > 100 or features['vibration'] > vibration_limit:
        return {
            'status': 'alert',
            'reason': 'rule_violation'
        }

    novelty = isolation_forest.predict([features_vector])
    failure_type = classifier.predict([features_vector])

    return {
        'status': 'watch' if novelty == -1 else 'ok',
        'failure_probability': classifier_proba,
        'failure_type': failure_type
    }

This is a belt-and-suspenders design. The rules catch obvious problems. Isolation Forest catches unfamiliar patterns. The classifier adds a failure label when the system has enough signal to make one.

LayerWhat it catchesWhy it exists
RulesObvious threshold violationsFast, explainable, cheap
Isolation ForestUnknown or unusual behaviorCatches novelty before labels exist
Supervised classifierKnown failure patternsTurns features into a failure type

The Digital Twin Is a Failure Generator, Not a Demo Toy

The simulator matters because it makes failure gradual. In simulator.py, four machine types, including pump, lathe, compressor, and motor, do not simply flip from healthy to broken. Their readings drift, jitter, and degrade over time.

A close-up mechanical cross-section of a rotating bearing where one side still turns smoothly and the other side shows a tiny crack, increasing vibration, and a drifting motion path. The scene explains how the simulator models gradual degradation instead of instant failure.
The simulator’s realism comes from ramping into failure. That makes the data more believable and the product more trustworthy.

That choice changes everything. A gradual drift gives the inference stack something to detect, gives users something believable to watch, and gives the UI a story instead of a flashing red light.

Fallbacks, Portability, and the Single-Server Constraint

There is a nice practical detail in the ML engine: if scikit-learn is missing, the project does not die. It falls back to a statistical detector. That is a rare and useful form of humility in an open-source ML repo.

Design choiceBenefitTrade-off
SQLiteZero-config portabilitySingle-server limits
WebSocketsLive updates without pollingNeeds a persistent connection
Fallback anomaly logicGraceful degradationLess model sophistication
In-memory cachesFast state accessNot durable at scale

So yes, this is robust for a lab or demo environment. It is not yet a factory-scale deployment stack. The code itself makes that boundary visible.

How It Compares to Typical Predictive Maintenance Projects

Compared with notebook-only projects, PredMaint System is more complete. Compared with enterprise CMMS or IoT platforms, it is much lighter and easier to understand. That middle position is what makes it interesting.

Project typeStrengthWeakness
Notebook-only PdMFast experimentationStops at the model
Enterprise CMMS or IoT platformOperational depthHeavy to adopt
PredMaint SystemEnd-to-end prototypeNot built for large-scale production

It sits in the useful middle zone. That is not a compromise. It is a clear editorial identity.

What the Repo Suggests About the Future

The code hints at an obvious next step: use verified root causes as training data, move event fanout to something like Redis, and harden persistence beyond a single node. In other words, make the feedback loop durable.

That is the real promise here. PredMaint System already treats maintenance as a living process. The next version just has to make the memory stronger.