Skip to content

Latest commit

 

History

History
32 lines (17 loc) · 1.24 KB

README.md

File metadata and controls

32 lines (17 loc) · 1.24 KB

Food11-Classification

Using pretrained DenseNet-121 for image classification

1 Environment:

In this experiment, Google Colab is used to utilize GPU acceleration and achieve better training results in a shorter time.

The source code is in notebook format and can be directly opened on the Google Colab platform by running each code block sequentially.

2 Program Workflow

(1) Data Processing

First, downloading food images dataset from Kaggle, and upload zip to Google Drive (compression speeds up the upload process), and then extract it.

Next, define some data augmentation operations, such as cropping and rotation.

Finally, extract the labels and put all the data into dataloaders.

(2) Model Building

The model consists of a pretrained DenseNet121 and a fully connected layer.

(3) Model Training

The loss function is cross-entropy, and the Adam optimizer is used.

f45a7d139a05776aa863360d36ebcd8

(4) Model Testing

ba19b1260fa66a4b337757ca68ace8e