SlowFast<T>

Models & Types · AiDotNet.Video.ActionRecognition

SlowFast Networks for Video Recognition.

Inheritance: NeuralNetworkBase<T> → SlowFast<T>

For Beginners

SlowFast is a two-pathway network that processes video at two different frame rates simultaneously:

  • Slow pathway: Processes fewer frames (e.g., 4 fps) but with more channels to capture spatial details
  • Fast pathway: Processes more frames (e.g., 32 fps) but with fewer channels to capture motion

This design is inspired by how human vision has:

  • Parvo cells: Slow but detailed spatial processing
  • Magno cells: Fast but coarse motion processing

Example usage:

How It Works

Technical Details:

  • Two-pathway design with lateral connections
  • Slow pathway: T frames, C channels
  • Fast pathway: alphaT frames, betaC channels (alpha=8, beta=1/8 typically)
  • Lateral connections fuse information between pathways

Reference: “SlowFast Networks for Video Recognition” ICCV 2019 https://arxiv.org/abs/1812.03982

Constructors

Constructor Summary
SlowFast() Initializes a new instance with default architecture settings.
SlowFast(NeuralNetworkArchitecture<T> architecture, SlowFastOptions options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer, ILossFunction<T> lossFunction, IActivationFunction<T> probabilityActivation, IReadOnlyList<ILayer<T>> customFastLayers, IReadOnlyList<ILayer<T>> customFusionLayers) Creates a SlowFast model using native layers for training and inference.
SlowFast(NeuralNetworkArchitecture<T> architecture, string onnxModelPath, SlowFastOptions options, IActivationFunction<T> probabilityActivation) Creates a SlowFast model using a pretrained ONNX model for inference.

Properties

Property Summary
bool SupportsTraining { get; }

Methods

Method Summary
List<ValueTuple<int, double>> GetTopKPredictions(Tensor<T> videoFrames, int topK) Gets top-K predictions with probabilities.
ModelMetadata<T> GetModelMetadata() Gets metadata about this model for serialization.
Tensor<T> Classify(Tensor<T> videoFrames) Classifies video frames into action categories.
Tensor<T> ForwardForTraining(Tensor<T> input) Tape-aware forward pass for training.