Skip to content

Haze Buster is a full-stack AI web application that restores clarity to hazy images using a deep learning-based dehazing model. Upload a hazy photo or choose from 50+ built-in samples to see the magic of AI-driven enhancement in action.

License

Notifications You must be signed in to change notification settings

saipritampanda/haze-buster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌫️ Haze Buster - Lightweight Hybrid CNN for Real-Time Image Dehazing with Perceptual Loss Optimization

A lightweight and robust image dehazing web application powered by a refined hybrid CNN model inspired by AOD-Net.

Project Overview

Haze Buster is an end-to-end AI-based system that removes haze from real-world images using a custom-built deep learning model. The model enhances visibility in hazy images, trained on RESIDE's dataset and deployed via a FastAPI backend for real-time image dehazing.

Image Dehazing Website

Project Time Spent

Model Training Time

🚀 Key Features

  • 🔧 Custom Lightweight CNN Model: Designed for real-time image dehazing using dynamic input dimensions.
  • 📊 Refined Architecture: Combines multi-scale feature extraction, AOD-Net formulation, and refinement blocks.
  • 🌐 REST API Backend: Built using FastAPI and integrated with TensorFlow for serving predictions.
  • 🧪 High Accuracy Metrics: Achieved excellent PSNR and SSIM values with optimized loss curves.
  • 📸 End-to-End Workflow: From dataset preprocessing to live inference through web interface.

Model Architecture

1. Full Pipeline Overview

Implementation Pipeline

2. Methodology

Methodology

2. Detailed CNN Architecture

Architecture

  • Input Layer: Accepts RGB images of any size (None, None, 3).
  • Multi-Scale Feature Extraction Block: Series of 1×1, 3×3, 5×5, and 7×7 convolutions.
  • AOD-Net Inspired Formula: Applies the following formula for transmission map estimation.
    J(x) = K(x) * I(x) - K(x) + 1
    
  • Refinement Block: 2-layer convolution with batch normalization.
  • Output Layer: Sigmoid activation for image reconstruction in the 0–1 range.

Training Performance

1. Loss (MSE) vs Epoch Graph

Loss Curve

  • Training Loss: Steadily decreasing trend, indicating proper learning.
  • Validation Loss: Shows generalization with acceptable fluctuation.
  • Number of Epochs Trained: 48

2. Evaluation Metrics

  • Loss Function: Mean Squared Error (MSE)

           1
    MSE = ─── * ∑(Yᵢ - Ŷᵢ)²
           n
    
    Where,
    - Yᵢ and Ŷᵢ denote the ground truth and predicted pixel values respectively.
    - n is the total number of pixels.
    
  • Peak Signal-to-Noise Ratio (PSNR): > 60 dB on validation set

                       MAX²
    PSNR = 10 * log₁₀ ──────
                       MSE
    Where,
    - MAX is the highest possible intensity value a pixel can have in the image.
    - Mean Squared Error (MSE) is used both as a standalone loss function and for PSNR calculation.
    
  • Structural Similarity Index (SSIM): Around 0.76 - 0.78 (on test samples)

                       (2 * μₓ * μᵧ + C₁) * (2 * σₓᵧ + C₂)   
        SSIM(x, y) =  ─────────────────────────────────────  
                       (μₓ² + μᵧ² + C₁) * (σₓ² + σᵧ² + C₂) 
    
    Where:  
    - μₓ, μᵧ = Means of the two images  
    - σₓ², σᵧ² = Variances of the two images  
    - σₓᵧ = Covariance between the images  
    - C₁, C₂ = Constants for stability
    

🖥️ Tech Stack

Layer Technology
Frontend React, Tailwind CSS
Backend API FastAPI, Python, TensorFlow
Model AOD-Net (Refined Keras)
Deep Learning TensorFlow + Keras
Utilities Python, NumPy, Pillow, OpenCV
Frontend Deployment Vercel
Backend Deployment Render

API Endpoint

  • POST /dehaze
  • Accepts: .png, .jpg, .jpeg
  • Returns: Dehazed image in image/png format

Training Info

  • Dataset: RESIDE - ITS (Indoor Training Set) || Reside - SOTS , I-HAZE & D-HAZE are removed for now
  • Data Split: 80:10:10
    • 80% → Training Set
    • 10% → Validation Set
    • 10% → Testing Set
  • Training Images per Epoch: 13,000+
  • Trainable Parameters: 1,54,308 (602.77 KB)
  • Training Platform: Google Colab (T4 GPU)
  • Batch Size: 1 (to preserve image quality)
  • Floating Point Operations (FLOPs): 6,727,598,272 (6.7B+ FLOPs or 6727.60 MFLOPs)
    FLOPs = FLOPs = 2 × Kₕ × Kₓ × Cᵢₙ × Hₒᵤₜ × Wₒᵤₜ × Cₒᵤₜ
    
  • Dynamic Image Size Support: Accepts RGB images of any size (None, None, 3).
  • Model saved as: aod_net_refined.keras

Team Contributions

Name Contribution Areas
Sai Pritam Panda (Group Leader) Data cleaning, preprocessing, model architecture design, training, backend integration
Debi Prasad Mahakud Model implementation, backend setup, error handling
Prabhat Sharma Research analysis, debugging, frontend planning
Hrishikesh Swain Data collection, frontend prototyping

📈 Project Results

  • Model Performance:

    • Final Training Loss: Consistently low MSE
    • PSNR: Above 60 dB on validation set
    • SSIM: Approximately 0.76 to 0.78, indicating high structural similarity with ground truth
  • 📊 Training Insights:

    • Smooth convergence with minimal overfitting
    • Training graph available: mse_vs_epoch_graph.png
    • Detailed training logs available in training_log.txt
  • 📁 Output Samples:

    • Real image and dehazed image comparisons
    • Dehazed Images can be downloaded, if viewed in the website
  • Deployment:

    • Fast, real-time inference using FastAPI backend
    • Supports dynamic image input sizes for flexible usage

1. After AOD-NET Implementation

2. After AOD-NET Modification

3. Website

📄 License

This project is released under the Apache License 2.0.

About

Haze Buster is a full-stack AI web application that restores clarity to hazy images using a deep learning-based dehazing model. Upload a hazy photo or choose from 50+ built-in samples to see the magic of AI-driven enhancement in action.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published