## 3 Method
### Model Architecture  
As stated in Section 1, robust features, which can combine color, shape, and texture information of tongues, are needed to describe the tooth-marked symptom. In this paper, we use the CNN to extract a fixed-length feature vector of the tongue image. As shown in Figure 2, the proposed method takes a tongue image as input and outputs the probability of tooth-marked along with a heatmap localizing the most indicative tooth-marked regions in the image. The proposed network has seven weight layers, five of which are convolutional layers and the rest of which are fully connected layers (FC layers). Input images are downscaled to 256 \(\times\) 256 and randomly cropped to 224 \(\times\) 224. The convolution kernel has a size of 3 \(\times\) 3 and a stride of 1, and the kernel channel for each convolutional layer is 128, except that the first layer is 64. We apply max-pooling with a size of 2 \(\times\) 2 with a stride of 2 on each feature map to reduce the filter responses to a lower dimension. Instead of traditional sigmoid or tanh neurons, we use Rectified Linear Units (ReLUs) in each convolution layer and the full connection layer [20], which enables the network to converge several times faster while achieving almost identical performance. We use 0.7 dropout, followed by the fifth pooling layer, to reduce overfitting in the model training procedures. The last FC layer is a 2-way fully connected layer, that represents whether the image is a tooth-mark tongue or not. We use softmax to output the probability of each category as a classification function. Many previous works have shown that the fully-connected layers lose spatial information about the image, but the convolutional layers naturally preserve this information, while deeper features can capture higher levels of the visual construct. Therefore, in [28], it is conjectured that the last convolutional layers have the best expression between abstract semantics and specific spatial information, and the neurons in these convolutional layers can look up the semantic information of a particular class. Grad-CAM uses the gradient values of different convolutional layers to analyze the importance of each neuron for classification [9]. In order to generate the class-discriminative localization map, \(L_{Gnd-CAM}\in\mathbb{R}^{u\times v}\) of width \(u\) and height \(v\) for tooth-marked tongue class, the score of the gradient for tooth-marked tongue class \(y\) is calculated, and the feature maps \(A^{k}\) to a convolutional layer is obtained (i.e., \(\frac{\partial y}{\partial A^{k}}\)). These gradients are fed back into global average pooling to obtain the weights of the neurons for the tooth-marked tongue \(\alpha_{k}\):  
\[\alpha_{k}=\overbrace{\frac{1}{Z}\sum_{i}\sum_{j}}^{\text{global average pooling}}\underbrace{\frac{\partial y}{\partial A^{k}_{ij}}}_{\text{ gradients via backprop}}. \tag{2}\]  
This weight \(\alpha_{k}\) represents the weight of feature map \(k\) to the tooth-marked tongue class, and \(\partial A^{k}_{ij}\) represents the pixel value at the \((i,j)\) position in the feature map \(k\). Global Average Pooling (GAP) [24] outputs the spatial average of each unit in the feature map. After obtaining the weights of the tooth-marked tongue class for all feature maps, the weights can be summed to obtain the heat map. Figure 2: Our method is designed to output the probability of a tooth-marked tongue and localize regions in the image most indicative of the pathology. In this example, given a tongue image as input, we forward-propagate the image through the Convolutional Neural Network (CNN) and then compute a raw score (89%) for the class of tooth-marked tongue. Then, we reset the output to one for tooth-marked tongue predictions while zero for nontooth-marked ones.