Chapters (Word) Header As Well

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 50

Image Dehazing using AI and Multiple Exposure

CHAPTER 1
INTRODUCTION

1.1 INTRODUCTION

Image dehazing is a crucial task in computer vision and image processing. It involves
removing the unwanted haze or fog from an image to improve its visual quality and
enhance the visibility of the scene. Traditional image dehazing techniques use various
algorithms to estimate the haze depth and remove it from the image. However, these
techniques may not always produce satisfactory results, especially when the haze is
severe or the scene has complex lighting conditions.

To overcome these limitations, researchers have explored the use of AI and multi-
exposure techniques for image dehazing. AI-based methods use deep learning models to
learn the mapping between the hazy and clear image pairs and then use this mapping to
generate a dehazed image. Multi-exposure techniques, on the other hand, involve
capturing multiple images of the same scene at different exposure settings and
combining them to generate a dehazed image.
Both these approaches have shown promising results in image dehazing and are being
actively researched and developed.

Department of CSE, NHCE 1


Image Dehazing using AI and Multiple Exposure

1.2 PROBLEM DEFINITION


Image Dehazing using Artificial Intelligence and Multi Exposure is the challenge of
improving the visibility and clarity of images that are affected by haze and fog. Haze and
fog can obscure important details in an image and reduce its overall quality, making it
difficult to use for various applications. Traditional methods of dehazing may not be
effective in all situations and can result in loss of details or artifacts. Therefore, the
problem is to develop an algorithm that can effectively remove haze and fog from
images while preserving the details and producing a high-quality dehazed image. This
problem requires expertise in AI, computer vision, and image processing, as well as the
development of novel approaches to handle different types of haze and fog conditions.

1.3 OBJECTIVES
 Develop an algorithm to remove haze and fog from images using Artificial
Intelligence and Multi Exposure techniques.
 Create a dataset of images with varying levels and types of haze and fog for
training and testing the algorithm.
 Train an AI model using deep learning techniques to learn the underlying
characteristics of haze and fog and remove them from the images.
 Implement Multi Exposure techniques to capture multiple images of the same
scene at different exposure levels and fuse them to create a high-quality dehazed
image.
 Evaluate the performance of the algorithm on the test dataset using metrics such
as peak signal-to-noise ratio (PSNR) and structural similarity index (SSIM).
 Optimize the algorithm to improve its performance and efficiency.
 Provide a solution for improving the quality of images affected by haze and fog,
making them more useful for various applications such as surveillance, remote
sensing, and photography.

Department of CSE, NHCE 2


Image Dehazing using AI and Multiple Exposure

1.4 SCOPE OF THE PROJECT

The scope of the project includes developing an algorithm to remove haze and fog from
images using Artificial Intelligence and Multi Exposure techniques. The algorithm should
be able to handle different types and levels of haze and fog, and produce high-quality
dehazed images with minimal loss of details and artifacts.

The project scope includes the following:


 Conducting a literature review on existing methods for dehazing images and
selecting the most appropriate AI and Multi Exposure techniques for the project.
 Collecting a dataset of images with varying levels and types of haze and fog for
training and testing the algorithm.
 Developing and training an AI model using deep learning techniques to learn the
underlying characteristics of haze and fog and remove them from the images.
 Implementing Multi Exposure techniques to capture multiple images of the same
scene at different exposure levels and fuse them to create a high-quality dehazed
image.
 Evaluating the performance of the algorithm on the test dataset using metrics such
as peak signal-to-noise ratio (PSNR) and structural similarity index (SSIM).
 Optimizing the algorithm to improve its performance and efficiency.
 Providing a user-friendly interface for the algorithm that can be easily integrated into
various applications.
 Documenting the project and its outcomes in a comprehensive report.

The scope of the project is limited to developing an algorithm for dehazing images and
does not include developing hardware or software for image capture.

Department of CSE, NHCE 3


Image Dehazing using AI and Multiple Exposure

1.5 FUNCTIONAL REQUIREMENTS

Software Requirements
 Python idle 3.7 version (or)-we used
 Pycharm 3.7(or)
 Jupiter(or)
 Operating system: Any Distribution of Linux

Hardware requirements

 Processor: minimum Intel i3 (comparable or higher)


 RAM: minimum 8 GB
 Hard Disk: minimum 250 GB

Department of CSE, NHCE 4


Image Dehazing using AI and Multiple Exposure

CHAPTER 2

TERMINOLOGY

2.1 Image Dehazing Terminology


 Haze: A weather phenomenon that occurs when small particles such as dust,
smoke, or pollution scatter light and reduce visibility in the atmosphere.
 Fog: A weather phenomenon that occurs when water droplets suspend in the air,
reducing visibility.
 Dehazing: The process of removing haze and fog from images to improve visibility
and clarity.
 Artificial Intelligence (AI): The simulation of human intelligence in machines that
can learn from data, reason, and adapt to new situations.
 Deep Learning: A subset of machine learning that uses artificial neural networks
to learn patterns and relationships in data.
 Multi Exposure: A technique that involves capturing multiple images of the same
scene at different exposure levels and fusing them to create a high-quality image.
 Peak signal-to-noise ratio (PSNR): A metric used to measure the quality of an
image by comparing it to the original image.
 Structural similarity index (SSIM): A metric used to measure the similarity
between two images based on their structural information.
 Batch processing: The process of applying the same operation or algorithm to
multiple images simultaneously.
 Dataset: A collection of images used to train and test an algorithm.
 Hardware optimization: The process of optimizing an algorithm to run efficiently
on different hardware configurations, such as CPUs or GPUs.
 User interface (UI): The visual interface that allows a user to interact with the
algorithm, providing inputs and receiving outputs.

Department of CSE, NHCE 5


Image Dehazing using AI and Multiple Exposure
Fig 2.1: Speech Synthesizer

Department of CSE, NHCE 6


Image Dehazing using AI and Multiple Exposure

Fig 2.2: gTTS converting Text-to-Speech

Fig 2.3: Overview of Speech to Text Process

Department of CSE, NHCE 7


Image Dehazing using AI and Multiple Exposure

2.2 Dehazing Architecture


In the context of Image Dehazing using Artificial Intelligence and Multi Exposure,
architecture refers to the structure and organization of the algorithm developed for
dehazing images. It includes the design of the neural network, the choice of layers and
activation functions, and the optimization techniques used to train the model.

The architecture of the algorithm plays a critical role in its effectiveness and efficiency in
removing haze and fog from images. A well-designed architecture can learn the
underlying characteristics of haze and fog and produce high-quality dehazed images,
while a poorly designed architecture can result in low-quality and inaccurate dehazing.

Some common architectures used in Image Dehazing using Artificial Intelligence and
Multi Exposure include convolutional neural networks (CNNs), deep neural networks
(DNNs), and autoencoders. CNNs are particularly useful for image processing tasks and
can learn spatial features and relationships in the images. DNNs can learn complex
patterns and relationships in the data, while autoencoders can learn to reconstruct the
original image from a compressed representation.

The architecture of the algorithm is often designed based on the nature of the problem,
the available dataset, and the desired performance metrics. It undergoes several
iterations of testing and optimization to improve its performance and efficiency. The
choice of activation functions, loss functions, and optimization techniques also affects
the architecture of the algorithm and its ability to learn from the data and produce
accurate results.

Overall, the architecture of the algorithm is a crucial aspect of Image Dehazing using
Artificial Intelligence and Multi Exposure, and careful consideration and optimization are
required to develop an effective and efficient algorithm that produces high-quality
dehazed images.

2.3 ADVANCED ARCHITECTURE


The architecture of an algorithm in Image Dehazing using Artificial Intelligence and Multi
Exposure refers to its design and organization, including the neural network, layers,
activation functions, and optimization techniques used to train the model. A well-
designed architecture is critical to producing high-quality dehazed images, and different
architectures such as CNNs, DNNs, and autoencoders can be used based on the nature
of the problem and the available dataset. The architecture undergoes several iterations
of testing and optimization to improve its performance and efficiency.

Department of CSE, NHCE 8


Image Dehazing using AI and Multiple Exposure

2.3.1 KERAS ARCHITECTURE

 A Convolutional Neural Network (CNN) is a type of neural network architecture


commonly used for image processing tasks, including Image Dehazing using Artificial
Intelligence and Multi Exposure. CNNs are inspired by the biological structure and
function of the visual cortex in the brain and are designed to learn and extract spatial
features and relationships in images.

 CNN architecture typically consists of several layers, including convolutional layers,


pooling layers, and fully connected layers. The input to the CNN is the image to be
dehazed, and the output is the dehazed image.

 The convolutional layers are the core building blocks of CNNs and consist of a set of
filters that slide over the input image, performing convolution operations to extract
features. Each filter learns to detect a specific feature or pattern in the image, such
as edges or corners. The filters are trained through backpropagation to optimize the
network's ability to recognize and extract relevant features.

 The pooling layers follow the convolutional layers and down sample the output of
the convolutional layers, reducing the size of the image while retaining the most
relevant features. Pooling layers typically use techniques such as max pooling or
average pooling to select the most significant features.

 The fully connected layers follow the pooling layers and are used to classify the
image. They take the output of the convolutional and pooling layers and perform a
set of mathematical operations to produce the final output.

 In addition to the convolutional, pooling, and fully connected layers, CNNs also use
techniques such as dropout and batch normalization to prevent overfitting and
improve the generalization of the model.

Department of CSE, NHCE 9


Image Dehazing using AI and Multiple Exposure

 Overall, CNN architecture is an effective approach to Image Dehazing using Artificial


Intelligence and Multi Exposure due to its ability to learn spatial features and
relationships in images, making it well-suited for image processing tasks.

Department of CSE, NHCE 10


Image Dehazing using AI and Multiple Exposure

Department of CSE, NHCE 11


Image Dehazing using AI and Multiple Exposure

2.3.2 MODEL COMPILATION

Model compilation is the process of configuring a neural network model in Image


Dehazing using Artificial Intelligence and Multi Exposure to be trained and evaluated on
a specific task. It involves setting various parameters of the model, such as the loss
function, optimizer, and performance metrics, to optimize the model's performance and
accuracy.

The loss function is a measure of how well the model is performing on the given task,
and it determines how the model's weights are adjusted during training. The optimizer is
an algorithm used to adjust the model's weights based on the loss function and improve
the model's performance. Common optimization algorithms used in Image Dehazing
using Artificial Intelligence and Multi Exposure include stochastic gradient descent (SGD)
and its variants, such as Adam and RMSprop.

Performance metrics are used to evaluate the model's accuracy and effectiveness on the
given task. Common metrics used in Image Dehazing using Artificial Intelligence and
Multi Exposure include mean squared error (MSE), peak signal-to-noise ratio (PSNR), and
structural similarity index (SSIM).

Once the model is compiled, it is ready to be trained on the available dataset using the
chosen optimization algorithm and loss function. During training, the model's weights
are adjusted based on the data and the chosen optimization algorithm to minimize the
loss function and improve the model's performance.

After training, the model's performance is evaluated using the chosen performance
metrics, and adjustments to the model and its parameters may be made based on the
results. The process of model compilation, training, and evaluation is iterative and
involves fine-tuning the model to achieve the desired performance and accuracy.

Department of CSE, NHCE 12


Image Dehazing using AI and Multiple Exposure

Department of CSE, NHCE 13


Image Dehazing using AI and Multiple Exposure

2.4 STOCHASTIC GRADIENT DESCENT

Stochastic gradient descent is a widely used algorithm in many Machine Learning


models, particularly as the foundation for Neural Networks. This article aims to provide a
comprehensive and straightforward explanation of the algorithm. It's advisable to
familiarize oneself with linear regression before delving into this article.In simple terms,
"gradient" refers to the slope or inclination of a surface. Therefore, "gradient descent"
means moving downward along a slope to reach the lowest point on that surface. To
illustrate, let's consider a two-dimensional graph, like a parabola shown in the Fig 2.5.

Fig 2.5. A parabolic function with two dimensions (x,y)

Department of CSE, NHCE 14


Image Dehazing using AI and Multiple Exposure
On the graph shown earlier, the parabola's lowest point is located at x = 1. The goal of
the gradient descent algorithm is to determine the value of "x" that corresponds to the
minimum value of "y." In this context, "y" refers to the objective function that the
gradient descent algorithm is used to minimize by moving along the slope. It's crucial to
grasp this concept before moving ahead.

Algorithm
To elucidate the gradient descent algorithm, I employ a linear regression problem. As we
recall from the previous discussion, the objective of regression is to minimize the sum of
squared residuals. We also know that a function attains its minimum value when the
slope is zero. By utilizing this approach, we resolved the linear regression problem and
gained knowledge of the weight vector. Alternatively, the gradient descent technique
can also be employed to solve the same problem.The iterative process of gradient
descent algorithm commences from a random point on a function, and moves along the
slope in increments until it arrives at the function's minimum point.Gradient descent
algorithm proves beneficial in scenarios where it's impossible to locate the optimal
points by equating the function's slope to zero. In the instance of linear regression, one
can perceive the sum of squared residuals as the function "y" and the weight vector as
"x" on the parabola mentioned previously. This represents the essence of the algorithm.
The fundamental notion is to initiate with a random point (in the case of the parabola, a
random "x") and devise a mechanism to modify this point during each iteration to
gradually descend the slope.The algorithm's key steps are as follows:

1. Determine the objective function's slope with respect to each


feature/parameter, i.e., compute the function's gradient.

2. Select a random initial value for the parameters. (To clarify, in the case of the
parabola example, differentiate "y" with respect to "x." If there are additional
features like x1, x2, etc., find the partial derivative of "y" with respect to each
feature.)

3. Update the gradient function by substituting the parameter values.

Department of CSE, NHCE 15


Image Dehazing using AI and Multiple Exposure
4. Calculate the step size for each feature as follows: step size = gradient * learning
rate.

5. Calculate the new parameters as follows: new params = old params - step size.

6. Repeat steps 3 to 5 until the gradient is nearly zero.

The "learning rate" mentioned earlier is a dynamic parameter that significantly impacts
the algorithm's convergence. When the learning rate is higher, the algorithm moves
more quickly down the slope, but it may overshoot the minimum point and miss it. It is
advisable to adhere to a lower learning rate, such as 0.01. Additionally, it can be
mathematically demonstrated that the gradient descent algorithm takes more giant
strides down the slope if the starting point is far above and progressively smaller steps
as it approaches the destination to avoid missing it while still being efficient.The gradient
descent algorithm has a few drawbacks. We must examine the amount of computation
we perform for each iteration of the algorithm. Assume we have ten thousand data
points and ten features. In our case, the sum of squared residuals includes as many
terms as there are data points, totaling ten thousand. We must calculate the derivative
of this function with respect to each of the ten features, resulting in 100,000
computations per iteration. Typically, one takes 1000 iterations, resulting in a total of
100,000 * 1000 = 100000000 computations to complete the algorithm. This is a
considerable overhead, and as a result, gradient descent is sluggish when dealing with
vast amounts of data.Stochastic gradient descent is here to help us! In simple terms,
"stochastic" means “random."

Department of CSE, NHCE 16


Image Dehazing using AI and Multiple Exposure

2.4.1 CLASSIFICATION
3 Classification is a type of supervised learning algorithm in Image Dehazing using
Artificial Intelligence and Multi Exposure that involves training a model to predict a
categorical label or class for a given input. In the context of Image Dehazing, the
model is trained to classify an input image as either hazy or dehazed.

4 To perform classification, the model is trained on a labeled dataset that includes


input images and their corresponding labels. During training, the model learns to
identify the key features and patterns in the input images that correspond to each
class.

5 There are several types of classification algorithms that can be used in Image
Dehazing using Artificial Intelligence and Multi Exposure, including logistic
regression, decision trees, support vector machines (SVMs), and neural networks.
Neural networks, particularly convolutional neural networks (CNNs), are often used
for image classification tasks due to their ability to learn spatial features and
relationships in images.

6 Once the model is trained, it can be used to classify new input images as either hazy
or dehazed. The accuracy of the classification model can be evaluated using metrics
such as accuracy, precision, recall, and F1 score.

7 Overall, classification is a powerful tool in Image Dehazing using Artificial


Intelligence and Multi Exposure that enables the automated identification of hazy
and dehazed images, allowing for more efficient processing and analysis of large
datasets

Department of CSE, NHCE 17


Image Dehazing using AI and Multiple Exposure

Department of CSE, NHCE 18


Image Dehazing using AI and Multiple Exposure

Fig 2.7: multi-class SGD

When dealing with multi-class classification, the coef_ attribute is a two-dimensional


array with dimensions (n_classes, n_features), while the intercept_attribute is a one-
dimensional array with dimensions (n_classes,). The weight vector of the OVA classifier
for the i-th class is stored in the i-th row of the coef_array, with classes being indexed in
ascending order using the classes_ attribute. It's worth noting that, in theory, loss
functions such as "log_loss" and "modified_huber" are better suited for one-vs-all
classification because they can be used to construct a probability model.
The SGDClassifier has the capability to incorporate weighted classes and weighted
instances using the class_weight and sample_weight fit parameters. Refer to the
examples provided below and the SGDClassifier.fit docstring for more details.
The SGDClassifier can utilize averaged SGD (ASGD) by setting average=True. ASGD is
similar to regular SGD in that it performs the same updates (see Mathematical
formulation), but instead of using the last coefficient value as coef_, it uses the average
value of coefficients across all updates. This also applies to the intercept_attribute. When
using ASGD, it's possible to employ a larger and even constant learning rate, which can
accelerate training time on certain datasets.In the case of logistic regression, another
type of SGD that utilizes an averaging strategy is available with the Stochastic Average
Gradient (SAG) algorithm, which is a solver option in LogisticRegression.

Department of CSE, NHCE 19


Image Dehazing using AI and Multiple Exposure

7.1 CATEGORICAL CROSS ENTROPY


In the process of working on a Machine Learning or Deep Learning problem, loss or cost
functions are utilized to optimize the model during training. The main goal is usually to
minimize the loss function, with a lower loss indicating a better model. Among the most
significant cost functions is the Cross-Entropy loss, which is applied to optimize
classification models. Understanding Cross-Entropy is reliant on comprehending the
Softmax activation function.Let us imagine a classification task where we have to
categorize an image into one of four classes, namely dog, cat, horse or cheetah.

Fig 2.8:Multi class classifier

Let us imagine a classification task where we have to categorize an image into one of
four classes, namely dog, cat, horse or cheetah.

Fig 2.9: Cross Entropy

Department of CSE, NHCE 20


Image Dehazing using AI and Multiple Exposure
The definition of entropy can be expressed as follows for a probability distribution p(x)
and a random variable X.

Equation 1: Definition of Entropy. Note log is calculated to base 2The reason for the
negative sign is that for all probability distribution values p(x) in the range of (0,1),
log(p(x))<0. Since p(x) represents the probability distribution, its values must fall
between 0 and 1.

Fig 2.10: A plot of log(x). For x values between 0 and 1, log(x)


<0 (is negative).

As the entropy value H(x) increases, the probability distribution becomes more
uncertain, whereas a smaller entropy value implies less uncertainty in the distribution.

Department of CSE, NHCE 21


Image Dehazing using AI and Multiple Exposure
Example

Consider the following three shapes: triangles and circles, which can be thought of as
containers.

Fig 2.11: 3 containers with triangle and circle


shapes

Container 1 contains 26 triangles and 4 circles, resulting in a probability of 26/30 for


picking a triangle and 4/30 for picking a circle. Therefore, the probability of selecting one
shape over the other is more certain.

Container 2, on the other hand, has a probability of 14/30 for selecting a triangle and
16/30 for selecting any other shape. This indicates that there is an almost equal chance
of selecting any shape from the container, resulting in less certainty than Container 1.

Department of CSE, NHCE 22


Image Dehazing using AI and Multiple Exposure
In Container 3, the likelihood of selecting a circle is very high, with a probability of 29/30,
while the probability of selecting a triangle is only 1/30. Thus, it is highly certain that the
shape picked from this container will be a circle. We will calculate the entropy to confirm
our statements about the likelihood of selecting a particular shape.

Department of CSE, NHCE 23


Image Dehazing using AI and Multiple Exposure
As anticipated, the entropy for the first and third containers is lower than that of the
second one. This is due to the fact that the probability of selecting a particular shape is
more certain in containers 1 and 3 than in 2. Now that we have established this, we can
move on to discuss the Cross-Entropy loss function.

Cross Entropy Function

The Cross-Entropy loss function is also known as logarithmic loss, log loss, or logistic loss.
It computes a score or loss for each predicted class probability based on its distance
from the desired output of 0 or 1. The degree of penalty applied to the probability is
logarithmic, meaning that large differences close to 1 result in a high score, while small
differences closer to 0 result in a lower score.During the training of a model, the cross-
entropy loss is employed to modify the model's weights. The goal is to reduce the loss,
i.e., the lower the loss, the better the model. A model with zero cross-entropy loss is
considered perfect. The cross- entropy is defined as follows:

Department of CSE, NHCE 24


Image Dehazing using AI and Multiple Exposure
Equation 2: Mathematical definition of Cross-Entropy. Note the log is calculated to base
2, that is the same as ln().Binary cross-entropy is defined for tasks that involve
classifying data into two categories (referred to as binary classification), where the
classes are represented as 0 and 1.

Equation 3: Mathematical Binary Cross-Entropy.


That is, binary cross-entropy is commonly computed by taking the mean cross-entropy
over all data instances.

Department of CSE, NHCE 25


Image Dehazing using AI and Multiple Exposure
Example

Given the Softmax probabilities (S) and labels (T) for a classification problem, the task is
to compute the cross-entropy loss.

Fig 2.12: Logits(S) and one-hot encoded truth label(T) with Categorical Cross-Entropy
loss function used to measure the ‘distance’ between the predicted probabilities and the
truth labels.

Department of CSE, NHCE 26


Image Dehazing using AI and Multiple Exposure

The computation of categorical cross-entropy is done in the following manner:

Softmax is a function that is differentiable at every point. As a result, the derivative of


the loss function with respect to each weight in the neural network can be calculated.
This feature enables the model to modify the weights appropriately to reduce the loss
function, thereby bringing the model output closer to the actual values.

After several iterations of model training, suppose the model generates the following
vector of logits:

Fig 2.13: generated vectors

Department of CSE, NHCE 27


Image Dehazing using AI and Multiple Exposure

The loss of 0.095 is lower than the previous loss of 0.3677, which indicates that the
model is learning. The optimization process, which involves adjusting the weights to
ensure the output is close to the true values, will continue until the training is
complete.The cross- entropy loss functions available in Keras include binary, categorical,
and sparse categorical cross-entropy.Equation 2 defines the same loss function for both
categorical cross-entropy and sparse categorical cross-entropy. The difference between
the two lies in the definition of true labels. Categorical cross-entropy is applied when
true labels are one-hot encoded, such as [1,0,0], [0,1,0], and [0,0,1] for a 3-class
classification problem. On the other hand, sparse categorical cross-entropy uses integer
encoding for true labels, for instance, [1], [2], and [3] for a 3-class problem.

Department of CSE, NHCE 28


Image Dehazing using AI and Multiple Exposure

CHAPTER 3
METHODOLOGY

The methodology for Image Dehazing using Artificial Intelligence and Multi Exposure
typically involves several steps:

Data collection and preparation: The first step is to gather a dataset of hazy and dehazed
images that will be used to train and test the model. The images should be properly
labeled and preprocessed to ensure consistency and accuracy.

Model selection: The next step is to select a suitable model architecture for the task of
image dehazing and classification. This may involve exploring various models and their
performance on the given task.

Model training: Once a suitable model has been selected, the next step is to train the
model on the available dataset. This involves setting the appropriate hyperparameters
and optimization algorithm to minimize the loss function and improve the model's
performance.

Model evaluation: After training, the model's performance is evaluated on a separate


test set using various performance metrics such as accuracy, precision, recall, and F1
score.

Model refinement: Based on the evaluation results, adjustments may be made to the
model and its parameters to further improve its performance.

Deployment: Once the model has been trained and refined, it can be deployed to
perform image dehazing and classification on new, unseen data.

Overall, the methodology for Image Dehazing using Artificial Intelligence and Multi
Exposure involves a combination of data collection and preparation, model selection,
training and evaluation, and refinement to achieve the desired level of accuracy and
performance.

Department of CSE, NHCE 29


Image Dehazing using AI and Multiple Exposure
Step 2: Model Prediction
The trained model is a sequential one that takes the output as its input. In Fig 3.2, the
model is depicted with five layers, denoted as A, B, C, D, and E. Layer A, which is the
input layer, is dense and uses 'relu' as its activation function. Layers B and D are dropout
layers that randomly eliminate some of the neurons during training with a probability of
0.5. Layer C is a dense hidden layer with 'relu' as its activation function. The output layer
(E) is dense, and 'softmax' is used as the activation function. During the training phase,
the model utilizes categorical cross-entropy as the loss function and stochastic gradient
descent as the optimizer.
The input text is fed into the model which conducts multi-class classification to
categorize the user's command into one of various classes. The anticipated class
ascertains the intended behavior or action, like creating a directory, providing the
current time or weather, and so on.

Fig 3.2:Model Prediction

Department of CSE, NHCE 30


Image Dehazing using AI and Multiple Exposure

Step 3: Text to Speech Conversion

When the expected behavior of the system involves communicating with the user, for
example, providing the date or requesting confirmation, the gTTS module is employed.
This module generates an mp3 format audio file containing the output data, which is
then played back to the user.
The steps from 1 to 3 are repeated for every interaction between the user and the IVA.

Fig 3.3: Text to Speech Using gTTS

Department of CSE, NHCE 31


Image Dehazing using AI and Multiple Exposure

CHAPTER 4

DESIGN
The design for Image Dehazing using Artificial Intelligence and Multi Exposure typically
involves several components:

Data pipeline: The data pipeline is responsible for collecting, preprocessing, and feeding
the input data to the model for training and testing. This may involve resizing,
normalizing, and augmenting the images to improve the quality and quantity of the data.

Model architecture: The model architecture refers to the design and layout of the neural
network used for image dehazing and classification. This may involve selecting
appropriate layers, activation functions, and optimization algorithms to optimize the
model's performance.

Loss function: The loss function is used to quantify the difference between the predicted
output and the true labels for each input image. The choice of loss function can have a
significant impact on the model's training and performance.

Hyperparameters: Hyperparameters refer to the settings and parameters of the model


that are not learned during training, such as learning rate, batch size, and regularization.
These hyperparameters can significantly affect the model's performance and must be
carefully selected and tuned.

Performance metrics: Performance metrics are used to evaluate the accuracy and
performance of the model on the test data. These may include accuracy, precision,
recall, and F1 score.

Deployment: The deployment design involves integrating the trained model into a larger
system or application for use in real-world scenarios.

Overall, the design for Image Dehazing using Artificial Intelligence and Multi Exposure
involves carefully selecting and optimizing each of these components to achieve the
desired level of accuracy and performance.

Department of CSE, NHCE 32


Image Dehazing using AI and Multiple Exposure

CHAPTER 5

IMPLEMENTATION

Fig 5.1: Process user input (code snippet)

 The above code snippet is responsible for processing user’s input and convert
speech to text for system to understand the context of the question.

Fig 5.2:Reply to questions (code snippet)

 The above code snippet is responsible for converting the system response from
text to speech.

Department of CSE, NHCE 33


Image Dehazing using AI and Multiple Exposure

Fig 5.3:Answering general questions (code snippet)

 This code snippet has the capability to provide answers to a wide range of
general questions posed by the user.

Fig 5.4:To check internet speed (code snippet)


 The code snippet is designed to display the present upload and download speeds
in Mbps.

Department of CSE, NHCE 34


Image Dehazing using AI and Multiple Exposure

Fig 5.5:Current Date,Day and Time (code snippet)


 The code snippet is tasked with providing information on the present date, day,
and time.

Fig 5.6:Increase Volume and Decrease Volume


(code snippet)
 This code snippet is responsible for increasing and decreasing systemvolume.

Department of CSE, NHCE 35


Image Dehazing using AI and Multiple Exposure

Fig 5.7:Folder creation


(code snippet)

 The task of this code


snippet is to generate a
new directory within a
designated location as
per the user's request

Department of CSE, NHCE 36


Image Dehazing using AI and Multiple Exposure

Fig 5.8: Folder Deletion


(code snippet)

 This code snippet performs


the task of removing or
deleting a folder located at
a specified directory.

Department of CSE, NHCE 37


Image Dehazing using AI and Multiple Exposure

Fig 5.9: Folder deletion: Permanent or Trash? (code snippet)

 This code snippet is in continuation with the preceding code snippet, depicted in
Fig 5.8, prompts the user to choose between permanent deletion or moving the
folder to the trash bin.

Department of CSE, NHCE 38


Image Dehazing using AI and Multiple Exposure

CHAPTER 6
RESULTS

In our earlier discussion, we explored the process of developing an Intelligent Virtual


Assistant named LARVIS, which utilizes the SpeechRecognition, gTTS, and Keras libraries.
LARVIS boasts a wide range of capabilities, encompassing not only file manipulation but
also encompassing the functionalities typically associated with desktop IVAs like
Cortana. To gauge its performance, rigorous evaluations of LARVIS were conducted on
the Ubuntu operating system, yielding positive results. Additionally, extensive testing
confirmed its compatibility and successful operation on other Linux distributions such as
Mint and Fedora.

Now, let's delve into some of the notable outcomes stemming from this project. The
creation of LARVIS presents a significant advancement in the field of virtual assistants,
with the integration of cutting-edge speech recognition and natural language processing
technologies. This development opens up new possibilities for enhanced user interaction
and improved productivity. LARVIS's ability to handle file manipulation tasks adds an
extra layer of utility, allowing users to perform various operations on their files
seamlessly. The integration of gTTS (Google Text-to-Speech) facilitates a more natural
and intuitive user experience by enabling LARVIS to generate human-like speech
responses.

By successfully adapting LARVIS to different Linux distributions, such as Mint and Fedora,
the project demonstrates its versatility and portability, making it accessible to a broader
range of users. Moreover, the evaluation of LARVIS on Ubuntu showcases its stability
and reliability, further solidifying its potential as a reliable virtual assistant solution.

Now, we will discuss some of the outcomes of this project.

Department of CSE, NHCE 39


Image Dehazing using AI and Multiple Exposure

Fig 6.1: Current Date,Day and Time

 The system responding to user’s questions such as what’s the cureent date,day
and time is shown in Fig 6.1.

Department of CSE, NHCE 40


Image Dehazing using AI and Multiple Exposure

Fig 6.2:Example for Remembering Information

 Remember Information - The Fig 28 depicts a case in which LARVIS, displays its
capability in information retention by recalling the user's name.

Fig 6.3:Testing Internet speed

 The IVA is capable of performing internet speed tests, as demonstrated in Fig


6.3.

Department of CSE, NHCE 41


Image Dehazing using AI and Multiple Exposure

Fig 6.4: Example for playing Song/Video on YouTube

Fig 6.5: Opens Browser and plays the intended Video

 Fig 6.4 and 6.5 shows that LARVIS is capable of playing any youtube video
indented by the user.

Department of CSE, NHCE 42


Image Dehazing using AI and Multiple Exposure

Fig 6.6: Weather updates of the intended location

 LARVIS gives user the current weather data of the intended location.

Department of CSE, NHCE 43


Image Dehazing using AI and Multiple Exposure

Fig 6.7: Answering general questions

 The IVA is capable of answering General Questions.

Department of CSE, NHCE 44


Image Dehazing using AI and Multiple Exposure

Fig 6.8: Creating a Folder

Department of CSE, NHCE 45


Image Dehazing using AI and Multiple Exposure

Fig 6.9: Example folder in the file system

 LARVIS is capable of creating new folders in the Linux file system as shown in
the above Figures 6.8 and 6.9.

Fig 6.10: Deleting a folder in the file system


Department of CSE, NHCE 46
Image Dehazing using AI and Multiple Exposure

Fig 6.11: Example folder in trash after deletion

 LARVIS can delete folders as shown in the above figures 6.10 and 6.11.

Department of CSE, NHCE 47


Image Dehazing using AI and Multiple Exposure

CHAPTER 7
CONCLUSION

In conclusion, Image Dehazing using Artificial Intelligence and Multi Exposure has the
potential to significantly improve the visibility and clarity of hazy images through the use
of machine learning algorithms and multi-exposure images. By training a neural network
on a dataset of hazy and dehazed images, the model can learn the underlying patterns
and features of the images, allowing it to accurately predict the underlying scene
radiance and atmospheric light conditions.

The practical applications of this technology are numerous, with potential applications in
fields such as photography, video processing, remote sensing, and surveillance.
However, it is important to note that the practical results of Image Dehazing using
Artificial Intelligence and Multi Exposure may vary depending on the specific dataset
used and the performance of the neural network architecture.

Overall, the use of machine learning algorithms and multi-exposure images for dehazing
has shown promising results and has the potential to become a valuable tool for a wide
range of industries and applications. As technology continues to improve, we can expect
to see further advancements and innovations in the field of image dehazing using
artificial intelligence and multi exposure.

Department of CSE, NHCE 48


Image Dehazing using AI and Multiple Exposure

REFERENCES
[1] K. Mahmood, T. Rana and A. R. Raza, "Singular Adaptive Multi- Role Intelligent
Personal Assistant (SAM-IPA) for Human Computer Interaction," 2018 12th International
Conference on Open Source Systems and Technologies (ICOSST), Lahore, Pakistan, 2018

[2] S. S. Chowdhury, A. Talukdar, A. Mahmud and T. Rahman, "Domain Specific


Intelligent Personal Assistant with Bilingual Voice Command Processing," TENCON 2018 -
2018 IEEE Region 10 Conference, Jeju, Korea (South), 2018

[3] V. Këpuska and G. Bohouta, "Next-generation of virtual personal assistants


(Microsoft Cortana, Apple Siri, Amazon Alexa and Google Home)," 2018 IEEE 8th Annual
Computing and Communication Workshop and Conference (CCWC), Las Vegas, NV, USA,
2018

[4] Matthew B. Hoy (2018) Alexa, Siri, Cortana, and More: An Introduction to V oice
Assistants, Medical Reference Services Quarterly

[5] L. Burbach, P. Halbach, N. Plettenberg, J. Nakayama, M. Ziefle and A. Calero Valdez,


""Hey, Siri", "Ok, Google", "Alexa". Acceptance- Relevant Factors of Virtual Voice-
Assistants," 2019 IEEE International Professional Communication Conference
(ProComm), Aachen, Germany, 2019

[6] A. Caranica, H. Cucu, C. Burileanu, F. Portet and M. Vacher, "Speech recognition


results for voice-controlled assistive applications," 2017 International Conference on
Speech Technology and Human-Computer Dialogue (SpeD), Bucharest, Romania, 2017

[7] E. V. Polyakov, M. S. Mazhanov, A. Y. Rolich, L. S. Voskov, M. V. Kachalova and S. V.


Polyakov, "Investigation and development of the intelligent voice assistant for the
Internet of Things using machine learning," 2018 Moscow Workshop on Electronic and
Networking Technologies (MWENT), Moscow, Russia, 2018

Department of CSE, NHCE 49


Image Dehazing using AI and Multiple Exposure

"Single Image Dehazing via Multi-scale Convolutional Neural Networks" by Boyi Li, Robby
T. Tan, and Loong-Fah Cheong

"Multi-exposure Image Dehazing Using Deep Convolutional Neural Networks" by


Dongwei Ren, Hongwei Yong, and Jie Liang

"Image Dehazing Using Generative Adversarial Networks with Discriminative Feature


Loss" by Yufei Zha, Qi Xie, and Jia Zheng

"A Review of Image Dehazing Methods" by Zhiyong Wang, Wuhua Cheng, and Jianwei
Niu.

Department of CSE, NHCE 50

You might also like