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.
.📂 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
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.
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.
- 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.
Follow these steps to set up the project:
-
Clone the repository:
git clone https://github.com/nmb735/RFID-VWC-Estimator-Bayesian-ML.git cd RFID-VWC-Estimator-Bayesian-ML -
(Optional) Create a virtual environment:
python3 -m venv venv source venv/bin/activate -
Install dependencies:
pip install -r requirements.txt
-
Set up the environment (Front-End):
- Run the setup script to configure the Raspberry Pi or virtual environment:
bash setup.sh
- Run the setup script to configure the Raspberry Pi or virtual environment:
-
Run the back-end:
- Execute the server:
cd backend python main_backend.py
- Execute the server:
-
Run the front-end:
- Execute the main script:
cd frontend python main_frontend.py
- Execute the main script:
-
Test the system:
- Use the provided Jupyter notebooks in the
notebooksdirectory to test and visualize the system's performance.
- Use the provided Jupyter notebooks in the
The project requires the following dependencies:
- Python 3.8+
- Libraries:
numpyscipypandasmatplotlibseabornscikit-learntensorflowpymc3mqtt
- Hardware:
- Raspberry Pi 4 (or equivalent)
- UHF RFID Reader and Antenna
- Passive UHF RFID Tags
Install the Python dependencies using:
pip install -r requirements.txtFor hardware setup, refer to the documentation in the docs/ folder.
Distributed under the MIT License. See LICENSE for more information.
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.