Predict Air Pollution with Computer Vision

Introduction

 

When you look at the photos below, you’re not just seeing landscapes, you’re seeing the input to an interactive AI system I built. This system can estimate air quality based on simple pictures of the sky and surroundings.

 

Landscape (suburb)

 

Instructions screen

 

Taking a photo of the landscape

 

The air quality is good

 

What makes it exciting is that everything runs locally on a tiny single-board computer called the UNIHIKER K10. No cloud servers, no external processing - just a lightweight AI model running directly on the device.

 

In this article, I’ll take you step-by-step through the journey of building this system. We’ll start from data collection, move into training the model, then cover deployment on the K10, and finally evaluate the results. I’ll also share the challenges I faced, the compromises I had to make, and some ideas on how the project could be improved in the future.

 

UNIHIKER K10 (front)

 

UNIHIKER K10 (back)

 

UNIHIKER K10 - photo mode

 

This is not just another DIY tutorial. It’s a project that connects cutting-edge TinyML techniques with one of the world’s most pressing issues: air pollution. Along the way, I’ll also explain the science of air quality, the pollutants that affect our health, and how the U.S. Air Quality Index (AQI) works. My goal is that, by the end, you not only understand how I built this system but also why it matters.

 

By the way, this is an open-source project. You’ll find all the code, datasets, and supporting files in this GitHub repository.

 

Now that you know what this project is about, let’s dive into the story of how I made it happen.

 

Materials

 

Before diving into the details of training AI models and deploying them to microcontrollers, let’s talk about the hardware and tools that made this project possible. At its heart is the UNIHIKER K10, a single-board computer developed by DFRobot. This little device might not look like much at first glance, but it packs a surprising amount of power for TinyML (Tiny Machine Learning) applications.

 

The K10 is built around the ESP32-S3 Xtensa LX7 chip and comes with:

 

- 16 MB flash memory

- 512 KB SRAM

- 2 MP camera

- 2.8-inch, 240×320 color display

- 2.4G Wi-Fi

- Bluetooth 5.0

- MicroSD card slot

- Pre-installed demo models (face detection, voice commands, etc.)

- Support for multiple environments: Arduino IDE, Thonny IDE, PlatformIO, and Mind+

 

In short, it’s an all-in-one solution for experimenting with AI at the edge. What I love most is how much it enables makers like us to experiment without needing extra shields, modules, or complex wiring. Everything is already onboard.

 

I received my K10 through the DFRobot Explore AI with K10 contest, a program that will distribute 1,000 boards to makers and educators worldwide. If you have a creative AI idea, I highly recommend applying - you’ll be surprised how much this tiny board can do.

 

For my setup, here’s the list of materials I used:

 

- UNIHIKER K10 board

- MicroSD card (I used a generic 8GB card, but larger works too)

- Power supply (a compatible battery for portable use)

 

UNIHIKER K10 box

 

It comes with the board and a type-C USB cable

 

UNIHIKER K10 (front)

 

UNIHIKER K10 (back)

 

That’s it. No complicated hardware stack. Just the board, storage, and a power source.

 

And of course, all the code and training files are open-sourced on this GitHub repository.

 

With the materials ready, let’s step back and look at why I built this project in the first place - and why air quality matters so much.

 

Why Air Quality Matters

 

Artificial Intelligence is often associated with futuristic technologies: self-driving cars, voice assistants, or smart factories. But one of its most impactful applications may actually lie in something we encounter every single day: the air we breathe.

 

Air pollution is not just an environmental challenge; it is a public health crisis. According to the World Health Organization (WHO), 99% of the global population breathes air that exceeds safe limits. This exposure contributes to around 7 million premature deaths every year. The majority of these occur in South-East Asia and the Western Pacific, but no region is immune.

 

The health effects are severe. Prolonged exposure to polluted air can trigger strokes, heart disease, lung cancer, and chronic respiratory conditions. Children, the elderly, and those with preexisting conditions are particularly vulnerable. And beyond individual suffering, poor air quality places an enormous burden on healthcare systems and economies. Quite simply, the dirtier the air, the higher the cost to society.

 

Recognizing the urgency of the problem, the United Nations General Assembly declared September 7 as the International Day of Clean Air for Blue Skies in 2019. Since then, the public sector, NGOs, and researchers have used this day to spotlight innovative solutions and push for policies that move us toward a healthier planet.

 

But here’s the catch: in order to solve air pollution, we first need to measure it accurately. After all, how can we know if we are breathing clean or harmful air if we don’t have reliable data?

 

Traditional Methods of Measuring Air Quality

 

Conventional air monitoring stations use specialized hardware to detect pollutants in real-time. These systems are incredibly accurate, but also expensive, bulky, and complex. They typically rely on a network of sensors that measure different pollutants:

 

Particulate Matter (PM): Tiny solid particles or droplets suspended in the air. The most dangerous are PM2.5, which are small enough to penetrate deep into the lungs and even enter the bloodstream. PM levels are one of the strongest indicators of air pollution.

 

Carbon Monoxide (CO): A colorless, odorless gas produced by incomplete combustion (e.g., car engines, wildfires, burning fuels). At high concentrations, CO can be deadly, earning it the nickname “the invisible killer.”

 

Ozone (O₃): At ground level, ozone forms when sunlight reacts with pollutants like nitrogen oxides (NOx) and volatile organic compounds (VOCs). Unlike the protective ozone layer in the atmosphere, ground-level ozone irritates the lungs and eyes.

 

Nitrogen Dioxide (NO₂): A reddish-brown gas from burning fossil fuels. Long-term exposure increases the risk of asthma and other respiratory diseases, especially in children and the elderly.

 

Sulfur Dioxide (SO₂): A sharp-smelling gas released from burning sulfur-rich fuels and volcanic eruptions. When mixed with water vapor, it forms sulfuric acid, a key component of acid rain.

 

To measure these pollutants, stations use techniques such as laser scattering (for particulate matter) and non-dispersive infrared sensors (for CO₂). Companies like IQAir have even built global monitoring networks where anyone can check real-time pollution levels.

 

While these systems are powerful, they are also resource-heavy. They require constant maintenance, calibration, and investment - making them difficult to scale everywhere.

 

The AI Alternative

 

This is where Artificial Intelligence enters the picture. In recent years, researchers began asking: what if we could estimate air quality using images of the sky?

 

The logic is simple: as pollution levels rise, the visual appearance of the sky and atmosphere changes. Just like we humans can sometimes tell a “clean" sky from a "smoggy" one, a computer vision system can be trained to do this at scale (with far greater precision).

 

For example, in 2025 a team of scientists from China, South Korea, Poland, Kazakhstan, and Tajikistan published a system that used Deep Learning to analyze video feeds and estimate air quality. Their model achieved 94% accuracy with less than two seconds of latency, making it suitable for real-time applications.

 

Another project from Canada demonstrated how existing traffic cameras could be repurposed to estimate pollutant levels like PM2.5, NO₂, and O₃. Imagine an entire city monitoring air quality through cameras already installed at intersections - no additional sensors required.

 

These approaches are not meant to replace traditional methods entirely, but they offer a low-cost, scalable, and complementary tool for monitoring.

 

Inspired by these researches, I wanted to experiment with the concept myself. Could I train an AI model to classify landscape photos based on the U.S. Air Quality Index (AQI)? And could I run it on a tiny board like the UNIHIKER K10?

 

That’s the challenge I set out to explore.

 

Overview of the Project

 

The idea behind this project is simple: use Artificial Intelligence to analyze a landscape photo and estimate the Air Quality Index (AQI). Instead of relying on expensive sensors, the system classifies the image and reports whether the air is good, moderate, unhealthy, or severe - following the U.S. AQI standard.

 

At its core, the project combines three key elements:

 

Image Capture - The UNIHIKER K10 board has a built-in camera that takes a photo of the surrounding landscape.

 

AI Inference - A TinyML model, trained on labeled images of skies and landscapes, runs directly on the K10. This model processes the photo and predicts the AQI category.

 

User Feedback - The result is displayed instantly on the K10’s screen, giving a clear, color-coded indicator of air quality.

 

What makes this build exciting is that it runs entirely offline. There’s no need for cloud computing or external servers. Everything, from capturing the image to processing it with AI, happens on the microcontroller itself.

 

What You’ll Learn

 

By following this tutorial, you’ll get hands-on experience with:

 

- Using the UNIHIKER K10 for computer vision projects.

- Training and deploying a TensorFlow Lite model for embedded AI.

- Building an application that combines environmental science with edge computing.

 

This project isn’t meant to replace professional-grade air monitoring systems. Instead, it’s a proof of concept showing how AI can be applied creatively to real-world problems. Think of it as a DIY experiment that bridges environmental awareness, artificial intelligence, and maker culture.

 

Collecting Data

 

Any machine learning project is only as good as its dataset, and this one was no exception. Fortunately, I didn’t have to start from zero. After some searching, I found an excellent open dataset of urban landscape images from India and Nepal.

 

This dataset was created by researchers Adarsh Rouniyar, Sapdo Utomo, Dr. John A., and Dr. Pao-Ann Hsiung, who collected more than 12,000 images of cities in India and Nepal and labeled them according to the U.S. Air Quality Index (AQI).

 

That means every photo already had a category assigned, such as:

 

- Good

- Moderate

- Unhealthy for Sensitive Groups

- Unhealthy

- Very Unhealthy

- Severe

 

Here’s the class distribution across the dataset:

 

Class distribution

 

This dataset was the backbone of my project. By using a real-world collection of photos taken under diverse environmental conditions, I could train a model that had far more variety and robustness than I could achieve on my own.

 

Why This Dataset Matters

 

The India/Nepal dataset is valuable for several reasons:

 

- It provides urban diversity, with different weather, lighting, and visibility conditions.

- It’s large enough (12,000+ images) to train a lightweight CNN without overfitting.

- It connects the project to real-world air pollution issues, since both India and Nepal face severe air quality challenges.

 

Good (dataset)

 

Moderate (dataset)

 

Unhealthy (dataset)

 

Transparency About Limitations

 

Even though the dataset is excellent, it is still geographically specific. A model trained on these images might not generalize perfectly to other regions of the world. For example, pollution in São Paulo doesn’t look the same as smog in Los Angeles or dust storms in the Middle East.

 

Still, for the purpose of this project, the dataset provided an incredible foundation to build and deploy a proof of concept.

 

Training the Model

 

Once I had collected a dataset of landscape photos, the next big step was training a model that could recognize patterns related to air quality. For this, I used a Convolutional Neural Network (CNN) - a type of deep learning model designed specifically for image classification tasks.

 

CNNs are powerful because they can automatically detect features like colors, edges, textures, and shapes in an image. In the context of air quality, things like the color of the sky, the visibility of distant objects, and the presence of haze become important clues. The CNN learns to associate these visual patterns with AQI categories like good, moderate, unhealthy, or severe.

 

My DIY Training Setup

 

Here’s the part I’m most proud of: I trained the model locally on a PC I built myself for under $300. Most people think you need expensive hardware for AI projects, but that’s not always true if you’re working with optimized frameworks like TensorFlow Lite.

 

Here are the specs of my humble yet reliable machine:

 

CPU: Intel Xeon E5-2670 v3 @ 2.30GHz

RAM: 16GB DDR4 @ 2133 MHz

GPU: Nvidia GT 1030 (2GB)

Storage: 512GB 2.5” SSD

Power Supply: Corsair CV650 80 Plus Bronze, 650W

Operating System: Ubuntu 24.04.2 LTS

 

This machine isn’t a powerhouse, but it’s more than capable of handling lightweight AI experiments and TinyML model training. The GPU isn’t particularly strong for deep learning (2GB of VRAM is very modest), but since I worked with a compact dataset and optimized models, training was still feasible.

 

If you’re curious about the build itself, I made a video explaining how I assembled this PC - you can watch it on my YouTube channel.

 

First Attempts & Hardware Limitations

 

There are countless algorithms and architectures available for computer vision problems. My first attempt was to use MobileNetV2 - a popular lightweight CNN designed for embedded vision tasks. With a bit of fine-tuning, it reached about 86% validation accuracy. That was exciting, until I tried to deploy it on the UNIHIKER K10.

 

The problem? Memory.

 

MobileNetV2 required nearly 2MB of SRAM, while the K10 only has 512KB available. That made it completely unusable for this project.

 

So, I pivoted. Instead of trying to shrink an existing heavy model, I decided to design and train progressively simpler CNNs until I found one light enough to run on the K10, while still accurate enough to be useful.

 

Dataset Preparation

 

The dataset images were originally 224×224 pixels, but during training I resized them to 64×64. This drastically reduced computational requirements and ensured the final model could realistically run on the hardware.

 

I split the dataset using the 70/20/10 rule:

 

- 70% for training

- 20% for validation

- 10% for testing

 

To avoid overfitting, I set 60 training epochs with an early stopping patience of 6. That meant training would halt if validation accuracy stopped improving for six rounds in a row, restoring the best weights automatically.

 

I also applied data augmentation techniques like random flips, small rotations, and zooming. These helped the model generalize better by simulating real-world variations.

 

Training Process

 

After all the trial and error, I used TensorFlow to design a CNN with the following structure:

 

- Convolutional layers to extract low-level features like edges and colors.

- Pooling layers to reduce dimensionality and keep only the most important information.

- Dense layers at the end to make predictions about the AQI category.

 

Training was not always smooth. I had to experiment with different hyperparameters (like learning rate and batch size) and deal with memory constraints. But in the end, I managed to create a model small enough to fit on the K10, while still performing reasonably well in tests.

 

The training script was designed to:

 

- Save the best model based on validation accuracy

- Use class weights to handle imbalanced categories

- Log metrics and generate visualizations (accuracy curves, loss curves, confusion matrix)

- Convert the final model to TensorFlow Lite with int8 quantization

 

Quantization was critical. Without it, the model would have been too large to fit into memory. With int8 quantization, weights and activations were compressed into 8-bit integers, reducing size dramatically while still preserving most of the accuracy.

 

Results

 

At the end of training, my final tiny CNN achieved 71.29% test accuracy. Considering the severe memory limitations of the K10, this was a solid result.

 

This pipeline prioritized low memory footprint over raw accuracy, which is exactly what you need for IoT and edge devices with strict resource constraints like the ESP32-S3 or UNIHIKER K10.

 

I’ll go deeper into the tradeoff between resource consumption and accuracy in the next section, but for now, here’s a quick look at the model’s performance:

 

Training vs validation loss

 

Training vs validation accuracy

 

Training loss

 

Training accuracy

 

Validation loss

 

Validation accuracy

 

Confusion matrix

 

Deploying to the UNIHIKER K10

 

This was by far the hardest challenge I had to tackle: how do you actually run a custom AI model on the UNIHIKER K10?

 

If you remember from the beginning of this article, the K10 can be programmed using four different tools. As of September 2025, the Arduino IDE offers the most flexibility for building your own K10 projects.

 

To control the board, you need a special library called unihiker_k10 - provided by DFRobot. To use it, you need to search UNIHIKER on the boards manager tab and install the application.

 

In the boards manager, install the UNIHIKER application

 

The official documentation is great for examples, but it doesn’t explain how to run your own AI models.

 

So, how do we make it work? Enter TensorFlow Lite for Microcontrollers (TFLite Micro) - the official TensorFlow library for running AI models on microcontrollers. In the Arduino Library Manager, you’ll find two versions: one for standard Arduino boards and one for ESP32 devices. For the K10, we need the ESP32 version (TensorFlowLite_ESP32).

 

In the library manager, install the TensorFlowLite_ESP32 library

 

Why Quantization Matters

 

Remember when I mentioned int8 quantization during training? This step is critical for deployment on edge devices. During quantization, your model is essentially transformed into a C array, which the microcontroller can read and execute directly.

 

There’s a catch: TFLite Micro cannot run models stored on the micro SD card. This means the model must reside in the board’s internal flash memory, which is only 16MB. Quantization helps ensure that the AI model is small enough to fit. Without it, even a modest CNN would be too large to load.

 

Uploading the Model

 

Once training is complete, the final best_model_int8.h file needs to be placed in the same folder as your Arduino sketch. When you hit Upload in Arduino IDE, both your program and the AI model are stored together in the K10’s flash memory.

 

Model and sketch in the same folder

 

At this point, you have everything in place to run inference directly on the board. The AI can now analyze images, classify air quality, and provide predictions - all without relying on a PC or cloud server.

 

Next, we’ll go through the Arduino code that makes this magic happen, showing exactly how the K10 interacts with the model, captures images, and outputs predictions in real time.

 

Arduino Code Walkthrough

 

The Arduino sketch for this project is over 500 lines long, so diving line by line would be overwhelming. Instead, let me give you the big picture, highlighting the architecture, key functions, and technical decisions that make the UNIHIKER K10 perform as intended. Understanding this framework will help you implement your own projects.

 

Key Components

 

The K10 has three main hardware components that our program interacts with:

 

Camera: to capture landscape photos for AI analysis.

Screen: a 2.8-inch, 240x320 color display for showing menus, instructions, and results.

Micro SD Card: for storing temporary images and UI assets.

 

Controlling these three elements is essential for the AI to function properly and for the user to have a smooth experience.

 

Screen and User Interface

 

The display is surprisingly capable, yet the official unihiker_k10 library has limitations - you can set text color and background color, but you cannot:

 

- Change font type or size

- Adjust line spacing or letter spacing

- Apply gradients or advanced graphic effects

 

Despite this, I designed a clear and interactive interface:

 

- When the user powers on the K10, a logo screen appears, followed by the main menu.

- The menu instructs the user: press A or B to navigate.

- Press B → opens an info screen with a short explanation of the system

- Press B again → returns to the menu

- Press A → enters photo mode

- In photo mode, a short message explains how to take a picture.

- The camera opens, and the user presses:

- A → takes a photo

- B → returns to the menu

- After taking a picture, the AI analyzes it and displays the predicted AQI classification on the screen.

 

Because of the library limitations, I implemented a workaround for a more visually appealing UI (user interface):

 

- I designed all interface screens in Canva

- Saved them as images on the micro SD card

- The program loads the correct image as the background whenever the user navigates to a screen

 

Screen: welcome

 

Screen: menu

 

Screen: instruction

 

Screen: how it works

 

This approach is simple yet effective. Later, I discovered a more advanced method used by Mirko Pavleski in a light meter project. He employed the TFT_eSPI library and reverse-engineered the K10 display pins to gain full control over the screen. It’s an elegant solution, but I chose to stick with the SD card method for simplicity.

 

Screen: welcome

 

Screen: menu

 

Screen: instructions

 

Screen: how it works

 

Capturing and Processing Images

 

When the user takes a photo:

 

- The K10 captures a 240x320 image and saves it to the SD card.

- A custom algorithm resizes the image to 64x64 pixels, which matches the input shape of our AI model.

- This resizing is necessary because the CNN was trained on 64x64 images to reduce computational load.

- The resized image is also saved on the SD card.

 

Running the AI Model

 

After resizing, the workflow for inference is straightforward:

 

- The TFLite Micro model loads the 64x64 image from memory.

- The model outputs an array of six probabilities, each representing one AQI class.

- The class with the highest probability is selected and displayed above the original image.

- If two or more classes have the same probability, the first one is chosen by default.

 

This walkthrough covers the logic, data flow, and challenges behind the Arduino sketch. Next, we’ll dive into the Results section, where I analyze how well the model performs on real-world images and share insights about accuracy, limitations, and observed trends.

 

Results

 

After weeks of designing, training, and deploying the model on the UNIHIKER K10, it was finally time to evaluate how well the system performed. Results are crucial because they tell us whether the pipeline, from dataset preparation to TinyML deployment, actually works in the real world.

 

Taking first photo

 

First prediction: moderate

 

Taking second photo

 

Second prediction: moderate

 

As you can see from the photos above, I tested the model outdoors by taking different shots of the sky. Most of the time, the model predicted the air quality as moderate. According to IQAir, the place of testing got a score of 55 (moderate), so it seems the system worked right. But that raises an important question: is this really a good model? How can I be sure it’s not simply underfitting or overfitting?

 

To dig deeper, I evaluated the model on a dataset it had never seen before. For this, I used a collection of smartphone landscape photos taken by Ruikuan Zhu.

 

This external dataset contains 456 images across five AQI categories defined by the U.S. Environmental Protection Agency:

 

- 135 in the Good class

- 188 in the Moderate class

- 29 in the Unhealthy for Sensitive Groups class

- 78 in the Unhealthy class

- 26 in the Very Unhealthy class

 

I wrote a script to load the same quantized model I deployed on the UNIHIKER K10 and evaluate it against this dataset. After some processing time, the results came in - exactly as I had feared.

 

The model achieved just 6.61% overall accuracy on this dataset.

 

Accuracy per class looked like this:

 

Moderate: 0%

Unhealthy for Sensitive Groups: 0%

Good: 16.3%

Unhealthy: 3.85%

Very Unhealthy: 19.23%

 

There were only two invalid predictions overall, and the model almost never predicted the "Hazardous" class.

 

Here’s the confusion matrix for clarity:

 

Confusion matrix of the evaluating dataset

 

The prediction confidence tends to be around 0.5

So what went wrong?

 

There are several reasons for this poor generalization:

 

Data mismatch: The training dataset contained images resized to 224×224, while the evaluation dataset consisted of 4K images (4032×3024 or 3024×4032). Since the K10 model input is just 64×64, resizing 4K images down to this size leads to extreme loss of detail. The subtle cues that distinguish AQI categories simply vanish.

 

Hardware limitations: The decision to train at 64×64 resolution wasn’t arbitrary - it was a necessity. The K10 only has 512KB of SRAM, which forced me to train a very compact CNN. Larger, more expressive models like MobileNetV2 or EfficientNet would perform better, but they wouldn’t fit on the K10.

 

Overfitting risk: Given that my CNN was relatively shallow, it likely overfitted the limited training dataset. A stronger approach would involve transfer learning with pretrained models (e.g., MobileNetV2), but again hardware constraints got in the way.

 

Data availability: One of the biggest challenges of this project was simply finding enough quality data. Many research papers I found used custom-built datasets. I reached out to some of those researchers, but most either didn’t respond or denied access. That left me to work with the few datasets openly available online.

 

In short: while the model works in controlled tests and even runs on the K10, its ability to generalize is still weak. The tradeoff between accuracy and memory constraints defined every design choice in this project, and that’s why thinking about new hardware platforms is going to be critical moving forward.

 

Improvements + Future Work

 

While the UNIHIKER K10 project successfully demonstrates that a tiny AI can classify air quality from landscape images, there’s a lot of room for improvement. Edge AI is inherently about tradeoffs between accuracy, model complexity, and hardware constraints, and exploring these possibilities opens exciting directions for future work.

 

1. Higher Input Size and More Complex Architectures

 

Currently, our CNN operates on 64x64 images to stay within the memory limitations of the K10. Increasing the input size to 128x128 or even 224x224 would allow the model to capture more visual details, such as subtle haze gradients or distant objects, potentially improving accuracy.

 

Moreover, experimenting with more complex architectures - like MobileNet, EfficientNet, or ResNet variants - could help the model learn richer features. These architectures are designed for efficiency on mobile and embedded devices, so with careful pruning and quantization, they could still run on slightly more capable boards or microcontrollers.

 

Leveraging transfer learning is another promising approach. Instead of training a model from scratch, we can start with a model pre-trained on a large image dataset like ImageNet and fine-tune it for air quality classification. This usually improves performance dramatically, especially when the dataset is limited.

 

2. Leveraging More Powerful Hardware

 

One limitation of the K10 is its 512KB of SRAM and 16MB flash memory. More powerful boards, like the UNIHIKER M10, offer a significant upgrade:

 

- Quad-Core ARM Cortex-A35, up to 1.2GHz

- 512MB RAM

- Debian OS

- Capacitive touchscreen

 

While the M10 doesn’t come with a camera, it supports external USB webcams, allowing real-time image capture. Using such hardware would allow larger models, higher resolution images, and faster inference, opening doors to more sophisticated applications.

 

Other alternatives include Raspberry Pi boards or AI-focused single-board computers, which provide similar advantages: better processing, full Python/TensorFlow support, and easy camera integration. This would make training and deploying more complex models feasible.

 

3. Transforming Into a Mobile or Real-Time System

 

Another exciting avenue is turning the system into a cellphone app. Smartphones already have cameras, powerful CPUs/GPUs, and widespread accessibility. By deploying the model on iOS or Android, anyone could measure local air quality with a few taps, expanding the project’s impact from hobbyists to the general public.

 

Alternatively, the system could be integrated with security and traffic cameras. Many cities already have extensive camera networks. Applying air quality AI models to these existing infrastructures could enable real-time, city-scale air quality monitoring, providing actionable insights for citizens and authorities.

 

4. Building a More Robust Dataset

 

The current dataset is focused on daytime urban landscapes from India and Nepal. For a more robust and generalizable model, the dataset should include:

 

- Nighttime photos, where visibility and lighting are dramatically different

- Seasonal variation, e.g., summer haze versus winter fog

- Diverse scenes, including forests, lakes, mountains, industrial areas, and skyscraper-filled cityscapes

 

Additionally, creating specific labels for smog versus haze could enable the model to distinguish between different types of pollution, providing more nuanced air quality assessments.

 

5. Towards Continuous and Real-Time Monitoring

 

The ultimate goal for this system is real-time environmental monitoring. Combining powerful edge devices with continuous image streams could enable:

 

- Automatic logging of air quality over time

- Alerts when pollution reaches dangerous levels

- Integration with urban planning or environmental research projects

 

By deploying this AI to multiple locations and leveraging existing camera infrastructure, we could create large-scale, low-cost air quality monitoring networks, complementing traditional sensors and providing valuable, real-time data to policy makers, researchers, and the public.

 

In summary, the UNIHIKER K10 project represents just the first step in a much larger vision. From higher-resolution models and complex architectures to mobile apps and real-time city-scale monitoring, the opportunities to expand, refine, and scale this work are vast. With careful attention to hardware constraints, dataset quality, and deployment strategies, this system could evolve from a DIY experiment into a practical tool for environmental awareness and public health.

 

Conclusion

 

Air pollution is one of the most pressing environmental challenges of our time. Traditional air quality monitoring stations, while highly accurate, are expensive and sparse, leaving large blind spots in coverage. This project demonstrates that with a low-cost AI-enabled board like the UNIHIKER K10, it’s possible to build an image-based air quality classifier that fits in the palm of your hand.

 

The current implementation runs a lightweight CNN on 64×64 images, and while it performs reasonably well on the training dataset, external evaluation revealed its limits. When tested on a completely different dataset of smartphone photos, accuracy dropped to just 6.61%, highlighting issues with generalization, class imbalance, and the extreme detail loss from resizing 4K images down to 64×64. These results make it clear: the model works under controlled conditions but struggles when exposed to real-world variability.

 

Still, the fact that such a constrained device, with only 512KB of SRAM, can run a custom AI model at all is an achievement in itself. The system isn’t meant to replace official monitoring stations, but rather to complement them by exploring how edge devices can provide affordable and scalable environmental sensing.

 

Along the way, this project highlighted key lessons about dataset preparation, model optimization, overfitting, and the tradeoff between accuracy and memory constraints - challenges that echo across many AI-on-edge applications.

 

And this is just the beginning. With richer datasets, more advanced architectures like MobileNet or EfficientNet, transfer learning, and more powerful boards such as the UNIHIKER M10 or Raspberry Pi, we could unlock systems that monitor air quality continuously, in real time, and at city-wide scales. Imagine embedding these models into smartphones, traffic cameras, or urban infrastructure, making invisible pollution visible and empowering communities to take informed action.

 

In the end, this project is more than a technical experiment. It’s proof that innovation often starts small: with constraints, with compromises, and with persistence. By pushing the limits of what’s possible on low-cost hardware, we take one step closer to democratizing environmental sensing through AI.

License
All Rights
Reserved
licensBg
0