BASIC<T>

Models & Types · AiDotNet.VisionLanguage.Encoders

BASIC (Combined Scaling for Zero-shot Transfer Learning) model using CoAtNet vision encoder.

Inheritance: NeuralNetworkBase<T> → VisionLanguageModelBase<T> → BASIC<T>

Implements: IContrastiveVisionLanguageModel<T>

For Beginners

BASIC pushes CLIP performance higher by combining three things at scale: a stronger vision architecture (CoAtNet, which mixes convolutions and attention), a larger dataset, and bigger batch sizes during training. The result is 85.7% zero-shot ImageNet accuracy. Default values follow the original paper settings.

How It Works

BASIC (Pham et al., 2022) combines CoAtNet (Convolution + Attention) vision encoder with large-scale contrastive image-text pre-training, achieving 85.7% zero-shot ImageNet via architecture+data+batch-size combined scaling.

References:

  • Paper: “Combined Scaling for Zero-shot Transfer Learning” (Pham et al., 2022)

Example

var architecture = new NeuralNetworkArchitecture<double>(
    inputType: InputType.TwoDimensional,
    taskType: NeuralNetworkTaskType.ImageClassification,
    inputHeight: 224, inputWidth: 224, inputDepth: 3, outputSize: 512);
var trainModel = new BASIC<double>(architecture, new BASICOptions());

Constructors

Constructor Summary
BASIC(NeuralNetworkArchitecture<T> architecture, BASICOptions options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer)
BASIC(NeuralNetworkArchitecture<T> architecture, string imageEncoderModelPath, BASICOptions options)

Properties

Property Summary
T Temperature { get; }
int EmbeddingDimension { get; }
int MaxSequenceLength { get; }
int ProjectionDimension { get; }
int TextEmbeddingDimension { get; }

Methods

Method Summary
Dictionary<string, T> ZeroShotClassify(Tensor<T> image, string[] labels)
ModelMetadata<T> GetModelMetadata()
T ComputeSimilarity(Tensor<T> image, string text)
Tensor<T> EncodeImage(Tensor<T> image)
Tensor<T> EncodeText(string text)
Tensor<T>[] EncodeTexts(string[] texts)