# Automated Gluten Detection in Bread Images Using Convolutional Neural Networks
## 3 Materials and Methods
### Model Training  
A total of six models were tested on the Pinterest bread dataset, which was divided into training (80%), validation (10%), and testing (10%) datasets:  
* VGG19: This is a convolutional neural network (CNN) architecture developed by the Visual Geometry Group (VGG) at Oxford University in 2014 and is used in a wide range of image classification tasks [44]. The VGG architecture explores the impact of increasing the depth of convolutional networks on classification accuracy. Compared to state-of-the-art configurations, it employs a design with small 3 \(\times\) 3 convolution filters, which has been shown to improve performance significantly [45]. VGG19 \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Dataset** & **Number of Gluten-Free** & **Number of Gluten-Containing** & **Total** \\  & **Bread Images** & **Bread Images** & **Total** \\ \hline Pinterest bread dataset & 256 & 256 & 512 \\ Instagram bread dataset & 43 & 40 & 83 \\ Custom bread dataset & 108 & 107 & 217 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Datasets’ description. consists of 19 layers with learnable parameters, including 16 convolutional layers and 3 fully connected layers. * Inception-V3: This is also a deep convolutional neural network architecture developed by Google Research as an improvement over the original Inception architecture. The Inception-V3 model is widely used for image classification. This architecture comprises several layers of convolutional and pooling operations and auxiliary classifiers at intermediate layers. It utilizes a technique known as \"inception modules\", which involves parallel convolutions of different sizes followed by concatenating their output features to efficiently extract multi-scale features. As compared to VGGNets, Inception is more computationally efficient [46]. * InceptionResNetV2: This is a CNN architecture that combines the strengths of Inception networks and ResNet architectures, developed by Google Brain to enhance image classification performance [47]. InceptionResNetV2 integrates Inception modules, which use parallel convolutional layers of different kernel sizes, with residual connections, which improve gradient flow and enable efficient training of deeper networks. This architecture consists of 164 layers, incorporating batch normalization, factorized convolutions, and scaling residual connections to optimize accuracy and computational efficiency [47]. Compared to standalone Inception or ResNet models, InceptionResNetV2 achieves superior performance while maintaining lower computational complexity. * NASNetLarge: This CNN architecture was developed by Google Brain using Neural Architecture Search (NAS), an automated machine learning (AutoML) technique that optimizes network design. NASNetLarge is designed to achieve high performance in image classification tasks while maintaining computational efficiency [48]. Unlike manually designed architectures, NASNet utilizes a reinforcement learning-based search algorithm to discover the most efficient network structure. The NASNetLarge model consists of 88 layers and employs separable convolution operations and batch normalization to reduce computational cost while maintaining high accuracy [49]. * ResNet50V2: This is a CNN architecture introduced as an improved version of ResNet50, developed by Microsoft Research as part of the Residual Network (ResNet) family [50]. ResNet architectures address the vanishing gradient problem by incorporating residual connections (skip connections), which enable deeper networks to train more effectively. ResNet50V2 consists of 50 layers, including convolutional, batch normalization, and fully connected layers, and employs pre-activation residual units, which improve gradient flow during training and lead to better convergence compared to the original ResNet50 [51]. This architecture is widely used in image classification tasks due to its strong generalization capability and efficient training process.