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

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: probes

Endpoint Name Data Format Nature
feature_vectors system/array_1d_floats/1 Input
scores system/array_1d_floats/1 Output

Group: train

Endpoint Name Data Format Nature
machine system/array_1d_floats/1 Input
xxxxxxxxxx
28
 
1
import numpy
2
3
4
class Algorithm:
5
6
    def __init__(self):
7
        self.data = []
8
        self.machine = None
9
10
    def process(self, inputs, outputs):
11
12
        
13
        if self.machine == None:
14
          inputs['machine'].next()
15
          self.machine = inputs["machine"].data.value
16
17
        sample = inputs['feature_vectors'].data.value
18
        tmp = numpy.square(sample - self.machine)
19
        tmp = numpy.nan_to_num(numpy.divide(tmp, self.machine))
20
        score = -numpy.sum(tmp)
21
        score = numpy.array([score])
22
23
        outputs["scores"].write({
24
                'value': score
25
            })
26
27
        return True
28

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

This algorithm compares an input histogram to a histogram model. It computes a score between the input histogram and the model using Chi-2 distance measurement. The output (score) is packaged into a numpy array for compatibility with the subsequent analyzer step.

Experiments

Updated Name Databases/Protocols Analyzers
smarcel/ivana7c/simple-antispoofing-updated/1/replay2-antispoofing-lbp-histograms-fix replay/3@grandtest Kanma/iqm_spoof_eer_analyzer/1
sbhatta/ivana7c/simple-antispoofing-updated/1/replay2-antispoofing-lbp-histograms replay/2@grandtest sbhatta/iqm_spoof_eer_analyzer/9
Created with Raphaël 2.1.2[compare]sbhatta/cmp_hist_model_arrayoutput/22015Nov19

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