# Recognition of Traffic Sign Based on Bag-of-Words and Artificial Neural Network
## 3 Research Methodology
### Traffic Sign Recognition Phase
#### 3.3.1 Feature Extraction  
The process of feature extraction and selection obtain useful parts of an image to represent it in a compact feature vector [45]. For extracting useful features from a detected traffic sign, BoW was employed. The BoW uses SURF and \(k\)-means clustering to obtain the most discriminative features of an image. In the computer vision, SURF [46] approach is used to extract local feature descriptor. This approach can be utilized with machine learning classifier to identify an object from an image. This technique was developed as a variant of traditional Scale Invariant Feature Transform (SIFT) descriptor and is much faster than tradition SIFT. For the image feature extraction, using SURF descriptor is the most important step of this proposed system of traffic sign recognition. SURF delivers the sign of Laplacian, position, orientation, and scale as shown in Figure 7.  
For the descriptors and the interest point extraction, SURF involves multiple steps of the image features calculation. To find the interest points, SURF uses a Hessian-based blob detector. The element of a Hessian matrix expression, the extent of the response is an expression of the local change around the area. In the following stages, the raw images are calculated and are used to improve the system performance. The following equations are known as a Hessian matrix [47]. \[H(x,\sigma)=\left[ \begin{array}{cc}L_{xx}(x,\sigma)&L_{xy}(x,\sigma)\\ L_{xy}(x,\sigma)&L_{yy}(x,\sigma)\end{array} \right] \tag{1}\]  
where  
\[L_{xx}(x,\sigma) = I(x)*\frac{\partial^{2}}{\partial x^{2}}\;g(\sigma)\] \[L_{xy}(x,\sigma) = I(x)*\frac{\partial^{2}}{\partial xy}\;g(\sigma)\]  
In Equation (1) \(Lxx(x,\sigma)\) represents the convolution of the image with the second derivative of the Gaussian. The essential parameter of SURF is non-maximal-suppression of determinants of Hessian matrices. The convolutions are very expensive to compute, hence, these are approximated and fasten with a utilization of approximated kernels and integral images. An input image \(I(x)\) is an image where each point \(x=(x,y)^{\mathrm{T}}\) is stored as the sum of all pixels in rectangular area between origo and \(x\) shown in the Equation (2). Figure 7: Interest points of Speeded Up Robust Features (SURF); (**a**) Speed limit; (**b**) Hump; (**c**) Stop; (**d**) Give way. \[I(x)=\sum_{i=0}^{i<x}\sum_{j=0}^{j\leq y}I(x,y) \tag{2}\]  
In an image representation using the BoW model, an image may be presented as a document. Similarly, \"word\" in images also need to be defined. To achieve this, the following three phases are usually required, first is features detection, second is features description, and third is clustering [48]. A simple definition of the BoW for an image may be the \"histogram representation of an image based on independent features\" [49]. This is utilized to change over the 64 measurement descriptors into histograms of codes. This method is utilized to take up with the SURF descriptors to its different picture. If the output of SURF descriptors area unit is used as an input for ANN then ANN might be unable to understand the decision boundaries. The BoW outputs are going to be a group of codes for every descriptor and a thin bar chart of those codes represent every traffic sign distinctively. \(K\)-means clustering is commonly used with BoW process. However, finding the centroid of the clusters is the most critical step. \(K\)-means clustering [50] is a technique of vector quantization. It initially comes from signal processing, however, these days, it is also extensively used for the classification of an image. The main objective of \(k\)-means clustering is to make a section of \(n\) observations into \(k\) clusters, whereby, every observation will be a part of a cluster with the nearest mean, as shown in Figure 8. Clustering may be implemented by using several ways and methods, however, mostly all of the methods are especially used in a mathematical or computational process.