signet matlab_SigNet(使用机器学习/深度学习检测签名相似性):这是人类法医分析的终点吗?...

signet matlab

My grandfather was an expert in handwriting analysis. He spent all his life analyzing documents for the CBI (Central Bureau Of Investigation) and other organizations. His unique way of analyzing documents using a magnifying glass and different tools required huge amounts of time and patience to analyze a single document. This is back when computers were not fast enough. I remember vividly that he photocopied the same document multiple times and arranged it on the table to gain a closer look at the handwriting style.

我的祖父是笔迹分析专家。 他一生都在分析CBI (中央调查局)和其他组织的文件。 他使用放大镜和不同工具分析文件的独特方法需要大量时间和耐心来分析单个文件 。 当计算机不够快时又回来了。 我清楚地记得他多次影印同一份文档并将其放在桌子上,以便更仔细地查看笔迹样式。

Handwriting analysis involves a comprehensive comparative analysis between a questioned document and the known handwriting of a suspected writer. Specific habits, characteristics, and individualities of both the questioned document and the known specimen are examined for similarities and differences.

笔迹分析包括有问题的文档和可疑作家的已知笔迹之间的全面比较分析 。 检查有问题的文档已知标本的 特定习惯特征个性 ,以查找相似性和差异。

As this problem consists of detecting and analyzing patterns, Machine Learning is a great fit to solve this problem.

由于此问题包括检测和分析模式,因此机器学习非常适合解决此问题。

为什么和如何? (Why and How?)

Why: My grandfather’s unique way of analyzing documents using a magnifying glass and different tools required huge amounts of time and patience to analyze a single document. This is back when computers were not fast enough. I remember vividly that he photocopied the same document multiple times and arranged it on the table to gain a closer look at the handwriting style. While I agree that we cannot replace that job with an A.I with a 100% accuracy, we can certainly build a system capable of aiding human beings.

w ^ HY:我爷爷的独特分析用放大镜和所需的时间和耐心大量不同的工具,文档,分析单个文档的方式。 当计算机不够快时又回来了。 我清楚地记得他多次影印同一份文档并将其放在桌子上,以便更仔细地查看笔迹样式。 虽然我同意我们不能用100%的精度替换AI的工作,但我们当然可以构建能够帮助人类的系统。

How: To build our Signature Similarity network, we will use utilize the wonders of Deep Learning. We will go through three approaches to extract the similarity between our handwritten signatures. For our initial data, we will use the HandWritten Signatures dataset from Kaggle.

^ h流量:建立我们的签名相似的网络,我们将使用利用深度学习的奥妙。 我们将通过三种方法来提取手写签名之间的相似性。 对于我们的初始数据,我们将使用KaggleHandWritten Signatures数据集

要求 (Requirements)

For this project we will require:

如果是这个项目,我们将要求:

  • Python 3.8: The Programming Language

    Python 3.8:编程语言
  • TensorFlow 2: The Deep Learning Library

    TensorFlow 2:深度学习库
  • Numpy: Linear Algebra

    numpy:线性代数
  • Matplotlib: Plotting images

    Matplotlib:绘制图像
  • Scikit-Learn: General Machine Learning Library

    Scikit-Learn:通用机器学习库

数据集 (The Dataset)

The dataset contains real and forged signatures of 30 people. Each person has 5 genuine and 5 forged signatures.

吨他集包含30人的真实和伪造签名。 每个人都有5个真实签名和5个伪造签名。

Image for post
The Directory Structure of our data.
我们数据的目录结构。

For loading the data, I have created a simple load_data() that iterates through all the datasets and extracts real and forged signatures with a label of 1 and 0 respectively.

为了加载数据,我创建了一个简单的load_data(),它循环访问所有数据集并提取标签分别为1和0的真实和伪造签名。

In addition to this, I have also created a dictionary of tuples consisting of images and labels. (To be used later in the project).

除此之外,我还创建了一个由图像和标签组成的元组字典。 (将在项目的后面使用)。

def load_data(DATA_DIR=DATA_DIR, test_size=0.2, verbose=True, load_grayscale=True):
"""
Loads the data into a dataframe.

Arguments:
DATA_DIR: str
test_size: float
Returns:
(x_train, y_train,x_test, y_test, x_val, y_val, df)
"""
features = []
features_forged = []
features_real = []
features_dict = {}
labels = [] # forged: 0 and real: 1
mode = "rgb"
if load_grayscale:
mode = "grayscale"

for folder in os.listdir(DATA_DIR):
# forged images
if folder == '.DS_Store' or folder == '.ipynb_checkpoints':
continue
print ("Searching folder {}".format(folder))
for sub in os.listdir(DATA_DIR+"/"+folder+"/forge"):
f = DATA_DIR+"/"+folder+"/forge/" + sub
img = load_img(f,color_mode=mode, target_size=(150,150))
features.append(img_to_array(img))
features_dict[sub] = (img, 0)
features_forged.append(img)
if verbose:
print ("Adding {} with label 0&
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值