# Sustainable Parking Space Management Using Machine Learning and Swarm Theory--The SPARK System
## 4 Results
The obtained results, encompassing effective detection of vehicles and parking spaces while maintaining high accuracy and near-real-time processing, are particularly significant in the context of rapidly advancing urbanization and the growing need for efficient management of municipal resources. In relation to solutions based on artificial intelligence and machine learning [83; 84], the proposed approach presents an attractive alternative to traditional systems founded on fixed markings and constrained vehicle orientation rules [85; 86]. This flexibility is achieved through an image segmentation methodology employing cameras positioned at elevated vantage points (e.g., atop high-rise buildings), thereby affording a comprehensive field of view and expeditious detection of both occupied and unoccupied parking areas. The YOLOv9 semantic segmentation framework facilitates the precise identification of available and occupied regions. Subsequently, the ABC optimization algorithm ensures the maximal utilization of these polygonal spaces by optimally fitting rectangular representations of vehicles. A key advantage of this approach lies in its ability to position these rectangles at arbitrary angles, thus enhancing adaptability to heterogeneous urban environments where formalized parking guidelines are limited or altogether absent. A salient consideration is the computational complexity of the proposed solution. YOLOv9-based segmentation can be optimized for near-real-time performance. On the employed hardware configuration (featuring an NVIDIA RTX 3090 GPU with 24 GB of memory), the mean segmentation time per image was approximately 0.62 s. Although ABC-based optimization is computationally more demanding, its performance can be \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Detection Method** & **Metric** & **Range** & **Mean** & **Standard Deviation** \\ \hline \multirow{3}{*}{YOLO9 eseg (car)} & Precision *1 & (0.923, 1.000) & 0.928 & 0.016 \\  & Recall & (0.667, 1.000) & 0.884 & 0.064 \\  & Accuracy & (0.632, 1.000) & 0.895 & 0.069 \\ \hline \multirow{3}{*}{SPARK (Parking Spot)} & Precision *2 & (0.667, 1.000) & 0.891 & 0.053 \\  & Recall *3 & (0.000, 1.000) & 0.883 & 0.122 \\ \cline{1-1}  & Accuracy & (0.000, 1.000) & 0.873 & 0.133 \\ \hline \hline \end{tabular}
1 Precision = 1 consistently when there are no false positives; 2 Precision = 1 when all detected spots were correct with no false positives; 3 Recall = 0 when there were 4 manual parking spots but no automated spots.  
\end{table} 
Table 1: Summary of average performance metrics for YOLOv9e Seg car detection and SPARK parking spot detection, calculated for 120 pairs of test images (Source: Author’s own elaboration). significantly improved through heuristic strategies, search space reduction methods, and parallelized implementations [87]. In the tested non-optimized Python environment (without parallel computing), the processing of polygons obtained from the segmentation phase for a single image required an average of 0.44 s. Overall, managing a single image within the proposed framework required less than 1.3 s. Comparable challenges relating to scalability and computational efficiency have been documented in other research, including the modeling and forecasting of transport flows and the utilization of extensive urban datasets [83; 84], underscoring the universality of these issues. The presented system, currently in its developmental stage and early implementation phase, has achieved accuracy comparable to other global solutions while maintaining near-real-time performance on mid-range home PC hardware. This level of accuracy offers a promising outlook for the system's development, providing a solid foundation for creating a cost-effective and efficient solution that can be successfully replicated to manage parking spaces within the communities of large urban agglomerations.