Image Classifier Using CNN in Pytorch
Farid Farhat
Published
• While studying AI and Machine Learning Nano degree at UDACITY, I developed NeuroCLI application– a neural network with command-line control.
• The application efficiently trains and predicts on new image datasets by leveraging pre-trained CNN,
significantly reducing training time.
• A user can specify input data and hyper-parameters of the model from command line interface then the
program automatically start training, more details are on GitHub repo – image classifier.
Key Features:
• Customizable Parameters: Users can modify hyperparameters from the command line, including: data
directory, CNN architecture (vgg13 or densenet121), learning rate, number of hidden units, epochs, and GPU
usage.
• Default Model is vgg13, with the option to switch to densenet121.
Model Development
• The model classifies flower types based on image input, providing probabilities for each class.
• In network architecture, modified the final layer of the CNN with a single hidden layer that uses ReLU
activation to capture non-linearity in the dataset.
• A 20% dropout rate is applied to mitigate overfitting, taking into account the dataset’s small size and low
model complexity.
• Finally, the LogSoftmax activation function maps the model’s output to log-probabilities for classification.