EER有什么用

這篇文章主要介紹“EER有什么用”,在日常操作中,相信很多人在EER有什么用問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”EER有什么用”的疑惑有所幫助!接下來,請跟著小編一起來學(xué)習(xí)吧!

創(chuàng)新互聯(lián)專業(yè)為企業(yè)提供巴州網(wǎng)站建設(shè)、巴州做網(wǎng)站、巴州網(wǎng)站設(shè)計、巴州網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計與制作、巴州企業(yè)網(wǎng)站模板建站服務(wù),十余年巴州做網(wǎng)站經(jīng)驗,不只是建網(wǎng)站,更提供有價值的思路和整體網(wǎng)絡(luò)服務(wù)。

   FRR(False Rejection Rate)和FAR(False Acceptance Rate)是用來評估指紋識別算法性能的兩個主要參數(shù)。

   FRR通俗叫法是拒真率的意思,標(biāo)準(zhǔn)稱謂是 FNMR(False Non-Match Rate 不匹配率)??梢酝ㄋ椎睦斫鉃椤鞍褢?yīng)該相互匹配成功的指紋當(dāng)成不能匹配的指紋”的概率。

     Equal Error Rate , 這個在說話人識別,說話人確認(rèn)中最常用的評價標(biāo)準(zhǔn),是一種使錯誤接受率(nontarget_is_target / (target_is_target + nontarget_is_target)) 和 錯誤拒絕

率(target_is_nontarget / (target_is_nontarget + nontarget_is_nontarget))的一個相對平衡點閾值點,然后這個閾值點可以作為實際使用階段的固定的閾值。

   如 得分非 -170----A-------threshold ------B------- +100    按理來說 A 中都是nontarget, B中都是target。 如果在A 中出現(xiàn)了target 就是錯誤拒絕了,如果在B 中出現(xiàn)了

nontarget  就是錯誤接收了

   FAR一般稱為認(rèn)假率,其標(biāo)準(zhǔn)稱謂是FMR(False Match Rate 錯誤匹配率)。FMR是用來評估指紋識別算法性能的最重要參數(shù)??梢酝ㄋ椎睦斫鉃椤鞍巡粦?yīng)該匹配的指紋當(dāng)成匹配

的指紋”的概率。

   FAR是隨閾值增大而減小的,F(xiàn)RR是隨閾值增大而增大的。因此它們一定有交點。這個點是在某個閾值下的FAR與FRR等值的點。習(xí)慣上用這一點的值來衡量算法的綜合性能。

對于一個更優(yōu)的指紋算法,希望在相同閾值情況下,F(xiàn)AR和FRR都越小越好。

   把FAR和FRR曲線都向下平移。同時相交點ERR也向下平移。所以EER值越小的時候,表示算法的整體性能越高。   

Equal Error Rate , 這個在說話人識別,說話人確認(rèn)中最常用的評價標(biāo)準(zhǔn),是一種使錯誤接受率(nontarget_is_target / (target_is_target + nontarget_is_target)) 和 錯誤拒絕率(target_is_nontarget / (target_is_nontarget + nontarget_is_nontarget))的一個相對平衡點閾值點,然后這個閾值點可以作為實際使用階段的固定的閾值。 
還記得trials文件嘛,還記得沒有cvs文件自己偽造trials文件嘛, 還記得不明白為什么要制造50%或者80%的nontarget嘛,就是為了要計算EER。所以在偽造trials文件的時候,最好是分布均勻,也就是要涉及到每一個人,每一個人都要有一定數(shù)量的nontarget,其實也可以每個人對其他所有人都做一個nontarget,到底是取一部分還是所有的這個我也不確定,等驗證過后再更新(記得驗證)。

-->先說一些EER的計算: 
false reject and false accept. Clearly, the false reject rate and the false accept rate depend on the threshold. When the two rates are equal, the common value is called equal error rate (EER).

什么是false reject(用fr表示), 就是本來應(yīng)該accept 的結(jié)果 reject了: 
FR = target_is_nontarget / (target_is_nontarget + nontarget_is_nontarget) 
而false accept(用fa表示),就是本來應(yīng)該reject的結(jié)果accept了: 
FA = nontarget_is_target / (target_is_target + nontarget_is_target) 
當(dāng)E(fr) = E(fa) = E 時, E即 EER的值。 
-->維基百科ROC曲線 https://zh.wikipedia.org/wiki/ROC曲線 
--> 然后看一下kaldi源碼: 
eer=compute-eer <(python local/prepare_for_eer.py $trials local/scores_gmm_${num_components}_${x}_${y}/plda_scores) 2> /dev/null
單獨運行: 
python local/prepare_for_eer.py data/test/trials exp/scores_gmm_2048_ind_female/plda_scores 
結(jié)果:

-30.99115 target
-28.06169 target
-17.78868 target
-87.6428 nontarget
-74.32495 nontarget
-74.18333 nontarget
-5.662024 target
-7.832421 target
-26.46083 target
-74.93365 nontarget
-86.17784 nontarget
-50.90917 nontarget
-26.51904 target
-14.09044 target
...
#Ki就是上面的lines流, 把沒用的代碼全都刪掉,可以去看kaldi的源碼
 while (std::getline(ki.Stream(), line)) {
      std::vector<std::string> split_line;
      SplitStringToVector(line, " \t", true, &split_line);
      BaseFloat score;
      if (split_line[1] == "target")
        target_scores.push_back(score);
      else if (split_line[1] == "nontarget")
        nontarget_scores.push_back(score);
      else 
        KALDI_ERR << "blablabla"
    }
    BaseFloat threshold;
    #定義一個threshold,兩個list: target_scores, nontarget_scores
    BaseFloat eer = ComputeEer(&target_scores, &nontarget_scores, &threshold);
    KALDI_LOG << "Equal error rate is " << (100.0 * eer)
              << "%, at threshold " << threshold;
    std::cout.precision(4);
    std::cout << (100.0 * eer);
    return 0;

下面看ComputeEer(&target_scores, &nontarget_scores, &threshold)的實現(xiàn)

 {
  #將兩個都從大到小排列
  std::sort(target_scores->begin(), target_scores->end());
  std::sort(nontarget_scores->begin(), nontarget_scores->end());

  size_t target_position = 0,
      target_size = target_scores->size();
  for (; target_position + 1 < target_size; target_position++) {
        size_t nontarget_size = nontarget_scores->size(), #計算nontarget的個數(shù)
        #比如nontarget_size=100 ,target_size=100 這個 nontarget_n 屬于[0,100], 
        #所以nontarget_positon 從99到-1
        nontarget_n = nontarget_size * target_position * 1.0 / target_size; 
        nontarget_position = nontarget_size - 1 - nontarget_n;
    if (nontarget_position  < 0)
      nontarget_position = 0;
    #所以當(dāng)nontarget_position 小于 target_position 的值的時候
    if ((*nontarget_scores)[nontarget_position] <
        (*target_scores)[target_position])
      break;
  }
  *threshold = (*target_scores)[target_position];
  BaseFloat eer = target_position * 1.0 / target_size;
  return eer;
}
要理解這個函數(shù)的實現(xiàn),其實在compute-eer里邊還是一行注釋:
ComputeEer computes the Equal Error Rate (EER) for the given scores
   and returns it as a proportion beween 0 and 1.
   If we set the threshold at x, then the target error-rate is the
   proportion of target_scores below x; and the non-target error-rate
   is the proportion of non-target scores above x.  We seek a
   threshold x for which these error rates are the same; this
   error rate is the EER.

   We compute this by iterating over the positions in target_scores: 0, 1, 2,
   and so on, and for each position consider whether the cutoff could be here.
   For each of these position we compute the corresponding position in
   nontarget_scores where the cutoff would be if the EER were the same.
   For instance, if the vectors had the same length, this would be position
   length() - 1, length() - 2, and so on.  As soon as the value at that
   position in nontarget_scores at that position is less than the value from
   target_scores, we have our EER.
下面拿一個例子用python簡單模擬一下:
#coding: utf-8
'''
首先計算這一步,將target的得分和nontarget的得分文件
python local/prepare_for_eer.py data/test/trials exp/scores_gmm_2048_ind_female/plda_scores > scores
'''
target_scores = []
nontarget_scores = []
f = open('scores').readlines()
#將兩個數(shù)組讀出來
for line in f:
    splits = line.strip().split(' ')
    if splits[1] == 'target':
        target_scores.append(eval(splits[0]))
    else:
        nontarget_scores.append(eval(splits[0]))

#排序,從小到大排序
target_scores = sorted(target_scores)
nontarget_scores = sorted(nontarget_scores)

print target_scores

target_size = len(target_scores)
target_position = 0
for target_position in range(target_size):
    nontarget_size = len(nontarget_scores)
    nontarget_n = nontarget_size * target_position * 1.0 / target_size
    nontarget_position = int(nontarget_size - 1 - nontarget_n)
    if nontarget_position < 0:
        nontarget_position = 0
    if nontarget_scores[nontarget_position] < target_scores[target_position]:
        print "nontarget_scores[nontarget_position] is",  nontarget_position, nontarget_scores[nontarget_position]
        print "target_scores[target_position] is",  target_position, target_scores[target_position]
        break

threshold = target_scores[target_position]
print "threshold is --> ",  threshold
eer = target_position * 1.0 / target_size
print "eer is --> ",  eer

到此,關(guān)于“EER有什么用”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識,請繼續(xù)關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編會繼續(xù)努力為大家?guī)砀鄬嵱玫奈恼拢?/p>

本文題目:EER有什么用
轉(zhuǎn)載源于:http://bm7419.com/article22/goisjc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站改版、企業(yè)網(wǎng)站制作、企業(yè)建站網(wǎng)站制作、網(wǎng)站內(nèi)鏈標(biāo)簽優(yōu)化

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都做網(wǎng)站