Skip to content

sid-stack001/Visibility-Enhancement-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Visibility Enhancement System

Real-Time Dehazing & Deraining using CycleGAN

WhatsApp Image 2025-08-16 at 14 50 31_e451d44f

Overview

Weather conditions like haze and rain degrade visibility, reducing the reliability of computer vision systems used in:

  • Autonomous navigation
  • Surveillance
  • Remote sensing
  • Image & video enhancement

This project introduces a CycleGAN-based system for high-resolution multi-weather degradation removal. Unlike conventional dehazing/deraining approaches, our model:

  • Operates on native image resolution (avoiding downscaling)
  • Handles both haze & rain simultaneously
  • Achieves competitive state-of-the-art results on benchmark datasets

Key Contributions

  • πŸ”Ή Custom Dataset: 7,614 unpaired images (synthetic + real) from REVIDE, Rain1400, and Dense-Haze
  • πŸ”Ή Architecture Modifications: CycleGAN tailored for high-fidelity restoration
  • πŸ”Ή Training Optimizations: ADAM optimizer, 100 epochs, unpaired image learning
  • πŸ”Ή Benchmark Testing: Evaluated on SOTS and O-HAZE datasets
  • πŸ”Ή Results: Achieved PSNR ~29 dB and competitive SSIM scores

Methodology

πŸ”Ή Why CycleGAN?

CycleGAN enables image-to-image translation without paired datasets, making it ideal for visibility enhancement where paired clean-weather images are hard to obtain.

πŸ”Ή Architecture

Generator: Translates hazy/rainy frames into clear frames

Discriminator: Ensures generated outputs are visually realistic

Cycle Consistency Loss: Maintains structural fidelity between degraded and restored images. image


Project Structure

β”œβ”€β”€ canny_edge_det/      # Checks image features through canny edges
β”œβ”€β”€ checkpoints/         # Saved model checkpoints  
β”œβ”€β”€ data/                # Datasets (train/test splits)  
β”œβ”€β”€ datasets/            # Dataset processing scripts  
β”œβ”€β”€ docs/                # Documentation and related resources  
β”œβ”€β”€ imgs/                # Images for README/demo  
β”œβ”€β”€ input_images/        # Input images for testing  
β”œβ”€β”€ input_videos/        # Input videos for testing
β”œβ”€β”€ models/              # Stores models
β”œβ”€β”€ onnx/                # Converts model to .onnx format
β”œβ”€β”€ options/             # Configuration files and options  
β”œβ”€β”€ results/             # Generated results (images/videos)  
β”œβ”€β”€ results_past/        # Previous experiment results  
β”œβ”€β”€ scripts/             # Utility scripts for training/inference  
β”œβ”€β”€ util/                # Helper functions and utilities  
β”‚
β”œβ”€β”€ LICENSE              # License file (MIT)  
β”œβ”€β”€ README.md            # Project documentation  
β”œβ”€β”€ desktop.ini          # Windows system file (can be ignored)  
β”œβ”€β”€ server.py            # API/Server script  
β”œβ”€β”€ test.py              # Testing script  
β”œβ”€β”€ test_native_live.py  # Live webcam inference (native resolution)  
β”œβ”€β”€ test_pic.py          # Single image test script  
β”œβ”€β”€ test_resize.py       # Test with resized inputs  
β”œβ”€β”€ test_server.py       # Server-based test script  
β”œβ”€β”€ test_video.py        # Video file inference  
β”œβ”€β”€ test_video_live.py   # Live video stream inference  
β”œβ”€β”€ train.py             # Training entry point  
β”œβ”€β”€ yolov8.pt            # YOLOv8 weights (for auxiliary tasks if used)  

Dataset

Dataset Train Images Test Images Total
REVIDE 3310 194 3504
Rain1400 3600 400 4000
Dense Haze 80 30 110
Total 6990 624 7614

Getting Started

Follow these steps to quickly run the Visibility Enhancement System on your machine.

Clone the Repository

git clone https://github.com/your-username/visibility-enhancement.git
cd visibility-enhancement

Setup Environment

It’s recommended to use Conda or virtualenv.

conda create -n vis-enhance python=3.9
conda activate vis-enhance
pip install -r requirements.txt

Run Inference

On a single image:

python test_pic.py --input input_images/sample.jpg --output results/output.jpg

On a video file:

python test_video.py --input input_videos/sample.mp4 --output results/output.mp4

Live webcam demo (native resolution):

python test_native_live.py


Results

image image image

Evaluation Metrics

  • PSNR (Peak Signal-to-Noise Ratio) - 28.09
  • SSIM (Structural Similarity Index) - 0.78

Tested on the SOTS indoor dataset.


Tech Stack

Python 3.9+

PyTorch

OpenCV

CUDA/cuDNN


Future Work

Extending to fog, snow, and low-light scenarios

Developing a lightweight version for mobile & edge devices

ROS integration for autonomous systems

Exploring transformers and diffusion-based approaches


πŸ™ Acknowledgements

This work is built upon the excellent open-source implementation of CycleGAN and Pix2Pix provided by junyanz/pytorch-CycleGAN-and-pix2pix.
We sincerely thank the authors for their contributions to the research community.


About

Real-time CycleGAN-based system for multi-weather visibility enhancement. Removes haze & rain from images and videos while preserving high-resolution details. Tested on SOTS, O-HAZE, and custom datasets with competitive PSNR/SSIM.

Topics

Resources

License

Stars

3 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors