Computes the ISV session offset

This algorithm is a legacy one. The API has changed since its implementation. New versions and forks will need to be updated.
This algorithm is splittable

Algorithms have at least one input and one output. All algorithm endpoints are organized in groups. Groups are used by the platform to indicate which inputs and outputs are synchronized together. The first group is automatically synchronized with the channel defined by the block in which the algorithm is deployed.

Group: main

Endpoint Name Data Format Nature
statistics tutorial/gmm_statistics/1 Input
isv_offset system/array_1d_floats/1 Output

Unnamed group

Endpoint Name Data Format Nature
ubm tutorial/gmm/1 Input
isvbase tutorial/isvbase/1 Input
xxxxxxxxxx
70
 
1
import bob
2
import numpy
3
4
5
6
def gmm_from_data(data):
7
    """Unmangles a bob.machine.GMMMachine from a BEAT Data object"""
8
9
    dim_c, dim_d = data.means.shape
10
    gmm = bob.machine.GMMMachine(dim_c, dim_d)
11
    gmm.weights = data.weights
12
    gmm.means = data.means
13
    gmm.variances = data.variances
14
    gmm.variance_thresholds = data.variance_thresholds
15
    return gmm
16
17
18
def isvbase_from_data(data, ubm):
19
    """Unmangles a bob.machine.ISVBase from a BEAT Data object"""
20
21
    dim_cd, dim_u = data.subspace_u.shape
22
    isvbase = bob.machine.ISVBase(ubm, dim_u)
23
    isvbase.u = data.subspace_u
24
    isvbase.d = data.subspace_d
25
    return isvbase
26
27
def stats_from_data(data):
28
    """Unmangles a bob.machine.GMMStats from a BEAT Data object"""
29
30
    dim_c, dim_d = data.sum_px.shape
31
    stat = bob.machine.GMMStats(dim_c, dim_d)
32
    stat.t = long(data.t)
33
    stat.n = data.n
34
    stat.sum_px = data.sum_px
35
    stat.sum_pxx = data.sum_pxx
36
    return stat
37
38
39
class Algorithm:
40
41
    def __init__(self):
42
        self.ubm        = None
43
        self.isvbase    = None
44
45
46
    def process(self, inputs, outputs):
47
48
        # retrieve the UBM once
49
        if self.ubm is None:
50
            inputs['ubm'].next()
51
            self.ubm = gmm_from_data(inputs['ubm'].data)
52
53
        # retrieve the ISVBase once
54
        if self.isvbase is None:
55
            inputs['isvbase'].next()
56
            self.isvbase = isvbase_from_data(inputs['isvbase'].data, self.ubm)
57
58
        stats = stats_from_data(inputs["statistics"].data)
59
60
        projected_isv = numpy.ndarray(shape=(self.ubm.dim_c*self.ubm.dim_d,), dtype=numpy.float64)
61
        model = bob.machine.ISVMachine(self.isvbase)
62
        model.estimate_ux(stats, projected_isv)
63
64
        # outputs data
65
        outputs["isv_offset"].write({
66
            'value':       projected_isv,
67
        })
68
69
        return True
70

The code for this algorithm in Python
The ruler at 80 columns indicate suggested POSIX line breaks (for readability).
The editor will automatically enlarge to accomodate the entirety of your input
Use keyboard shortcuts for search/replace and faster editing. For example, use Ctrl-F (PC) or Cmd-F (Mac) to search through this box

Given a feature vector, a GMM and a U subspace, computes the session offset (xi, j).

Specific details can be found in [McCool2013].

This algorithm relies on the Bob library.

The inputs are:

  • statistics: A set of GMM Statistics of a probe.
  • ubm: A GMM corresponding to the Universal Background Model.
  • isvbase: The subspace_u and subspace_d for the session and the client offset respectivelly.

The output, isv_offset, is the latent variable xi, j ( Eq. (29) in [McCool2013]) that corresponds to the session offset.

[McCool2013](1, 2) McCool, Christopher, et al. "Session variability modelling for face authentication." IET biometrics 2.3 (2013): 117-129.

Experiments

Updated Name Databases/Protocols Analyzers
smarcel/tutorial/full_isv/2/mobio_male-gmm_100Gx10I-isv_50Ux10Ix4R-dct_12Bx8Ox45C-seed101 mobio/1@male tutorial/eerhter_postperf_iso/1
tutorial/tutorial/full_isv/2/bancaMc_isv_DCT12x8_100G_U50 banca/1@Mc tutorial/eerhter_postperf_iso/1
tutorial/tutorial/full_isv/2/xm2vtsLp1_isv_DCT12x8_100G_U50 xm2vts/1@lp1 tutorial/eerhter_postperf_iso/1
tutorial/tutorial/full_isv/2/mobioMale_isv_DCT12x8_100G_U50 mobio/1@male tutorial/eerhter_postperf_iso/1
tutorial/tutorial/full_isv/2/bancaP_isv_DCT12x8_100G_U50 banca/1@P tutorial/eerhter_postperf_iso/1
tutorial/tutorial/full_isv/2/atnt_isv_DCT12x8_100G_U50 atnt/1@idiap_test_eyepos tutorial/eerhter_postperf_iso/1
Created with Raphaël 2.1.2[compare]tutorial/isv_offset/32014Nov11

This table shows the number of times this algorithm has been successfully run using the given environment. Note this does not provide sufficient information to evaluate if the algorithm will run when submitted to different conditions.

Terms of Service | Contact Information | BEAT platform version 2.2.1b0 | © Idiap Research Institute - 2013-2025