03

Loading and Decoding Rules

Registry fields control model loading, preprocessing, and postprocessing.

Loader Types

  • transformers_image_classification: loads a true Transformers-native image processor and classifier.
  • convnext_ordinal_mixed: tries the configured structured subfolder first, then a timm ConvNeXt ordinal fallback.
  • custom_deit_timm: tries Transformers loading, then a timm DeiT loader for safetensors/bin checkpoints.
  • torchvision_mobilenetv3: reconstructs MobileNetV3 large/small and safely checks checkpoint compatibility.
  • bilal_parallel_corn: inspects the CORN parallel-checkpoint structure and stays unavailable until the original module mapping is verified.

Postprocessing

  • classification: softmax plus argmax over the five DR classes.
  • ordinal: sigmoid threshold decoding when the model returns four cumulative logits; otherwise an argmax fallback is reported.
  • regression: single-value outputs are rounded and clamped to DR grades 0 through 4.