BSRoFormer<T>
Models & Types · AiDotNet.Audio.SourceSeparation
BS-RoFormer (Band-Split Rotary Transformer) for music source separation.
Inheritance: NeuralNetworkBase<T> → AudioNeuralNetworkBase<T> → BSRoFormer<T>
Implements: IMusicSourceSeparator<T>
For Beginners
BS-RoFormer separates a mixed song into stems (vocals, drums, bass, other) by dividing frequencies into bands and using AI to figure out which parts belong to which instrument.
Usage:
How It Works
BS-RoFormer (Lu et al., 2023) splits the spectrogram into frequency bands, processes each with Transformer layers using rotary position embeddings, then fuses results for mask estimation. Achieves 12.8 dB SDR on vocals separation (MUSDB18-HQ).
Constructors
| Constructor | Summary |
|---|---|
BSRoFormer(NeuralNetworkArchitecture<T> architecture, BSRoFormerOptions options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer) |
|
BSRoFormer(NeuralNetworkArchitecture<T> architecture, string modelPath, BSRoFormerOptions options) |
Properties
| Property | Summary |
|---|---|
IReadOnlyList<string> SupportedSources { get; } |
|
int NumStems { get; } |
Methods
| Method | Summary |
|---|---|
ModelMetadata<T> GetModelMetadata() |
|
SourceSeparationResult<T> Separate(Tensor<T> audio) |
|
Task<SourceSeparationResult<T>> SeparateAsync(Tensor<T> audio, CancellationToken ct) |
|
Tensor<T> ExtractSource(Tensor<T> audio, string source) |
|
Tensor<T> GetSourceMask(Tensor<T> audio, string source) |
|
Tensor<T> Remix(SourceSeparationResult<T> separationResult, IReadOnlyDictionary<string, double> sourceVolumes) |
|
Tensor<T> RemoveSource(Tensor<T> audio, string source) |