FasterRCNN<T>

Models & Types · AiDotNet.ComputerVision.Detection.ObjectDetection.RCNN

Faster R-CNN - Two-stage object detection with region proposal network.

Inheritance: ModelBase<T, Tensor<T>, Tensor<T>> → VisionTaskModelBase<T> → ObjectDetectorBase<T> → FasterRCNN<T>

Implements: IDetectionTrainingModel<T>

For Beginners

Faster R-CNN is a foundational object detection model that works in two stages: first proposing regions that might contain objects (RPN), then classifying and refining those proposals. It’s highly accurate but slower than single-stage detectors like YOLO.

How It Works

Key features:

  • Two-stage detection: RPN + Fast R-CNN
  • End-to-end trainable
  • High accuracy through refined proposals
  • RoI pooling/align for fixed-size feature extraction

Reference: Ren et al., “Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks”, NeurIPS 2015

Constructors

Constructor Summary
FasterRCNN(NeuralNetworkArchitecture<T> architecture, ModelSize size, int numClasses) Creates a new Faster R-CNN detector with default options derived from the architecture.
FasterRCNN(ObjectDetectionOptions<T> options) Creates a new Faster R-CNN detector.

Properties

Property Summary
string Name { get; }

Methods

Method Summary
BatchDetectionResult<T> DetectBatch(Tensor<T> images, double confidenceThreshold, double nmsThreshold)
DetectionResult<T> Detect(Tensor<T> image, double confidenceThreshold, double nmsThreshold)
Task LoadWeightsAsync(string pathOrUrl, CancellationToken cancellationToken)
void SaveWeights(string path)
void Train(Tensor<T> input, Tensor<T> expectedOutput) Raw-output regression over the RoIs the network actually scored: mean squared error against expectedOutput, laid out like Forward’s padded prediction.
void TrainDetections(Tensor<T> input, DetectionTrainingBatch<T> targets) Trains the proposal network and the detection head with the Faster R-CNN objectives.