SkyGuard AI — Intelligent Anomaly Detection for Automatic Weather Stations

Inspiration

Automatic Weather Stations (AWS) collect important environmental data such as temperature, humidity, and other sensor readings. However, unusual readings caused by sensor malfunctions, sudden environmental changes, or communication issues can affect the reliability of this data.

We were inspired by the challenge of identifying these unusual patterns automatically instead of relying entirely on manual monitoring. This led us to build SkyGuard AI, an AI-powered anomaly detection system designed to help identify suspicious sensor readings and support more reliable weather data monitoring.

What It Does

SkyGuard AI analyzes sensor readings and identifies patterns that differ from expected behavior. It uses machine learning to flag potentially abnormal readings and presents the results through a dashboard.

Key features include:

  • AI-based anomaly detection: Uses the Isolation Forest algorithm to identify unusual patterns across multiple sensor features.
  • Sensor data analysis: Examines features such as temperature, humidity, CO, LPG, smoke, light, and motion from our development dataset.
  • API-based predictions: Uses FastAPI to receive sensor readings and return model predictions and anomaly scores.
  • Interactive dashboard: Uses Streamlit to display readings, prediction results, and sensor monitoring information.
  • Data storage and history: Integrates a Neon database to store and retrieve prediction history.

SkyGuard AI is currently a working prototype. It demonstrates anomaly detection using sensor telemetry data and provides a foundation for integration with real Automatic Weather Stations.

How We Built It

We built SkyGuard AI by combining data analysis, machine learning, backend development, database integration, and dashboard development.

1. Data Preparation

We started with a sensor telemetry dataset containing more than 405,000 valid readings. We selected relevant sensor features, handled Boolean values, and prepared the data for machine learning.

2. Machine Learning Model

We used Isolation Forest, an unsupervised machine learning algorithm designed to detect unusual data points without requiring labeled examples of every possible anomaly.

The model creates randomized decision trees that isolate individual observations. Unusual observations can often be isolated in fewer steps than typical observations.

We used the model's predictions and anomaly scores to identify potentially abnormal sensor patterns.

3. Backend Development

We built a FastAPI backend to load the trained model, accept sensor readings, prepare the input in the correct feature order, and return predictions as JSON responses.

This allowed the model to be accessed through an API instead of being limited to a notebook.

4. Dashboard and Database

We developed a Streamlit dashboard to demonstrate sensor monitoring and display prediction results. We also integrated a Neon database to persist prediction history and retrieve previous results.

5. Testing and Validation

We tested the API, database connection, prediction flow, and dashboard. We also evaluated the model on a held-out portion of the dataset and examined unusual temperature changes to understand how the model responded.

Challenges We Faced

Building SkyGuard AI involved several practical challenges:

  • Understanding anomaly detection: Isolation Forest works differently from traditional supervised classification. Understanding randomized splits, path length, and anomaly scores required experimentation and careful study.
  • Preparing sensor data: We had to ensure that feature names, feature order, and data types matched between model training and API predictions.
  • Building a working API: We resolved issues involving Python dependencies, port conflicts, API connectivity, and request handling.
  • Connecting the components: Integrating the model, FastAPI, Streamlit, and Neon database required testing the complete data flow.
  • Evaluating anomalies: A reading flagged by a model is not automatically a confirmed fault. We learned that anomaly thresholds must be evaluated carefully and that unusual readings may also represent genuine environmental events.

These challenges helped us understand that building an AI system involves much more than training a model. Reliable data preparation, integration, testing, and validation are equally important.

What We Learned

Through this project, we gained practical experience in:

  • Applying unsupervised machine learning to sensor telemetry.
  • Understanding Isolation Forest and anomaly scores.
  • Building and testing REST APIs with FastAPI.
  • Developing dashboards with Streamlit.
  • Integrating a database to preserve prediction history.
  • Testing a model on unseen data.
  • Connecting multiple technologies into a complete working prototype.
  • Recognizing the difference between a model-generated anomaly and a verified real-world fault.

Most importantly, we learned how to move from a machine learning experiment toward an end-to-end application.

What's Next

Our next steps include connecting SkyGuard AI to real Automatic Weather Station data, improving anomaly validation with labeled fault examples and domain-specific rules, calibrating detection thresholds, and introducing more reliable alerting and monitoring.

Our long-term goal is to make SkyGuard AI a practical tool that helps operators identify suspicious sensor behavior earlier and investigate potential equipment problems more efficiently.

SkyGuard AI brings machine learning and sensor monitoring together to help make weather data more trustworthy.

Built With

Share this project:

Updates

Submission history