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 #if defined(_WIN32) 00056 #if defined(LIA_SPKTOOLS_EXPORTS) 00057 #define LIA_SPKTOOLS_API __declspec(dllexport) 00058 #else 00059 #define LIA_SPKTOOLS_API __declspec(dllimport) 00060 #endif 00061 #else 00062 #define LIA_SPKTOOLS_API 00063 #endif 00064 00065 #include<iostream> 00066 #include<fstream> 00067 #include<cstdio> 00068 #include<cassert> 00069 #include<cmath> 00070 #include "TrainTools.h" 00071 00072 using namespace alize; 00073 using namespace std; 00074 00075 00076 /********************************************************** 00077 * mergeCluster: merge two clusters 00078 * 00079 * Author C. Fredouille February 2006 00080 ***********************************************************/ 00081 LIA_SPKTOOLS_API SegCluster& mergeCluster(SegCluster& c1, SegCluster& c2, SegServer& segTemp,String merge="NULL"); 00082 00083 00084 /********************************************************** 00085 * clrCrit: Application of CLR criterion for clustering 00086 * 00087 * Author C. Fredouille February 2006 00088 ***********************************************************/ 00089 LIA_SPKTOOLS_API double clrCrit(Config& config, SegCluster& c1, SegCluster &c2, StatServer& ss, FeatureServer& fs, MixtureGD& m1, MixtureGD& m2, MixtureGD& world); 00090 00091 /********************************************************** 00092 * glrCrit: Application of GLR criterion for clustering 00093 * 00094 * Author C. Fredouille February 2006 00095 ***********************************************************/ 00096 LIA_SPKTOOLS_API double gllrCrit(Config& config, SegCluster& c1, SegCluster &c2, SegCluster &c12, StatServer& ss, FeatureServer& fs, MixtureGD& m1, MixtureGD& m2, MixtureGD& m12); 00097 00098 /********************************************************** 00099 * bicCrit: Application of GLR criterion for clustering 00100 * 00101 * Author C. Fredouille February 2006 00102 ***********************************************************/ 00103 LIA_SPKTOOLS_API double bicCrit(Config& config, SegCluster& c1, SegCluster &c2, SegCluster &c12, StatServer& ss, FeatureServer& fs, MixtureGD& m1, MixtureGD& m2, MixtureGD& m12); 00104 00105 /********************************************************** 00106 * bicCrit: Application of Delta BIC criterion for clustering (IDIAP) 00107 * 00108 * Author C. Fredouille February 2006 00109 ***********************************************************/ 00110 LIA_SPKTOOLS_API double deltabicCrit(Config& config, SegCluster& c1, SegCluster &c2, SegCluster &c12, StatServer& ss, FeatureServer& fs, MixtureGD& m1, MixtureGD& m2, MixtureGD& 00111 m12); 00112 00113 /********************************************************** 00114 * clusteringCriterionByAdapt: Application of different criterion for clustering (models are trained by adaptation) 00115 * 00116 * Author C. Fredouille February 2006 00117 ***********************************************************/ 00118 LIA_SPKTOOLS_API double clusteringCriterionByAdapt(Config& config, Seg *segment1, Seg *segment2, StatServer& ss, FeatureServer& fs, MixtureGD& world, String crit); 00119 00120 00121 /********************************************************** 00122 * clusteringCriterion: Application of different criterion for clustering (models are trained by EM/ML - Initialization by external model) 00123 * 00124 * Author C. Fredouille February 2006 00125 ***********************************************************/ 00126 LIA_SPKTOOLS_API double clusteringCriterion(Config& config, Seg *segment1, Seg *segment2, StatServer& ss, FeatureServer& fs, MixtureGD& world, String crit); 00127 00128 /********************************************************** 00129 * clusteringCriterionWithoutWorldInit: Application of different criterion for clustering (models are trained by EM/ML - Initialization by external model) 00130 * 00131 * Author C. Fredouille February 2006 00132 ***********************************************************/ 00133 LIA_SPKTOOLS_API double clusteringCriterionWithoutWorldInit(Config& config, SegCluster& c1, SegCluster& c2, StatServer& ss, FeatureServer& fs,MixtureGD& world,String crit); 00134 00135 /********************************************************** 00136 * clusteringCriterionWithoutWorldInit: Application of different criterion for clustering (models are trained by EM/ML - Initialization by external model) 00137 * 00138 * Author C. Fredouille February 2006 00139 ***********************************************************/ 00140 LIA_SPKTOOLS_API double clusteringCriterionWithoutWorldInit(Config& config, SegCluster& c1, MixtureGD& m1, SegCluster& c2, MixtureGD& m2, StatServer& ss, 00141 FeatureServer& fs,MixtureGD& world,String crit); 00142 00143 /********************************************************** 00144 * clusteringCriterion: Application of different criterion for clustering (models are trained by EM/ML - Initialization by external model) 00145 * 00146 * Author C. Fredouille February 2006 00147 ***********************************************************/ 00148 LIA_SPKTOOLS_API double clusteringCriterionWithoutWorldInit(Config& config, Seg *segment1, Seg *segment2, StatServer& ss, FeatureServer& fs,MixtureGD& world,String crit); 00149 00150 /********************************************************** 00151 * isSimilarSegment: compare two segments with BIC, GLR, ..., criterions 00152 * 00153 * Author C. Fredouille February 2006 00154 ***********************************************************/ 00155 LIA_SPKTOOLS_API bool isSimilarSegment(Config& config, Seg *segment1, Seg *segment2, StatServer& ss, FeatureServer& fs, MixtureGD& world, String crit); 00156 00157 /********************************************************** 00158 * bestFittingSegment: search the best segments of a cluster (in terms of normalized or not likelihood) and return it 00159 * 00160 * Author C. Fredouille February 2006 00161 ***********************************************************/ 00162 LIA_SPKTOOLS_API Seg *bestFittingSegment(Config& config, SegCluster& cluster, MixtureGD& m, StatServer& ss, FeatureServer& fs); 00163 LIA_SPKTOOLS_API Seg *bestFittingSegment(Config& config, SegCluster& cluster, MixtureGD& m, StatServer& ss, FeatureServer& fs, MixtureGD& world); 00164 LIA_SPKTOOLS_API Seg *bestFittingSegment(Config& config, SegCluster& cluster, MixtureGD& m, StatServer& ss, FeatureServer& fs, hmm& actualHMM,unsigned long except); 00165 00166 00167 00168 /********************************************************** 00169 * bestFittingCLuster: search the best cluster for a segment (in terms of normalized likelihood) and return it 00170 * 00171 * Author C. Fredouille February 2006 00172 ***********************************************************/ 00173 LIA_SPKTOOLS_API unsigned long bestFittingCluster(Config& config, hmm& actualHMM, SegServer& actualSeg, Seg *segment, StatServer& ss, FeatureServer& fs, unsigned long exceptInd=200); 00174 00175 00176 /********************************************************** 00177 * intraCluster: evaluate purity intra cluster 00178 * 00179 * Author C. Fredouille February 2006 00180 ***********************************************************/ 00181 LIA_SPKTOOLS_API void intraCluster(Config& config, hmm& actualHMM, SegServer& actualSeg, StatServer& ss, FeatureServer& fs, MixtureGD& world, String crit); 00182 00183 /********************************************************** 00184 * interCluster: Evaluate purity inter cluster 00185 * 00186 * Author C. Fredouille February 2006 00187 ***********************************************************/ 00188 LIA_SPKTOOLS_API void interCluster(Config& config, hmm& actualHMM, SegServer& actualSeg, StatServer& ss, FeatureServer& fs, MixtureGD& world, String crit);
1.7.2