人脸识别的核心业务流程介绍

1、通用流程概述
根据实际应用场景以及硬件配置,活体检测和特征提取可选择是否采用并行的方式。
如上图所示,人脸识别的核心业务流程可以分为以下四个步骤:
a)人脸检测:采集视频帧或静态图,传入算法进行检测,输出人脸数据,用于后续的检测。 b)活体检测:在人脸识别过程中判断操作用户是否为真人,有效防御照片、视频、纸张等不同类型的作弊攻击,提高业务安全性,可根据应用场景选择是否接入; c)特征提取:对待比对的图像进行特征提取、人脸库的预提取,用于之后的比对; d)人脸识别:1:1比对主要是判断「你是你」,用于核实身份的真实性;1:n搜索主要识别「你是谁」,用于明确身份的具体所属。
虹软产品:
arcface 离线sdk,包含人脸检测、性别检测、年龄检测、人脸识别、图像质量检测、rgb活体检测、ir活体检测等能力,初次使用时需联网激活,激活后即可在本地无网络环境下工作,可根据具体的业务需求结合人脸识别sdk灵活地进行应用层开发。
2、arcface接入集成及示例
2.1 sdk的获取
访问arcsoft ai开放平台门户:https://ai.arcsoft.com.cn,注册开发者账号并登录。
sdk下载
创建对应的应用,并选择需要下载的sdk、对应平台以及版本,确认后即可下载sdk。
查看app_id、sdk_key ,点击下载图标获取sdk开发包。
2.2 sdk包结构
|---doc| |---arcsoft_arc_face_java_developer's_guide.pdf 开发说明文档|---lib|---|---win32/x64| |---|---libarcsoft_face.dll 算法库| |---|---libarcsoft_face_engine.dll 引擎库 | |---|---libarcsoft_face_engine_jni.dll 引擎库| |---arcsoft-sdk-face-3.0.0.0.jar java依赖库|---samplecode| |---faceenginetest.java 示例代码|---releasenotes.txt 说明文件 2.3 指标
算法检测指标受硬件配置、图像数据质量、测试方法等因素影响,以下实验数据仅供参考,具体数据以实际应用场景测试结果为准。
2.3.1 算法性能
硬件信息:
处理器:intel core i5-8500 3.0ghz
安装内存(ram):16.0gb(15.9gb可用)
系统类型:win10 64位操作系统
分辨率:1280 x 720
不同人脸库条件下人脸比对+rgb活体检测全流程体感耗时
人脸库 性能(ms)
1000 < 200
5000 < 300
10000 < 600
2.3.2 阈值推荐
活体取值范围为[0~1],推荐阈值如下,高于此阈值的即可判断为活体。
rgb 活体:0.5
ir 活体:0.7
人脸比对取值范围为[0~1],推荐阈值如下,高于此阈值的即可判断为同一人。
用于生活照之间的特征比对,推荐阈值0.80
用于证件照或生活照与证件照之间的特征比对,推荐阈值0.82
2.3.3 图像质量要求
建议待检测的图像人脸角度上、下、左、右转向小于30度;
图片中人脸尺寸不小于50 x 50像素;
图片大小小于10mb;
图像清晰;
2.4 在项目中引入 sdk 包
com.arcsoft.face arcsoft-sdk-face 3.0.0.0 system ${project.basedir}/lib/arcsoft-sdk-face-3.0.0.0.jar 2.4.1 简要集成示例
package com.arcsoft;import com.arcsoft.face.*;import com.arcsoft.face.enums.imageformat;import javax.imageio.imageio;import java.awt.color.colorspace;import java.awt.image.bufferedimage;import java.awt.image.colorconvertop;import java.awt.image.databufferbyte;import java.io.file;import java.io.ioexception;import java.util.arraylist;import java.util.list;public class faceenginetest { public static void main(string[] args) { new faceenginetest().faceenginetest(); } public void faceenginetest() { string appid = ;        string sdkkey = ; faceengine faceengine = new faceengine(); //激活引擎 faceengine.active(appid, sdkkey); engineconfiguration engineconfiguration = engineconfiguration.builder().functionconfiguration( functionconfiguration.builder() .supportage(true) .supportface3dangle(true) .supportfacedetect(true) .supportfacerecognition(true) .supportgender(true) .supportliveness(true) .build()).build(); //初始化引擎 faceengine.init(engineconfiguration); imageinfo imageinfo = getrgbdata(new file(d:\1.jpg)); imageinfo imageinfo2 = getrgbdata(new file(d:\2.jpg)); //人脸检测 list faceinfolist = new arraylist(); faceengine.detectfaces(imageinfo.getrgbdata(), imageinfo.getwidth(), imageinfo.getheight(), imageformat.cp_paf_bgr24, faceinfolist); list faceinfolist2 = new arraylist();        faceengine.detectfaces(imageinfo.getrgbdata(), imageinfo.getwidth(), imageinfo.getheight(), imageformat.cp_paf_bgr24, faceinfolist2); //提取人脸特征 facefeature facefeature = new facefeature(); faceengine.extractfacefeature(imageinfo.getrgbdata(), imageinfo.getwidth(), imageinfo.getheight(), imageformat.cp_paf_bgr24, faceinfolist.get(0), facefeature); facefeature facefeature2 = new facefeature(); faceengine.extractfacefeature(imageinfo2.getrgbdata(), imageinfo2.getwidth(), imageinfo2.getheight(), imageformat.cp_paf_bgr24, faceinfolist2.get(0), facefeature2); //人脸对比 facefeature targetfacefeature = new facefeature(); targetfacefeature.setfeaturedata(facefeature.getfeaturedata()); facefeature sourcefacefeature = new facefeature(); sourcefacefeature.setfeaturedata(facefeature2.getfeaturedata()); facesimilar facesimilar = new facesimilar();        faceengine.comparefacefeature(targetfacefeature, sourcefacefeature, facesimilar); int processresult = faceengine.process(imageinfo.getrgbdata(), imageinfo.getwidth(), imageinfo.getheight(), imageformat.cp_paf_bgr24, faceinfolist, functionconfiguration.builder().supportage(true).supportface3dangle(true).supportgender(true).supportliveness(true).build()); //性别提取 list genderinfolist = new arraylist(); int gendercode = faceengine.getgender(genderinfolist); //年龄提取 list ageinfolist = new arraylist(); int agecode = faceengine.getage(ageinfolist); //3d信息提取 list face3danglelist = new arraylist(); int face3dcode = faceengine.getface3dangle(face3danglelist); //活体信息 list livenessinfolist = new arraylist(); int livenesscode = faceengine.getliveness(livenessinfolist); system.out.println();    } public imageinfo getrgbdata(file file) { if (file == null) return null; imageinfo imageinfo; try { //将图片文件加载到内存缓冲区 bufferedimage image = imageio.read(file); imageinfo = bufferedimage2imageinfo(image); } catch (ioexception e) { e.printstacktrace(); return null; } return imageinfo;    } private imageinfo bufferedimage2imageinfo(bufferedimage image) { imageinfo imageinfo = new imageinfo(); int width = image.getwidth(); int height = image.getheight(); // 使图片居中 width = width & (~3); height = height & (~3); imageinfo.setwidth(width); imageinfo.setheight(height); //根据原图片信息新建一个图片缓冲区 bufferedimage resultimage = new bufferedimage(width, height, image.gettype()); //得到原图的rgb像素矩阵 int[] rgb = image.getrgb(0, 0, width, height, null, 0, width); //将像素矩阵 绘制到新的图片缓冲区中 resultimage.setrgb(0, 0, width, height, rgb, 0, width); //进行数据格式化为可用数据 bufferedimage dstimage = new bufferedimage(width, height, bufferedimage.type_3byte_bgr); if (resultimage.gettype() != bufferedimage.type_3byte_bgr) { colorspace cs = colorspace.getinstance(colorspace.cs_linear_rgb); colorconvertop colorconvertop = new colorconvertop(cs, dstimage.creategraphics().getrenderinghints()); colorconvertop.filter(resultimage, dstimage); } else { dstimage = resultimage; } //获取rgb数据 imageinfo.setrgbdata(((databufferbyte) (dstimage.getraster().getdatabuffer())).getdata()); return imageinfo; } class imageinfo { public byte[] rgbdata; public int width;        public int height; public byte[] getrgbdata() { return rgbdata;        } public void setrgbdata(byte[] rgbdata) { this.rgbdata = rgbdata;        } public int getwidth() { return width;        } public void setwidth(int width) { this.width = width;        } public int getheight() { return height;        } public void setheight(int height) { this.height = height; } }} 参考文献:https://ai.arcsoft.com.cn/manual/docs


美国推出净网行动 中兴与泰国运营商达成 5G 商用合同
完整关注跨模态转换器网络
微雪电子QFN10测试座介绍
互联网络培训教程[3]
光伏逆变器是干什么用的 逆变器如何在台风暴雨季平稳运行
人脸识别的核心业务流程介绍
魅族Pro7什么时候上市?魅族Pro7最新消息:曲面屏、全面屏、墨水屏魅族Pro7舍谁选谁?
库克:全球使用苹果设备超16.5亿部 iPhone 12立功
用深度学习研究睡眠阶段,给患者提供更好的睡眠
无线调频话筒的制作原理与调试
几个高频易错C语言易错代码案例赏析
矽海达科技RCB COFDM调制发射模块介绍
俄罗斯遭受史上最大的黑客攻击
在通信电源集中环境下的监控系统优化和升级方案
广州车展比亚迪思锐 车载网络平台i吸引眼球
PC卡(PCMCIA)详述
华为5G小型基站美国零部件占比已降至1%
LED透明屏使用注意事项_LED透明屏的保养维护
关于光电振荡器和飞秒激光器技术的思考
浅谈电瓶修复技术,给UPS电池售后人员的一些建议