HOME Label types and conversion rules Dataset details Feature domain testingMulti-labeling system

Multi-labeling system

This section deals with the use of multiple labeling systems, i.e. how to define several different class definitions over the same objects, the ways to switch between them and applications for restricted types of crossvalidation and multiple instance learning. Examples of situation for which multiple label sets may arrive are:

Such problems are slightly different from problems in which a classifier should be trained using objects that have multiple labels within the same labeling system, e.g. an image can be labeled as containing a car as well as a bicycle but no pedestrians. If these are the three classes then memberships to these classes should be included in the labeling system. This may be done by using soft labels.

The multi-labeling system has been introduced in PRTools 4.1 and is defined on top of the existing single labeling system without disturbing it. The commands shown in the below table take care of storing and retrieving label lists in and from a set of cells in the dataset lablist field. Labeling systems have a name by which they can be identified. The name of the current (i.e. active) labeling sytem is stored in one of the cells. The nlab field is extended to an array with N columns (N is the number of labeling systems), and also the target field (for soft labels and targets) has an extended set of columns. The priors of the current labeling are copied to the prior field when needed.

> Dataset multi-labeling commands
addlabels Add another set of labels and give it a name.
addlablist Low level routine for programmers.
getlablistnames Retrieve the names of all available labeling systems.
setlablistnames Change the names of the available labeling systems.
changelablist Activate another, already available labeling system and make it the current one.
curlablist Get the number and name of the current labeling system.
dellablist Delete a labeling system.

Example:

     %PREX_MULTI_LABELING   PRTools example on multi_labeling
     %
     % Example on generating and analyzing a multi-labeling system
     % (just two label lists are used here :-))
     %
     % We assume a scenario in which two classes A and B have 2D distributions
     % that shift over time. Let the classes as well as their means be normally
     % distributed.

     % Let us generate 5 means per class (e.g. for 5 days of observation)
     % Let the means of these means by [3 3] and [-3 -3]. Assume unit variance.

     means = gendatgauss([5 5],[4 4; -4 -4]);

     % Assume that on every day for both classes 50 objects are measured.
     % Assume they are also normally distributed with a variance of 5 in all
     % direct

     X = [];

     for j=1:5
      X = [X; gendatgauss([50 50],[means([j j+5],:)],5*eye(2))];
     end

     delfigs; scatterd(X); title('Class labels')
     % Creation of labels indicating the day of measurement

     day_labels = genlab(100*ones(1,5),char('d1','d2','d3','d4','d5'));

     % Now the day_labels are added to the dataset as a second labelling
     % which is given the name 'days'.

     X = addlabels(X,day_labels,'days')
%       Gaussian Data, 500 by 2 dataset with 5 classes: [100  100  100  100  100]
     figure; scatterd(X); title('Day labels')

     showfigs

     % The names of the two labeling systems can be retrieved:

     getlablistnames(X)
%       default
%       days   

     % The active labelings can be changed by labeling system numbers
     Y1 = changelablist(X,1)
%       Gaussian Data, 500 by 2 dataset with 2 classes: [250  250]
     Y2 = changelablist(Y1,2)
%       Gaussian Data, 500 by 2 dataset with 5 classes: [100  100  100  100  100]

     % The active labelings can be changed by labeling system names
     Z1 = changelablist(X,'default')
%       Gaussian Data, 500 by 2 dataset with 2 classes: [250  250]
     Z2 = changelablist(Z1,'days')
%       Gaussian Data, 500 by 2 dataset with 5 classes: [100  100  100  100  100]

     % retrieve the number and name of the current labeling system
     [n,name] = curlablist(Z2)
%       2
%       days

Dataset with class labels
.

Dataset with class labels

Dataset with day labels
.

Dataset with day labels

R.P.W. Duin, January 28, 2013


HOME Label types and conversion rules Dataset details Feature domain testingMulti-labeling system