SegNeXtOptions

Options & Configuration · AiDotNet.ComputerVision.Segmentation.Semantic

Configuration options for SegNeXt (Guo et al. 2022).

Inheritance: ModelOptions → NeuralNetworkOptions → ModelHyperparameterOptions → SegmentationModelOptions → SegNeXtOptions

For Beginners

SegNeXt labels every pixel of an image with a class. These options pick its size and how it trains.

How It Works

The training defaults are the paper’s ADE20K recipe (§4.1, and the authors’ and mmsegmentation’s configs): AdamW at 6e-5 with weight decay 0.01, a linear warm-up over 1500 iterations from 1e-6 of the rate, then a poly (power 1) decay to zero over 160k iterations. The configs also train the decode head at ten times the rate and exempt parameters named “norm” from weight decay. The architecture follows ModelSize (MSCAN-T/S/B/L with a LightHamHead of 256/256/512/1024 channels).

Constructors

Constructor Summary
SegNeXtOptions() Creates the paper’s defaults (MSCAN-T, 150 ADE20K classes).
SegNeXtOptions(SegNeXtOptions other) Copies every option.

Properties

Property Summary
SegNeXtModelSize ModelSize { get; set; } MSCAN-T, -S, -B or -L.
bool RandomBasesPerForward { get; set; } Whether the Hamburger NMF draws new random bases on every forward pass (the official code’s rand_init=True, which makes predictions vary slightly between calls), instead of bases drawn once when the model is built and saved with it (rand_in…
double HeadLearningRateMultiplier { get; set; } The decode head’s learning-rate multiplier (10).
double LearningRate { get; set; } AdamW’s base learning rate (6e-5).
double WarmupStartFactor { get; set; } The fraction of the rate the warm-up starts from (1e-6).
double WeightDecay { get; set; } AdamW’s weight decay (0.01).
double? DropPathRate { get; set; } The encoder’s stochastic-depth rate; null takes the size’s (0.1, and 0.3 for Large).
int MatrixRank { get; set; } The Hamburger NMF’s rank (16).
int TrainingIterations { get; set; } The iteration the poly decay reaches zero at (160 000).
int WarmupIterations { get; set; } Linear warm-up iterations (1500).
int? HeadChannels { get; set; } The head’s channels (squeeze, Hamburger and align) overriding the size’s; null keeps them.
int[] Depths { get; set; } Blocks per stage overriding the size’s; null keeps them.
int[] EmbedDims { get; set; } Stage widths overriding the size’s; null keeps them.

Methods

Method Summary
void Validate() Checks the shared segmentation options.