Skip to content

Wireless-Information-Networking/Indirect-Soil-Moisture-RFID-Sensor

Repository files navigation

🌱 Passive UHF RFID VWC Estimator Using Bayesian ML

📚 Table of Contents


🧭 Introduction

This repository accompanies the bachelor’s thesis “Indirect Sensing Using Passive UHF RFID Technology and Machine Learning”, conducted at:

  • Wireless Information Networking (WIN) Group – Department of Telecommunications and Systems Engineering
  • RFID, Antennas and Communication Devices (GRADCOM) – Department of Electronic Engineering
  • Department of Computer Architectures and Operating Systems
    at the Universitat Autònoma de Barcelona (UAB).

It implements a Bayesian machine learning framework to estimate soil Volumetric Water Content (VWC) from passive UHF RFID tag responses, integrating:

  • 🌐 Physics-informed preprocessing (Friis-based features, phase & RSSI calibration)
  • 🎯 Probabilistic modeling (Gaussian Mixture Models, Hierarchical Bayesian Regression)
  • 📊 Experimental dataset handling, visualization, and uncertainty quantification

The project aims to advance indirect RFID sensing for smart agriculture and IoUT applications, enabling low-power, low-cost, and uncertainty-aware soil monitoring.


🏗️ Repository Structure

.📂 RFID-VWC-Estimator-Bayesian-ML/
├── 📁 frontend/               # Sensor Front-End (Edge)
│   ├── acquisition/           # Antenna & reader control, data acquisition
│   ├── preprocessing/         # Tag filtering, averaging, frequency fusion
│   ├── edge_nn/               # On-device neural network (trained offline)
│   └── mqtt_client/           # Communication with back-end
├── 📁 backend/                # Sensor Back-End (Server)
│   ├── synthetic_data/        # Synthetic data generator (RF propagation models)
│   ├── vwc_estimator/         # Bayesian regression, inference, metrics
│   ├── feature_engineering/   # Feature extraction & scaling
│   └── visualization/         # Plotting, diagnostics, uncertainty visualization
├── 📁 data/                   # Experimental and synthetic datasets
├── 📁 notebooks/              # Jupyter notebooks for experiments
├── 📁 docs/                   # Paper figures, diagrams, and documentation
├── requirements.txt           # Python dependencies
├── setup.sh                   # Setup script for Raspberry Pi / virtual env
├── LICENSE
└── README.md

⚙️ Sensor Front-End (Edge)

Runs on a Raspberry Pi integrated with a COTS RFID System (reader and antenna). It is responsible for:

  • 🔗 Establishing a stable connection with the RFID System via MQTT.
  • 📡 Acquiring RSSI, phase, and frequency from tags. The raw RF backscattered signal.
  • 🛠️ Preprocessing data (tag filtering, averaging, frequency fusion).
  • 🧠 Running a lightweight PPE NN (Physical Parameter Extraction Neural Network).
  • 🔊 Sending features to the back-end via a Wireless Link.

🖥️ Sensor Back-End (Server)

Runs the Bayesian VWC Estimation Framework:

  • ⚗️ Synthetic data generation using Friis and propagation-based models and Bayesian Sampling through the posterior distribution.
  • 🧮 Training and evaluation of the probabilistic estimator (Bayesian Regression).
  • 🧰 Feature engineering and uncertainty analysis
  • 🪄 Model deployment: exports NN weights for the Raspberry Pi.

🔢 Data and Models

  • Experimental datasets: captured via COTS UHF RFID Systems.
  • Synthetic datasets: generated from propagation and noise models.
  • Models: Bayesian regression checkpoints, NN weights, and hyperparameter configs.

🚀 Getting Started

Follow these steps to set up the project:

  1. Clone the repository:

    git clone https://github.com/nmb735/RFID-VWC-Estimator-Bayesian-ML.git
    cd RFID-VWC-Estimator-Bayesian-ML
  2. (Optional) Create a virtual environment:

    python3 -m venv venv
    source venv/bin/activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Set up the environment (Front-End):

    • Run the setup script to configure the Raspberry Pi or virtual environment:
      bash setup.sh
  5. Run the back-end:

    • Execute the server:
      cd backend
      python main_backend.py
  6. Run the front-end:

    • Execute the main script:
      cd frontend
      python main_frontend.py
  7. Test the system:

    • Use the provided Jupyter notebooks in the notebooks directory to test and visualize the system's performance.

🧩 Dependencies

The project requires the following dependencies:

  • Python 3.8+
  • Libraries:
    • numpy
    • scipy
    • pandas
    • matplotlib
    • seaborn
    • scikit-learn
    • tensorflow
    • pymc3
    • mqtt
  • Hardware:
    • Raspberry Pi 4 (or equivalent)
    • UHF RFID Reader and Antenna
    • Passive UHF RFID Tags

Install the Python dependencies using:

pip install -r requirements.txt

For hardware setup, refer to the documentation in the docs/ folder.


📋 License

Distributed under the MIT License. See LICENSE for more information.

🙏 Acknowledgements

This project was developed under the supervision of Prof. Dolores Rexachs, Prof. Jose Vicario and Prof. Antoni Morell, with collaboration from the WIN and GRADCOM research groups, and the DAOS Department at UAB.

About

Propagation-based (physics-informed) Bayesian modeling for low-cost RFID indirect soil moisture sensing within an edge-oriented ecosystem.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors