## 2 Preliminaries  
Figure 1 describes the principles [2] of building a machine-learning system. Machine-learning technology as a predictive modeling system can be divided into four parts: preprocessing, learning, evaluation, and prediction. Generally, the raw data and format of images cannot be directly used for calculations because such data could contain a considerable amount of useless information that may have a negative impact on the performance of the learning algorithms. Hence, the preprocessing of raw data plays an import role within every application of machine learning systems. In this work, the raw data are scalp images, and we try to capture the key features. The key features are usually the color, luminance, and density of hair. Features are selected to meet particular restrictions so that they perform well when using machine-learning algorithms. A good machine-learning algorithm predicts good results in both training and new datasets. The datasets are usually automatically divided into two parts (training and testing datasets). The training dataset is for training and optimizing the models, and the testing dataset is for evaluating the efficiency of the model. Each machine-learning algorithm has its own advantages for solving specific problems, and one learning algorithm cannot manage all problems. Hence, to train and discover the best models, different learning algorithms could be applied to the same dataset. Comparisons of the training data results for each learning algorithm can be used to identify the most suitable learning model. In the 1980s, multilayer perceptron (MLP) was a very popular machine learning technique, especially for speech recognition and image recognition. However, since the 1990s, MLP has encountered strong competition from the simpler support vector machines (SVM). Recently, due to the success of deep learning, MLP has regained attention. As we know, modern deep-learning techniques were based on the MLP structure. MLP includes at least one hidden layer (in addition to one input layer and one output layer). Compared to the single-layer perceptron (SLP), which can only learn linear functions, MLP can learn non-linear functions. Figure 2 shows a simple structure of an MLP with a hidden layer. Please note that all connections are weighted, but only three weights (w0, w1, and w2) are marked in Figure 2. A simple structure of an MLP is introduced as follows. Figure 1: Typical machine-learning system [2]. Figure 2: A simple structure of a multilayer perceptron (MLP) with a hidden layer. **Input layer:** The input layer has three nodes. The offset node value is 1. The other two nodes take external inputs from X1 and X2 (all are digital values based on the input data set). As discussed above, no calculation is performed on the input layer; thus, the output of the input layer node is 1, and X1 and X2 are passed to the hidden layer. **Hidden layer:** The hidden layer also has three nodes. The offset node output is 1. The output of the other two nodes of the hidden layer depends on the output of the input layer (1, X1, and X2) and the weight attached to the connection (boundary). Figure 2 shows the calculation of an output in a hidden layer (highlighted). The output calculations of the other hidden nodes are the same. Please note that \"f\" refers to the activation function. These outputs are passed to the nodes of the output layer. **Output layer:** The output layer has two nodes, receives input from the hidden layer, and performs calculations similar to the highlighted hidden layer. These calculated values (Y1 and Y2), which are the result of the calculation, are the outputs of the MLP. As a result, given a set of features X = (x1, x2,... ) and a goal Y, an MLP can learn the relationship between features and goals for the purpose of classification or regression. To assess the effectiveness of a given model, the accuracy of different models is compared. In this work, we have applied several popular machine-learning algorithms to analyze and diagnose hairy scalp images.