Skip to content

Latest commit

 

History

55 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart Campus Sensor Analytics

Indoor Air Quality, Occupancy Intelligence & Operational Decision Support

This repository contains the complete data analysis and machine learning workflow developed for an undergraduate thesis focused on Smart Campus sensor data.

The project combines heterogeneous environmental and occupancy measurements to study indoor air quality, room usage, short-term CO₂ forecasting, natural ventilation support and potential lighting-related energy waste.


🇬🇷 Ελληνικά

Περιγραφή έργου

Το παρόν αποθετήριο περιλαμβάνει τα notebooks, τον κώδικα και τις βασικές ροές επεξεργασίας που αναπτύχθηκαν στο πλαίσιο πτυχιακής εργασίας με αντικείμενο την ανάλυση και αξιοποίηση δεδομένων αισθητήρων σε περιβάλλον Smart Campus.

Η ανάλυση βασίζεται σε δεδομένα από τρεις πανεπιστημιακούς χώρους:

  • Room 2.3
  • Room 3.9
  • Room 4.9

Η Room 4.9 διαθέτει την πληρέστερη διαμόρφωση αισθητήρων και αξιοποιείται στα περισσότερα προχωρημένα σενάρια.

Βασικοί στόχοι

Το έργο περιλαμβάνει:

  • προεπεξεργασία και ενοποίηση δεδομένων αισθητήρων,
  • διερευνητική ανάλυση των συνθηκών εσωτερικού περιβάλλοντος,
  • εκτίμηση πληρότητας χώρων,
  • διόρθωση προβληματικών μετρήσεων people counter,
  • πρόβλεψη συγκέντρωσης CO₂ 30 λεπτά στο μέλλον,
  • υποστήριξη αποφάσεων φυσικού αερισμού,
  • εντοπισμό πιθανών περιπτώσεων ενεργειακής σπατάλης φωτισμού.

🇬🇧 English

Project Overview

This repository contains the notebooks, code and analytical workflows developed as part of an undergraduate thesis focused on Smart Campus sensor data.

The analysis is based on heterogeneous measurements collected from three monitored university rooms:

  • Room 2.3
  • Room 3.9
  • Room 4.9

Room 4.9 provides the richest sensor configuration and is therefore used in most of the advanced application scenarios.

Main Objectives

The project focuses on:

  • preprocessing and integration of heterogeneous sensor data,
  • exploratory analysis of indoor environmental conditions,
  • occupancy estimation,
  • correction of anomalous people-counter measurements,
  • 30-minute-ahead CO₂ forecasting,
  • natural ventilation decision support,
  • detection of potential lighting-related energy waste.

Data Source

The datasets used in this project were collected from the HUA Smart Campus infrastructure.

Sensor data were extracted from the Smart Campus platform through terminal-based data retrieval commands and subsequently stored locally for preprocessing and analysis.

The repository includes the raw datasets used in the thesis as well as the processed datasets generated by the preprocessing notebooks.

The original terminal-based data extraction commands/scripts are not included in the current repository.


Πηγή Δεδομένων

Τα δεδομένα που χρησιμοποιήθηκαν στην εργασία προέρχονται από την υποδομή HUA Smart Campus.

Η εξαγωγή των δεδομένων πραγματοποιήθηκε μέσω εντολών στο terminal από την πλατφόρμα του Smart Campus και τα δεδομένα αποθηκεύτηκαν τοπικά για την επακόλουθη προεπεξεργασία και ανάλυση.

Στο αποθετήριο περιλαμβάνονται τα πρωτογενή δεδομένα που χρησιμοποιήθηκαν στην πτυχιακή εργασία, καθώς και τα επεξεργασμένα σύνολα δεδομένων που παράγονται από τα notebooks προεπεξεργασίας.

Οι αρχικές εντολές ή τα scripts εξαγωγής μέσω terminal δεν περιλαμβάνονται στην παρούσα έκδοση του αποθετηρίου.


Project Workflow

The repository follows the complete analytical workflow of the thesis:

Raw Sensor Data
      │
      ▼
Data Preprocessing
      │
      ▼
Processed Room Datasets
      │
      ▼
Exploratory Data Analysis
      │
      ▼
Applied Scenarios
      │
      ├── Occupancy Estimation
      ├── CO₂ Forecasting
      ├── Natural Ventilation Decision Support
      └── Potential Energy Waste Detection

Notebooks

Data Preprocessing

Exploratory Data Analysis

Applied Scenarios

Analysis Stages

1. Data Preprocessing

Separate preprocessing notebooks are provided for Rooms 2.3, 3.9 and 4.9.

The preprocessing stage includes:

  • timestamp parsing,
  • chronological ordering,
  • sensor-data integration,
  • consistency checks,
  • handling of room-specific variables,
  • creation of final processed datasets for analysis.

2. Exploratory Data Analysis

Exploratory Data Analysis is performed separately for each monitored room.

The analysis examines:

  • CO₂ concentration,
  • temperature,
  • humidity,
  • occupancy patterns,
  • PIR activity,
  • window status,
  • lighting conditions,
  • temporal usage patterns.

Applied Scenarios

Scenario 1 – Occupancy Estimation and People Counter Correction

This scenario investigates room occupancy using environmental and sensor-derived information.

Several machine learning approaches are evaluated for occupancy estimation, while anomalous people-counter measurements are also identified and corrected where appropriate.

Key Result

For Room 4.9, the Random Forest model achieved:

  • RMSE: 2.42

The scenario also includes people-counter correction for Room 3.9.


Scenario 2 – Air Quality Forecasting

This scenario predicts indoor CO₂ concentration 30 minutes ahead.

The forecasting pipeline uses:

  • current environmental measurements,
  • occupancy information,
  • temporal variables,
  • lagged CO₂ features,
  • rolling statistics,
  • short-term CO₂ change features.

A HistGradientBoostingRegressor is used as the final forecasting approach.

A strict chronological split is applied in order to reduce temporal leakage.

Key Results

Room RMSE R²
Room 4.9 50.36 ppm 0.857
Room 2.3 53.20 ppm 0.865
Room 3.9 61.60 ppm 0.846

Scenario 3 – Natural Ventilation Decision Support

The CO₂ forecasting methodology is combined with:

  • predicted future CO₂ concentration,
  • current occupancy,
  • current number of open windows.

A rule-based mechanism determines whether additional windows should be opened.

Historical window-opening events are also analyzed under stable occupancy and window conditions.

Key Results

  • Occupied observations analyzed: 6,304
  • Candidate occupied-period window-opening events: 475
  • Valid stable events: 34

The output is intended as decision support rather than automated building control.


Scenario 4 – Potential Energy Waste Detection

This scenario identifies possible lighting-related energy waste through an interpretable rule-based mechanism using:

  • desk occupancy,
  • PIR activity,
  • measured light level,
  • time of day.

A room is considered confidently empty when no desk occupancy and no PIR activity are detected simultaneously.

Nighttime empty-room observations with elevated lighting are treated as high-confidence potential-waste cases.

Daytime observations are treated more cautiously because natural daylight may influence measured light levels.

Key Results

  • Total observations: 38,692
  • Observations with detected light: 9,853
  • Empty-room observations with detected light: 4,980
  • High-confidence nighttime potential-waste observations: 1,124
  • Daytime review cases: 876
  • PIR activity without desk occupancy: 203
  • Estimated cumulative high-confidence duration: 187.33 hours

Main Technologies

The project is implemented in Python and primarily uses:

  • Python
  • pandas
  • NumPy
  • Matplotlib
  • scikit-learn
  • XGBoost
  • LightGBM
  • SciPy
  • joblib

The notebooks were developed and executed in Google Colab / Jupyter environments.


Reproducibility

The recommended execution order is:

  1. Run the preprocessing notebooks.
  2. Generate the processed room datasets.
  3. Run the exploratory analysis notebooks.
  4. Run the four applied scenario notebooks.

The scenario notebooks depend on the processed datasets generated during preprocessing.

For machine learning tasks involving time-dependent data, chronological splitting is used where required in order to reduce the risk of temporal leakage.


Methodological Notes

The project includes several interpretation constraints:

  • CO₂ forecasts are short-term predictions and should not be interpreted as guaranteed future values.
  • Natural ventilation recommendations are rule-based decision-support outputs.
  • Historical window-opening analysis is observational and does not establish causality.
  • Potential energy waste is inferred from sensor patterns and does not represent direct measurement of electrical energy consumption.
  • No power-consumption measurements were available for the lighting system.

Thesis Context

This repository accompanies an undergraduate thesis focused on the analysis and exploitation of Smart Campus sensor data for:

  • indoor air quality monitoring,
  • occupancy analysis,
  • operational decision support,
  • intelligent use of heterogeneous building sensors.

The overall objective is to demonstrate how raw sensor measurements can be transformed into reproducible analytical workflows and useful operational information.


Author

Spyridon Kalliakmanis


Usage

This repository is provided for academic and educational purposes.