Professional Documents
Culture Documents
This section critically examines tools, technologies and environmental setup used in devel-
oping the content trading system. It provides a detailed overview of software, hardware, and
setup procedures, enabling to understand the technical infrastructure supporting the project’s
objectives and methodologies.
3.2.1 Tools
1. Vs code: Visual Studio Code (VS Code) is a versatile and customizable integrated devel-
opment environment (IDE) developed by Microsoft. This platform, utilized for the project
on image dehazing, offers a range of library features essential for efficient development.
These include syntax highlighting, code completion, debugging capabilities, version con-
trol integration (such as Git), support for extensions, and a lightweight yet powerful in-
terface. These features enhance productivity, streamline the development process, and
provide flexibility for implementing and testing image dehazing algorithms effectively.
2. Kaggle Notebook: In a Kaggle notebook for a dehazing project, users can leverage var-
ious datasets available on the platform to train and evaluate their models. Kaggle hosts a
diverse range of datasets that may include hazy images paired with their corresponding
clear images, facilitating supervised learning approaches for dehazing algorithms. These
datasets may be sourced from different domains and environments, providing a rich vari-
ety of scenes and conditions for training robust dehazing models. Additionally, Kaggle’s
dataset exploration tools and community-driven discussions enable users to discover, an-
alyze, and contribute to datasets relevant to their dehazing project, fostering collaboration
and knowledge sharing within the data science community. Overall, the availability of
datasets on Kaggle enhances the accessibility and effectiveness of dehazing projects by
providing a wealth of data for training and experimentation.
3. Python: Python offers a versatile and efficient platform for dehazing, a crucial task in
image processing and computer vision. With libraries like OpenCV and scikit-image,
Python provides a rich ecosystem of tools for implementing dehazing algorithms. Addi-
tionally, machine learning frameworks such as TensorFlow and PyTorch enable the de-
velopment of sophisticated deep learning models for dehazing tasks. Python’s simplicity
9
and readability facilitate rapid prototyping and experimentation, making it an ideal choice
for developers working in the field of image enhancement and restoration.
10
Chapter 4
In this chapter, a comprehensive examination of the outcomes of dehazing the images sep-
arately using Digital Image Processing techniques and Deep Learning, specifically employing
CNN is provided. It thoroughly assesses the quality and efficacy of each method in reducing
haze and enhancing image quality across diverse environmental conditions. Through compara-
tive evaluation, this section aims to elucidate the strengths and limitations of both approaches,
offering valuable insights into their respective performances. Rather than examining the result
by visual inspection, examination is also done quantitatively by metrics such as PSNR, SSIM,
and MAE, this analysis provides a detailed understanding of the effectiveness of digital image
processing versus deep learning techniques in dehazing images.
4.1 Results
1. Dehazed images using Digital Image Processing: Efficient dehazing of the images was
achieved through the application of Digital Image Processing techniques. The hazy image
Fig. 4.1 underwent dehazing using the Digital Image Processing technique to dehaze the
image and dehazed the image shown in Fig. 4.2.
11
Figure 4.2: Dehazed image using Digital Image Processing
2. Dehazed images using CNN: The hazy image Fig.4.1 underwent dehazing using Con-
volutional Neural Network (CNN) techniques, leveraging the power of deep learning to
effectively mitigate the effects of haze and enhance image clarity. Fig.4.3 shows the de-
hazed image using CNN model.
12
4.2 Performance Analysis
This section critically examines various aspects of the system’s performance. Through a
comprehensive discussion of these results, insights into the effectiveness of the proposed sys-
tem.
• Peak Signal-to-Noise Ratio (PSNR): It is the most widely used objective evaluation
standard for images. In other words, the value of this parameter depends on how far the
real image is from the restored image in terms of pixel match. Thus, PSNR is highly
sensitive to errors, and its unit is dB. PSNR should be maximized.
• Structural similarity (SSIM): The perception model is used to assess image similarity,
which takes into account three factors: brightness, contrast and structure. SSIM [0, 1],
Closer to 1 states the higher structural quality of the restored image.
• Mean Absolute Error (MAE): MAE measures the average absolute difference between
corresponding pixels of the original and processed images.
13
4.2.1.2 CNN Method
In contrast, the Convolutional Neural Network (CNN) approach tends to produce lower
PSNR values across the evaluated 5 different images, indicating comparatively lower image
quality than Digital Image Processing as shown in the Fig. 4.4 . The SSIM scores for CNN are
also lower on average, indicating less preservation of structural details during reconstruction as
depicted in Fig. 4.5. Furthermore, in Fig. 4.6, CNN methods exhibit higher MAE values, sug-
gesting a higher degree of distortion and reduced accuracy in reproducing the original images.
These results highlight the challenges faced by CNN methods in achieving image enhancement
comparable to Digital Image Processing techniques.
14
Figure 4.6: MAE of 5 images
Table 4.1: Comparison of PSNR, SSIM and MAE for Digital Image Processing and CNN
Metrics
Image Method
PSNR SSIM MAE
1 Digital Image Processing 16.92 0.84 31.96
CNN 14.24 0.8 42.93
2 Digital Image Processing 16.95 0.82 31.19
CNN 15.24 0.87 37.92
3 Digital Image Processing 24.37 0.92 10.36
CNN 16.53 0.9 33.16
4 Digital Image Processing 20.39 0.92 20.46
CNN 14.07 0.8 41.2
5 Digital Image Processing 17.96 0.85 29.02
CNN 16.87 0.78 32.69
In Table 4.1, a detailed comparison is drawn between Digital Image Processing and Con-
volutional Neural Network (CNN) methods across five images, revealing notable performance
disparities. For each image, Digital Image Processing consistently outperforms CNN across all
metrics. For instance, in Image 1, Digital Image Processing achieves a PSNR of 16.92, SSIM
of 0.84, and MAE of 31.96, surpassing CNN’s corresponding values of 14.24, 0.8, and 42.93.
This trend persists across all images, with Digital Image Processing consistently yielding higher
PSNR values, indicating superior image quality preservation, along with higher SSIM scores
15
and lower MAE values, implying better structural preservation and reconstruction accuracy.
In conclusion, the comparison between Digital Image Processing and Deep Learning (CNN)
methods for dehazing images reveals significant differences in performance. While both ap-
proaches aim to enhance image clarity and quality by mitigating the effects of haze, Digital
Image Processing techniques consistently outperform CNN-based methods in terms of quan-
titative metrics such as PSNR, SSIM, and MAE. Also, training the deep learning models is
time-consuming and requires high-quality training labels.The Digital Image Processing method
achieves higher scores across all metrics, indicating better preservation of image details and
closer resemblance to ground truth. Moreover, visual inspection further confirms the superior
visual quality of images dehazed using Digital Image Processing techniques. Therefore, in the
context of dehazing images, Digital Image Processing demonstrates superior effectiveness over
Deep Learning (CNN), offering a more reliable and robust solution for enhancing image clarity
and quality that can be effectively used for target detection.
16
Chapter 5
CONCLUSION
In conclusion, this project presents an effective dehazing method that combines digital im-
age processing techniques with deep learning, specifically CNN, to mitigate the challenges
posed by haze in outdoor and remote sensing images. By leveraging techniques such as Dark
Channel Prior, Atmospheric Scattering Model, Retinex, and Gaussian-weighted Image Fusion,
the proposed system successfully enhances image clarity and quality while reducing the effects
of haze. This method takes advantage of the image enhancement based dehazing methods and
image restoration based dehazing methods. To address the problem of inaccurate calculation of
transmittance in existing methods, a Gaussian-weighted image fusion is introduced to obtain a
refined transmittance. Additionally, the dehazed images are corrected using a USM method to
solve the color distortion problem. Comparative evaluation between digital image processing
and CNN-based dehazing methods reveals that digital image processing techniques consistently
outperform CNN in terms of quantitative metrics such as PSNR (22.3), SSIM (0.93) and MAE
(34.0). The digital image processing method achieves higher scores across these metrics, indi-
cating better preservation of image details, closer resemblance to ground truth and efficiently
removed haze. Visual inspection further confirms the superior visual quality of images dehazed
using digital image processing techniques. Therefore, in the context of dehazing images, digital
image processing demonstrates superior effectiveness over CNN, offering a more reliable and
robust solution for enhancing image clarity and quality, which is crucial for target detection in
various fields. Overall, this project provides a valuable contribution to the domain of outdoor
and remote sensing imaging by offering a robust dehazing solution applicable across diverse
scenarios, particularly those requiring precise target detection under challenging atmospheric
conditions.
17
Chapter 6
FUTURE SCOPE
In the future, the focus can be given to reduce the complexity of the method to facilitate
its implementation for real-time processing of image acquisition terminals. While our current
approach shows promise, further enhancements are necessary to address challenges associated
with dense haze and clouds. Specifically, aim to improve the dehazing performance in scenarios
where images contain dense clouds, as the current method may yield suboptimal results under
such conditions. This will involve exploring advanced techniques and algorithms tailored to
effectively remove dense haze, thereby enhancing the overall robustness and applicability of
the dehazing solution. Additionally, plan to investigate methods for optimizing computational
efficiency without compromising the quality of dehazed images, ensuring seamless integration
into real-time image processing systems. By addressing these aspects in the future work, we
aim to advance the capabilities of our dehazing method and enable its widespread deployment
in various practical applications requiring reliable haze removal.
18
BIBLIOGRAPHY
[1] Chenyang Li, Hang Yu, Suiping Zhou, Zhiheng Liu, Yuru Guo and Wenjie Zhang
”Efficient Dehazing Method for Outdoor and Remote Sensing Images” IEEE Jour-
nal Of Selected Topics In Applied Earth Observations and Remote Sensing, Vol.
16,2023,10.1109/JSTARS.2023.3274779
[2] A. A. J. Pazhani and S. Periyanayagi, “A novel haze removal computing architecture for
remote sensing images using multi-scale Retinex technique,” Earth Sci. Inform., vol. 15,
no. 2, pp. 1147–1154, Jun. 2022, doi: 10.1007/s12145-022-00798-4.
[3] H. Yu, C. Li, Z. Liu, Y. Guo, Z. Xie, and S. Zhou, “A novel nighttime dehazing model inte-
grating Retinex algorithm and atmospheric scattering model,” inProc. 3rd Int. Conf. Geol.,
Mapping Remote Sens., 2022, pp. 111–115, doi: 10.1109/ICGMRS55602.2022.9849369.
[4] . Song, D. Zhou, W. Li, H. Ding, Y. Dai, and L. Zhang, “WSAMF-Net: Wavelet spa-
tial attention-based multistream feedback network for single image dehazing,” IEEE
Trans. Circuits Syst. Video Technol., vol. 33, no. 2, pp. 575–588, Feb. 2023, doi:
10.1109/TCSVT.2022.3207020.
[5] https://www.kaggle.com/datasets/wwwwwee/dehaze
[6] F. A. Dharejo , “A deep hybrid neural network for single image dehazing via wavelet
transform,” Optik, vol. 231, Apr. 2021, Art. no. 166462, doi: 10.1016/j.ijleo.2021.166462.
[7] S. C. Pei and T. Y. Lee, Nighttime haze removal using color transfer pre-processing and
dark channel prior,” in Proc. IEEE 19th Int. Conf. Image Process., 2012, pp. 957–960, doi:
10.1109/ICIP.2012.6467020.
[8] J. Zhang, Y. Cao, S. Fang, Y. Kang, and C. W. Chen, “ Fast haze removal for night-
time image using maximum reflectance prior”, in Proc. IEEE Conf. Comput. Vis. Pattern
Recognit.,7 2017, pp. 7016–7024, doi: 10.1109/CVPR.2017.742
[9] J. Guo, J. Yang, H. Yue, H. Tan, C. Hou, and K. Li, “ RSDehazeNet: Dehazing net-
work with channel refinement for multispectral remote sensing images,” IEEE Trans.
Geosci. Remote Sens., vol. 59, no. 3, pp. 2535–2549, Mar. 2021, doi: 10.1109/T-
GRS.2020.3004556.
19
APPENDIX
Sample Code
1 import cv2
2 import numpy as np
3 import streamlit as st
4 from skimage.metrics import structural_similarity as ssim
5 from skimage.metrics import mean_squared_error as mse
6 import tensorflow as tf
7 from PIL import Image
8
20
31
44 def dark_channel_prior(image):
45 dark_channel = cv2.ximgproc.createFastGlobalSmootherFilter(image,
10, 0.05)
46 dark_channel = dark_channel.filter(image)
47 return dark_channel
48
21
61
22
91
92 if st.button("Enhance"):
93 try:
94 dehazed_img = dehaze_ASM(original_image, omega=omega,
t0=t0)
95 retinex_img = retinex(original_image, sigma=
sigma_retinex, gain=gain_retinex)
96 fused_transmittance = gaussian_weighted_fusion(
dehazed_img, retinex_img, alpha=alpha_fusion)
97 corrected_img = unsharp_mask(dehazed_img, sigma=
sigma_usm, strength=strength_usm)
98 st.image(corrected_img, caption="Image Processed
Dehazed Image", use_column_width=True)
99 # Convert images to float32 for metrics calculation
100 original_float = original_image.astype(np.float32)
101 enhanced_float = corrected_img.astype(np.float32)
102 # Calculate PSNR
103 psnr_value = psnr(original_float, enhanced_float)
104 st.write("PSNR:", round(psnr_value, 2))
105 # Calculate SSIM
106 ssim_value = ssim_index(original_float,
enhanced_float)
107 st.write("SSIM:", round(ssim_value, 2))
108 # Calculate MAE
109 mae_value = mean_absolute_error(original_float,
enhanced_float)
110 st.write("MAE:", round(mae_value, 2))
111 # Generate CNN-based dehazed image and metrics
112 cnn_dehazed_img_tensor = evaluate(loaded_model,
img_array)
113 cnn_dehazed_img_numpy = cnn_dehazed_img_tensor.numpy
() # Convert TensorFlow tensor to numpy array
114 cnn_dehazed_img_resized = cv2.resize(
cnn_dehazed_img_numpy, (original_image.shape[1], original_image.
shape[0]))
23
115 cnn_dehazed_img_resized_display = cv2.convertScaleAbs
(cnn_dehazed_img_resized, alpha=(255.0/cnn_dehazed_img_resized.max
()))
116 # Normalize pixel values to range [0, 1]
117 cnn_dehazed_img_resized = cnn_dehazed_img_resized /
255.0
118 st.image(cnn_dehazed_img_resized_display, caption=’
CNN-based Dehazed Image’, use_column_width=True)
119 # Convert CNN-based dehazed image to float32 for
metrics calculation
120 cnn_dehazed_float = cnn_dehazed_img_resized.astype(np
.float32)
121 # Calculate PSNR, SSIM, and MAE for CNN-based
dehazed image
122 cnn_psnr_value = psnr(original_float,
cnn_dehazed_float)
123 st.write("PSNR (CNN-based Dehazed Image):", round(
cnn_psnr_value, 2))
124 cnn_ssim_value = ssim_index(original_float,
cnn_dehazed_float)
125 st.write("SSIM (CNN-based Dehazed Image):", round(
cnn_ssim_value, 2))
126 cnn_mae_value = mean_absolute_error(original_float,
cnn_dehazed_float)
127 st.write("MAE (CNN-based Dehazed Image):", round(
cnn_mae_value, 2))
128 except Exception as e:
129 st.write("Error occurred during processing:", e)
130
24
Project Screenshots
25
Dehazed Image
26
Figure 6.3: Dehazed Image using CNN
27
GitHub History
28