RadFM<T>

Models & Types · AiDotNet.VisionLanguage.Medical

RadFM: 3D ViT with perceiver for radiology report generation and VQA.

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

Implements: IMedicalVLM<T>

For Beginners

RadFM is a vision-language model for radiology report generation and visual question answering on medical imaging data. Default values follow the original paper settings.

How It Works

RadFM (2024) is a generalist foundation model for radiology that uses a 3D Vision Transformer with a perceiver module to encode volumetric CT and MRI data. It handles both 2D radiographs and 3D volumetric scans, generating radiology reports, answering visual questions about medical images, and supporting multi-modal clinical decision-making.

References:

  • Paper: “RadFM: Towards Generalist Foundation Model for Radiology (Various, 2024)”

Example

// Create a RadFM model for radiology report generation and VQA
// with 3D ViT encoding for volumetric CT/MRI data
var architecture = new NeuralNetworkArchitecture<double>(
    inputType: InputType.TwoDimensional,
    taskType: NeuralNetworkTaskType.ImageClassification,
    inputHeight: 224, inputWidth: 224, inputDepth: 3, outputSize: 512);
            
// ONNX inference mode with pre-trained model
var model = new RadFM<double>(architecture, "radfm.onnx");
            
// Training mode with native layers
var trainModel = new RadFM<double>(architecture, new RadFMOptions());

Constructors

Constructor Summary
RadFM(NeuralNetworkArchitecture<T> architecture, RadFMOptions options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer)
RadFM(NeuralNetworkArchitecture<T> architecture, string modelPath, RadFMOptions options)

Properties

Property Summary
int DecoderEmbeddingDim { get; }
int EmbeddingDimension { get; }
int MaxGenerationLength { get; }
string LanguageModelName { get; }
string MedicalDomain { get; }

Methods

Method Summary
ModelMetadata<T> GetModelMetadata()
Tensor<T> AnswerMedicalQuestion(Tensor<T> image, string question)
Tensor<T> EncodeImage(Tensor<T> image)
Tensor<T> GenerateFromImage(Tensor<T> image, string prompt) Generates text from a radiology image using RadFM’s 3D-aware perceiver pipeline.