Smart Laptop Bag with Machine Learning for Activity Recognition

Dwij Sukeshkumar Sheth, Shantanu Singh, Prakhar S. Mathur, Vydeki DarXiv 2019 · arXiv

Abstract

This paper presents an IoT-enabled "smart laptop bag" prototype designed for real-time environmental monitoring and user activity recognition. Utilizing a multi-sensor array integrated with an Arduino Mega and Raspberry Pi, the system collects data on physical movement, load, and environmental hazards. A Deep Neural Network (DNN) deployed via TensorFlow Lite achieves over 98% accuracy in classifying activities such as walking, running, and idling. The system integrates with Google Firebase and a custom Android application to provide a comprehensive safety and tracking wearable.

Introduction

While the Internet of Things (IoT) has revolutionized wearables like smartwatches, everyday items like laptop bags have remained largely analog. Previous attempts at creating "smart bags" have typically been one-dimensional, focusing solely on a single feature like a GPS tracker or a manual SOS panic button. This research identifies a gap in the market for a holistic, intelligent wearable system. The proposed bag actively monitors the user's physical state (walking, running, idle), the physical load on the user's shoulders, and environmental hazards such as combustible gases or extreme temperatures. The goal is to create a predictive, context-aware safety device that can automatically trigger alerts during abnormal health conditions or emergencies, rather than relying solely on manual user input.

Methodology

The system architecture combines hardware engineering, cloud integration, and machine learning to create a responsive safety hub.

Hardware and Data Pipeline

The prototype is built around an Arduino Mega 2560 connected to a comprehensive sensor suite:

  • IMU: MPU6050 for accelerometer and gyroscope data.
  • Location: Neo-6M GPS module.
  • Gas Sensors: MQ2 and MQ135 for detecting LPG, smoke, and ammonia.
  • Environment: DHT11 for temperature and humidity.
  • Load: Piezo sensors on the straps to measure physical weight distribution.
System architecture block diagram showing the connection between sensors, microcontrollers, and the cloud backend.

The Arduino collects raw data and transmits it serially to a Raspberry Pi 3B. The Pi packages this data into JSON format and pushes it to Google Firebase every two seconds.

Machine Learning and Edge Deployment

A 5-layer Deep Neural Network (DNN) was developed using Keras and TensorFlow to classify user activity. The model utilizes ReLU activation for hidden layers and a SoftMax function for the output layer. To minimize latency, the trained model is converted to TensorFlow Lite (TFLite) and hosted via Firebase ML Toolkit. This allows the user's smartphone to perform real-time inference on incoming sensor data locally.

Dataset

A custom dataset of 1,743 labeled entries was collected from a single individual (Height: 170.2 cm, Weight: 66 kg). Each entry includes 13 features derived from the sensor array, categorized into "Walking," "IDLE," and "Running" classes. The data was split 90/10 for training and testing.

Results and Discussion

The system successfully integrates hardware telemetry with real-time classification. The DNN achieved a training accuracy of 95.87% and a testing accuracy of 98.30%.

The custom Android application displaying real-time sensor telemetry and the ML-predicted user state.

The backpack form factor proves to be an ideal sensor hub, accommodating larger batteries and more sensors than a standard smartwatch. By combining environmental data (e.g., gas detection) with physical activity (e.g., a sudden fall or rapid movement), the system can infer emergencies contextually.

Limitations

The primary limitation is the dataset's lack of diversity, as it was trained on a single user, which may lead to overfitting. Generalization to different body types and gaits remains a challenge. Additionally, the power consumption of the dual-microcontroller setup and active gas sensors requires further optimization for long-term use.

Conclusion and Future Work

This prototype demonstrates the feasibility of a context-aware smart wearable in a backpack form factor. Future work will focus on expanding the dataset for better generalization, integrating computer vision for obstacle detection, and adding solar panels to the exterior of the bag to improve battery longevity.

Summary updated

BibTeX
@misc{sheth2019smart,
  author = {Dwij Sukeshkumar Sheth and Shantanu Singh and Prakhar S. Mathur and Vydeki D},
  title = {{Smart Laptop Bag with Machine Learning for Activity Recognition}},
  year = {2019},
  eprint = {1904.11882},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1904.11882},
}
Figure