Skip to content

Enhance underwater images with CNN-based U-Net model in Keras. Optimized with MSE loss, evaluated via PSNR & SSIM. Features RGB equalization, histogram & HSV stretching for color, contrast, and brightness. Produces visually enhanced results consistently.

Notifications You must be signed in to change notification settings

SahilSathe1710/BE-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Underwater Image Enhancement with U-Net

Overview

This project enhances underwater images using a Convolutional Neural Network (CNN) based on the U-Net architecture. Implemented in Keras, the model improves image quality by addressing issues like color distortion, low contrast, and poor visibility.

Features

  • U-Net Model: Enhances underwater images effectively using downsample and upsample paths with skip connections.
  • Comprehensive Enhancement: Balances colors, improves contrast, and adjusts brightness and saturation.
  • Evaluation Metrics: Uses PSNR and SSIM to measure the quality of enhanced images.

Enhancement Techniques

  1. RGB Equalization: Balances colors in the image.
  2. Histogram Stretching: Enhances contrast.
  3. HSV Stretching: Adjusts brightness and saturation.

Getting Started

Prerequisites

  • Python 3.8+
  • TensorFlow, Keras, OpenCV, Flask, React

Installation

  1. Clone the repository:
    git clone https://github.com/your-username/underwater-image-enhancement.git
    cd underwater-image-enhancement
    

Usage

  • Training the Model
    1. Prepare your image datasets and list their paths in train.csv, validation.csv, and test.csv.
    2. Train the model:
        python train_model.py

Running the Web Application

  1. Start the Flask backend: Note :- create virtual environment first then do below steps & CNN model is not present in repo if need plz contact me
    • Go in backend directory
        cd backend
    • Run virtual Environment
        venv/Scripts/activate
    • Start server
       python server.py
  2. Start the React frontend: Note :- install node modules first then reun below code
    • Go in frontend directory
        cd frontend
    • run react app
        npm run dev

Model and Evaluation

The U-Net model uses convolutional layers to downsample and upsample the image, with skip connections to retain spatial information. The model is trained using mean squared error loss and evaluated with PSNR and SSIM metrics.

Results

Enhanced images consistently show improved quality in terms of color balance, contrast, and clarity

Input Image Output Image
Input Image 1 Output Image 1
Input Image 2 Output Image 2
Input Image 3 Output Image 3
Input Image 3 Output Image 3

About

Enhance underwater images with CNN-based U-Net model in Keras. Optimized with MSE loss, evaluated via PSNR & SSIM. Features RGB equalization, histogram & HSV stretching for color, contrast, and brightness. Produces visually enhanced results consistently.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages