vgg 名人人脸图像库

People often try to look like a celebrity they like the most. They always seem to love it when they get compliments like…

人们经常试图看起来像他们最喜欢的名人。 当他们得到诸如……的称赞时,他们似乎总是喜欢它。

“Hey, you look just like that guy from the Interstellar movie, OMG, what’s his name…??? Yes, MATTHEW MCCONAUGHEY!!”

“嘿,你看起来就像星际电影中的那个家伙,OMG,他叫什么名字??? 是的,MATTHEW MCCONAUGHEY!”

Meanwhile…

与此同时…

nydailynewsnydailynews

Maybe your friends were just being polite to make you feel good, but is there a way to objectively identify which celebrity you resemble the most?

也许您的朋友只是彬彬有礼,使您感觉良好,但是有没有一种方法可以客观地确定您最喜欢哪个名人?

In this post, I’ll use a Siamese Neural Network approach to calculate a similarity percentage(0–100%) between two images by comparing facial features.

在本文中,我将使用暹罗神经网络方法通过比较面部特征来计算两幅图像之间的相似度百分比(0–100%)。

介绍 (INTRODUCTION)

Comparing images for similarities has far and wide-reaching applications. Some use cases for matching images can be found in the field of healthcare, where radiology reports could be compared with stock images of some medical condition in order to assist doctors in the diagnosis of diseases.

比较图像的相似性具有广泛的应用。 可以在医疗保健领域找到一些匹配图像的用例,可以将放射线报告与某些医疗状况的库存图像进行比较,以帮助医生诊断疾病。

In retail where an image of a product might be searched on an e-commerce website for price and availability details and in general search applications for looking up an image in a database of images. Such a task is far from trivial as images of similar objects might appear different due to differences in camera equipment, lighting conditions, image orientation, color, and resolution.

在零售中,可以在电子商务网站上搜索产品图像以获取价格和可用性详细信息,并且通常在搜索应用程序中用于在图像数据库中查找图像。 这样的任务绝非易事,因为由于摄像设备,照明条件,图像方向,颜色和分辨率的差异,相似物体的图像可能看起来有所不同。

There have been many algorithms that have been proposed for matching images, such as SIFT, Pyramid Match among others. Recent advancements in Convolutional Neural Networks (CNNs) have enabled direct comparison of images without the use of handcrafted features that were earlier used to compare images.

已经提出了许多用于匹配图像的算法,例如SIFT,金字塔匹配。 卷积神经网络(CNN)的最新进展使图像的直接比较成为可能,而无需使用以前用于比较图像的手工功能。

Siamese networks are typically used in this domain, they are a special type of neural network architecture. Instead of a model learning to classify its inputs, the Siamese networks learn to differentiate between two inputs. It learns the similarity between them.

暹罗网络通常用于此领域,它们是神经网络架构的一种特殊类型。 暹罗网络不是在学习模型来对其输入进行分类,而是在两个输入之间进行区分。 它了解它们之间的相似性。

数据集 (DATASET)

The dataset used for this exercise is taken from FaceScrub, which is a face dataset built by detecting faces in images returned from searches for public figures on the Internet, followed by automatically discarding those not belonging to each queried person. It comprises a total of over 100,000 face images of male and female 530 celebrities, with about 200 images per person. The name and gender annotation and the pixel values of the faces of celebrities inside the images are also included in this dataset.

此练习使用的数据集来自FaceScrub , FaceScrub是通过检测Internet搜索公共人物返回的图像中的人脸,然后自动丢弃不属于每个被查询者的人脸而构建的人脸数据集。 它总共包含100,000幅530位男性和女性名人的面部图像,每人约200张图像。 图像中名人的名字和性别注释以及面Kong的像素值也包含在此数据集中。

数据预处理 (DATA PREPROCESSING)

  • Discard all black and white images, and keep on the colored images, for consistency.丢弃所有黑白图像,并保留彩色图像,以保持一致性。
  • For the sake of simplicity (and because of the limited computation power I had), only 20 images per celebrity were used for training.为了简单起见(并且由于我的计算能力有限),每个名人仅使用20张图像进行训练。
  • Crop out the faces of celebrities from the images.从图像中裁剪出名人的脸。
  • Resize all the images to a 150X150 resolution (RGB images) for a consistent input size.将所有图像调整为150X150分辨率(RGB图像),以获得一致的输入尺寸。
  • Randomly applied a contrast limited adaptive histogram equalization algorithm to the images to improve the contrast.将对比度受限的自适应直方图均衡算法随机应用于图像以提高对比度。
  • Added additional augmented images on the fly while training the network to reduce overfitting on the training set. The images were rotated randomly from -30 to 30 degrees and flipped.在训练网络时动态添加其他增强图像,以减少训练集的过度拟合。 图像从-30度随机旋转到30度并翻转。

模型— 暹罗神经网络 (MODEL — SIAMESE NEURAL NETWORK)

A Siamese neural network (sometimes called a twin neural network) is an artificial neural network that uses the same weights while working in tandem on two different input vectors to compute comparable output vectors (Wiki).

暹罗神经网络(有时称为双神经网络)是一种人工神经网络,它在两个不同的输入向量上串联工作时使用相同的权重,以计算可比较的输出向量( Wiki )。

This diagram illustrates how a Siamese neural network works. The two sister networks are identical and share the hyperparameters and weights. Each sister network of the siamese network is fed with a different image and the neural network is trained using triplet loss or contrastive loss. The loss is calculated using the ground truth, i.e. whether the images are similar or not.

该图说明了暹罗神经网络的工作方式。 两个姐妹网络是相同的,并且共享超参数和权重。 暹罗网络的每个姐妹网络都收到不同的图像,并且使用三重态损失或对比损失来训练神经网络。 使用地面真实性(即图像是否相似)来计算损失。

The Sister network used here is a SqueezeNet which is an 18-layer Neural network consisting of Convolution, Normalization, Pooling, and ReLU activation layers. In addition to that, it also consists of 8 Fire Nodes as illustrated below.

这里使用的姐妹网络是SqueezeNet ,它是一个18层的神经网络,由卷积,规范化,池化和ReLU激活层组成。 除此之外,它还包括8个火节点,如下图所示。

SqueezeNet
挤压网
Fire Node
火节点

Finally, since the objective of this solution is not to classify but to differentiate between images, a Contrastive Loss Function is used that distinguishes between the input pair of feature vectors. The following is the formula for contrastive loss.

最后,由于此解决方案的目的不是要分类而是要在图像之间进行区分,因此使用了对比损失函数来区分输入的特征向量对。 以下是对比损失的公式。

X1, X2 are the two input images to the network, X1,X2是网络的两个输入图像, Gw is the transformation of the image to the feature vector and Gw是图像到特征向量的变换, Dw is the Euclidean Distance between the two feature vectors.Dw是两个特征向量之间的欧几里得距离。

Here is what the final Siamese model training looks like

这是最终的暹罗模型训练的样子

In the training example above, two celebrity images, Bruce Lee and Jackie Chan, are fed individually to the sister networks. The two output vectors at the end of the Sister networks are then used to compute the contrastive loss, based on the ground truth that these two images are not from the same person. This loss value is then backpropagated to both the sister networks to update their weights equally. Similarly, two images of the same actor will also be fed to the model to help it understand the similarities along with the dissimilarities.

在上面的训练示例中,两个名人图像,李小龙和成龙分别喂给了姐妹网络。 然后,基于这两个图像不是来自同一个人的事实,将Sister网络末端的两个输出矢量用于计算对比损失。 然后,将该损耗值反向传播到两个姐妹网络,以平等地更新其权重。 类似地,同一演员的两个图像也将被馈送到模型,以帮助其理解相似性和相似性。

输出值 (OUTPUT)

After uploading a new image, the model returns a list of probability scores calculated against other celebrity images, indicating how similar the two images are. Here is a sample output of celebrity look-alikes for Matt Damon.

上载新图像后,该模型将返回针对其他名人图像计算出的概率分数列表,指示这两个图像有多相似。 这是Matt Damon的名人相像的样本输出。

The model can also be used to compare the similarity between two images as shown below…

该模型还可用于比较两个图像之间的相似性,如下所示……

That’s the best similarity score I got with any celebrity…:)
这是我与任何名人获得的最佳相似度分数……:)
Johnny Depp(old) vs Johnny Depp(Young) — High Similarity
约翰尼·德普(旧)vs约翰尼·德普(年轻)—高度相似
Emma Watson vs Anne Hathaway — Not that similar
艾玛·沃特森(Emma Watson)vs安妮·海瑟薇(Anne Hathaway)—不太相似
Katy Perry vs Zooey Deschanel — Basically Twins
凯蒂·佩里(Katy Perry)vs祖伊·德斯香奈(Zooey Deschanel)—基本上是双胞胎

有问题吗? (GOT QUESTIONS?)

If you have any questions/feedback about the post, please contact me on Linkedin here

如果您有任何疑问/该讯息有关的反馈,请在LinkedIn与我联系点击这里

翻译自: https://medium.com/swlh/which-celebrity-do-you-look-like-an-image-similarity-search-model-87539a511c5

vgg 名人人脸图像库


http://www.taodudu.cc/news/show-863565.html

相关文章:

  • 机器学习:贝叶斯和优化方法_Facebook使用贝叶斯优化在机器学习模型中进行更好的实验
  • power-bi_在Power BI中的VertiPaq内-压缩成功!
  • 模型 标签数据 神经网络_大型神经网络和小数据的模型选择
  • 学习excel数据分析_为什么Excel是学习数据分析的最佳方法
  • 护理方面关于人工智能的构想_如何提出惊人的AI,ML或数据科学项目构想。
  • api数据库管理_API管理平台如何增强您的数据科学项目
  • batch lr替代关系_建立关系的替代方法
  • ai/ml_您本周应阅读的有趣的AI / ML文章(8月9日)
  • snowflake 使用_如何使用机器学习模型直接从Snowflake进行预测
  • 统计 python_Python统计简介
  • ios 图像翻转_在iOS 14中使用计算机视觉的图像差异
  • 熔池 沉积_用于3D打印的AI(第3部分):异常熔池分类的纠缠变分自动编码器
  • 机器学习中激活函数和模型_探索机器学习中的激活和丢失功能
  • macos上的硬盘检测工具_如何在MacOS上使用双镜头面部检测器(DSFD)实现90%以上的精度
  • 词嵌入应用_神经词嵌入的法律应用
  • 谷歌 colab_使用Google Colab在Python中将图像和遮罩拆分为多个部分
  • 美国人口普查年收入比赛_训练网络对收入进行分类:成人普查收入数据集
  • NLP分类
  • 解构里面再次解构_解构后的咖啡:焙炒,研磨和分层,以获得更浓的意式浓缩咖啡
  • 随机森林算法的随机性_理解随机森林算法的图形指南
  • 南加州大学机器视觉实验室_机器学习带动南加州爱迪生的变革
  • 机器学习特征构建_使用Streamlit构建您的基础机器学习Web应用
  • 数学建模算法:支持向量机_从零开始的算法:支持向量机
  • 普元部署包部署找不到构建_让我们在5分钟内构建和部署AutoML解决方案
  • 基于决策树的多分类_R中基于决策树的糖尿病分类—一个零博客
  • csdn无人驾驶汽车_无人驾驶汽车100年历史
  • 无监督学习 k-means_无监督学习-第2部分
  • regex 正则表达式_使用正则表达式(Regex)删除HTML标签
  • 精度,精确率,召回率_了解并记住精度和召回率
  • 如何在Python中建立回归模型

vgg 名人人脸图像库_您看起来像哪个名人? 图像相似度搜索模型相关推荐

  1. 树莓派实验室python人脸识别_在树莓派上实现人脸识别

    原标题:在树莓派上实现人脸识别 本文为 AI 研习社编译的技术博客,原标题 Facial Recognition & Identification On Raspberry Pi,作者为 Ad ...

  2. CoLab - 图像人脸检测_框出人脸

    CoLab - 图像人脸检测_框出人脸 此文章教你如何使用谷歌Colaboratory实现静止图片的人脸检测和划框框. CoLab最大好处:GPU计算速度快! 注: · 国内登陆Colab需使用到梯梯 ...

  3. android 人脸识别_小模型,高精度!小视科技推出极致轻量型人脸识别SDK

    AI 落地为王时代的到来,使得人脸识别的精度和速度备受人们关注.近年来,随着模型压缩.量化技术的进步,模型运行速度也越来越快.对于一些特定的人脸检测任务,轻量型的人脸识别SDK即可满足需求. ▲图源网 ...

  4. 基于cnn的人脸识别_鬼都藏不住,人脸识别新突破!就算遮住半张脸也能100%被识别...

    转自:新智元 如涉版权请加编辑微信iwish89联系 哲学园鸣谢 新智元报道 来源:sciencedirect 编辑:金磊,元子 [新智元导读]众所周知,人脸识别在摄像头无法捕捉到完整面部图像的情况下 ...

  5. r语言把两个折线图图像放到一个图里_图像相似度度量

    图像相似度度量的应用场景很多,包括以图搜图,相似图像去重等多种功能,目前在项目中的场景是针对大量重复类似的图片,需要进行筛选剔除,自然需要用到图像相似度,简单调研了下图像相似度的方法,包括传统图像方法 ...

  6. 人脸识别测颜值、测脸龄、测相似度微信接口

    <?php /*** 人脸识别测颜值.测脸龄.测相似度微信接口* @Created by MOS.Ving.* @Author: MOS.Ving* @Mail 904679843@qq.com ...

  7. 计算机视觉、图像分类、目标检测、人脸比对、人脸识别、语义分割、实例分割、图像搜索

    计算机视觉.图像分类.目标检测.人脸比对.人脸识别.语义分割.实例分割.图像搜索 目录

  8. matlibplot 一张图画多个曲线_从一张风景照中就学会的SinGAN模型,究竟是什么神操作?| ICCV 2019最佳论文...

    作者 | 王红成,中国海洋大学-信息科学与工程学院-计算机技术-计算机视觉方向研究生,研二在读,目前专注于生成对抗网络的研究 编辑 | Jane 出品 | AI科技大本营(ID:rgznai100) ...

  9. 全景看房vr全景展示,获得360度全景式视角实时交互体验

    当在马路边收到地产广告传单,相信大部分人会直接无视或者扔掉,相比地产商付出大量的物料和人力成本来说,收效甚微,难以产生高收益.VR全景沉浸式看房体验以全新的体验式选房购房,打造差异化的服务体验,有效截 ...

最新文章

  1. python绘制直方图根据不同分类_如何在python中绘制具有多个类别的直方图
  2. hadoop学习笔记2
  3. mysql atlas更新问题_Atlas几种常见故障解决(不定期更新)
  4. collectors 求和_Collectors扩展接口 实现BigDecimal的相加
  5. grandle下载安装图解
  6. 前端学java还是python_零基础应该选择学习 java、php、前端 还是 python?
  7. 随想录(OllyDbg和IDA Pro的配合使用)
  8. Tensorflow关于Dataset的一般操作
  9. python相对路径-Python中的绝对路劲和相对路径
  10. Linux虚拟文件系统之文件打开(sys_open())
  11. 【图像分割】基于matalb灰狼算法最小交叉熵多阈值图像分割【含Matlab源码 903期】
  12. data fastboot 擦除_fastboot命令大全
  13. unrar在linux如何编译,rarlinux(rar\unrar在linux使用)
  14. CSRF--跨站请求伪造
  15. 【我的Android进阶之旅】 解决Android编译出现问题:AAPT: error: resource string/xxx (aka xxx:string/xxx) not found.
  16. java 模拟登陆人人网_java模拟登陆人人,通过验证码
  17. 面向对象设计的3个基本特征和5个原则
  18. hzw的数列分块入门
  19. JAVA 接口 验证哥特巴赫猜想
  20. KubeSphere 多行日志采集方案深度探索

热门文章

  1. 在SuSE10.1上安装Oracle10g
  2. 全球最大IXP为何选择与华为开展数据中心互联合作?
  3. maven+jenkins自动化构件
  4. 傅里叶变换库FFTW的安装配置(VS2010)
  5. 北京XXX学院WLAN项目现场勘查报告
  6. android闹钟详细设计,基于LabVIEW的闹钟设计 详细文档+程序
  7. 10个优秀的 Web UI 库/框架
  8. android四个按钮平分,android 水平平分两个按钮
  9. 中反应器体积_实验室规模半连续和连续生物反应器在微生物学和生物技术工艺中的作用...
  10. html 子级选择器,css3子选择器(选择某个标签做内容)