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.
- 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.
- RGB Equalization: Balances colors in the image.
- Histogram Stretching: Enhances contrast.
- HSV Stretching: Adjusts brightness and saturation.
- Python 3.8+
- TensorFlow, Keras, OpenCV, Flask, React
- Clone the repository:
git clone https://github.com/your-username/underwater-image-enhancement.git cd underwater-image-enhancement
- Training the Model
- Prepare your image datasets and list their paths in train.csv, validation.csv, and test.csv.
- Train the model:
python train_model.py
- 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
- Go in backend directory
- 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
- Go in frontend directory
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.
Enhanced images consistently show improved quality in terms of color balance, contrast, and clarity
Input Image | Output Image |
---|---|