Automatic Vehicle Parking Availability System for Indoor Environments

Finding parking spaces is a time-consuming and fuel-wasting task, especially in crowded areas. To address this issue, researchers have proposed an automatic parking detection system using deep learning-based cameras in outdoor parking lots with sufficient lighting. However, the development of parking detection systems for indoor areas with low lighting has not yet been extensively researched. This paper proposed an automatic vehicle parking availability system for an indoor environment using an object detection algorithm and clustering methods. The proposed method was tested with parking spots on the ground floor of the Faculty of Science building on the at Kasetsart University Sriracha campus, Thailand. Six models that combined three object detection algorithms with two clustering methods were tested for performance evaluation. The results showed that the model combining YOLOV4 and OPTICS achieved the highest detection accuracy for occupied parking slots of about 95 percent.


INTRODUCTION
In a situation where oil prices remain high, vehicle users must try to find ways to maximize fuel efficiency.A vehicle is not only a means of transportation from one place to another as there is the associated issue of the driver finding a vacant parking space at their destination.In such cases, it will take longer to find a parking spot without prior knowledge of its availability.Furthermore, driving around in search of a parking space can be considered as wasteful in terms of fuel consumption.Due to these problems, a system that can detect available parking spaces could provide a solution that offers information in advance to the driver before reaching the parking area.Other research identified two categories of devices to detect vehicles in parking areas.First, the researchers proposed parking detection methods using image processing from high-angle cameras [10].After capturing the locations of vehicles in the parking area, several researchers used machine learning and deep learning [3][4][5]7] algorithms to guide the vehicles to vacant parking slots.The performance level of these methods was high; however, their efficiency depended on the lightening conditions [2] and different camera views [7].Another group of researchers proposed methods combining IoT sensors and a wireless network to detect parking slots [1,13,14].A major weakness of these methods is their detection error due to the sensor not classifying objects correctly [9].
The Faculty of Science on the Kasetsart University Sriracha campus, Thailand is facing a shortage of parking spaces for its staff.It is often the case that on arrival, a driver encounters a full parking area and must then spend time driving around to find alternative parking outside.A case study was developed to solve the problem and help staff based on parking spaces within the building of the Faculty of Science at Sriracha.Due to height limitations that prevented installing cameras at high viewing angles, we opted to use rear-facing camera placement as an alternative.
In this paper, we propose an automatic vehicle parking availability system (AVPA) for counting the number of occupied and vacant parking slots and showing parking information on web site.The AVPA system combines object detection and clustering algorithms to process data based on the rear views of parked vehicles in videos from mobile phones.The approach is expected to provide high accuracy in counting parked vehicles in indoor parking areas with low ceilings.

RELATED WORK
Several recent research studies regarding parking availability methods have analyzed videos from cameras with machine learning and/or deep learning techniques.The first research utilized deep convolutional neural networks (CNN) to classify parking space images captured by smart cameras as either vacant or occupied [6].The accuracy of this method was compared to other techniques, including mAlexNet (a well-known CNN architectures for parking space classification), local phase quantization with uniform initialization, local phase quantization with Gaussian initialization, and Mean Ensemble.The evaluation was performed on two datasets-PKLot (a standard test dataset) and CNRPark-EXT (a dataset specifically created for this research).The results showed that the deep CNN approach achieved an accuracy improvement of more than 3% compared to the other methods.However, notably, their study faced limitations concerning low light conditions.
A second research group used R-CNN, a region-based CNN model, to detect parking space vacancies by identifying cars in images captured by cameras.A Faster R-CNN model was built using the ResNet-50 backbone network [7], a popular architecture known for its strong feature extraction capabilities, which achieved a higher area under the curve than the other compared methods.Another new object detection method was used to estimate and identify parking spaces in a parking lot with 1,000 spaces based on the fundamental principles of R-CNN [8].Their proposed approach applied the Intersection over Union (IOU) Ratio to calculate the parking spaces that were occupied and vacant at different time intervals.The experimental results produced an accuracy of detecting parking spaces of up to 80%.A third group of researchers applied the Faster R-CNN parking detection model to analyze panoramic view images of a parking area [6].The performance of that model using 101-Floor ResNet as the feature extraction network was better than that of model using 50-Floor ResNet.
Another proposed method adjusted the hyperparameter tuning and stochastic gradient descent optimization of R-CNN to classify images obtained from smart cameras [10].The proposed model used the Alexnet and mAlexnet methods to analyze the images and find available parking spaces.After adjustment of the as presented, the results showed that accuracy values improved by 15% compared to before the parameter tuning.These results were displayed as graphical images on the website, showing the availability of parking spaces.
A proposed approach used YOLO (You Only Look Once) v5 algorithm to detect vacant parking spaces and to calculate the Intersection over Union (IOU) Ratio to determine the occupied and vacant parking spaces in each time interval [11].When the proposed model was tested with the PKLot dataset, it achieved an impressive accuracy of 99.5%.
Finally, most of the recent research papers have focused on proposing new methods that achieved high performance when tested with the standard dataset (PKLot).The PKLot dataset contains 12,416 images of outdoor parking lots extracted from surveillance camera frames in different weather conditions.Consequently, those proposed methods are more suitable for outdoor parking lots.

AUTOMATIC VEHICLE PARKING AVAILABILITY SYSTEM
The current research presents a method for automatically counting the numbers of parked vehicles and available parking spaces (AVPA).
Figure 1 shows a sample parking area under a low ceiling on the ground floor of Faculty of Science on the Sriracha campus.There are nine parking slots in the low-light indoor area.In Figure 2, the AVPA system uses three kinds of equipment for data processing.First, three standard mobile phones capture rear views of vehicles in the parking area.Figure 3 shows captured shots from videos captured using three mobile cameras attached in different areas.Second, the database server is used to store data and images.Lastly, the web server acts as a host to show parking information via a web page.Algorithmn 1 of the APLC system consists of six functions.First, the RecordVideo function involves capturing the rear view of each vehicle in the parking spaces using OpenCV techniques.The result from OpenCV is a video that has eight frames.Second, the object detection model detects and collects parked vehicle frames using the ObjectDetection function.Third, the CreateDataset function creates a data table that contains six columns related to the size of frames and the dominant color.Fourth, FrameCluster involves grouping the detected vehicle images into clusters, where each cluster represents a single vehicle.Fifth, GetSampleFromCluster collects the number of detected vehicles, the sample images of each group representing individual vehicles, and recording timestamp.Next, the system stores these data in the database using the StoreData function.Finally, the system presents sample images of the vehicles and displays the numbers of occupied parking spaces, as well as the number of available parking spaces to the users through a web page.
Figure 4 shows the web interface from the web server.Three numbers regarding parking lots are presented on the web page: the number of parking lots, the number of occupied lots, and the number of available lots.Additionally, the web page shows a rear view of the parked vehicles in each lot.Faculty staff can check the number of available lots before driving through this parking area.If  .(4) 13: end while all parking lots are occupied, the staff will have to search elsewhere for a parking spot.

EXPERIMENTS
We experimented with six different models that combined three object detection algorithms with two clustering methods (Table 1).We used three pre-trained object detection algorithms: YOLO4, YOLOV4-tiny, and MobilenetV2 from the Intel OpenVINO models library.The ordering points to identify the clustering structure (OPTICS) and MeanShift clustering methods were used to cluster vehicles frames from object detection models.The OPTICS is a density-based clustering algorithm closely related to DBSCAN.The OPTICS method finds a core sample of high density and expands clusters from them using the cluster hierarchy for neighborhood radius.Meanshift clustering is another density-based clustering method to find groups of smooth density data using centroids.The Meanshift updates candidates for centroids to be the mean of the points within a given region.Any near-duplicate centroids are removed from the set of centroids.Both methods are selected for clustering data because they do not require specifying the number of clusters in advance.In the current experiment, the compared methods were tested with 12 videos of mobile cameras that were recorded in four periods over three days at 1000, 1300, 1500, and

Dataset
After the object detection algorithm had created all the vehicle frames from videos of the mobile cameras, the AVPA system created a dataset containing six columns, as shown in Table 2.The size and color dominance of the frame were used as features of the dataset.The clustering method used this dataset to group vehicle frames into clusters.The size of the dataset in each period depends on the number of vehicles in the parking lot.

Performance Measures
We used three measures to describe the performance of AVPA.The first two were measured in terms of the sum of absolute error (SAE) and the mean of absolute error (MAE).The SAE is the sum of the uncorrected occupied lots, whereas the MAE is a measure of the average uncorrected occupied lots.Calculation of SAE and MAE was carried out using ( 1) and ( 2), respectively, where the method with lowest SAE and MAE values had the highest detecting performance.
where   is the number of actual vehicles and ŷ is the number of detected vehicles compared by method.Additionally, we also evaluate the clustering performance of all compared methods based on the accuracy rate (AR), as shown in (3): where (  ) is the number of detected vehicles that are correctly clustered for the cluster  and  is the total number of data points.The larger AR value of the clustering method, the better the clustering performance [12].

RESULTS AND DISCUSSION
Table 3 shows the number of detected vehicles based on the six methods compared with the actual number of vehicles (68).The number of vehicles detected using the YOLOOPTICS method was nearly equal to the number of vehicles parked in actual parking spaces, while the other methods used for comparison had large differences in the number of vehicles detected compared to the number of vehicles parked in actual parking spaces.Figures 5 (a) and (b) show that the YOLOOPTICS method achieved the lowest SAE and MAE, whereas there were only small differences among these values for MobileOPTICS, YOLOTinyMeanShift, and Mobile-MeanShift.Table 4 shows the total number of correctly and incorrectly detected vehicles compared by method.Figure 6 shows that YOLOOP-TICS achieved the highest AR value.The YOLOOPTICS, MobileOP-TICS, and YOLOTinyOPTICS methods were the top-three highest

CONCLUSION
This paper presented an automatic vehicle parking availability system for an indoor environment using an object detecting algorithm and clustering methods.The test location was on the ground floor of the car park for the Faculty of Science building.Rear views of vehicles in the parking area were captured in short videos using three mobile phones.The videos were sent to a computer via a Wi-Fi connection.Then, the software on the computer detected frames of the videos and clustering groups of parked vehicles.Six models were investigated, combining three object detection algorithms (YOLOV4, YOLOV4-tiny, and MobilenetV2) with two clustering methods (OP-TICS and MeanShift).The results showed that YOLOV4 outperformed the YOLOV4-tiny and MobilenetV2 models.Additionally, the OPTICS method clustered the group of vehicle frames better than the Meanshift method.Accordingly, YOLOOPTICS achieved the highest accuracy of detection for occupied parking slots.The YOLOOPTICS method was chosen as the final model for calculating the number of parked vehicles.Via a web page on the web server, users were provided with sample images of the vehicles and the number of occupied parking spaces, as well as the number of available parking spaces.
The AVPA system is limited with a large number of mobile phones because mobile camera phones capture only three rear views of vehicles.Due to the limitation in camera coverage, the AVPA could enhance its capabilities by changing the positions of mobile cameras to capture top views of more vehicles.Furthermore, having fewer videos from smaller-sized cameras can improve the detection speed of the AVPA system.

Figure 3 :
Figure 3: Captured images from (a) left camera, (b) middle camera, and (c) right camera.

Figure 4 :
Figure 4: Web parking lot information: Number of total slots (left), Number of occupied slots (center), and Number of available slots (right), and vehicle rear images.

Figure 5 :
Figure 5: (a) SAE and (b) MAE for all compared methods.

Figure 6 :
Figure 6: Comparison of AR for all methods.

Table 1 :
List of compared models.

Table 2 :
Summary of dataset for clustering.

Table 3 :
Comparison of vehicle detection methods.

Table 4 :
Total number of correctly and incorrectly detected vehicles compared by method.
the clustering algorithm.YOLOMeanshift had the lowest AR values, while the highest number of frames was provided by YOLO.These results indicated that the Meanshift clustering algorithm tended to produce larger cluster sizes than the OPTICS method.