DEV Community

Soham Kulkarni
Soham Kulkarni

Posted on

Building an AI-Powered Motion Blur Mitigation System for High-Speed Railway Wagon Monitoring

Hi everyone,

Over the past few weeks I've been working on a computer vision project focused on a very specific but important problem in railway monitoring: obtaining usable visual information from fast-moving freight wagons captured by station cameras.

I wanted to share the idea, the architecture, and some of the challenges we're facing, and hopefully get feedback from people who have experience with computer vision, edge AI, OCR, video analytics, or industrial inspection systems.

The Problem

Railway stations already have surveillance infrastructure in place. However, when freight wagons pass through monitoring points at high speed, the resulting footage often suffers from:

Severe motion blur
Low-light degradation during night operations
Reduced visibility of wagon identifiers
Poor image quality for damage inspection

These issues significantly reduce the effectiveness of downstream tasks such as:

Wagon number OCR
Wagon counting
Damage detection
Asset tracking
Maintenance inspection

Most AI systems assume that the input imagery is reasonably clear. In practice, that assumption often breaks down in real railway environments.

Our idea is simple:

Instead of improving the detection algorithms first, improve the quality of the visual data itself.

Project Objective

The goal is to build an AI-powered pipeline capable of:

Receiving live video streams from monitoring cameras
Reducing motion blur caused by high-speed wagon movement
Enhancing visibility under low-light conditions
Producing inspection-ready frames for downstream analytics

The system is designed to operate in near real time and eventually run on edge devices such as NVIDIA Jetson platforms.

System Architecture

Current pipeline:

Video Stream

Frame Extraction

Motion Deblurring

Low-Light Enhancement

Frame Quality Analysis

OCR / Inspection Ready Output

The output is not intended to make videos look prettier.

The objective is to make them operationally useful.

Current Implementation
Input Sources

The system currently supports:

Live Camera Feed
Video Upload
Image Upload

For prototyping purposes, live streams are currently provided through DroidCam, allowing a smartphone camera to simulate a CCTV stream.

Motion Deblurring

For blur mitigation we experimented with deep learning approaches trained on paired blurred and sharp image datasets.

The primary focus is restoring:

Wagon side panels
Wagon identifiers
Structural details

that become unreadable under motion blur.

Low-Light Enhancement

Railway operations occur 24/7, so night-time performance is critical.

We integrated low-light enhancement capabilities to improve visibility during:

Night operations
Poor weather
Low illumination environments

One challenge we're currently facing is preventing excessive enhancement during daylight conditions.

We're exploring adaptive processing pipelines to solve this.

Dashboard

To make the system useful for operators, we designed a monitoring dashboard with three operating modes:

Live Stream

Displays:

Real-time camera feed
Real-time enhanced feed
Processing metrics
Video Upload

Allows historical footage analysis.

Image Upload

Allows individual frame inspection.

Additional Dashboard Features
Before vs After Comparison

Operators can compare:

Original Frame ↔ AI Enhanced Frame

to visually verify improvements.

Top 10 Restored Frames

The system automatically stores and displays the best restored frames from the current stream.

These frames can later be used for:

OCR
Inspection
Reporting
Archival purposes
Quality Metrics

The dashboard displays metrics such as:

Blur reduction estimate
Sharpness score
Processing latency
Frame rate

This helps quantify performance rather than relying solely on visual assessment.

System Status Monitoring

A dedicated panel displays:

Current FPS
Processing latency
Hardware information
Active processing mode

This becomes important when moving toward edge deployment.

Why This Matters

The majority of railway AI systems focus on:

Detection
Classification
Tracking

However, all of those systems depend on image quality.

If the input imagery is blurred or unreadable, even the most advanced detection model will struggle.

We see image restoration as a foundational layer that improves the performance of all downstream railway analytics.

Future Roadmap

The current project focuses on image restoration.

Future phases include:

Wagon Number OCR

Automatic extraction of wagon identifiers from enhanced frames.

Wagon Counting

Automated counting and verification of wagon sequences.

Damage Detection

Detection of:

Broken ladders
Open doors
Missing components
Structural anomalies
Anomaly Detection

Instead of training for every possible defect, the system could learn normal wagon appearance and flag unusual conditions.

Predictive Maintenance

Long-term vision:

Visual Inspection

Damage Detection

Condition Tracking

Failure Prediction

This would transform the platform from a monitoring system into a maintenance intelligence system.

Edge Deployment Vision

Target deployment architecture:

Camera

Jetson AGX

AI Processing

Dashboard

Central Monitoring System

The goal is to process footage locally while sending only relevant analytics to a centralized platform.

Looking for Feedback

I'd love to hear thoughts from the community on:

Motion deblurring approaches that perform well on real CCTV footage.
Railway-specific datasets that may be useful.
Common failure cases for high-speed object monitoring.
Edge deployment optimization strategies.
OCR techniques for motion-restored imagery.

Any suggestions, criticism, or lessons learned from similar projects would be greatly appreciated.

Thanks for reading.

Top comments (0)