Project MetaPKLot
Machine Learning Applied in Smart Cities
This project aims to propose new techniques that leverage the use of cameras to enhance automated traffic management in smart cities through machine learning. It addresses issues such as the automatic detection of parking spaces, the identification of congested areas with vehicles, and the generation of relevant information, such as the usage time of specific road infrastructures in urban areas.
The solutions developed in this project could, for example, assist drivers in finding the nearest available parking space, saving time and fuel. Additionally, these solutions open up the possibility of creating new business opportunities, such as automated billing based on the duration a vehicle occupies a specific parking space.
Main Technologies
Deep Learning, Instance Segmentation, Image Processing, and IoT Devices.
Project Team

Alceu de Souza Britto Jr.
PUCPR

Andre Hochul
PUCPR

Eduardo Cunha de Almeida
UFPR

Luiz Eduardo S. de Oliveira
UFPR

Paulo R. Lisboa de Almeida
UFPR

Bruno Aquiles
UFPR

Luan Kujavski
UFPR

Marcelo Ribas
UFPR

Heloísa Mendes
UFPR

Paulo Mateus Luza
UFPR

Nadia Luana Lobkov
UFPR

Thamiris Yamate Fischer
UFPR

Pietro Comin
UFPR
Current Results
Automated mapping of parking area layout
Our method, as presented at IEEE SMC 2023, has the capability to automatically identify parking areas using cameras, entirely without human intervention. This allows us to map and subsequently monitor these regions within smart cities with minimal effort.
The core innovation of this work is the method named GraphSpot. Unlike traditional approaches that look for painted lines on the ground, our technique uses an instance segmentation network to detect vehicles and generate an occurrence-based ‘Heat Map’. The system is capable of learning the entire parking lot layout by observing just a single day of operation, identifying areas where vehicles frequently park and automatically drawing parking space boundaries. Tests showed an accuracy of up to 95.6% (AP25), proving effective even in parking lots without visible markings or with irregular occupancy.
In the video below, you can observe the system in action, employing a fusion of instance segmentation networks and image processing to automatically process images from a typical workday. This process enables a comprehensive understanding of the area’s layout.
Defining the Best Strategy: Deep Single Models vs. Ensembles
One of the fundamental challenges in creating scalable monitoring systems is generalization capability: the system must work immediately in a new parking lot without needing retraining with local data (cross-dataset scenario). The goal is to enable “plug-and-play” (ready-to-use) solutions that can be installed on new cameras and start operating without the burdensome task of manual data annotation and specific retraining for each new location.
In this research, presented at ICMLA 2023, we investigated whether the best strategy for this problem would be the use of Ensembles (sets of multiple models making decisions as a group) or robust Single Models.
The results were surprising and defined the laboratory’s subsequent research direction:
- Diversity is Key: Training data diversity (such as found in the PKLot dataset) proved more important than model architecture complexity.
- Efficiency: Contrary to the intuition that “more models are better”, a Single Model (MobileNetV3) outperformed Ensemble strategies, achieving an average accuracy of 95.5% in unknown scenarios.
This discovery allowed us to focus efforts on optimizing lightweight, single models for edge devices, forming the basis for our knowledge distillation work.
Optimizing Parking Space Classification: Distilling Ensembles
This research explores solutions to optimize image classification in smart city applications, such as parking space monitoring. Sending large volumes of data to central servers represents a critical challenge for urban infrastructure: it is estimated that a network with 1,000 cameras can generate traffic of about 35 gigabytes of data per hour, requiring complex and expensive network equipment. To mitigate this bottleneck, the solution is to process data at the edge, sending only lightweight information to the server.
To address this issue, researchers proposed a Teacher-Student model, where Teacher models (more complex) generate pseudo-labels to train Student models (lighter), which can be deployed directly on edge devices.
Results show that Student models, despite having 26 times fewer parameters, outperformed Teacher models, achieving 96.6% accuracy, making this approach more efficient and scalable for smart cities.
One of the authors of the article titled “Optimizing Parking Space Classification: Distilling Ensembles into Lightweight Classifiers”, published at ICMLA (IEEE 2024), shared insights about their work in a video on the Bit Por Bit channel. Learn more through the link below.
Using Deep Neural Networks to Quantify Parking Dwell Time
This study proposes an innovative method to calculate the dwell time of vehicles in parking spaces, using two deep neural networks. The challenge here goes beyond detecting occupancy: it is necessary to perform vehicle re-identification, ensuring the system knows that the car seen now is the same one from hours ago, despite changes in lighting, shadows, or rain. The first network classifies whether a parking space is occupied or empty, while the second, a Siamese network, verifies if the parked car is the same in consecutive images.
The results showed that, with a perfect classifier, the system achieved 75% accurate predictions, where the estimated time matched the actual dwell time exactly. However, when using a real classifier, the accuracy dropped to 49%, demonstrating that the quality of the initial classifier significantly impacts the performance of the Siamese network. The mean absolute error (MAE) was 46 minutes for PKLot and 54 minutes for CNRPark-EXT.
The research concludes that the Siamese network is promising for tracking vehicles over time, but its effectiveness depends on the accuracy of the classifier. Improvements in the classifier and the training of the Siamese network could enhance the system’s accuracy, making it viable for applications in smart cities, such as detecting abandoned cars or illegal parking.
The article titled “Using Deep Neural Networks to Quantify Parking Dwell Time“ has been accepted at ICMLA (IEEE 2024).
Regularization in Neural Networks with Data Resampling for Intelligent Urban Monitoring
This study proposes a new regularization method for neural networks, aimed at smart city applications such as parking space management. The technique consists of using smaller subsets of the dataset over more training epochs, applying dynamic resampling throughout the process. This strategy seeks to reduce overfitting and improve the model’s generalization.
Four experiments were conducted using the MobileNetV3-Small architecture with the PKLot and CNRPark-EXT datasets. The method allowed for a reduction of up to 97% in the number of images per epoch, while maintaining an average accuracy close to 89%.
The results indicate that a greater diversity and volume of data, as in PKLot, improves robustness and reduces overfitting, whereas smaller datasets such as CNRPark-EXT tend to be more susceptible to it. Nevertheless, dynamic resampling showed potential to increase both efficiency and generalization in computationally constrained scenarios.
The study concludes that the proposed regularization method is promising for computer vision applications in urban environments.
The article titled “Regularização em Redes Neurais com Reamostragem de Dados para Monitoramento Urbano Inteligente” was published in the Anais do Computer on the Beach 2025
Proposal of Lightweight Models for Parking Space Classification in Smart Cities
Considering the context of smart cities, especially the problem of classifying parking spaces as empty or occupied, the article addresses the need to develop lightweight and efficient models capable of handling the large volume of data generated by urban monitoring systems.
The study suggested and investigated modifications to the Hochuli network, evaluating its performance on the PKLot and CNRPark-EXT datasets, with the goal of reducing model complexity without significantly compromising accuracy. The research proposed two new convolutional neural network architectures: CustomNNSmall and CustomNNLarge, which reduced the number of parameters by up to 88 times and 34 times, respectively, compared to MobileNetV3-Large.
The results showed that, even with this drastic reduction in parameters, the new architectures achieved only about 2% less average accuracy compared to MobileNet. In the case of CustomNNSmall, the parameter reduction reached 88 times, with a loss of only 1.8% accuracy. Meanwhile, CustomNNLarge achieved even more consistent results, with high stability and an average accuracy of 95.9%, making it a promising alternative for edge device applications.
The study concludes that it is possible to significantly reduce computational cost while maintaining high performance, making the proposed networks especially suitable for embedded systems and large-scale urban monitoring.
The article titled “Proposta de Modelos Leves para Classificação de Vagas de Estacionamentos em Cidades Inteligentes“ was published in the Anais do Computer on the Beach
Investigating the Differentiation Issues of ReLU in Deep Learning Model Training
In this research, we investigate how non-differentiability points in activation functions, particularly ReLU, affect the training of neural networks. To conduct this analysis, the study compares the behavior of the Hochuli network and its variations with MobileNetV3 when using non-differentiable functions, such as ReLU, Hardsigmoid, and Hardswish, as well as differentiable alternatives like GELU, Sigmoid, and Swish.
The study shows that the ratio between the number of occurrences of ReLU’s non-differentiability point and the total number of activation function calls is mainly influenced by the depth of the network, deeper models exhibit a lower incidence of evaluations at non-differentiable points. Additionally, differentiable functions offer slightly earlier convergence, while non-differentiable functions present a small advantage in inference speed. The results reinforce that the practical choice between ReLU and differentiable alternatives may be guided more by computational efficiency than by theoretical differentiability limitations.
The article titled “Diferenciando o Não Diferenciável: Investigando os problemas na diferenciação da ReLU no treinamento de modelos de Aprendizado Profundo” was published in the Anais do Computer on the Beach 2025
Undergraduate Final Papers:
In this project, several undergraduate projects were developed, along with master’s dissertations that are currently in progress. The generated works include the following:
Luza Alves, Paulo M. Otimizando a Classificação de Vagas de Estacionamento: Destilando Conjuntos em Modelos Leves. 2024. Link
Eckermann Cardoso, Erick. Impacto de Imagens Sintéticas na Classificação de Vagas de Estacionamento Usando Redes Neurais.Link
