This model is a custom Convolutional Neural Network (CNN) built with PyTorch, trained from scratch on a labelled dataset of fruit and vegetable images. It can classify images into 35 categories spanning common fruits, vegetables, and root crops.
Architecture
The network uses a BiggerVGG design — four stacked convolutional blocks (each with two Conv2d + ReLU layers followed by MaxPool2d), ending in a fully-connected classifier. The input images are resized to 224×224 pixels and normalised to [0, 1] before being fed into the network.
Training
The model was trained using the Adam optimiser with a learning rate of 0.001 and cross-entropy loss. TrivialAugmentWide augmentation was applied during training to improve generalisation. The model achieved 84% accuracy on the held-out test split.
Limitations
The training set is relatively small — around 70 images per category — so performance on unusual or ambiguous specimens may be lower than a large-scale model. The source dataset was also not heavily cleaned: it contains cartoon and illustrated images for some categories, which can confuse the model when those training examples conflict with real photographs. The model is also constrained to its 35 categories: any input image will always be mapped to one of them, regardless of whether the subject actually belongs there. The confidence scores are raw softmax outputs and can be overconfident — treat a low top-1 score as a sign the input may be outside the model’s known categories.