SegmentationModelOptions

Options & Configuration · AiDotNet.Models.Options

The hyperparameters every segmentation model in the library has: how many classes it predicts, and how much dropout its encoder uses.

Inheritance: ModelOptions → NeuralNetworkOptions → ModelHyperparameterOptions → SegmentationModelOptions

Known derived types: BiomedParseOptions, CUPSOptions, ConcertoOptions, DEVAOptions, DiffCutOptions, DiffCutSegmentationOptions, DiffSegOptions, EdgeSAMOptions, EfficientSAMOptions, EfficientTAMOptions, FastSAMOptions, InternImageOptions, KMaXDeepLabOptions, MedNeXtOptions, MedSAM2Options, MedSAMOptions, MedSegDiffV2Options, MedSegDiffV2SegmentationOptions, MedicalSAM2Options, MobileSAMOptions, NnUNetOptions, ODISEOptions, ODISESegmentationOptions, PIDNetOptions, PointTransformerV3EncoderOptions, RepViTSAMOptions, SAM21Options, SAMHQOptions, SAMOptions, SEEMOptions, SegFormerOptions, SegGPTOptions, SegMambaOptions, SegNeXtOptions, SlimSAMOptions, SwinUNETROptions, TextQueriedSegmentationOptions, TransUNetOptions, U2SegOptions, UMambaOptions, UniVSOptions, UniverSegOptions, VMambaOptions, ViMUNetOptions, ViTAdapterOptions, ViTCoMerOptions, VisionMambaOptions, YOLO11SegOptions, YOLO26SegOptions, YOLOv12SegOptions, YOLOv8SegOptions, YOLOv9SegOptions

For Beginners

A segmentation model labels every pixel (or point, or voxel) of its input. Two settings apply to all of them regardless of the architecture: how many different labels it can choose between, and how much of the network is randomly switched off during training to stop it memorising the training images. Everything else — patch sizes, embedding widths, decoder shapes — differs per model and lives on that model’s own options class.

How It Works

Both values were previously constructor parameters on all 62 segmentation models, which is the defect issue #2090 describes: the options object existed and was stored, but the values that actually shape the model arrived past it and could not be set through it. They are declared here rather than repeated on each leaf because every one of the 62 has both, and every one of them called them by these names.

A model’s size variant is deliberately NOT here. Each model names its own variants with its own enum (SegFormerModelSize, SAMModelSize, and so on), so there is no common type to declare; the variant stays a property on the leaf options class.

Properties

Property Summary
double DropRate { get; set; } Gets or sets the dropout rate applied inside the encoder during training.
int NumClasses { get; set; } Gets or sets the number of classes the model predicts per pixel.