{'fraction_non_alphanumeric': 0.03468320093005232, 'fraction_numerical': 0.022891466216403245, 'mean_word_length': 4.8261570714400905, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Smart Parking Space Detection under Hazy conditions using Convolutional Neural Networks: A Novel Approach

Limited urban parking space combined with urbanization has necessitated the development of smart parking systems that can communicate the availability of parking slots to the end users. Towards this, various deep learning based solutions using convolutional neural networks have been proposed for parking space occupation detection. Though these approaches are robust to partial obstructions and lighting conditions, their performance is found to degrade in the presence of haze conditions. Looking in this direction, this paper investigates the use of dehazing networks that improves the performance of parking space occupancy classifier under hazy conditions. Additionally, training procedures are proposed for dehazing networks to maximize the performance of the system on both hazy and non-hazy conditions. The proposed system is deployable as part of existing smart parking systems where limited number of cameras are used to monitor hundreds of parking spaces. To validate our approach, we have developed a custom hazy parking system dataset from real-world task-driven test set of RESIDE-\b{eta} dataset. The proposed approach is tested against existing state-of-the-art parking space detectors on CNRPark-EXT and hazy parking system datasets. Experimental results indicate that there is a significant accuracy improvement of the proposed approach on the hazy parking system dataset.


Introduction
The increase in population coupled with rapid urbanization has led to increased in vehicle footprints in cities. With the urban space being limited, this has put a lot of strain on existing parking systems leading to an increase in time spent by a person searching for a parking slot. According to Giuffre et al. [1], and Shoup et al. [2], around 25% to 40% of urban traffic flow are searching for an effective parking slot. Further, a survey conducted by Lin et al. [3] indicates that the drivers searching for a parking slot have an increased possibility for accidents due to their lack of attention to the road. This has necessitated the development of smart parking solutions which could communicate the availability of parking slots in advance to the end user, thereby reducing the time spent on road searching for a vacant parking slot. Further, the current global market value of parking industry exceeding 2 billion US dollars has also fuelled the development of smart parking solutions. The parking industry is projected to have a compounded growth of 17% over the next decade, of which 65% is projected to be from smart parking solutions 2 . Many research works have been done in this domain [4,5,6,7,8,9,10].
Various existing smart parking solutions have used sensors to determine the occupancy of parking slots and communicate the same to the end user using Bluetooth/WiFi modules [11,12,13,14,15,16,17]. However, these solutions require installation and constant maintenance of sensors at each parking slot, making it difficult to scale to a larger IoT setting. Vision-based parking slot occupation detection offers an alternative cost-effective and scalable solution where a limited number of cameras is used to monitor hundreds of parking spaces [18,19,20,21,22]. However, obstruction of parking slots (for example, from trees) and changing weather conditions degrade the performance of such vision-based techniques. This problem was surpassed in [20,21] by exploiting the robustness of Deep Neural Networks (DNN). They developed a Convolutional Neural Network (CNN) based parking space occupancy classifier for that purpose.
Despite these fine efforts, vacant parking slot detection under hazy conditions is still an open problem. In densely populated areas and areas closer to industries, the atmosphere is polluted with smoke, dust, and other particles that drastically reduce the visibility. Further, during snowfall and rainfall, the visibility is compromised. Hence, detecting parking slot occupancy under hazy conditions is challenging. All the above-mentioned vision-based approaches are not generalizable to such hazy conditions, and their performance degrades in such situations to a large extent.
Working in this direction, the proposed work focuses on improving the accuracy of visionbased parking space occupation detection under both hazy and non-hazy conditions. To the best of our knowledge, the proposed approach is the first work that tackles the problem of parking slot occupation detection under hazy conditions.

Contributions
The significant contributions of this paper include the following: i. A vision-based parking slot occupancy detection system is proposed that consists of the following two networks in series: an end-to-end dehazing network and a parking slot classifier (CNN). For the dehazing network, we follow All-in-One Dehazing network (AOD-N et) architecture [23] owing to its lower computational cost than other stateof-the-art dehazing networks. For the parking space occupancy classifier, we follow the mAlexnet architecture [20] owing to its low computational cost and robustness of the architecture to changing weather conditions. The proposed system is robust to partial occlusions, changing weather conditions, and the presence of haze in the image. Further, the system is deployable as part of existing smart parking systems and scalable to IoT settings.
ii. Various training procedures are explored to maximize the accuracy of the system under both hazy and non-hazy conditions. These include: (a) Inclusion of non-hazy images as part of the training of dehazing network.
(b) Use of modified loss function during training of dehazing network incorporating a new hyperparameter for tuning the relative performance of the system on hazy and non-hazy images.
(c) Joint optimization of dehazing network and classifier.
iii. The proposed approach introduces a custom hazy parking system dataset consisting of 5010 real world hazy occupied and unoccupied parking patches extracted from RTTS (Real-world Task-driven Test Set) subset of RESIDE-β dataset [24]. Optional nonoverlapping training and test split are also provided for benchmarking purposes. The dataset includes patches captured under various intensities of haze as well as different types of hazy conditions (e.g., snow, fog, etc.), and it will help the researchers working in this domain.
Experimental results show that the use of dehazing network significantly improves the parking space classification accuracy (around 10−15%) on the proposed hazy parking system dataset. The rest of the paper includes the following: Section 2 focused on the related works in this domain. The proposed approach is discussed in Section 3, and the experimental work is carried out in Section 4. Finally, the paper is concluded in Section 5 with some future enhancements.

Image Dehazing 2.1.1. Atmospheric scattering model
The atmospheric scattering model proposed in [25,26,27,28] for hazy image generation is given by Here A denotes the global atmospheric light, J(x) is the clear image to be recovered, I(x) is the observed hazy image, and t(x) is the transmission matrix given by where β denotes the scattering coefficient of atmosphere and d(x) denotes the distance between the camera and the object.
Dehazing methods involve estimating the transmission matrix t(x) using physically grounded information or data-driven methods and the global atmospheric light A using empirical methods. The clear image is then computed using equation (1).

Dehazing networks
Much effort has been used to calculate the transmission matrix t(x) accurately. He et al. [28] calculated the transmission matrix by discovering the dark channel prior (DCP) of the image. Zhu et al. [29] estimated the transmission map using a linear model to map the scene depth of the hazy image whose parameters are learned in a supervised way using colour attenuation prior.
Recently CNN's are being used for haze removal. Ren et al. [30] proposed a Multi-Scale-Convolutional-Neural-Network (MSCNN) which takes a hazy image as input, outputs a coarse-scale transmission matrix which is then refined by the second fine tuning network. In [31] a dehazing network called Dehazenet is proposed, which takes a hazy image as input and outputs the corresponding transmission matrix. Both these approaches then calculate the global atmospheric light A using empirical methods and the clear image using the atmospheric scattering model. However, in all the above mentioned approaches, the errors in the estimation of transmission matrix t(x) and global atmospheric light A will accumulate and amplify each other leading to sub-optimal results [23].
To minimize the errors during restoration, recent works [23,32,33] are focused on developing an end-to-end dehazing solution. Li et al. [23] developed a novel end-to-end dehazing network based on CNN called AOD-N et. They studied its use for high-level vision tasks such as object detection and recommended joint optimization of the pretrained dehazing network and the object detector for better performance on hazy images. Similarly, Liu et al. [31] also proposed an end-to-end CNN architecture called "GridDehazenet" for single image dehazing. Working in the same direction, Ren et al. [30] suggested an end-to-end encoder-decoder based CNN called "Gated Fusion Network (GFN)" for single image dehazing. Though GridDehazeN et [33] and GF N [32] achieve better dehazing results than AOD-N et, they are computationally more expensive. This complicates the implementation of GridDehazenet and GF N at the edges of the system for real-time applications.

Smart Parking System
In the early days, smart parking systems were built by embedding sensors at each parking spot. Mustaffa et al. [11] used ultrasonic sensors fixed at the ceiling of each parking spot and displayed the availability at the entrance gate. They displayed directional signage to assist the drivers in finding a parking slot. Idris et al. [14] has suggested the use of ultrasonic sensors at each parking slot and used a wireless sensor network to transmit this information to the entry gate. Khanna et al. [15] used infrared sensors at the parking slots, and the occupancy information is stored in the cloud server that is made available to the users through mobile applications. However, these approaches require installation and maintenance of sensors at each parking slot incurring huge costs, especially when the number of parking slots is large.
Vision-based techniques offer a scalable and cost-effective solution as it requires the use of only a few cameras for monitoring the entire parking system. De Almeida et al. [18] developed a new parking system dataset called PKLot consisting of around 700, 000 parking space images captured from three different cameras. The authors also proposed two systems for vacancy verification using textual descriptors: one using Local Binary Pattern (LBP) and the other using Local Phase Quantization (LPQ) [34]. Both the systems used SVM classifier and achieved an error rate of 11% on the test set. The cameras are placed at the top of the building to solve the occlusion problems.
True [19] used colour histogram and Difference-of-Gaussian (DoG) using SVM and Linear Discriminant Analysis (LDA) for classification. He achieved an average accuracy of 96.45% on images which are not used during the training phase. However, the problem of partial occlusion due to trees, snow, fog, etc. is not addressed in his work.
With the popularization of deep learning, various Deep Neural Networks (DNN's) have also been proposed for parking space occupation classification [35]. Among deep learning approaches, Convolutional Neural Networks (CNN's) are found to be most effective for vision-based detection, and segmentation tasks [36,37,38]. In [20] a parking system dataset called CN RP ark consisting of 12, 584 parking space patches captured from 2 different viewpoints was introduced. Besides introducing the dataset, they also proposed the use of a mini version of AlexNet [36] architecture for parking space detection and proved it to be robust to light changes, partial occlusions.
Amato et al. [21] further extended the CN RP ark dataset to CN RP ark-EXT dataset consisting of 144, 965 parking space patches captured from 9 different cameras under various weather conditions. Using the CN RP ark-EXT dataset, they proved the robustness of mAlexnet architecture to changing camera views as well changing weather conditions. Bura et al. [39] developed a smart parking system where the license plate of the cars was captured at the entrance and used wide eye cameras for monitoring the multiple parking slots. For the real time occupancy classification, they developed a computationally inexpensive CNN architecture. More survey works in this domain can be found in [40,41,42].
All the above mentioned approaches are best suitable for non-hazy conditions, and their performances are severely degraded in the presence of haze. The proposed parking system can overcome such limitations and works well both in hazy and non-hazy conditions. Experimental results show the efficiency of the proposed approach over the conventional approaches.

System Overview
The proposed parking system enhances the model proposed in [20] and is further extended to tackle hazy conditions by incorporating a dehazing network into the system's flow. The model proposed in [20] consists of a set of cameras to monitor the entire parking lot. Periodically, images are captured from the cameras for determining the occupancy of parking spaces. From each image, all the parking spaces captured by that camera are extracted using manually created predetermined masks. Each parking space is then classified using the trained CNN to determine its occupancy.
The dehazing network can be employed in two different ways. In the first case, the images captured from the cameras are fed to the dehazing network. The dehazed output is then segmented into individual parking spaces and classified using the CNN. In the second case, the images captured from cameras are first segmented into parking spaces, and then each parking space is fed to the dehazing network followed by the classification process using CNN. Computationally, the former case is more efficient as it uses dehazing network once for all the parking spaces in the image. In contrast, the latter case uses dehazing network for each of the parking spaces. However, the latter case enables to jointly optimize the dehazing network and classifier as a single pipeline which can be used to achieve higher accuracies in hazy conditions.
The choice is dependent on the computational resources available, the number of parking spaces in the parking lot, and the period between successive capture of images by the cameras. In this paper, the second case is adopted for experimental works. Accordingly, the classifier and dehazing network are developed considering the computational feasibility of the system.
The proposed system consists of five stages as follows: Stage 1 : Images of the parking lot are captured using cameras.  The following sections describe how the CNN is used for the parking space classification process and how the dehazing network is used in the proposed model.

Parking space classification
For parking space classification, the proposed system followed the mAlexnet proposed in [20]. mAlexnet is a miniaturized version of Alexnet proposed in [36], specifically built for binary classification tasks. It is computationally cheaper and is found to achieve accuracies similar to that of Alexnet for binary classification tasks [21]. mAlexnet consists of three convolutional layers and two fully connected layers. Each convolutional layer is followed by ReLU activation and max pooling layers. The fully connected layers FC4 and FC5 are followed by ReLU and SoftMax activations, respectively.
The mAlexnet architecture proposed in [20] uses Local response normalization. However quantitative experiments performed by Z. Wang et.al in [43] on CIFAR-10 dataset using various CNN networks showed batch normalization to be a better normalization technique than local response normalization. Taking inspiration from [43], the proposed system uses batch normalization layer instead of local response normalization layer (LRN) after   first two convolutional layers. For conv1-3, the number and size of filter is specified by "num×width×height+stride" along with ReLU activation and batch normalization. Max pooling layer is denoted by "width×height+stride". For fully connected layers, the dimensionality along with the activation function is presented. Padding is not used for any of the layers. The details of the modified mAlexnet architecture used in the proposed system are illustrated in Table 1.

Dehazing network
The proposed system followed the AOD-Net proposed in [23]. It combines all the parameters of atmospheric scattering equation by rewriting it as follows.
Where b is constant bias with a default value of 1. With t(x) and A incorporated into a single parameter K(x), a CNN architecture named as the K-estimation module is trained to learn the parameter K(x) given an input image I(x). It consists of five convolutional layers and combines features from different layers to compensate for information loss during convolution. "concat1" combines features of "conv1" and "conv2"."concat2" combines features of "conv1","conv2" and "conv3". "concat3" combines features of "conv1","conv2", "conv3" and "conv4". Each convolutional layer is followed by a ReLU activation layer. The CNN architecture is depicted in Figure 2 [23]. Once K(x) is estimated, the clear image is obtained using equation 4.
Experimentally, AOD-Net [23] is found to have lower average runtime than other dehazing networks [33]. Given the computational constraints of the system, AOD-Net is the ideal choice when compared to other works such as GridDehazenet [33], Gated Fusion Network [32], MSCNN [30], and Dehazenet [31] owing to its small network architecture.

Datasets used for evaluation 4.1.1. Parking lot datasets
For parking space occupancy classification, the proposed system used CNRPark [20], CNRPark-EXT [21] and PKLot [18] datasets. PKLot consists of around 700, 000 manually checked and labeled parking space images acquired from parking lots of Federal University of Parana (UFPR) and Pontifical Catholic University of Parana (PUCPR) located in Curitiba, Brazil. The dataset consists of images captured from different parking lots with distinct features and is divided into three subsets: UFPR04, UFPR05, and PUCPR corresponding to images captured by cameras at 4 th and 5 th floor of UFPR, and at 10 th floor of PUCPR respectively. With the cameras placed at the top of the buildings, the dataset contains fewer occluded images. The dataset also contains images under different weather conditions (Sunny, Overcast, Rainy) and various illuminations occasioned by weather conditions. The dataset contains both non-segmented full images of the parking lot and pre-segmented parking patches. The slope of pre-segmented parking space rectangle is rotated such that those with a slope between 0 • to 45 • were rotated to 0 • and those with a slope between 45 • to 90 • were rotated to 90 • . Details of the PKLot dataset are shown in Table 2.
The CNRPark (CNRPark A and CNRPark B) dataset consists of 12, 584 images segregated into two non overlapping subsets: CNRPark A (Images captured using camera A) consisting of 6, 171 images and CNRPark B (Images captured using camera B) consisting of 6, 413 images. The dataset includes patches captured under various light conditions. It also contains patches partially occluded by trees as well as shadowed by the neighbouring cars. This enables us to demonstrate the robustness of the classifier to changing real life conditions. Further, one can also test the robustness of the classifier to changing camera views by training on images captured from one camera and testing on images captured from different cameras. CNRPark A contains fewer occluded images than CNRPark B.
CNRPark dataset is extended to CNRPark-EXT in [21]. CNRPark-EXT consists of 144, 965 image patches captured from 9 different cameras. Those patches are captured under various weather conditions (Sunny, Overcast, Rainy) as well as at different distances from the camera. The dataset also contains patches partially occluded or shadowed, enabling to train the classifier on various difficult real-life scenarios. The dataset contains both  Table 2.

Single Image Dehazing datasets
For training the dehazing network, the proposed system used Outdoor Training Set (OTS) of Reside-β dataset [24]. OTS dataset consists 72, 135 synthetic outdoor hazy images synthesized from 2061 diverse non-hazy outdoor images 3 . Each non-hazy image was used to synthesize 35 synthetic hazy images by using different pairs of A and β of atmospheric scattering model described in equation 1. Values of A ∈ [0.8-1] with increment of 0.05 and β ∈ [0.04, 0.06, 0.08, 0.1, 0.12, 0.16, 0.2]. This captures various hazy conditions encountered in real life. The depth map for each image was estimated using the procedure outlined in [44]. To counter the errors during depth estimation, the final hazy images were visually inspected for any irregularities.

Hazy Parking System dataset
The proposed system creates a benchmark for the hazy parking system using Real-time Task-driven Test Set (RTTS) of RESIDE-β dataset [24]. RTTS consists of 4322 images extracted from the Web covering real world hazy traffic and driving scenarios. Each image is annotated with bounding boxes and object categories. Hazy car images and hazy unoccupied parking space patches are manually extracted to create the hazy parking system dataset. Optional non-overlapping training and test splits are provided for the sake of comparing classification results under hazy conditions. The dataset contains 752 unaugmented patches with 502 hazy car patches, and 250 hazy free patches. It is splited into non-overlapping 70% training and 30% test set. The test set contains roughly the same number of busy and free patches before augmentation. The images in the training and test set are then augmented using Keras 4 (a deep learning framework) image data pre-processing tool. The hazy car patches are randomly flipped horizontally and a crop of the image containing 90% of the total height and width is considered. Hazy unoccupied patches are also augmented in a similar setting where additionally the patches are randomly flipped in a vertical manner. The dataset consists of 5010 augmented labelled patches, and captures busy and unoccupied patches under various hazy conditions such as fog, snow and pollution with varying intensity levels from lightly hazed to heavily hazed patches. Details of the dataset is shown in Table 3. For demonstration purposes, we have shown some of the sample images of the proposed hazy parking system dataset in Figure 3. Out of 5010 images, 500 images (250 of training set and 250 of test set) of the hazy parking system dataset is made available publicly for download 5 .  [20] achieved state-of-the-art results using the mAlexnet CNN architecture. The mAlexnet network takes an input image of size 224 × 224. They trained mAlexnet on Caffe framework [45] using gradient descent with momentum. Momentum and weight decay were set to 0.9 and 5 × 10 −4 respectively. The learning rate was individually determined for each experiment and decreased by a factor of 10 after loss stabilization. All the models were trained for 30 epochs. Further in [21], mAlexnet's performance was proven to be comparable to that of Alexnet [36] on CNRPark [20] and CNRPark-EXT [21] datasets while being three times smaller in size. In [21], all the models were trained using gradient descent with momentum for 6 epochs, having an initial learning rate of 0.0008, which was multiplied by 0.75 after every 2 epochs. The batch size was set to 64, momentum to 0.9, and weight decay to 0.0005. In this work, the proposed system uses the mAlexnet architecture after doing certain modifications to it (shown in Table 1). Training and testing images are shuffled and resized to 224×224 pixels. The modified mAlexnet architecture is trained on Caffe framework using Adam optimization algorithm 6 with the following hyperparameters: β 1 = 0.9, β 2 = 0.999, and weight decay=5 × 10 −4 . The learning rate is fixed to 0.001 throughout the training process. The training procedure followed in this work is shown in Table 4. The proposed trained model is compared with the existing mAlexnet model of [20] and [21] using CNRPark, CNRPark-EXT and PKLot datasets (shown in Tables 5 and 6). For comparison, we trained the models on various subsets of CNRPark, CNRPark-EXT, PKLot datasets and are evaluated on non-overlapping test sets. Models shown in Tables 5 and 6 are trained for 10 epochs and 5 epochs respectively. All the models were trained on Ubuntu 18.04 virtual environment with 16 GB RAM running on Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz in CPU mode.
It can be observed from Tables 5 and 6 that the proposed model using modified mAlexnet

Dehazing network 4.3.1. Model description
For the dehazing network, the proposed model followed the AOD-Net [23] architecture. Instead of evaluating the dehazing networks on performance metrics such as peak signal-tonoise ratio (PSNR) and structural similarity index (SSIM), they are evaluated by their utility before the parking space classification takes place on hazy and non-hazy datasets. By using dehazing network before the classification process starts will improves the performance of the system on hazy images, but degrades the performance on non-hazy images. Alternative training methodologies for dehazing networks are explored to improve the performance of system on non-hazy images. For that purpose, we explore four different models, and the details are presented below: 1. Model 1 : AOD-Net trained on hazy images of OTS dataset followed by parking space classifier.
2. Model 2 : AOD-Net trained on both hazy and clear (non-hazy) images of OTS dataset followed by parking space classifier.
3. Model 3 : AOD-Net trained on both hazy and clear (non-hazy) images of OTS dataset using a modified loss function L 1 followed by parking space classifier. The modified loss function L 1 is given by: Table 6: Accuracy comparison of proposed model with the pretrained models of [21] Train set Test set Network Accuracy modified mAlexnet 93.92% CNRPark All CNRPark-EXT Test mAlexnet [21] 93.70% Alexnet [21] 93.38% modified mAlexnet 97.85% CNRPark+EXT TRAIN C1-C8 CNRPark-EXT Test mAlexnet [21] 96.44% Alexnet [21] 96.74% modified mAlexnet 98.51% CNRPark+EXT TRAIN CNRPark-EXT Test mAlexnet [21] 97.78% Alexnet [21] 97.98% modified mAlexnet 98.89% PKLot Train PKLot Test mAlexnet [21] 97.96% Alexnet [21] 98.76% Where L denotes the Mean Square Error (MSE) loss function between the output of the network and the ground truth of the image corresponding to the input. y = 1, when the input is a clear (non-hazy) image, and y = 0, when input is a hazy image. λ is a hyper-parameter whose value ranges from 0 to 1. λ can be used to tune the relative performance of the network on hazy or non-hazy images. For 0 ≤ λ < 0.5, the network is trained to perform better on hazy images. For 0.5 < λ ≤ 1, the network is trained to perform better on non-hazy images. This gives more flexibility than other three models to We then compare the performance of the above models with modified mAlexnet, mAlexnet [20], and Alexnet [21] trained on CNRPark-EXT train set. The combined dehazing network and classification process necessitates the output of AOD-Net, and input of the modified mAlexnet classifier to have same dimensions. The classifier developed in the section 4.2 takes the inputs of 224×224×3 images. Further, as the input and output of AOD-Net have same dimensions, the training and testing images are cropped to 224 × 224.

Model Training
AOD-Net is trained using gradient descent with momentum having the following hyperparameters: momentum = 0.9 and weight decay = 0.0001. For non-hazy images, Mean Square Error (MSE) between the output of the network and the ground truth of the image is used as the loss function. For clear (non-hazy) images, the output of the dehazing network is compared with the input for loss calculation. The number of clear (non-hazy) images used during the training phase is kept low compared to that of hazy images to prevent the Nvidia GPU production on Ubuntu' AMI. The training procedure followed is summarized in Table 7.
It is found that joint tuning of pretrained AOD-Net and modified mAlexnet as a unified pipeline improves the classification performance of the system under hazy conditions. All the trained AOD-Net models are concatenated with modified mAlexnet and are jointly tuned as a single network on hazy parking system training set. The training is performed on Caffe framework using gradient descent with momentum having the following hyperparameters: momentum = 0.9 and weight decay = 0.0001. The model is trained with a fixed learning rate of 0.0001 for 5 epochs, and the gradients are constrained between [−0.1, 0.1] to stabilise the training.

Discussion on Empirical Results
All the models are evaluated using hazy parking system test set (Table 3) and CNRPark-EXT test set (Table 2) to test the model's performance under both hazy and non-hazy conditions, respectively. The accuracies of the four models on these datasets are displayed in Table 8. The proposed modified mAlexnet model performs extremely well under non-hazy conditions achieving 98.51% accuracy on CNRPark-EXT test set. However, it performs poorly under hazy conditions achieving 74.41% accuracy on hazy parking system test set. Similarly mAlexnet [20] and Alexnet [21] achieves 97.76% and 97.98% on CNRPark-EXT test set while achieving 76.27% and 80.37% on hazy parking test set respectively. In comparison, the proposed AOD-Net+mAlexnet model achieved significant gains of over 10-15% accuracy on hazy parking system test set with a marginal decrease in accuracy of 1-3% on CNRPark-EXT test set.
Model 2 achieves higher accuracy than Model 1 on CNRPark-EXT test set, while achiev-  [20] 76.27% 97.76% Alexnet [21] 80.37% 97.98% ing lower accuracy on hazy parking test set. However, after joint optimization, Model 1 achieves higher accuracy than Model 2 on hazy parking system test set. Both these observations can be attributed to the fact that AOD-Net in Model 2 was trained on both hazy and clear (non-hazy) images, thereby enhancing system's performance under non-hazy conditions while degrading system's performance under hazy conditions. In the case of Model 3, λ is a hyperparameter that can be used to tune the relative performance of the network on hazy and non-hazy images. In accordance with equation 6, it is found that models trained with λ = 0.1916 and λ = 0.4291 achieve lower accuracy than models trained with λ = 0.6555 and λ = 0.8984 on CNRPark-EXT test set. Models trained with λ = 0.1916 and λ = 0.4291 achieve higher accuracy than the model trained with λ = 0.8984 on hazy parking test set and slightly lower accuracy than model trained with λ = 0.6555. Further, model 3 trained with λ = 0.6555 outperforms Model 1 and Model 2 under both hazy and non-hazy conditions. Joint optimization is found to improve the system's performance on hazy images in almost all of the cases, while it is found to degrade the system's accuracy under non-hazy conditions in all the cases. However, in some cases (Model 1, Model 3 λ = 0.1916, 0.4291, 0.8984), joint optimization is found to be beneficial as it is found to increase the accuracy on hazy parking test set by 1.5% with around 0.5% decrease in accuracy on CNRPark-EXT test set. Model 3 (λ = 0.4291) after joint optimization achieves the highest accuracy of 88.63% on hazy parking system test set. Apart from Model 4, Model 3 (λ = 0.8984) achieves the highest accuracy of 97.57% on CNRPark-EXT test set. This can be attributed to λ value used for training the dehazing network being closer to 1. Model 3 with λ = 0.8984 achieves around 10% gain on hazy parking system test set with only 1% decrease in accuracy on CNRPark-EXT test set. Model 3 with λ = 0.6555 after joint optimization achieving over 12% accuracy gain on hazy parking test set, and is particularly useful when the target application requires the system to be robust against the presence of haze in the image.

Runtime analysis
We compare the average runtimes of AOD-Net [23] with other state-of-the-art dehazing networks such as MSCNN [30] Dehazenet [31], GridDehazenet [33] and GFN [32]. Table 9 [33] shows the average runtimes of these models. AOD-Net is atleast 2.5 times faster than the other state-of-the-art dehazing networks.   Table 10 compares the average runtime of the proposed AOD-Net and mAlexnet pipeline with modified mAlexnet, Alexnet [21],mAlexnet [20]. We randomly select 1000 random 224× 224 images from each CNRPark-EXT test set and PKLot test set and 200 random 224 × 224 images from hazy parking system test set to run for each model on the same machine without GPU acceleration. The model runtime is tested using Caffe framework.
Modified mAlexnet and the existing mAlexnet with its compact nature are 20 times faster than Alexnet while achieving similar accuracies on parking space classification, making it an ideal choice for real time applications. With the use of dehazing network, the average runtime of the proposed architecture is significantly higher than mAlexnet architecture. However, the proposed pipeline of AOD-Net and mAlexnet in series is at least 2 times faster than Alexnet and other state-of-the-art dehazing networks. The runtime analysis is performed on Ubuntu 18.04 virtual environment with 16 GB RAM running on Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz.

Conclusion
This paper proposed a parking space occupancy detection model that is robust to hazy conditions. The system pipeline consists of two parts: A dehazing network followed by the parking space classification process using CNN. The system is evaluated on both hazy and non-hazy images. Modified mAlexnet architecture is trained to classify parking space occupancy and is compared against other state-of-the-art architectures. With modification in existing mAlexnet's architecture and the training methodology, higher classification accuracies are achieved on CNRPark and CNRPark-EXT datasets.
For the dehazing network, we trained AOD-Net, an end-to-end dehazing network on OTS dataset, and evaluated its performance by its utility before the classification. We studied the use of clear (non-hazy) images for training the dehazing network and joint optimization of dehazing network. Further, the trade-off between model's performance on hazy and nonhazy images is addressed, and a new loss function L 1 is introduced. We incorporated a hyperparameter λ, which can be used to tune the relative performance of the model on hazy and non-hazy images. This enables us to tune the proposed system according to target requirements.
To validate our approaches on hazy images, we have created a new hazy parking system dataset consisting of hazy and unoccupied parking patches extracted from RTTS subset of Reside-β dataset. CNRPark-EXT is used to evaluate the model's performance on nonhazy images. Experimental results show that the proposed approach achieved significant gains over the parking space classification system on hazy images. However, with the use of dehazing network, the average runtime of the proposed pipeline significantly greater than that of mAlexnet architecture.
This work can be extended by using quantization techniques, which will reduce the runtime of the proposed system. Further, the parameter λ used in the training of dehazing networks can be extensively tuned for better performance.

Conflicts of interest
No potential conflict of interest was reported by the authors.