Zing Forum

Reading

Vegetable Vision: A Production-Oriented CNN Image Classification Project Practice

A deep learning course project by Singapore Polytechnic students, demonstrating how to refactor course notebooks into a production-ready project with MLOps practices, CI/CD pipelines, security scans, and complete documentation.

CNN卷积神经网络图像分类TensorFlowKerasMLOps深度学习数据增强CI/CD
Published 2026-04-29 17:14Recent activity 2026-04-29 17:21Estimated read 6 min
Vegetable Vision: A Production-Oriented CNN Image Classification Project Practice
1

Section 01

Vegetable Vision: A Production-Oriented CNN Image Classification Project Guide

Vegetable Vision is a project by Singapore Polytechnic student Goh Kun Ming, which transforms a deep learning course assignment (Jupyter Notebook) into a production-ready machine learning project. It integrates MLOps practices, CI/CD pipelines, security scans, and complete documentation. The project focuses on vegetable image classification using CNNs, compares multiple architectures, and demonstrates how to bridge academic work to production-level engineering.

2

Section 02

Project Background & Motivation

The project originated from a course assignment (ST1504 Deep Learning CA1 Part A) at Singapore Polytechnic, where the task was to build a CNN classifier for vegetable images using a single Jupyter Notebook. The author realized the need to refactor the notebook into maintainable, reusable code to enable future reuse, maintenance, and expansion—leading to the birth of Vegetable Vision, which retains academic value while adopting modern software engineering and MLOps best practices.

3

Section 03

Core Technical Goals & Model Architecture Comparisons

The project's key technical goals include:

  1. Implementing multi-class vegetable image classification with TensorFlow/Keras, comparing input sizes (23px vs.101px) and data augmentation effects.
  2. Evaluating 5 CNN architectures: Sequential model (baseline), Functional API (flexible), Residual connections (alleviate gradient vanishing), Inception-like (multi-scale features), and Depthwise Separable convolution (lightweight, reduced compute).
  3. Refactoring the notebook into a maintainable codebase with production-level standards.
4

Section 04

Project Structure & MLOps Practices

Structure:

  • Original notebook kept in root and notebooks/ for academic integrity.
  • src/vegetable_vision/ for modular code (model definitions, training, data processing).
  • tests/ for pytest suites (config validation, data loading, notebook tools).
  • docs/ for comprehensive documentation.
  • Notebook split script to divide large notebooks into small files and ensure sync with original.

MLOps:

  • Dependency management: pyproject.toml, separate runtime (requirements.txt) and dev (requirements-dev.txt) dependencies.
  • Code quality: Ruff (formatting/static check), Bandit (security scan), pip-audit (dependency audit).
  • CI/CD: GitHub Actions automate tests, code checks, security scans, CodeQL analysis on each commit.
5

Section 05

Dataset & Training Process

The vegetable image dataset uses standard train/validation/test splits. Due to academic use restrictions, data is not committed to version control (via .env and .gitignore). Training scripts have a command-line interface to specify data directory, model type, image size, and epochs. Evaluation scripts load saved models to generate performance reports, enabling easy integration into automation pipelines.

6

Section 06

Documentation & Educational/Industry Value

Documentation:

  • PROJECT_CONTEXT.md (background/decisions), DATASET.md (format/source/restrictions), MLOPS.md (practices), MODEL_CARD.md (model details/limitations), ARCHITECTURE.md (code structure), CI_SECURITY.md (CI/security config).

Value:

  • Educational: Shows students how to turn academic prototypes into production-ready products—critical for AI industry competitiveness.
  • Industry: Provides a lightweight MLOps reference using simple tools (pytest, Ruff, GitHub Actions) to build effective quality assurance systems.
7

Section 07

Limitations & Future Improvement Directions

Limitations:

  • Full model reproduction requires original dataset and GPU resources.
  • Test coverage focuses on infrastructure code (not model training logic, which needs heavy compute).

Future Directions:

  • Integrate experiment tracking tools (Weights & Biases/MLflow).
  • Add model version management (e.g., DVC).
  • Implement model serving (e.g., FastAPI).
  • Expand test coverage to model inference paths.