PIDNet<T>

Models & Types · AiDotNet.ComputerVision.Segmentation.Efficient

PIDNet: A Real-time Semantic Segmentation Network Inspired by PID Controllers.

Inheritance: NeuralNetworkBase<T> → SegmentationModelBase<T> → SemanticSegmentationBase<T> → PIDNet<T>

For Beginners

Real-time semantic segmentation for autonomous driving. Cityscapes and urban scene parsing.

Common use cases:

  • Real-time semantic segmentation for autonomous driving
  • Cityscapes and urban scene parsing
  • Edge-device semantic segmentation
  • Balanced speed-accuracy segmentation

How It Works

Technical Details:

  • PID-controller-inspired three-branch architecture (P, I, D)
  • P-branch: detail features, I-branch: context, D-branch: boundary
  • Bag of Tricks for efficient feature fusion
  • Achieves Cityscapes mIoU 80+ at 90+ FPS

Reference: Xu et al., “PIDNet: A Real-time Semantic Segmentation Network Inspired by PID Controllers”, CVPR 2023.

Example

var trainingMasks = Tensor<double>.CreateRandom(1, 3, 32, 32);
var inputImage = Tensor<double>.CreateRandom(1, 3, 32, 32);
var trainingImages = Tensor<double>.CreateRandom(4, 3, 32, 32);
// Use AiModelBuilder facade for real-time semantic segmentation
var architecture = new NeuralNetworkArchitecture<double>(
    inputType: InputType.ThreeDimensional,
    taskType: NeuralNetworkTaskType.MultiClassClassification,
    inputHeight: 512, inputWidth: 1024, inputDepth: 3, outputSize: 19);
            
var builder = new AiModelBuilder<double, Tensor<double>, Tensor<double>>()
    .ConfigureModel(new PIDNet<double>(architecture));
            
var result = builder.Build(trainingImages, trainingMasks);
var segmentation = result.Predict(inputImage);

Constructors

Constructor Summary
PIDNet(NeuralNetworkArchitecture<T> architecture, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer, ILossFunction<T> lossFunction, PIDNetOptions options) Initializes PIDNet in native (trainable) mode.
PIDNet(NeuralNetworkArchitecture<T> architecture, string onnxModelPath, PIDNetOptions options) Initializes PIDNet in ONNX (inference-only) mode.

Methods

Method Summary
ModelMetadata<T> GetModelMetadata() Collects metadata describing this model’s configuration.