Tampering & Sound-Based IoT Framework
Real-Time Steel Cargo Theft Detection

Research (AHEAD ICE Grant)
IoT, Embedded Systems, Deep Learning, Audio Classification

AHEAD Innovation Commercialization Enhancement (ICE) Grant · University of Peradeniya · Sri Lanka

Tampering and Sound-Based IoT Framework for Real-Time Steel Cargo Theft Detection

A real-time theft detecting device combining a smart tamper-sensing seal with an audio-recognition CNN, designed for Thermo-Mechanically Treated (TMT) steel bar cargo.

Research University of Peradeniya Sri Lanka
ESP8266 Raspberry Pi MQTT Convolutional Neural Networks Transfer Learning Google Cloud IoT Core

Supervisors: Dr. Ruwan D. Nawarathna (Senior Lecturer, Department of Statistics and Computer Science, University of Peradeniya, Sri Lanka) and Mr. Lahiru J. Ekanayake (Lecturer, Department of Statistics and Computer Science, University of Peradeniya, Sri Lanka)

Authors: Hashan D. Fernando, Lahiru J. Ekanayake, Prabath Gunathilake, Roshan D. Yapa, Amalka J. Pinidiyaarachchi, Ruwan D. Nawarathna

Additional Resources: Paper (PDF) · Dashboard Repository

Cargo theft costs the global economy billions of dollars a year, and steel cargo is a frequent target: TMT steel bars are dense, valuable, and shipped in huge volumes by sea, rail, and truck. Most existing anti-theft devices only watch the cargo door, and none of them listen to what's happening inside the container. Meanwhile, real-time detection is hard to get right, GPS/GSM trackers suffer from poor signal at sea, and adding more sensors usually means adding more power draw on a device that has to run unattended for months.

This project designs, builds, and evaluates a real-time theft-detecting device with two complementary detection modules. A smart seal forms a conductive mesh wrapped around the top layer of a steel bar stack, break the mesh, and an ESP8266 microcontroller immediately flags the tampering over MQTT. In parallel, an audio detection module built on a Raspberry Pi continuously listens to the cargo hold, converts sound into Mel-spectrograms and MFCCs, and classifies it with a convolutional neural network to catch theft attempts that never touch a sensor. Both modules report to a cloud backend (Google Cloud IoT Core, Firebase, and BigQuery) that pushes real-time alerts and GPS location to a live dashboard.

System Architecture

Two detection modules, one alert pipeline

Each module can independently trigger an alert; both report through the same low-power communication and cloud layer.

01

Smart Seal (Module 1)

A conductive mesh wraps around the top layer of the steel bar stack. ESP8266 reads the mesh continuously in deep-sleep mode, pushing a status signal to MQTT every 15–60 seconds, and immediately on any break in the circuit.

02

Audio Detection (Module 2)

A Raspberry Pi and microphone continuously sample cargo-hold audio. Chunks above a silence threshold are converted to Mel-spectrograms and classified in real time by a CNN trained to distinguish theft-related sounds from ambient noise.

03

Low-Power Communication

Both modules connect to a centralized Wi-Fi hub over MQTT rather than relying on individual GSM links, which are unreliable at sea. Deep-sleep scheduling and a LiPo-battery-plus-LDO-regulator design keep the seal running unattended for the length of a shipping voyage.

04

Cloud & Dashboard

Google Cloud IoT Core ingests device telemetry over MQTT, Firebase Cloud Functions process it and update real-time state, and BigQuery stores the raw history. Owners see live device status, tamper alerts, and GPS location on a map-based dashboard.

Built With

Tools & Stack

ESP8266 Raspberry Pi MQTT TensorFlow / CNN Transfer Learning MFCC / Mel-Spectrograms Google Cloud IoT Core Firebase & BigQuery
Results

From model comparison to a working prototype

Both the audio classifier and the physical hardware were evaluated end to end.

Audio Classification

Which model architecture best separates theft-related sounds from ambient noise?

A dataset combining a custom steel-bar-dragging recording set with UrbanSound8K and YorNoise classes (10,452 spectrograms across 11 classes) was used to train a basic CNN and five transfer-learning architectures pretrained on ImageNet.

Solution

The basic CNN reached 76.23% accuracy. Transfer learning improved on that substantially; DenseNet201 was the strongest model at 93.75% accuracy, ahead of MobileNetV2 (91.00%), MobileNet (88.84%), VGG16 (86.54%), VGG19 (82.65%), and ResNet50 (59.76%).

Hardware Validation

Does the physical device actually detect tampering and report it in real time?

A working smart-seal prototype PCB (ESP8266-12F) was built and tested against multiple simultaneous tampering attempts across multiple sensor nodes, powered from a range of sources including LiPo batteries and solar panels.

Solution

The smart seals pushed status data over MQTT without delay, and tampering attempts triggered immediate, correctly attributed alerts, visible in real time on the dashboard with device ID, GPS coordinates, and a red-flagged tamper status. See the device prototype and dashboard in the gallery below.

Gallery

Figures