Tools implemented in bob.bio.gmm

Summary

bob.bio.gmm.algorithm.GMM(...)

Algorithm for computing UBM and Gaussian Mixture Models of the features.

Details

class bob.bio.gmm.algorithm.GMM(number_of_gaussians: int, kmeans_training_iterations: int = 25, kmeans_init_iterations: typing.Optional[int] = None, kmeans_oversampling_factor: int = 64, ubm_training_iterations: int = 25, training_threshold: float = 0.0005, variance_threshold: float = 0.0005, update_means: bool = True, update_variances: bool = True, update_weights: bool = True, gmm_enroll_iterations: int = 1, enroll_update_means: bool = True, enroll_update_variances: bool = False, enroll_update_weights: bool = False, enroll_relevance_factor: typing.Optional[float] = 4, enroll_alpha: float = 0.5, scoring_function: typing.Callable = <function linear_scoring>, init_seed: int = 5489, **kwargs)

Bases: bob.bio.base.pipelines.BioAlgorithm, sklearn.base.BaseEstimator

Algorithm for computing UBM and Gaussian Mixture Models of the features.

Features must be normalized to zero mean and unit standard deviation.

Models are MAP GMM machines trained from a UBM on the enrollment feature set.

The UBM is a ML GMM machine trained on the training feature set.

Probes are GMM statistics of features projected on the UBM.

custom_enrolled_load_fn(path)[source]
classmethod custom_enrolled_save_fn(data, path)[source]
enroll(data)[source]

Enrolls a GMM using MAP adaptation given a reference’s feature vectors

Returns a GMMMachine tuned from the UBM with MAP on a biometric reference data.

fit(array, y=None, **kwargs)[source]

Trains the UBM.

load_model(ubm_file)[source]

Loads the projector (UBM) from a file.

project(array)[source]

Computes GMM statistics against a UBM, given a 2D array of feature vectors

This is applied to the probes before scoring.

read_biometric_reference(model_file)[source]

Reads an enrolled reference model, which is a MAP GMMMachine.

save_model(ubm_file)[source]

Saves the projector (UBM) to file.

score(biometric_reference: bob.learn.em.GMMMachine, probe)[source]

Computes the score for the given model and the given probe.

Uses the scoring function passed during initialization.

Parameters
  • biometric_reference – The model to score against.

  • probe – The probe data to compare to the model.

score_multiple_biometric_references(biometric_references: list[bob.learn.em.GMMMachine], probe: bob.learn.em.GMMStats)[source]

Computes the score between multiple models and one probe.

Uses the scoring function passed during initialization.

Parameters
  • biometric_references – The models to score against.

  • probe – The probe data to compare to the models.

transform(X, **kwargs)[source]

Passthrough. Enroll applies a different transform as score.

write_biometric_reference(model: bob.learn.em.GMMMachine, model_file)[source]

Write the enrolled reference (MAP GMMMachine) into a file.