Skip to content
Snippets Groups Projects

Hqwmca

Merged Guillaume HEUSCH requested to merge hqwmca into master
93 files
+ 1179
824
Compare changes
  • Side-by-side
  • Inline
Files
93
@@ -86,11 +86,24 @@ def main(user_input=None):
@@ -86,11 +86,24 @@ def main(user_input=None):
else:
else:
disguise_scores.append(float(split[-1]))
disguise_scores.append(float(split[-1]))
 
# normalize score values (for visualization purposes)
 
min_score = min(min(full_scores), min(disguise_scores), min(bf_scores))
 
max_score = max(max(full_scores), max(disguise_scores), max(bf_scores))
 
logger.info("Min score = {}".format(min_score))
 
logger.info("Max score = {}".format(max_score))
 
bf_scores = [((x - min_score) / (max_score - min_score)) for x in bf_scores]
 
disguise_scores = [((x - min_score) / (max_score - min_score)) for x in disguise_scores]
 
full_scores = [((x - min_score) / (max_score - min_score)) for x in full_scores]
 
 
print("BF scores mean = {}".format(numpy.mean(bf_scores)))
 
print("BF scores median = {}".format(numpy.median(bf_scores)))
 
n_bins = 10
n_bins = 10
pyplot.xlabel("score value", fontsize=16)
pyplot.xlabel("score value", fontsize=16)
 
pyplot.xlim(left=0.0, right=1.0)
pyplot.ylabel("# of occurences", fontsize=16)
pyplot.ylabel("# of occurences", fontsize=16)
pyplot.hist(bf_scores, bins=n_bins, facecolor='green', alpha=0.5, label='bonafide')
pyplot.hist(bf_scores, bins=n_bins, facecolor='green', alpha=0.5, label='bonafide')
pyplot.hist(disguise_scores, bins=n_bins, facecolor='purple', alpha=0.3, label='obfuscation attacks')
pyplot.hist(disguise_scores, bins=n_bins, facecolor='purple', alpha=0.6, label='obfuscation attacks')
pyplot.hist(full_scores, bins=n_bins, facecolor='red', alpha=0.8, label='impersonation attacks')
pyplot.hist(full_scores, bins=n_bins, facecolor='red', alpha=0.8, label='impersonation attacks')
pyplot.legend(loc='upper right')
pyplot.legend(loc='upper right')
pyplot.show()
pyplot.show()
Loading