Standard metrics for biometric system evaluation

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 an analyzer. It can only be used on analysis blocks.

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
scores tutorial/multiclass_probe_scores/1 Input

Analyzers may produce any number of results. Once experiments using this analyzer are done, you may display the results or filter experiments using criteria based on them.

Name Type
number_of_negatives int32
roc plot/scatter/1
number_of_positives int32
cer float32
xxxxxxxxxx
45
 
1
import bob
2
import numpy
3
4
5
class Algorithm:
6
7
    def __init__(self):
8
        self.positives = []
9
        self.negatives = []
10
11
12
    def process(self, inputs, output):
13
14
      # accumulate the scores
15
      data = inputs['scores'].data
16
      real_id = data.real_identity
17
      estimated_id = data.estimated_identity
18
19
      if real_id == estimated_id:
20
          self.positives.append(data.score)
21
      else:
22
          self.negatives.append(data.score)
23
24
      # once all values are received, evaluate the scores
25
      if not(inputs.hasMoreData()):
26
        cer = len(self.negatives) / float(len(self.negatives) + len(self.positives))
27
        roc_points    = bob.measure.roc(self.negatives, self.positives, 100)
28
29
        # writes the output back to the platform
30
        output.write({
31
                'cer': numpy.float32(cer),
32
                'number_of_positives': numpy.int32(len(self.positives)),
33
                'number_of_negatives': numpy.int32(len(self.negatives)),
34
                'roc': {
35
                    "data": {
36
                        [
37
                            "label": "roc",
38
                            "x": roc_points[0],
39
                            "y": roc_points[1],
40
                            ]
41
                        }
42
                    },
43
            })
44
45
      return True

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

An algorithm that implements standard metrics for biometric system evaluation.

Specifically, it returns:

  • cer: the classification error rate (CER)
  • number_of_positives: the number of positive (genuine) trials
  • number_of_negatives: the number of negative (impostor) trials
  • roc: the receiver operating characteristic (ROC) curve

This implementation relies on the 'measure' package from the Bob library. See http://www.idiap.ch/software/bob/docs/releases/last/sphinx/html/measure/ for more details.

No experiments are using this algorithm.
Created with Raphaël 2.1.2[compare]tutorial/multiclass_postperf/1tutorial/multiclass_postperf/2Aug28tutorial/multiclass_postperf/32014Sep62015Sep3
This algorithm was never executed.
Terms of Service | Contact Information | BEAT platform version 2.2.1b0 | © Idiap Research Institute - 2013-2025