Next Article in Journal
Novel Deep Feature Fusion Framework for Multi-Scenario Violence Detection
Previous Article in Journal
Torus-Connected Toroids: An Efficient Topology for Interconnection Networks
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Automated Optimization-Based Deep Learning Models for Image Classification Tasks

by
Daudi Mashauri Migayo
1,2,*,
Shubi Kaijage
1,
Stephen Swetala
3 and
Devotha G. Nyambo
1
1
School of Computational and Communicational Science and Engineering, The Nelson Mandela African Institution of Science and Technology, Arusha 23311, Tanzania
2
Department of Business Administration, Tanzania Institute of Accountancy (TIA), Dar es Salaam 15108, Tanzania
3
Department of Orthopedic and Trauma Surgery, Bugando Medical Centre, Mwanza 33102, Tanzania
*
Author to whom correspondence should be addressed.
Computers 2023, 12(9), 174; https://doi.org/10.3390/computers12090174
Submission received: 19 May 2023 / Revised: 7 August 2023 / Accepted: 10 August 2023 / Published: 1 September 2023
(This article belongs to the Topic Recent Trends in Image Processing and Pattern Recognition)

Abstract

:
Applying deep learning models requires design and optimization when solving multifaceted artificial intelligence tasks. Optimization relies on human expertise and is achieved only with great exertion. The current literature concentrates on automating design; optimization needs more attention. Similarly, most existing optimization libraries focus on other machine learning tasks rather than image classification. For this reason, an automated optimization scheme of deep learning models for image classification tasks is proposed in this paper. A sequential-model-based optimization algorithm was used to implement the proposed method. Four deep learning models, a transformer-based model, and standard datasets for image classification challenges were employed in the experiments. Through empirical evaluations, this paper demonstrates that the proposed scheme improves the performance of deep learning models. Specifically, for a Virtual Geometry Group (VGG-16), accuracy was heightened from 0.937 to 0.983, signifying a 73% relative error rate drop within an hour of automated optimization. Similarly, training-related parameter values are proposed to improve the performance of deep learning models. The scheme can be extended to automate the optimization of transformer-based models. The insights from this study may assist efforts to provide full access to the building and optimization of DL models, even for amateurs.

1. Introduction

Artificial intelligence (AI) generally involves modeling intelligent behavior using a computer program with limited human interference [1]. AI manifests through numerous applications, such as autonomous driving, natural language processing, intelligent information retrieval, expert consulting systems, theorem proving systems, robotics, automatic programming, combinatorial and scheduling systems, and perception problems [2,3].
Machine learning (ML) is considered a subfield of AI [4]. However, some believe that only the intelligent part of ML should be regarded as a subset of AI [5]. Either way, both kinds of literature converge on the notion that in ML a computational algorithm is built that can be applied to make decisions or estimates based on training data, without being explicitly programmed to perform the task [4,6].
An ML model learns from experience for a given task if its performance towards the task improves with experience [7]. Machine learning models are primarily classified into four groups: supervised learning, unsupervised learning, semi-supervised learning, and reinforcement learning [8]. Deep learning leads to other machine learning tools in general imaging and computer vision [9].
Deep learning (DL) refers to techniques that build on artificial neural networks in which multiple network layers are added to increase the levels of abstraction and performance [10]. For better generalizability, a good DL model is obtained through several processes: pre-processing of data, feature engineering, model generation, and model evaluation [11]. Model generation includes the design of DL models and optimization during training. Model generation is turned into an optimization process for state-of-the-art (SOTA) DL models with transfer learning.
The optimization process can either involve hyperparameter optimization (HPO) or architecture optimization (AO) [11]. The former focuses on tuning training-related parameters, for example, the batch size, learning rate, and the number of training iterations. The latter deals with model-related parameters, for example, the number of hidden layers, filter size, and the number of neurons per layer. Popular optimization methods include grid and random search [12,13], Bayesian optimization [14,15], and gradient-based optimization [16,17,18,19].
Standard DL models require determining both training- and model-related parameters before training. The model’s performance can be affected considerably by the choice of these parameters, yet finding good values is notably tough [20]. The problem is exacerbated by the fact that some parameter values are integers (e.g., batch size), others are floating-point (e.g., learning rate), and others are categorical (e.g., optimizer). During training, landing on the veracious set of parameter values for better generalization remains an indistinct procedure, hampering the replication of ML experiments.
Luckily, there has been growing interest in automating the ML pipeline, i.e., automated machine learning (AutoML), to free data scientists from burdensome tasks. Google introduced publicly shared Cloud AutoML (https://cloud.google.com/automl/, accessed on 4 November 2022) systems, and others have submitted open-source optimization libraries, i.e., Hyperopt [21], Skopt [22], SMAC [23], and KerasTuner (https://keras.io/keras_tuner/, accessed on 29 June 2023). Similarly, the majority of recent literature on AutoML for DL models concentrates on automating the design of DL models through the neural architecture search (NAS) process [24,25,26,27,28]. However, works on automating the optimization process after obtaining the candidate architecture through NAS is still insufficient.
To date, an insufficient number of works of literature on the automated optimization of DL models have been identified. Similarly, building high-quality DL models through the optimization process can take time for non-experts. Therefore, existing difficulties motivated a desire to seek improved approaches for model optimization. Deliverables from such systems may be applied to join efforts to free data scientists from the burdensome optimization task.
For that reason, this empirical work proposes to advance the understanding of this growing area of research by introducing automated optimization of DL models for computer vision, specifically image classification tasks. Four DL models, each presenting a different architecture and prominent datasets, were employed during the implementation of the proposed solution. The proposed solution experimented with a transformer-based model to test its applicability to vision transformer models.
Data scientists, DL practitioners, experts, and non-experts working on image classification tasks can use the proposed solution without geographical limitations. A data scientist has control over the optimization attempts in the proposed solution, as opposed to using brute force and exhaustive searches. The main contributions of this paper can be summarized as follows:
  • Through a series of empirical tests, the association and impact on the performance of two main training-related parameters, batch size and learning rate, is explored;
  • A framework for automated optimization of the DL model for image classification tasks is presented;
  • An empirical demonstration showing that the proposed framework improves the performance of DL models is presented;
  • A set of training-related parameter values for better performance of DL models for further extensive empirical evaluations is recommended.
The remainder of this paper is structured as follows: Section 2 concerns materials and methods. Section 3 is dedicated to presenting results; subsequently, Section 4 discusses results and findings. Section 5 outlines a conclusion and some highlights of what to expect in future works.

2. Materials and Methods

This section summarizes the experimental setup, presents an overview of selected deep learning models, parameters to be used during automated optimization, datasets, and performance measures for empirical evaluation; an overview of the problem at hand is provided, proceeded by an optimization algorithm and the proposed framework.

2.1. Experimental Setup

Three sets of experiments were conducted in this study: the first to assess the association of learning rate and batch size; the second to assess the impact of optimizers; and the third to demonstrate the proposed solution. The first set involved twenty tests, the second set involved three, and the third involved three tests for each of the selected DL models. A total of 104 experimental runs were conducted.
All experiments were coded using Python and run using an online Jupyter Notebook executed on the Google Colab cloud computing on a TensorFlow framework. A graphics processing unit (GPU) offered on the Google platform was utilized to expedite the training process. At the beginning of each training session, Google offers up to 12.7 GB of RAM, 15 GB of GPU, and 78.2 GB of disk space that are dynamically assigned and utilized.

2.2. Deep Learning Models

Four of the top state-of-the-art deep convolution neural network (D-CNN) models, standard for image classification tasks, were selected in this work. A very deep convolutional network for large-scale image recognition (VGG-16) is beneficial as it generalizes well on other databases, apart from the ImageNet database, while achieving SOTA results [29]. GoogleLeNet or Inception uses fewer computational resources and few parameters while achieving high SOTA results [30]. In this paper, we considered Inception version V3.
Likewise, from the clan of Residual Network (ResNet), ResNet50 was selected as it presents a novel architecture, skipping connections that go deeper by up to 152 layers (8 times deeper than VGG-19) but still maintaining low complexity [31]. The final nomination was the EfficientNet, which introduced a novel model scaling method called compound scaling [32]. The proposed approach broke the mold of its predecessors, which previously used the conventional system of stacking many layers to scale up the model. EfficientNetB0 was considered in these experiments.
The selected four DL models are winners of the ImageNet Large Scale Visual Recognition Challenge (ILSVRC) at different timeframes. In the ILSVRC 2014, VGG-16 was ranked second, and Inception was first. Likewise, ResNet50 was ranked first in the ILSVCR 2015. Lastly, EfficientNet was a winner in the ILSVRC 2019.
Each of the selected models presents a unique architecture that generalizes well on a variety of datasets (VGG-16), minimizes computational resources (Inception), gets deeper while reducing complexity (ResNet50), and uniformly scales up (EfficientNet). Diverse architectures in the selected models lays a foundation for most variants of D-CNN.
A transformer-based model by Dosovitskiy et al. [33] was used to test the applicability of the proposed approach to vision transformers (ViT). The model contains multiple transformer blocks with a multi-head attention layer applied to the sequence of image patches. The final output of each transformer block is flattened to be used as the representation of image input to the classifier head. The classifier head uses a softmax activation to produce the output probability of each class.
In this paper, deep learning models based on ConvNets were mainly considered in the experiments. However, in recent years, the popularity of transformer-based models for computer vision applications has been growing. Yet recent ConvNets can be as robust and reliable or, in some cases, even more so than transformers [34]. Therefore, the experiments and results presented in this paper primarily concentrate on ConvNet-based deep learning models; however, at the same time, the proposed approach was evaluated with a transformer-based model.

2.3. Parameters

Four parameters were used in performing automated optimization during the empirical work: the number of trainable hidden layers, learning rate, batch size, and optimizer. Nevertheless, the number of training iterations (epoch) remained the same because early stopping was used in the selected DL models. Early stopping monitored improvements in the validation loss with patience set to 10 and mode set to min, as we seek to minimize loss when validation accuracy improves, restoring best model weights.

2.4. Datasets and Performance Measures

Standard datasets for image classification tasks used across research and hackathons were selected [35,36]. The ImageNet (https://image-net.org/download, accessed on 4 November 2022) is the largest dataset for image classification and localization. In addition, we selected Fashion-MNIST [37], Stanford Cars [38], and the Google Cats and Dogs dataset (https://storage.googleapis.com/mledu-datasets/cats_and_dogs_filtered.zip, accessed on 4 November 2022). All datasets are publicly available and can be freely accessed for various image classification challenges.
With a balanced dataset used to evaluate the proposed approach, the performance metric used in this work is accuracy. Accuracy measures the probability of an image being classified as positive or negative. With initial accuracy A c c i and final accuracy A c c f , the relative error ε r drop can be calculated as:
ε r = A c c f A c c i 100 A c c i × 100 %
Evaluation metrics like precision, recall, and confusion matrix may be employed when the proposed approach uses imbalanced datasets. However, a data scientist must explicitly define the evaluation metric before optimizing.

2.5. Problem Definition

This work addresses the following problem. Given:
  • A set of deep learning models Ϻ(1),…, Ϻ(t), with t being the number of deep learning candidate models for a CV task T;
  • A number m of datasets as Ɗ(1),…, Ɗ(m);
  • A set of n parameters with domains Θ1,…, Θn;
  • Model Ϻ’s configuration space as a product of parameter domains given as Θ = Θ1 × … × Θn;
  • For each of the selected model Ϻ on dataset Ɗ during task T, a number of K sets have a pair of empirical performance metrics y i with parameter settings θ i as y i , θ i i = 1 K .
Our goal is to automate the process of determining, for the selected model on a given dataset for a particular image classification task, which parameter values are to be applied for the expected better performance of a model during the optimization process.

2.6. Optimization Algorithm

We employed a sequential-model-based optimization algorithm to implement the proposed scheme. More specifically, we used Bayesian optimization (BO), a popular SMB-based hyperparameter optimization method [14,15]. With an evaluation function f and acquisition function S, SMBO can be articulated in Algorithm 1 [14].
Algorithm 1: Sequential-Model-Based Optimization
Input: f, Θ, S, Ϻ
Ɗ ← INITSAMPLES (f, Θ)
for i in [1, 2, … , t] do
p(y| θ , Ɗ) ← FITMODEL (Ϻ, Ɗ)
θ i a r g m a x θ Θ S( θ , p(y| θ , Ɗ))
y i ← f ( θ i )
Ɗ ← Ɗ ( y i , θ i )
end for
After tuning the probabilistic model Ϻ to fit on Ɗ, function S selects subsequent promising neural architecture from Ϻ. A balance between exploring new architectures from M and exploiting architectures already identified to have auspicious values is defined by S. Function f evaluates the selected neural architecture after training and validation. The new pair of evaluation results ( y i , θ i ) is appended on Ɗ.

2.7. Automated Optimization Framework

The proposed framework of the automated optimization scheme can be summarized in Figure 1. The optimization scheme accepts a DL model, classification task, and control variable to exploit the configuration space. Finally, it yields the best-performing DL model, associate parameters, and evaluation metrics.
At first, a data scientist specifies a DL model Ϻ, dataset Ɗ, and a maximum number of optimizations attempt Ɲ for a given image classification task. The algorithm compiles a model after preprocessing the data on Ɗ using default parameters θ 1 . Afterwards, the algorithm fits Ϻ on Ɗ and records the initial performance measure y 1 using θ 1 . A comparison between y 1 and new performance values will be made during the optimization process.
The algorithm then initializes automated optimization of Ϻ on Ɗ using configuration space Θ. Parameters θ i are selected iteratively to compile and fit Ϻ on Ɗ while recording new performance y i . If Ϻ improves as y i   is compared with y 1 , the algorithm updates the performance measure and corresponding parameter value ( y i , θ i ) on saving Ϻ. Otherwise, the algorithm retrains after unfreezing the top layers of Ϻ and reducing the learning rate. In this paper, unfreezing happened layer by layer, since the training process of the internal layers of DL differs significantly [39].
In both cases, if there are no improvements, parameters θ i and compiled Ϻ are discarded upon selecting subsequent parameter values for the next optimization attempt. The counter for optimization attempts, t , will be incremented. The process repeats with Ɲ controlling the exploration of θ i from Θ when exploiting selected parameters. The automated optimization can be summarized in Algorithm 2.
Algorithm 2: Automated Optimization of DL Models
Input: Ϻ, Ɗ, Ɲ
Output: best Ϻ ,   final   y i ,   and   values   θ i
Method: the algorithm works as follows.
1: Initialize Ϻ on Ɗ   with   θ 1
2 :   y 1     f   ( θ 1 )
3 :   record   ( y i , θ i )
4 :   for   θ i in Θ do
5 :   y i     f   ( θ i )
6 :   if   y i   improves ,   update   ( y i , θ i )
7:   else unfreeze Ϻ
8 : y i     f   ( θ i )
9 : if   y i   improves ,   update   ( y i , θ i )
10 :   else   discard   θ i ,   increment   t
11:    end if
12:   end if
13 :   while   t < Ɲ, reiterate
Most of the existing approaches optimize models for ML tasks other than computer vision. Optimizing a model for a computer vision task is often a resource-intensive task. The proposed method stands out from the existing literature for three reasons. First, it automates the optimization process of models for computer vision, a solution currently insufficiently addressed in the current literature. Second, it can be configured and supports state-of-the-art deep learning models with transfer learning for any image classification task. Third, a user controls the optimization process and may limit the utilization of resources, as opposed to using brute force and exhaustive searches.

2.8. Implementation

Transfer learning was employed on the selected models with pre-computed weights on ImageNet. The Fashion-MNIST and Stanford Cars datasets were used to initially examine the association between batch sizes and learning rates during training with a generic model. The Stanford Cars dataset encompasses 16,185 images and 196 car classes. Fashion-MNIST holds 70,000 28 × 28 grayscale fashion images from 10 categories, divided into 60,000 training and 10,000 test examples. The proposed automated optimization approach was implemented and evaluated on the Stanford Cars and the Cats and Dogs datasets with 1500 color images for each class, split into 2000 images for training and 1000 for validation.
Three optimizers were used: RMSProp, SGD with momentum, and Adam. Batch size increases by 2, starting with 8 through to 128. The number of epochs was fixed to 100 with the early stopping monitoring validation loss, with patience set to 10, and a 0.5 dropout rate to prevent overfitting, and saving only the best model.

3. Results

This section presents the result of our empirical work before, during, and after building an automated optimization-based deep learning model for computer vision.

3.1. Hyperparameter Association

At first, a series of empirical tests were conducted to explore the relationship between batch size and learning rate and their impact on the model’s performance. For each of the selected DL models, a pair of batch size and learning rate was iteratively determined while observing accuracy and loss during training and validation. Table 1 presents the experimental data for ResNet50. Epoch represents the number of iterations the activity training terminated using the early stopping criteria. Likewise, the time in minutes shows the corresponding duration of training. Appendix A provides supplementary experimental data. Table A1 gives experimental data for a VGG-16; Table A2 gives experimental data for Inception; Table A3 gives experimental data for EfficientNet.
The data in Table 2 present the results that indicate a positive association between batch size and learning rate, with the best performance obtained when high rates are used with large mini batches and the inverse is true.
The experimental evidence in Figure 2 reveals that a DL model diverges following training with a low rate and a large mini batch (a). Contrastingly, a clear benefit of using low rates with small mini batches can be witnessed as the model converges to a local optimal solution (b). Nevertheless, the latter’s training time is higher than the former.
If we turn to the training losses, a combination of low rates and a small mini batch promises convergence in reducing training and validation loss, as shown in Figure 2d. Conversely, low rates and a large mini batch guarantee training and validation loss divergence, as seen in Figure 2c.
The data in Figure 2 shows that model accuracy and loss improve positively when the model is trained using low rates and a small mini batch. Divergence in model accuracy and loss is observed when the model is trained using low rates and a high mini batch, or the inverse. The following subsection concerns performance gains obtained after applying the proposed automated framework during the training and optimization of DL models.

3.2. Performance Evaluation

Utilizing the proposed framework resulted in performance improvements of selected DL models after training and optimization. As can be seen from the data in Table 3, the error rate was reduced by improving accuracies for the selected DL model. The initial accuracy was obtained through the default training parameters of batch size 32 and a learning rate of 0.001, as suggested by existing literature. The automated optimization process achieved final accuracy after a series of empirical trials.
Closer inspection of Table 3 reveals an upsurge of accuracy from 0.9370 to 0.9830 for a VGG-16, signifying a 73.02% relative error drop from 0.063 to 0.017 as calculated using Equation (1) in approximately one hour. Similarly, there was a 37.29% relative error reduction for EfficientNet as the accuracy rose from 0.9830 to 0.9890 after utilizing the proposed framework. Contrary to expectations, no performance improvement was observed on ResNet50, as the initial accuracy could not be surpassed. These results indicate that the proposed framework can automate the optimization process of DL models and, indeed, improve performance by significant proportions.
Table 3 evaluates the optimization process using the proposed scheme regarding accuracy and training time. Accuracy represents model performance after the automated optimization process as an evaluation criterion. Training time means the consumption of resources during the automated optimization process.

3.3. Proposed Parameter Values

Several pairs of training-related parameters for better DL model performance were observed through our empirical tests. We recommend these values during the training of DL models for further extensive empirical evaluations. Generally, learning rates of 0.01, 0.001, and 0.0001 work well with mini batches 64, 32, and 16, respectively. However, the learning rate should be reduced if the top layers of a DL model are unfrozen to avoid wrecking precomputed weights. Table 4 summarizes these parameter values.
These values can be adopted as default parameters while training DL for image classification tasks. Based on our empirical evaluations, these values guarantee the optimal performance of DL models. Data scientists and DL practitioners may select and apply a pair of proposed values when building a baseline model. Afterward, the optimization process to surpass a baseline model may be initiated by utilizing automated tools like the proposed scheme.

3.4. Optimizers

Empirical tests were conducted to assess the optimizers’ impact on accuracy and loss. A default learning rate of 0.001 and a batch size of 32 were selected during training with varying optimizers. Three optimizers were used: Adam, SGD, and RMSprop. Table 5 provides a summary of the outcomes of these experiments.
From the data in Table 5, except for VGG-16, the rest of the selected DL models reported the best performance when trained with an SGD optimizer. A disappointing performance was noted when ResNet50 was trained with RMSprop and Adam. Comparable performance results can be seen from the rest of the data reported in Table 5.

3.5. Empirical Comparison with Existing Tools

Experimental comparisons were conducted with existing tools to establish the relevance of the proposed approach. We selected open-source optimization libraries implemented through known algorithms. Existing tools for auto-optimization were Hyperopt [21], Skopt [22], SMAC [23], and KerasTuner. Hyperopt uses Bayesian optimization and works best with classical ML models for various tasks other than computer vision. Similarly, Skopt and SMAC provide implementations suitable for ML tasks other than computer vision. For this reason, we chose KerasTuner from the selected optimization libraries.
KerasTuner optimizes DL models in two stages: first, it optimizes the hyperparameter search for a hyper model and returns optimal values. Second, it builds a model with optimal parameters and fits it into the training set. In our proposed approach, the first stage was executed when studying the association between hyperparameter values. Multiple experimental runs were conducted to reduce the bias of the reported results due to the stochastic nature of machine learning experiments. The average weight of accuracy and loss was registered to compare the performance of the existing tool and the proposed approach.
Figure 3 compares model performance when optimized using KerasTuner and the proposed approach. We first build and train a DL model with KerasTuner while observing the loss and accuracy for each experimental run. Then, we create a model with a similar architecture and optimize it with our proposed approach. The top half of the figure shows the model performance when optimized with KerasTuner. The bottom half of the figure offers model performance when optimized with our proposed approach.
As can be seen from Figure 3a, the model quickly converges to around 98.5% accuracy and diverges when optimized using KerasTuner. Optimizing with our proposed approach reveals a convergence at approximately 99.7%, as seen in Figure 3b,c, which presents the model loss as it converges at around 10% before overfitting when optimized with KerasTuner. The model loss in Figure 3d converges at about 5% when optimized with our proposed approach.
From the result in Figure 3, it is apparent that the proposed approach improves the performance of DL when compared with the existing library. There is an increase of 1.2% in model accuracy and a decrease of 5% in loss after utilizing our proposed approach. The proposed solution is essential in building and optimizing DL models for image classification tasks.

3.6. Optimization of Transformer-Based Models

The proposed optimization solution was applied to a transformer-based architecture to verify its applicability. The ViT model was trained for 100 epochs while monitoring accuracy and loss. Figure 4 presents the model performance.
The data in Figure 4a show that model accuracy converges at around 50% after 20 training iterations before overfitting. Training loss and validation loss improved to about 20%; as the training loss improved, the validation loss plateaued, as seen in Figure 4b.
The result in Figure 4 suggests that transformer-based models should be trained on larger image datasets for many iterations to ensure convergence. Current experiments used small datasets like Fashion-MNIST and Stanford Cars. The training iteration was fixed to 100 to provide a fair comparison with ConvNet-based models. This accounts for the suboptimal results observed in the ViT model.

4. Discussion

This section discusses the results presented in the previous section and positions our contributions relative to knowledge in the existing literature.

4.1. Contributions to Related Literature

Probst et al. [40] employed a statistical approach to study the importance of hyperparameter tuning and introduce tunability, signifying the gain in the model’s performance achieved through hyperparameter tuning. However, the research paper was confined to six classical machine learning models.
Faes et al. [41] researched the practicability of automated deep learning design by medical practitioners with non-programming and DL expertise. Developed models through the automated stream were compared with SOTA DL models on medical image classification tasks using publicly available datasets. Results indicated comparable discriminative performance and diagnostic properties [41].
Xu et al. [42] introduced an automatic network adaptation framework for object detection that goes beyond searching a classification backbone. The authors proposed the Auto-FPN framework with two modules performing an auto search: Auto-Fusion and Auto-Head. For both modules, the search space of gradient-based architecture claimed to be efficient with resource constraints [42].
Weerts et al. [43] introduced turning risk, an incurred loss into performance when a hyperparameter is not tuned but left to default value. Authors asserted that a model with default values might even outperform a model with adjustments to its hyperparameter in some cases [43]. However, only two classical ML algorithms were experimented with: Support Vector Machine and Random Forest.
Guo et al. [44] proposed a hierarchical trinity search framework that automatically discovers effective architecture for object detection. Their solution employs an end-to-end approach to discover all components and architectures of object detection simultaneously. With much less computational overhead, experimental results suggest that the proposed framework outperforms both manually designed and NAS-based architectures [44].
X. He, Wang, et al. [45] conducted a series of empirical evaluations to benchmark DL models and automated model design for COVID-19 detection. A random search was proven to deliver DL models with SOTA performance results through empirical results [45]. However, automating the optimization process of selected architectures after NAS remains not to be seen.
Yi and Bui [46] presented a deep learning model with an automated hypermeter search for highway traffic prediction. Their work employed a long short-term memory (LSTM) model and a recurrent neural network (RNN) variant to build a time series model for an intelligent transport system. Bayesian optimization is claimed to be superior to a manual search, grid search, or random search in searching for hyperparameter configuration [46].
While the literature on AutoML already exists, to our knowledge, it is limited to automating the design on DL models. Table 6 summarizes the research contribution to the existing body of knowledge. Thus far, some authors have attempted to highlight the significance of hyperparameter optimization [40,43]. Other researchers are more concerned with automating the design of deep learning models [41,42,44,45], while [46] focuses on automating the hyperparameter search for time series deep learning models.
Based on the reported literature, this paper concentrates on automating the optimization of deep learning models for image classification tasks. Experimental work examines the importance of hyperparameters and searches for the best value by automating the optimization process. Similarly, it empirically demonstrates that the proposed approach can improve the performance of deep learning models through automation.

4.2. Association between Batch Size and Learning Rate

Our results suggest a significant positive correlation between batch sizes and learning rates. This implies that lower rates should be used with smaller batches for better results, and the inverse is true for larger batches. Following the present results, previous studies have suggested using smaller batches [47,48] and high learning rates with large batch sizes [49]. Furthermore, batch size 32 was recommended as the default value that provides good results [50].
Another critical finding distinctive from the previously reported results is observed when a learning rate of 0.1 is selected. Regardless of how the batch size was iterated in all DL models, validation accuracy was at around 50%. An implication of this finding is the possibility that high rates plateau the performance close to a specific value. However, with the stochastic nature of ML experiments, these results must be interpreted cautiously.

4.3. Optimization Implications

The post-automated optimization results signify that the proposed scheme can improve the performance of DL models on a given image classification task. VGG-16 consumed approximately an hour of training and adjusting the knobs to reduce the error rate by 73%. Likewise, for EfficientNet, optimizing to a final accuracy took 2 h and 41 min.
Without automated optimization tools, data scientists spend hours manually training and optimizing DL models. Additionally, the optimization process requires a good knowledge of the impact of both model- and training-related parameters relative to performance evaluation metrics. With such constraints, it is evident that building and optimizing DL for image classification becomes a burdensome task.
However, with a fully automated machine learning pipeline, data scientists shall be liberated from the majority of burdensome tasks involved in deploying DL models. For this reason, the proposed automated optimization scheme becomes significant. Data scientists can leverage such a tool during the design and optimization process, consequently becoming more productive and efficient in completing other valuable scientific tasks in the machine learning pipeline. This implies that data scientists will only be required to define a task, model, and dataset and then submit it to automated machine learning tools.

4.4. Proposed Approach on Vision Transformers

The proposed tool can be applied to fine-tune and optimize transformer-based models automatically. However, it has to be customized to incorporate ViT hyperparameters. ViT hyperparameters include patch size, projection dimension, number of heads, number of transformer layers, multilayer perceptron units, and the standard convent parameters. This implies that the search space will be more extensive when compared to ConvNets.
Transformer-based models must be trained on larger datasets for long enough to ensure convergence [51]. The number of training iterations can be set to 500 with early stopping to control overfitting. This signifies that ViT models can be trained for up to five times more iterations than ConvNet models.
Similarly, transformer-based models can be trained with large batch sizes compared with convent models. Our results suggest that mini batches between 16 and 64 promise optimal performance with convents, but ViT models can be trained with 256 and 512 batches. The results presented in Section 3.6 were obtained when the ViT model was trained using a batch size of 256.
The proposed approach can be customized to train and optimize ViT models. The search space must be expanded to accommodate transformer-based hyperparameters. Similarly, training time must be long enough, with many iterations to guarantee convergence to an optimal solution.

5. Conclusions

The main goal of this study was to amplify the understanding of AutoML, and especially the optimization of DL models for image classification tasks. We have proposed a framework to automate the optimization process of DL models. Four DL models and prominent datasets for image classification challenges were selected for our empirical evaluations. We extended our experiments to include a transformer-based model for image classification. Our practical tests explored the association of two significant training-related parameters: batch size and learning rate. We have demonstrated that the proposed scheme improves the performance of DL models and significantly reduces the error rate by up to a 73% relative drop. Similarly, we have presented the training-related parameter values most likely to result in the improved performance of DL models for further empirical evaluations. The particular contribution of this paper is that it introduces a tool to automate the optimization process of DL models for image classification tasks. Instead of using brute force and exhaustive searches, a data scientist controls the number optimization attempt in the proposed framework. Image classification is considered as an ancient AI problem; nevertheless, it remains worthy of attention, as an image still speaks more than a thousand words. More research work will need to be done in efforts to fully automate these AI task’s ML pipeline. The insights gained from this study may assist in efforts to radically democratize the building and optimization of DL models, even for amateurs. While computer vision tasks involve image classification, object detection, and segmentation, implementation and empirical evaluations of the proposed solution are limited to image classification. Similarly, a data scientist must specify a preferred DL model for a given classification task before the optimization process. This demands a basic knowledge of existing or custom ConvNet-based models. In the future, we will seek to improve and deliver our automated optimization solution, which can be used as a Python library. Similarly, developing a web interface without additional package installation requirements allows non-practitioners to experiment and test the solution.

Author Contributions

Conceptualization, D.M.M.; methodology, D.M.M. and D.G.N.; formal analysis, D.M.M. and D.G.N.; writing—original draft preparation, D.M.M.; writing—review and editing, D.G.N., S.S. and S.K.; supervision, D.G.N., S.S. and S.K. All authors have read and agreed to the published version of the manuscript.

Funding

This work was carried out with the aid of a grant from the Artificial Intelligence for Development in Africa Program, a program funded by the Canada’s International Development Research Centre, Ottawa, Canada and the Swedish International Development Cooperation Agency, grant number 109704-001/002. The APC was funded by AI4D Anglophone Africa Multidisciplinary Research Lab.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Codes for the empirical test can be accessed from Google drive: https://drive.google.com/drive/folders/1G8uBoBp6hpSr9MeleeuFCVIEqKC5EOwF?usp=share_link, accessed on 7 August 2023; Fashion-MNIST dataset: https://github.com/zalandoresearch/fashion-mnist, accessed on 29 June 2023; Stanford Cars dataset: https://ai.stanford.edu/~jkrause/cars/car_dataset.html, accessed on 29 June 2023; Cats and Dogs dataset: https://storage.googleapis.com/mledu-datasets/cats_and_dogs_filtered.zip, accessed on 4 November 2022.

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
AutoMLAutomated Machine Learning
CIFARCanadian Institute for Advanced Research
ConvNetConvolutional Neural Networks
CVComputer Vision
DLDeep Learning
MLMachine Learning
MNISTModified National Institute of Standards and Technology
RMSPropRoot Mean Squared Propagation
SGDStochastic Gradient Descent
SMBOSequential-Model-Based Optimization
SOTAState-of-the-Art
ViTVision Transformer
VGGVirtual Geometry Group

Appendix A

Table A1. Training data for VGG-16.
Table A1. Training data for VGG-16.
Batch SizeLearning RateLossAccuracyValidation LossValidation AccuracyEpochTime (min)
80.10.81730.45930.79530.45921510
160.11.66380.46410.79690.4611127
320.10.79830.46920.79380.4607115
640.10.79550.45170.7910.4612107
1280.10.79220.46740.79420.4615158
80.010.68680.71480.34370.82883220
160.010.54790.73640.45570.82452717
320.010.4880.73770.29310.85692615
640.010.40460.75870.37130.8583139
1280.010.38610.77280.29080.8734168
80.0010.39830.80460.24170.87541913
160.0010.320.78120.24820.86722112
320.0010.33870.82320.24070.8622315
640.0010.27250.84630.23180.88482918
1280.0010.27160.85460.23680.88672214
80.00010.29760.85140.22920.89252917
160.00010.25240.87140.37840.85262313
320.00010.21710.87840.19490.9038138
640.00010.22290.88110.19450.90712110
1280.00010.21130.88790.19710.9107611
Table A2. Training data for Inception.
Table A2. Training data for Inception.
Batch SizeLearning RateLossAccuracyValidation LossValidation AccuracyEpochTime (min)
80.110.47080.48740.80360.46822910
160.10.80750.47430.77650.4825113
320.10.84160.48710.7720.4927113
640.10.7950.48230.76360.4837195
1280.10.8410.47410.79280.4715237
80.010.58460.72130.25060.7905186
160.010.63240.69240.7080.8738123
320.010.33620.82460.15050.9005165
640.010.25960.86230.140.9056226
1280.010.17190.89590.14720.909113
80.0010.17090.90220.15890.90673311
160.0010.13360.90970.10930.924248
320.0010.10360.93010.09860.926175
640.0010.09780.92830.10780.9183113
1280.0010.12130.9190.11870.9261236
80.00010.13040.92030.12780.92673712
160.00010.10450.92880.09080.9376257
320.00010.0670.94190.08790.93784611
640.00010.12980.92470.09910.9375217
1280.00010.10040.93630.10620.9334114
Table A3. Training data for EfficientNetB0.
Table A3. Training data for EfficientNetB0.
Batch SizeLearning RateLossAccuracyValidation LossValidation AccuracyEpochTime (min)
80.1Nan0.5000Nan0.5000117
160.1Nan0.5000Nan0.5000116
320.1Nan0.5000Nan0.5000106
640.1Nan0.5000Nan0.5000106
1280.1Nan0.5000Nan0.5000106
80.01Nan0.7407Nan0.8742116
160.011264.51010.8159158.3420.8877116
320.010.18180.89160.08850.92132920
640.010.1510.8593.3290.921189
1280.018696.48810.8901145.08450.93063216
80.0010.09340.92530.05520.93291710
160.0010.06380.93740.04910.93692110
320.0010.06050.93740.04920.9421178
640.0010.07440.93420.05110.94412413
1280.0010.07640.93450.04830.9467127
80.00010.10030.92790.04880.94851610
160.00010.0650.94470.04870.94863014
320.00010.07020.94270.04610.9487115
640.00010.07340.94360.09850.94962513
1280.00010.07730.95050.04250.9546115

References

  1. Hamet, P.; Tremblay, J. Artificial intelligence in medicine. Metabolism 2017, 69, S36–S40. [Google Scholar] [CrossRef] [PubMed]
  2. Nichols, J.A.; Herbert Chan, H.W.; Baker, M.A. Machine learning: Applications of artificial intelligence to imaging and diagnosis. Biophys. Rev. 2019, 11, 111–118. [Google Scholar] [CrossRef] [PubMed]
  3. Nilsson, N.J. Principles of Artificial Intelligence. IEEE Trans. Pattern Anal. Mach. Intell. 1981, PAMI-3, 112. [Google Scholar] [CrossRef]
  4. Zhang, X.-D. Machine Learning; Springer: Singapore, 2020; pp. 223–440. [Google Scholar] [CrossRef]
  5. Alpaydin, E. Introduction to Machine Learning; MIT Press: Cambridge, MA, USA, 2020. [Google Scholar]
  6. El Naqa, I.; Murphy, M.J. What is Machine Learning? In Machine Learning in Radiation Oncology; Springer: Cham, Switzerland, 2015; pp. 3–11. [Google Scholar] [CrossRef]
  7. Mitchell, T. Machine Learning; McGraw-Hill Science: London, UK, 1997. [Google Scholar]
  8. Mohammed, M.; Khan, M.B.; Bashier, E.B.M. Machine Learning: Algorithms and Applications; CRC Press: Cambridge, MA, USA, 2017. [Google Scholar]
  9. Greenspan, H.; Van Ginneken, B.; Summers, R.M. Guest Editorial Deep Learning in Medical Imaging: Overview and Future Promise of an Exciting New Technique. IEEE Trans. Med. Imaging 2016, 35, 1153–1159. [Google Scholar] [CrossRef]
  10. LeCun, Y.; Bengio, Y.; Hinton, G. Deep learning. Nature 2015, 521, 436–444. [Google Scholar] [CrossRef]
  11. He, X.; Zhao, K.; Chu, X. AutoML: A survey of the state-of-the-art. Knowl.-Based Syst. 2021, 212, 106622. [Google Scholar] [CrossRef]
  12. Bergstra, J.; Bengio, Y. Random search for hyper-parameter optimization. J. Mach. Learn. Res. 2012, 13, 281–305. [Google Scholar]
  13. Hesterman, J.Y.; Caucci, L.; Kupinski, M.A.; Barrett, H.H.; Furenlid, L.R. Maximum-likelihood estimation with a contracting-grid search algorithm. IEEE Trans. Nucl. Sci. 2010, 57, 1077–1084. [Google Scholar] [CrossRef]
  14. Dewancker, I.; McCourt, M.; Clark, C.; Peter, P.E. Hart, Bayesian Optimization Primer; Wiley: Hoboken, NJ, USA; p. 654. Available online: https://static.sigopt.com/b/20a144d208ef255d3b981ce419667ec25d8412e2/static/pdf/SigOpt_Bayesian_Optimization_Primer.pdf (accessed on 1 June 2022).
  15. Shahriari, B.; Swersky, K.; Wang, Z.; Adams, R.P.; de Freitas, N. Taking the human out of the loop: A review of bayesian optimization. Proc. IEEE 2015, 104, 148–175. [Google Scholar] [CrossRef]
  16. Bengio, Y. Gradient-Based Optimization of Hyperparameters. Neural Comput. 2000, 12, 1889–1900. [Google Scholar] [CrossRef]
  17. Chandra, K.; Xie, A.; Ragan-Kelley, J.; Meijer, E. Gradient Descent: The Ultimate Optimizer. arXiv 2019, arXiv:1909.13371. [Google Scholar]
  18. Franceschi, L.; Donini, M.; Frasconi, P.; Pontil, M. Forward And Reverse Gradient-Based Hyperparameter Optimization. In Proceedings of the 34th International Conference on Machine Learning, Sydney, Australia, 6–11 August 2017; pp. 1165–1173. [Google Scholar]
  19. Maclaurin, D.; Duvenaud, D.; Adams, R. Gradient-Based Hyperparameter Optimization through Reversible Learning. In Proceedings of the 32nd International Conference on Machine Learning, Lille, France, 7–9 July 2015; pp. 2113–2122. [Google Scholar]
  20. Claesen, M.; De Moor, B. Hyperparameter search in machine learning. arXiv 2015, arXiv:1502.02127. [Google Scholar]
  21. Bergstra, J.; Yamins, D.; Cox, D. Making a science of model search: Hyperparameter optimization in hundreds of dimensions for vision architectures. In Proceedings of the 30th International Conference on Machine Learning, Atlanta, GE, USA, 17–19 June 2013; pp. 115–123. [Google Scholar]
  22. Scikit, Scikit-Optimize: Sequential Model-Based Optimization in Python—Scikit-Optimize 0.8.1 Documentation. 2020. Available online: https://scikit-optimize.github.io/stable/ (accessed on 1 February 2023).
  23. Lindauer, M.; Eggensperger, K.; Feurer, M.; Biedenkapp, A.; Deng, D.; Benjamins, C.; Ruhkopf, T.; Sass, R.; Hutter, F. GitHub—automl/SMAC3: SMAC3: A Versatile Bayesian Optimization Package for Hyperparameter Optimization. J. Mach. Learn. Res. 2022, 23, 1–9. Available online: https://github.com/automl/SMAC3 (accessed on 1 February 2023).
  24. Cai, H.; Zhu, L.; Han, S. Proxylessnas: Direct neural architecture search on target task and hardware. In Proceedings of the 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, 6–9 May 2019. [Google Scholar]
  25. Liu, C.; Zoph, B.; Neumann, M.; Shlens, J.; Hua, W.; Li, L.J.; Li, F.-F.; Yuille, A.; Huang, J.; Murphy, K.; et al. Progressive Neural Architecture Search. In Lecture Notes in Computer Science (Including Subseries Lecture Notes Artificial Intelligence Lecture Notes Bioinformatics), Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; Springer: Cham, Switzerland, 2018; pp. 19–35. [Google Scholar]
  26. Pham, H.; Guan, M.; Zoph, B.; Le, Q.; Dean, J. Efficient neural architecture search via parameters sharing. In Proceedings of the 5th International Conference on Machine Learning, Stockholm, Sweden, 10–15 July 2018; pp. 4095–4104. [Google Scholar]
  27. Tan, M.; Chen, B.; Pang, R.; Vasudevan, V.; Sandler, M.; Howard, A.; Le, Q.V. Mnasnet: Platform-aware neural architecture search for mobile. In Proceedings of the 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Long Beach, CA, USA, 15–20 June 2019; pp. 2815–2823. [Google Scholar] [CrossRef]
  28. Zoph, B.; Le, Q.V. Neural architecture search with reinforcement learning. In Proceedings of the 5th International Conference on Learning Representations, ICLR 2017, Conference Track Proceedings, Toulon, France, 24–26 April 2017; pp. 1–16. [Google Scholar]
  29. Simonyan, K.; Zisserman, A. Very Deep Convolutional Networks for Large-Scale Image Recognition. arXiv 2014, arXiv:1409.1556. [Google Scholar]
  30. Szegedy, C.; Vanhoucke, V.; Ioffe, S.; Shlens, J.; Wojna, Z. Rethinking the Inception Architecture for Computer Vision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 2818–2826. [Google Scholar]
  31. He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 770–778. [Google Scholar] [CrossRef]
  32. Tan, M.; Le, Q. Efficientnet: Rethinking Model Scaling for Convolutional Neural Networks. In Proceedings of the 36th International Conference on Machine Learning, Long Beach, CA, USA, 9–15 June 2019; pp. 6105–6114. [Google Scholar]
  33. Dosovitskiy, A.; Beyer, L.; Kolesnikov, A.; Weissenborn, D.; Zhai, X.; Unterthiner, T.; Dehghani, M.; Minderer, M.; Heigold, G.; Houlsby, N.; et al. An Image Is Worth 16×16 Words: Transformers for Image Recognition at Scale. arXiv 2020, arXiv:2010.11929. [Google Scholar]
  34. Pinto, F.; Torr, P.H.S.; Dokania, P.K. An Impartial Take to the CNN vs. Transformer Robustness Contest. In Lecture Notes in Computer Science, Computer Vision—ECCV 2022, Proceedings of the 17th European Conference, Tel Aviv, Israel, 23–27 October 2022; Springer: Cham, Switzerland, 2022; pp. 466–480. [Google Scholar] [CrossRef]
  35. Sharma, N.; Jain, V.; Mishra, A. An Analysis of Convolutional Neural Networks for Image Classification. Procedia Comput. Sci. 2018, 132, 377–384. [Google Scholar] [CrossRef]
  36. Birodkar, V.; Mobahi, H.; Bengio, S. Semantic Redundancies in Image-Classification Datasets: The 10% You Don’t Need. arXiv 2019, arXiv:1901.11409. [Google Scholar]
  37. Xiao, H.; Rasul, K.; Vollgraf, R. Fashion-MNIST: A Novel Image Dataset for Benchmarking Machine Learning Algorithms. arXiv 2017, arXiv:1708.07747. [Google Scholar]
  38. Krause, J.; Stark, M.; Deng, J.; Fei-Fei, L. 3D Object representations for fine-grained categorization. In Proceedings of the 2013 IEEE International Conference on Computer Vision Workshops, Sydney, NSW, Australia, 2–8 December 2013; pp. 554–561. [Google Scholar] [CrossRef]
  39. Wang, Y.; Sun, D.; Chen, K.; Lai, F.; Chowdhury, M. Egeria: Efficient DNN Training with Knowledge-Guided Layer Freezing. arXiv 2022, arXiv:2201.06227. [Google Scholar]
  40. Probst, P.; Bischl, B.; Boulesteix, A.L. Tunability: Importance of Hyperparameters of Machine Learning Algorithms. arXiv 2018, arXiv:1802.09596. [Google Scholar]
  41. Faes, L.; Wagner, S.K.; Fu, D.J.; Liu, X.; Korot, E.; Ledsam, J.R.; Back, T.; Chopra, R.; Pontikos, N.; Keane, P.A.; et al. Automated deep learning design for medical image classification by health-care professionals with no coding experience: A feasibility study. Lancet Digit. Health 2019, 1, e232–e242. [Google Scholar] [CrossRef] [PubMed]
  42. Xu, H.; Yao, L.; Li, Z.; Liang, X.; Zhang, W. Auto-FPN: Automatic network architecture adaptation for object detection beyond classification. In Proceedings of the 2019 IEEE/CVF International Conference on Computer Vision (ICCV), Seoul, Republic of Korea, 27 October–2 November 2019; pp. 6648–6657. [Google Scholar] [CrossRef]
  43. Weerts, H.J.; Mueller, A.C.; Vanschoren, J. Importance of Tuning Hyperparameters of Machine Learning Algorithms. arXiv 2020, arXiv:2007.07588. [Google Scholar]
  44. Guo, J.; Han, K.; Wang, Y.; Zhang, C.; Yang, Z.; Wu, H.; Chen, X.; Xu, C. Hit-Detector: Hierarchical Trinity Architecture Search for Object Detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 13–19 June 2020; pp. 11405–11414. [Google Scholar] [CrossRef]
  45. He, X.; Wang, S.; Chu, X.; Shi, S.; Tang, J.; Liu, X.; Yan, C.; Zhang, J.; Ding, G. Automated Model Design and Benchmarking of Deep Learning Models for COVID-19 Detection with Chest CT Scans. In Proceedings of the Thirty-Fifth AAAI Conference on Artificial Intelligence (AAAI-21), virtually, 2–9 February 2021; Volume 35, pp. 4821–4829. [Google Scholar]
  46. Yi, H.; Bui, K.-H.N. An Automated Hyperparameter Search-Based Deep Learning Model for Highway Traffic Prediction. IEEE Trans. Intell. Transp. Syst. 2020, 22, 5486–5495. [Google Scholar] [CrossRef]
  47. Kandel, I.; Castelli, M. The effect of batch size on the generalizability of the convolutional neural networks on a histopathology dataset. ICT Express 2020, 6, 312–315. [Google Scholar] [CrossRef]
  48. Masters, D.; Luschi, C. Revisiting small batch training for deep neural networks. arXiv 2018, arXiv:1804.07612. [Google Scholar]
  49. Radiuk, P.M. Impact of training set batch size on the performance of convolutional neural networks for diverse datasets. Inf. Technol. Manag. Sci. 2017, 20, 20–24. [Google Scholar] [CrossRef]
  50. Bengio, Y. Practical recommendations for gradient-based training of deep architectures. In Neural Networks: Tricks of the Trade, 2nd ed.; Springer: Berlin/Heidelberg, Germany, 2012; pp. 437–478. [Google Scholar] [CrossRef]
  51. Touvron, H.; Cord, M.; El-Nouby, A.; Verbeek, J.; Jégou, H. Three Things Everyone Should Know About Vision Transformers. In Lecture Notes in Computer Science (Including Subseries Lecture Notes Artificial Intelligence Lecture Notes Bioinformatics); Springer: Cham, Switzerland, 2022; Volume 13684. [Google Scholar] [CrossRef]
Figure 1. Automated optimization framework.
Figure 1. Automated optimization framework.
Computers 12 00174 g001
Figure 2. Model performance when trained at a rate of 0.0001: (a) model diverges with mini batch of 128; (b) model converges with a mini batch of 8. Model loss when trained at a rate of 0.001: (c) model diverges with a minibatch of 128; (d) model converges with minibatch of 8.
Figure 2. Model performance when trained at a rate of 0.0001: (a) model diverges with mini batch of 128; (b) model converges with a mini batch of 8. Model loss when trained at a rate of 0.001: (c) model diverges with a minibatch of 128; (d) model converges with minibatch of 8.
Computers 12 00174 g002
Figure 3. Model performance when optimized with KerasTuner and our proposed approach: (a) model accuracy when trained with KerasTuner; (b) model loss when trained with KerasTuner; (c) model accuracy when trained with our approach; (d) model loss when trained with our approach.
Figure 3. Model performance when optimized with KerasTuner and our proposed approach: (a) model accuracy when trained with KerasTuner; (b) model loss when trained with KerasTuner; (c) model accuracy when trained with our approach; (d) model loss when trained with our approach.
Computers 12 00174 g003
Figure 4. Transformer-based model performance when optimized with our proposed approach: (a) model accuracy; (b) model loss; (c) model top-5 accuracy.
Figure 4. Transformer-based model performance when optimized with our proposed approach: (a) model accuracy; (b) model loss; (c) model top-5 accuracy.
Computers 12 00174 g004
Table 1. Training data for ResNet50.
Table 1. Training data for ResNet50.
Batch SizeLearning RateLossAccuracyValidation LossValidation AccuracyEpochTime (min)
80.10.83530.48270.87610.4929117
160.10.79280.55550.7870.51674930
320.10.89220.49370.90060.51511811
640.10.90660.46391.01160.47122920
1280.11.03630.46450.79070.46752818
80.010.22770.85060.32070.83316431
160.010.02140.91980.1140.91412515
320.010.23120.85530.59770.77374022
640.010.01720.92770.07270.9265029
1280.010.00220.93040.06030.93162614
80.0010.02390.92920.06860.93713513
160.0010.05840.92840.08270.93762012
320.0010.00790.94420.09270.9403159
640.0010.00080.95140.07860.9404127
1280.0010.0050.95040.06160.9383166
80.00010.60790.93950.06150.94246345
160.00010.0270.95060.08650.93691912
320.00010.09740.94390.10060.94277846
640.00010.04090.94690.10460.9458116
1280.00010.05690.95340.1050.9539116
Table 2. Association of hyperparameters during training and optimization.
Table 2. Association of hyperparameters during training and optimization.
DL ModelBatch SizeLearning RateValidation AccuracyEpoch
ResNet501280.0198.7%26
80.0188.7%66
VGG-161280.0192.6%16
80.0189.5%32
Inception1280.0195.4%11
80.0183.4%18
EfficientNetB01280.0195.8%14
80.0160.1%21
Table 3. Post-automated optimization performance evaluation.
Table 3. Post-automated optimization performance evaluation.
DL ModelInitial AccuracyFinal AccuracyTraining TimeBatch SizeLearning Rate
VGG-16 [29]0.93700.983001:00:58321 × 10−5
Inception [30]0.98700.992000:41:25161 × 10−5
ResNet50 [31]0.9820-03:17:26321 × 10−3
EfficientNet [32]0.98300.989002:41:08161 × 10−5
Table 4. A summary of proposed training-related parameters for DL models.
Table 4. A summary of proposed training-related parameters for DL models.
Batch SizeLearning RateLearning Rate (Unfrozen)
161 × 10−41 × 10−5
321 × 10−31 × 10−4
641 × 10−21 × 10−3
Table 5. The impact of optimizers on accuracy and loss.
Table 5. The impact of optimizers on accuracy and loss.
DL ModelOptimizerLossAccuracyValidation LossValidation AccuracyEpochTime (min)
ResNet50Adam0.33170.89050.33560.87202719
SGD0.00840.99750.06410.98103822
RMSprop0.83840.58450.82030.45602315
VGG-16Adam0.25860.88550.17230.93603621
SGD0.39870.81400.24960.90206319
RMSprop0.30570.86850.18970.92902512
InceptionAdam0.10150.95900.11010.95703811
SGD0.10640.95400.09750.9620216
RMSprop0.12830.95550.09550.96203810
EfficientNetAdam0.12170.96400.07800.98103919
SGD0.07890.96900.04580.9840189
RMSprop0.21290.96650.22350.98003115
Table 6. Research contributions of existing literature.
Table 6. Research contributions of existing literature.
ReferenceApproachML Model(s)Contribution
[40,43]ManualClassicalInvestigated the importance of hyperparameter tuning
[41,42,44,45]AutoDeep LearningDemonstrated the automated design of DL models
[46]AutoDeep Learning (Time Series)Demonstrated the automated hyperparameter search
Our Approach AutoDeep Learning (Image Classification)Investigated hyperparameter association, demonstrated automated optimization, proposed hyperparameter values
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Migayo, D.M.; Kaijage, S.; Swetala, S.; Nyambo, D.G. Automated Optimization-Based Deep Learning Models for Image Classification Tasks. Computers 2023, 12, 174. https://doi.org/10.3390/computers12090174

AMA Style

Migayo DM, Kaijage S, Swetala S, Nyambo DG. Automated Optimization-Based Deep Learning Models for Image Classification Tasks. Computers. 2023; 12(9):174. https://doi.org/10.3390/computers12090174

Chicago/Turabian Style

Migayo, Daudi Mashauri, Shubi Kaijage, Stephen Swetala, and Devotha G. Nyambo. 2023. "Automated Optimization-Based Deep Learning Models for Image Classification Tasks" Computers 12, no. 9: 174. https://doi.org/10.3390/computers12090174

APA Style

Migayo, D. M., Kaijage, S., Swetala, S., & Nyambo, D. G. (2023). Automated Optimization-Based Deep Learning Models for Image Classification Tasks. Computers, 12(9), 174. https://doi.org/10.3390/computers12090174

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop