Table of Contents
Fetching ...

Interpretable Hybrid Deep Q-Learning Framework for IoT-Based Food Spoilage Prediction with Synthetic Data Generation and Hardware Validation

Isshaan Singh, Divyansh Chawla, Anshu Garg, Shivin Mangal, Pallavi Gupta, Khushi Agarwal, Nimrat Singh Khalsa, Nandan Patel

TL;DR

This work tackles real-time spoilage prediction in IoT-enabled food supply chains by integrating a hybrid deep reinforcement learning framework (DQN) that combines LSTM and RNN layers with a rule-based, interpretable ground-truth classifier. The methodology uses Arduino-based sensors (DHT11, MQ3, MQ4, soil moisture) and synthetic data generation to train and validate the agent, with additional hardware data to demonstrate real-world applicability. Four evaluation metrics capture predictive accuracy and learning dynamics, and results show the LSTM+RNN hybrid consistently outperforms alternatives in both synthetic and real-time settings while maintaining interpretability. The study highlights the potential for scalable, transparent, and adaptive IoT spoilage monitoring systems, and outlines future directions to enhance data efficiency, transferability, and robustness.

Abstract

The need for an intelligent, real-time spoilage prediction system has become critical in modern IoT-driven food supply chains, where perishable goods are highly susceptible to environmental conditions. Existing methods often lack adaptability to dynamic conditions and fail to optimize decision making in real time. To address these challenges, we propose a hybrid reinforcement learning framework integrating Long Short-Term Memory (LSTM) and Recurrent Neural Networks (RNN) for enhanced spoilage prediction. This hybrid architecture captures temporal dependencies within sensor data, enabling robust and adaptive decision making. In alignment with interpretable artificial intelligence principles, a rule-based classifier environment is employed to provide transparent ground truth labeling of spoilage levels based on domain-specific thresholds. This structured design allows the agent to operate within clearly defined semantic boundaries, supporting traceable and interpretable decisions. Model behavior is monitored using interpretability-driven metrics, including spoilage accuracy, reward-to-step ratio, loss reduction rate, and exploration decay. These metrics provide both quantitative performance evaluation and insights into learning dynamics. A class-wise spoilage distribution visualization is used to analyze the agents decision profile and policy behavior. Extensive evaluations on simulated and real-time hardware data demonstrate that the LSTM and RNN based agent outperforms alternative reinforcement learning approaches in prediction accuracy and decision efficiency while maintaining interpretability. The results highlight the potential of hybrid deep reinforcement learning with integrated interpretability for scalable IoT-based food monitoring systems.

Interpretable Hybrid Deep Q-Learning Framework for IoT-Based Food Spoilage Prediction with Synthetic Data Generation and Hardware Validation

TL;DR

This work tackles real-time spoilage prediction in IoT-enabled food supply chains by integrating a hybrid deep reinforcement learning framework (DQN) that combines LSTM and RNN layers with a rule-based, interpretable ground-truth classifier. The methodology uses Arduino-based sensors (DHT11, MQ3, MQ4, soil moisture) and synthetic data generation to train and validate the agent, with additional hardware data to demonstrate real-world applicability. Four evaluation metrics capture predictive accuracy and learning dynamics, and results show the LSTM+RNN hybrid consistently outperforms alternatives in both synthetic and real-time settings while maintaining interpretability. The study highlights the potential for scalable, transparent, and adaptive IoT spoilage monitoring systems, and outlines future directions to enhance data efficiency, transferability, and robustness.

Abstract

The need for an intelligent, real-time spoilage prediction system has become critical in modern IoT-driven food supply chains, where perishable goods are highly susceptible to environmental conditions. Existing methods often lack adaptability to dynamic conditions and fail to optimize decision making in real time. To address these challenges, we propose a hybrid reinforcement learning framework integrating Long Short-Term Memory (LSTM) and Recurrent Neural Networks (RNN) for enhanced spoilage prediction. This hybrid architecture captures temporal dependencies within sensor data, enabling robust and adaptive decision making. In alignment with interpretable artificial intelligence principles, a rule-based classifier environment is employed to provide transparent ground truth labeling of spoilage levels based on domain-specific thresholds. This structured design allows the agent to operate within clearly defined semantic boundaries, supporting traceable and interpretable decisions. Model behavior is monitored using interpretability-driven metrics, including spoilage accuracy, reward-to-step ratio, loss reduction rate, and exploration decay. These metrics provide both quantitative performance evaluation and insights into learning dynamics. A class-wise spoilage distribution visualization is used to analyze the agents decision profile and policy behavior. Extensive evaluations on simulated and real-time hardware data demonstrate that the LSTM and RNN based agent outperforms alternative reinforcement learning approaches in prediction accuracy and decision efficiency while maintaining interpretability. The results highlight the potential of hybrid deep reinforcement learning with integrated interpretability for scalable IoT-based food monitoring systems.
Paper Structure (27 sections, 23 equations, 34 figures, 3 tables, 2 algorithms)

This paper contains 27 sections, 23 equations, 34 figures, 3 tables, 2 algorithms.

Figures (34)

  • Figure 1: Architecture Diagram of the whole methodology
  • Figure 2: Sensors wiring diagram made in Tinkercad
  • Figure 3: Two-Layer Deep Learning Architecture of the DQN Agent for Effective Q-Value Prediction
  • Figure 4: Real time photo of the sensors setup for the data collection
  • Figure 5: Reward plot for the LSTM+RNN Agent in the simulated data environment. Here, "steps" represent episodes, and the agent runs for a total of 1000 episodes.
  • ...and 29 more figures