Modern image classification

Classify the whole image without boxes or masks. Organize images in class folders. Defaults: input 960, maximum epochs 500, batch 8, workers 4, AdamW, initial learning rate 0.0005 and final multiplier 0.01.

Rotation and flipping

degrees defaults to 180, the maximum absolute random rotation during training; 0 disables this rotation. The application removes RandAugment's duplicate Rotate operation and inserts an explicit rotation to keep its strength controlled. Vertical and horizontal flip probabilities both default to 0.5.

Center-crop fraction crop_fraction

This is a retention fraction defined on the image's short edge, not object-box cropping or random image deletion.

For example, with imgsz=960 and fraction 0.8, resize the short edge to at least 960/0.8=1200, then center-crop 960×960. Validation and software inference use the same rule; training still applies random cropping and other augmentations after this central-region preprocessing.

At a fraction of 1, the short edge is not additionally enlarged, but validation/inference still center-crops to a square and can remove the edges of elongated images. A fraction of 1 does not preserve every edge for all aspect ratios.

The fraction and preprocessing rules are written to PT and ONNX metadata. ONNX also generates .preprocess.json for external deployment reference; software inference prioritizes embedded model information. Older models without this metadata retain native preprocessing and are not retroactively modified.

Outputs and metrics

Results are stored in a sibling folder named after the dataset with the _runs suffix. Charts show actual classification metrics such as accuracy, not detection mAP. Typical outputs include best.pt, last.pt, deployment PT, ONNX, class Label.txt and preprocessing information; the successful export log is authoritative.

See modern common parameters and the classification parameter table for other controls.