## 3 Proposed TSR Methodology
### Traffic Sign Classification (TSC) Step
#### 3.2.2 TSC Models and Architectures  
Two distinct TSC architectures are built: one does not involve any attention mechanisms, while the other does. The developed CNN model without an attention mechanism consists of two sets of convolutional layers (two per set), followed by two fully connected layers, as shown in Figure 9. Max pooling was applied after each set of convolutional layers to avoid overfitting. The model uses a rectified linear activation function (ReLU) at each step. The last layer gives the SoftMax probabilities for each of the 43 road sign classes. In addition, the process of finding the optimal parameters for traffic sign classification on the GTSRB dataset requires careful experimentation and testing. According to our research, some hyperparameters are fixed, like the learning rate (0.001), batch size (50), number of epochs (70), and the optimizer (Adam). 1. Attention mechanism  
Attention mechanism is a technique that mimics natural cognitive attention. It has been applied to a very wide range of applications, such as speech recognition [45], machine translation [46], text summarisation [47], and image description [46]. The effect of this mechanism is to enhance some parts of the input data while decreasing the impact of other parts, focusing more on this small but important part of the data. This mechanism is characterised by its flexibility, which comes from its role as \"soft weights\" that can change  
Figure 8: Distribution of road sign images per class. Figure 9: TSC model architecture without attention mechanism (TSC-M). during execution, unlike standard weights that must remain fixed at execution time, which helps to save processing resources when faced with complex data to analyse in an image. In our case, the goal of the attention module is to learn which part of the image is most important to focus on. Inspired by the visual attention mechanism, a visual selective attention model is designed to simulate the visual perception process of human beings in order to model the distribution of human attention during the observation of images as well as videos and to extend its applications, which is indeed a considerable contribution to the improvement of traffic sign type image processing. This was achieved by transposing the input and feeding it into a dense layer called a SoftMax, which estimates weight distributions that are then combined with the input sequence as shown in Figure 10 and the algorithm below (Algorithm 1):  
```
Input: timestamp, features Output: weighted output sequence For each t \(\in\) timestamp, f \(\in\) features  Input (t, f)  Dense layer (t, f)  Multiplication (Input (t, f), Dense layer (t, f)) End For
```  
**Algorithm 1** Attention (timestamp, features)  
Google colaboratory was used for training and testing the two developed models on the GTSRB dataset. This cloud service provides nearly 12 GB of RAM, which can be extended to 25 GB with GPU support. The CNN models are implemented using Keras (version 2.8.0) and TensorFlow (version 2.8.0) as a backend. The number of images used in the training step is increased by using the data augmentation process, which generates images with various sets of disturbances like rotation, shift, shear, and zoom to improve performance and the ability of the model to generalise, but it does not resolve the problem of the unbalanced dataset. Images are then resized to 32 * 32 with one channel so that they can be fed to the TSC model. The TSC_M is trained for 30, 70, and 100 epochs and the TSC_MA for 30 and 70 epochs on the GTSRB dataset. Then we test and evaluate them on a variety of testing sets using the Adam optimizer with a minibatch size of 50 and a learning rate of 0.001. There are a total of 906,763 parameters that are all formable;  
2.