ComputeNormMain.cpp

Go to the documentation of this file.
00001 /*
00002 This file is part of LIA_RAL which is a set of software based on ALIZE
00003 toolkit for speaker recognition. ALIZE toolkit is required to use LIA_RAL.
00004 
00005 LIA_RAL project is a development project was initiated by the computer
00006 science laboratory of Avignon / France (Laboratoire Informatique d'Avignon -
00007 LIA) [http://lia.univ-avignon.fr <http://lia.univ-avignon.fr/>]. Then it
00008 was supported by two national projects of the French Research Ministry:
00009         - TECHNOLANGUE program [http://www.technolangue.net]
00010         - MISTRAL program [http://mistral.univ-avignon.fr]
00011 
00012 LIA_RAL is free software: you can redistribute it and/or modify
00013 it under the terms of the GNU Lesser General Public License as
00014 published by the Free Software Foundation, either version 3 of
00015 the License, or any later version.
00016 
00017 LIA_RAL is distributed in the hope that it will be useful,
00018 but WITHOUT ANY WARRANTY; without even the implied warranty of
00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00020 GNU Lesser General Public License for more details.
00021 
00022 You should have received a copy of the GNU Lesser General Public
00023 License along with LIA_RAL.
00024 If not, see [http://www.gnu.org/licenses/].
00025 
00026 The LIA team as well as the LIA_RAL project team wants to highlight the
00027 limits of voice authentication in a forensic context.
00028 The "Person Authentification by Voice: A Need of Caution" paper
00029 proposes a good overview of this point (cf. "Person
00030 Authentification by Voice: A Need of Caution", Bonastre J.F.,
00031 Bimbot F., Boe L.J., Campbell J.P., Douglas D.A., Magrin-
00032 chagnolleau I., Eurospeech 2003, Genova].
00033 The conclusion of the paper of the paper is proposed bellow:
00034 [Currently, it is not possible to completely determine whether the
00035 similarity between two recordings is due to the speaker or to other
00036 factors, especially when: (a) the speaker does not cooperate, (b) there
00037 is no control over recording equipment, (c) recording conditions are not
00038 known, (d) one does not know whether the voice was disguised and, to a
00039 lesser extent, (e) the linguistic content of the message is not
00040 controlled. Caution and judgment must be exercised when applying speaker
00041 recognition techniques, whether human or automatic, to account for these
00042 uncontrolled factors. Under more constrained or calibrated situations,
00043 or as an aid for investigative purposes, judicious application of these
00044 techniques may be suitable, provided they are not considered as infallible.
00045 At the present time, there is no scientific process that enables one to
00046 uniquely characterize a persones voice or to identify with absolute
00047 certainty an individual from his or her voice.]
00048 
00049 Copyright (C) 2004-2010
00050 Laboratoire d'informatique d'Avignon [http://lia.univ-avignon.fr]
00051 LIA_RAL admin [alize@univ-avignon.fr]
00052 Jean-Francois Bonastre [jean-francois.bonastre@univ-avignon.fr]
00053 */
00054 
00055 #include <iostream>
00056 
00057 #include "ComputeNorm.h"
00058 #include "liatools.h"
00059 
00060 using namespace std;
00061 using namespace alize;
00062 
00063 int main(int argc, char* argv[])
00064 {
00065   ConfigChecker cc;
00066   cc.addStringParam("testNistFile",true, true,"target_seg score file");
00067   cc.addStringParam("normType",true, true,"tnorm|znorm|ztnorm|tznorm, the normalization method (ztnorm is outputing both tnorm and ztnorm scores, tznorm both tznorm and znorm scores)");
00068   cc.addStringParam("tnormNistFile",false,true,"imp_seg score file, impostor scores used for tnorm and ztnorm");
00069   cc.addStringParam("znormNistFile",false,true,"target_imp score file, impostor scores used for znorm and ztnorm");
00070   cc.addStringParam("ztnormNistFile",false,true,"imp_imp score file, impostor scores used for ztnorm and tznorm");
00071   cc.addStringParam("outputFileBaseName",true, true,"the output file(s) basename");
00072   cc.addStringParam("znormFilesExtension",false, true,"znorm output file extension (default='.znorm'");
00073   cc.addStringParam("ztnormFilesExtension",false, true,"ztnorm output file extension (default='.znorm'");
00074   cc.addStringParam("tnormFilesExtension",false, true,"tnorm output file extension (default='.tnorm'");
00075   cc.addStringParam("tznormFilesExtension",false, true,"tznorm output file extension (default='.tznorm'");
00076   cc.addStringParam("cohortFilePath",false, true,"cohort files path, for selectTargetDependentCohortInFile");
00077   cc.addStringParam("cohortFileExt",false, true,"cohort files extension, for selectTargetDependentCohortInFile");
00078   cc.addIntegerParam("maxIdNb",false, true,"Max target speakers - use to fix the max number of znorm score distributions (default=1000)");
00079   cc.addIntegerParam("maxSegNb",false, true,"Max test segments - use to fix the max number of tnorm score distributions (default=1000)");
00080   cc.addIntegerParam("maxScoreDistribNb",false, true,"Max scores per distribution - use to fix the max number of score in a distribution (default=1000)");
00081   cc.addIntegerParam("fieldGender",false, true,"The field for gender in the nist file format (default=0)");
00082   cc.addIntegerParam("fieldName",false, true,"The field for gender in the nist file format (default=1)");
00083   cc.addIntegerParam("fieldDecision",false, true,"The field for gender in the nist file format (default=2)");
00084   cc.addIntegerParam("fieldSeg",false, true,"The field for gender in the nist file format (default=3)");
00085   cc.addIntegerParam("fieldLLR",false, true,"The field for gender in the nist file format (default=4)");
00086   cc.addStringParam("impostorIDList",false, true,"If the option is set, it limits the used impostor scores to the one of the given list");
00087   cc.addIntegerParam("meanMode",false,true,"Score distrib mean computation mode. 0 classical, 1 median (default 0)"); 
00088   cc.addFloatParam("percentH",false,true,"% of higest scores discarded (default 0)");  
00089   cc.addFloatParam("percentL",false,true,"% of lowest scores discarded (default 0)");  
00090   
00091   try {
00092       CmdLine cmdLine(argc, argv);
00093       if (cmdLine.displayHelpRequired()){
00094         cout << "************************************" << endl;
00095         cout << "********** ComputeNorm.exe *************" << endl;
00096         cout << "************************************" << endl;
00097         cout << endl;
00098         cout << "Apply Z-T-ZT or ZT Norm to a Score File" << endl<< "ztnorm includes tnorm"<<endl;
00099         cout <<endl<<cc.getParamList()<<endl;
00100         return 0;  
00101       }
00102       if (cmdLine.displayVersionRequired()){
00103         cout <<"Version 3"<<endl;
00104       } 
00105       Config tmp;
00106       cmdLine.copyIntoConfig(tmp);
00107       Config config;
00108       if (tmp.existsParam("config")) config.load(tmp.getParam("config"));
00109       cmdLine.copyIntoConfig(config);
00110       cc.check(config);
00111       debug=config.getParam_debug();
00112       if (config.existsParam("verbose"))verbose=config.getParam("verbose").toBool();else verbose=false;
00113       if (verbose) verboseLevel=1;else verboseLevel=0;
00114       if (config.existsParam("verboseLevel"))verboseLevel=config.getParam("verboseLevel").toLong();
00115       if (verboseLevel>0) verbose=true;
00116       // Initialize the default values for the parameters TODO : add this option in the addParam functions...
00117           if(!config.existsParam("znormFilesExtension")) config.setParam("znormFilesExtension",".znorm");
00118           if(!config.existsParam("tnormFilesExtension")) config.setParam("tnormFilesExtension",".tnorm");
00119           if(!config.existsParam("ztnormFilesExtension")) config.setParam("ztnormFilesExtension",".ztnorm");
00120           if(!config.existsParam("tznormFilesExtension")) config.setParam("tznormFilesExtension",".tznorm");
00121           if(!config.existsParam("maxIdNb")) config.setParam("maxIdNb","1000");
00122           if(!config.existsParam("maxSegNb")) config.setParam("maxSegNb","1000");
00123           if(!config.existsParam("maxScoreDistribNb")) config.setParam("maxScoreDistribNb","1000");
00124           if(!config.existsParam("fieldGender")) config.setParam("fieldGender","0");
00125           if(!config.existsParam("fieldName")) config.setParam("fieldName","1");
00126           if(!config.existsParam("fieldDecision")) config.setParam("fieldDecision","2");                                                                  
00127           if(!config.existsParam("fieldSeg")) config.setParam("fieldSeg","3");                                                            
00128           if(!config.existsParam("fieldLLR")) config.setParam("fieldLLR","4");    
00129           if(!config.existsParam("meanMode")) config.setParam("meanMode","0");
00130           if(!config.existsParam("percentH")) config.setParam("percentH","0.0");
00131           if(!config.existsParam("percentL")) config.setParam("percentL","0.0");
00132           
00133           
00134                                                                   
00135 
00136       // start the prog!
00137       ComputeNorm(config);
00138     }
00139 catch (alize::Exception& e) {cout << e.toString() << endl << cc.getParamList()<< endl;}
00140 return 0;     
00141 }
00142 
00143