## 3 Experiment Results
### Building and Verifying the Deep Learning Model Architecture  
In the preliminary setup of the deep learning model of this research, the Adam in Keras [54] was selected as an optimizer for avoiding a potential local minimum because the learning rate is adjusted automatically during training. The ReLU in (4), which has no vanishing gradient problem, was used as the activation function of neurons in hidden layers, while softmax was used as the activation function of neurons in the output layer. Using images in training dataset, the granule size distributions obtained from the proposed image processing was divided into 16 intervals to form the inputs. As the size of default input vectors is small, only 16 \(\times\) 1, the expected deep learning model should be simple. A grid search [60; 61] was conducted to select the rest of the hyperparameters in the deep learning model. A grid search exhaustively tries every possible combination to determine the best set of hyperparameters. We used the following hyperparameter grid in Table 1 and aimed to obtain a preliminary deep learning model with a prediction accuracy of over 80%. Figure 14: Similar coffee granule size distributions for different wear levels and grinder settings. Figure 13: Severe wear burr granule size distributions for five grinding settings. An epoch refers to one complete pass through the entire training dataset. During each epoch, the model sees and learns from all training samples once. Batch size refers to the number of training examples utilized in one iteration. In other words, it defines the number of samples that will be propagated through the neural network before updating the model parameters (weights and biases). Smaller batch sizes can introduce some randomness into the training process and might help the model generalize better. Because we have 480 training datapoints, the three batch size options are well below 480. Large epochs might be helpful for obtaining high accuracy but might result in overfitting for the test data. Therefore, dropout that can prevent or reduce overfitting was also considered. A simple grid search can be conducted manually. There is also software available for performing complex grid searches. For example, GridSearchCV [61] is a hyperparameter-tuning function provided by the Scikit-learn library [65] in Python, specifically within the _model_selection_ module. It systematically searches for a predefined set of hyperparameters and evaluates the model performance for each combination. KerasClassifier [66] is a wrapper class in the Keras library that allows us to use Keras models with Scikit-learn's GridSearchCV. By combining KerasClassifier with GridSearchCV, one can easily tune hyperparameters for deep learning models built using Keras. After the grid search, a preliminary 5-layer deep learning model includes an input layer, an output layer using softmax as the activation function, and 3 hidden layers using the ReLu as the activation function, with 64 neurons, 32 neurons, and 16 neurons, respectively, being selected because it has acceptable accuracy and convergence speed. Its batch size is 32 and epoch number is 1000. In addition, the first two hidden layers had a 0.3 dropout rate to prevent overfitting on the test data. However, when running the preliminary deep learning model with validation data, the confidence scores were still lower than the confidence scores in training. This means that the model was overly trained and overfitting still occurred. After we manually increased the dropout to 0.5 (50%), the overfitting was reduced because the confidence scores for training and testing were very close to each other. This study focuses on investigating the impact of interval separation for different input quantities on classification accuracy; a three-layer hidden layer is employed as the experimental framework.