## 1 Introduction  
Bouskoura is a Moroccan city located approximately twenty kilometers south of the economic capital, Casablanca. Recently, the city has experienced a significant increase in population, resulting in a rise in road traffic as many individuals commute to and from Casablanca for work. This has led to direct congestion, particularly at intersections, resulting in increased travel time, vehicle blockages, and heightened fuel consumption. Congestion can cause driver stress and frustration [1], which can significantly impact individuals' performance and efficiency, lowering economic productivity and reducing the quality of life. Therefore, it is crucial to develop a traffic-management strategy that improves the design of existing roads [2]. Deep learning is a rapidly growing subfield of artificial intelligence that has shown a remarkable ability to learn from vast amounts of data and can solve complex problems with high accuracy [3, 4]. However, this often requires access to powerful computing resources and significant data storage, making it challenging to deploy deep-learning algorithms in resource-limited environments [5, 6]. To address this challenge, our study proposes a solution that leverages deep-learning techniques to analyze the traffic data collected by our smart camera and to make informed decisions on which road lanes to expand or extend. By designing our solution with consideration for resource constraints, we can demonstrate the feasibility of deploying deep learning in real-world applications with limited resources. Deep learning has already shown great potential for improving traffic management and our solution provides a promising avenue for addressing traffic congestion challenges in urban environments. In this paper, we present an efficient system that leverages modern image processing and artificial-intelligence technologies to support decision-making regarding which road lanes to extend or expand. Our system uses a smart camera equipped with an Nvidia Jetson Nano card to gather statistics. The camera records the number of vehicles by category at each intersection lane daily and calculates the precise count of vehicles moving from a certain entrance to a certain exit. All processing is carried out on the card, and the resulting statistics are then transmitted via the standard IoT messaging protocol MQTT [7] for further analysis and decision support. Our initial task was to create an application that could enable us to gather a substantial dataset to construct our detection and classification model. For data collection, we utilized an Allwinner A133 embedded card with a Linux system. The card was programmed to capture video sequences from an IP camera installed at the same intersection. The data were then stored in an external memory card and transmitted to a server via FTP with a secondary program. We used these videos to create a dataset of 13,000 images. For object detection, we employed YOLOv7 (you only look once, version 7), which is currently the most reliable and easily deployable model available [8]; it was selected based on these qualities, as well as its compatibility with the Nvidia Jetson Nano card. The images were manually labeled into four classes: cars, trucks, motorcycles, and buses. Manual labeling was essential to ensure the accuracy and precision of the labeled data, resulting in a higher-quality classification model. By manually labeling the images, we were able to carefully inspect and classify each object in the images, reducing the likelihood of errors or misclassifications. Our model of vehicle detection and classification was trained using 7000 images for training, 4000 for validation, and 2000 for testing. We evaluated the performance of our trained model using several measures, including a mean average precision (mAP) at a threshold of 0.5 of 91%, a recall of 84.1%, and a precision of 87.2%. After detection and recognition, we utilized the Deep SORT algorithm for vehicle tracking.