# Personal Identification Using Embedded Raspberry Pi-Based Face Recognition Systems
## 2 Materials and Methods
### Face Classification
#### 2.6.1 AdaBoost Machine Learning
Better classifiers receive exponentially greater weight. When the weight is zero, the error rate equals 0.5. A classifier with 50% accuracy or less is not considered better than random guessing, so it is discarded. After calculating \(\alpha\) for the first classifier, we update the weight of the training examples using the Formula (4). The argument \(i\) refers to the index of a specific training example in the dataset. Each training example is represented by a pair \((x_{i},y_{i})\). The weight vector \(D_{i}\) is updated at each iteration \(t\) accordingly:  
\[D_{t+1}(i)=\frac{D_{t}(i)e^{-\alpha_{t}y_{i}h_{t}(x_{i})}}{Z_{t}} \tag{4}\]  
where  
\(D_{t}(i)\)--the weight vector of the \(i\)-th training example. \(y_{i}\)--the true label of the \(i\)-th training sample, typically encoded \(+1\) for the positive class and \(-1\) for the negative class in binary classification problems. \(\alpha_{t}\)--the weight of the \(t\)-th weak classifier, determined by its accuracy (2). \(Z_{t}\)'the normalization factor ensuring that the weights reach a total of 1, given by the following:  
\[Z_{t}=\sum\limits_{i=1}^{n}D_{t}(i)e^{-\alpha_{i}y_{i}h_{t}(x_{i})} \tag{5}\]  
The underlying concept is to adjust the importance of each training example based on the performance of the weak classifier \(h_{t}\). If \(y_{i}h_{t}(x_{i})>0\) (i.e., the classifier correctly predicts \(y_{i}\)), the weight \(D_{t+1}(i)\) decreases. If \(y_{i}h_{t}(x_{i})<0\) (i.e., the classifier misclassifies \(y_{i}\)), the weight \(D_{t+1}(i)\) increases. This mechanism ensures that subsequent weak classifiers focus more on examples that were previously misclassified, thereby improving the overall accuracy of the strong classifier. The weights \(D_{t}(i)\) are always non-negative and normalized, ensuring that \(0\leq D_{t}(i)\leq 1\) and \(\sum\limits_{i=1}^{n}D_{t}(i)=1\) for all \(t\). While individual weights \(D_{t}(i)\) may oscillate or shift dynamically depending on the performance of the weak classifiers \(h_{t}(x)\), the overall algorithm exhibits exponential convergence in reducing training error. Specifically, AdaBoost minimizes the training error \(E\), as follows:  
\[E=\prod\limits_{t=1}^{T}Z_{t} \tag{6}\]  
where \(Z_{t}\) is always less than 1 if \(h_{t}(x)\) achieves accuracy better than random guessing (error \(\epsilon_{t}<0.5\)). Thus, \(E\) decreases exponentially with increasing \(T\). In practice, the exponential nature of the weights ensures that extreme misclassifications are penalized, but normalization \((Z_{t})\) prevents unbounded growth. The iterative process guarantees that the training error approaches zero if \(\epsilon_{t}<0.5\) for all \(t\). These properties demonstrate that the weight vector \(D_{t}\) adapts dynamically to emphasize harder examples while maintaining boundedness and promoting convergence of the training process. One of the most significant applications of AdaBoost is the Viola-Jones face detection algorithm. This detector uses a \"cascade of rejections\" consisting of multiple layers of classifiers. If, at any layer, a detection window is not recognized as a face, it is discarded, and the algorithm proceeds to the next window. The first classifier in the cascade aims to reject as many negative windows as possible at minimal computational cost. In this context, AdaBoost serves two roles. Each layer of the cascade is a strong classifier built from a combination of weaker classifiers and is used to find the most suitable features to apply in each cascade layer [67].