PyTorch-based baseline and image classification pipeline for crop disease detection.
AI Challenger 2018 competition baseline upgraded for PyTorch 2.x with automated device switching and AMP.
This repository provides a complete PyTorch pipeline for classifying plant diseases from high-resolution leaf images. It suits machine learning practitioners and agricultural data scientists looking for a baseline model built on ResNet50.
It processes 650x650 crop images through a modified ResNet50 architecture, handles stratified dataset splitting, and supports both online data augmentations and optional offline preprocessing. The pipeline features automatic CPU/GPU switching, mixed precision training, and a corrected FocalLoss implementation for handling class imbalances.
It suits developers and researchers with PyTorch experience who need a structured baseline for agricultural image classification tasks. It does not suit non-technical agronomists looking for a ready-to-use mobile app or plug-and-play web interface.
Uses a pretrained ResNet50 network adapted with an adaptive average pooling layer and a 59-class classification head.
Supports automatic mixed precision training on CUDA devices to reduce memory consumption and speed up execution.
Includes scripts to merge and split train-validation sets using stratified K-fold logic while handling anomalous classes.
Provides a fixed FocalLoss implementation with proper per-sample modulation to replace standard cross-entropy.
Free under its open-source nature, though the README does not specify a formal license. The only cost is running it yourself on your own hardware or cloud instance.
877 open remote AI-training roles, updated November 16, 2026; most pay $20–$175 an hour. Zekai lists them free; the application goes to the employer’s platform.
These reviewed AI tools do the same job instantly — from our scored directory.
A CUDA-compatible GPU with sufficient VRAM is recommended due to the 650x650 image size, though the code automatically falls back to CPU if no GPU is detected.
The preparation script removes specific anomalous classes and shifts indices, while the test pipeline automatically maps predictions back to original official identifiers.
See Zekai first in Google