面部特征点检测 facial keypoints tutorial

来源:互联网 发布:天界法宝五行进化数据 编辑:程序博客网 时间:2024/04/28 16:35

按照Daniel Nouri的Tutorial(2014年12月写的)实验一下,目的是:
1. 玩一下面部特征的定位
2. 再熟悉一下Lasagne的使用。

1 准备数据集

在Kaggle上注册,然后下载facial keypoints tutorial的数据集,包括如下文件。并将文件放入$home/data/kaggle-facial-keypoint-detection目录中。

IdLookupTable.csvSampleSubmission.csvtest.ziptraining.zip

解压缩

cd ~/data/kaggle-facial-keypoint-detection$unzip test.zipunzip training.zip

2 测试一下读入文件

运行kfkd.py

python kfkd.pyleft_eye_center_x            7039left_eye_center_y            7039...dtype: int64X.shape == (2140, 9216); X.min == 0.000; X.max == 1.000y.shape == (2140, 30); y.min == -0.920; y.max == 0.996

3 测试一下第一个模型 (1 hidden)

python first_model.py    197       0.00368       0.00436      0.84536  0.75s    198       0.00367       0.00435      0.84498  0.76s    199       0.00367       0.00434      0.84468  0.74s    200       0.00366       0.00433      0.84432  0.73s

运行结果:

运行200个epoch后的结果

测试一下:

python test_first_model.py

运行结果:

测试结果

4 测试一下第一个模型,改变Learn Rate并使用Momentum (1 hidden)

python first_model_ver2.py    197       0.00338       0.00329      1.02905  0.72s    198       0.00338       0.00329      1.02871  0.74s    199       0.00338       0.00329      1.02900  0.74s    200       0.00338       0.00329      1.02911  0.73s

改变Learning Rate
改变Learning Rate并使用Momentum,得到的模型比上一个错误更小,并且Train/Valid的比值更接近(更少的Overfit)。

0 0
原创粉丝点击