📓
Study
  • README
  • Application
    • Contest
      • 竞赛trick
  • Basic Know
    • 半监督学习
    • 贝叶斯
      • 朴素贝叶斯分类器
    • 对抗训练
    • 概率图模型
      • CRF
      • HMM
      • 概率图模型
    • 关联分析
    • 归纳偏置
      • [什么是 Inductive bias(归纳偏置)?](BasicKnow/归纳偏置/什么是 Inductive bias(归纳偏置)?.md)
    • 聚类
    • 决策树
    • 绿色深度学习
    • 树模型&集成学习
      • 提升树
      • Ada Boost
      • [集成学习]
    • 特征工程
      • 数据分桶
      • 特征工程概述
      • 特征选择
      • LDA
      • PCA
    • 线性模型
      • 感知机
      • 最大熵模型
      • SVM
        • SVM支持向量机
      • 逻辑回归
      • 线性回归
    • 优化算法
      • 拉格朗日对偶性
      • 牛顿法
        • 牛顿法&拟牛顿法
      • 梯度下降法
        • 梯度下降算法
      • 优化算法
    • 预处理
      • [1-1]正则表达式
      • [1-2]文本预处理
      • [1-3]词性
      • [1-4]语法分析
      • [1-6]文本分类
      • [1-7]网络爬取
      • 【备用】正则表达式
      • 7.re模块
      • 词典匹配
      • 分词
      • 子表达式
      • Todo
    • 主题模型
      • LDA
    • Deep Learning
      • 反向传播
      • 梯度消失&梯度爆炸
      • Batch Size
      • 1.DLbasis
      • 小概念
      • MLstrategy
      • CNN
      • RNN及其应用
      • 关于深度学习实践
      • 神经网络概述
      • Batch Normalization
      • Program CNN
      • Program D Lbasis
      • Program DN Nimprove
      • Program Neural Style Transfer
      • Summer DL
    • EM算法
    • GAN
      • Gans In Action Master
    • GNN
      • 搜广推之GNN
      • Representation Learning
        • Anomalydetection
        • Conclusion
        • Others
        • Papernotes
        • Recommadation
    • k近邻法
      • K近邻
    • Language Model
      • 语言模型解码采样策略
      • [1-1][语言模型]从N-gram模型讲起
      • [1-2][语言模型]NNLM(神经网络语言模型)
      • [1-3][语言模型]基于RNN的语言模型
      • [1-4][语言模型]用N-gram来做完形填空
      • [1-5][语言模型]用KenLM来做完形填空
    • Loss Function
      • 常用损失函数
      • Focal Loss
      • softmax+交叉熵
    • Machine Learning
      • [基础]概念
      • 待整合
      • 交叉验证
      • 无监督学习
      • 优缺点
      • ML Yearning
      • SVD
    • Statistics Math
      • 程序员的数学基础课
      • 数学基础
      • 统计&高数
      • 统计题目
      • 线性代数
      • 组合数学
      • Discrete Choice Model
      • Nested Choice Model
  • Course Note
    • 基于TensorFlow的机器学习速成课程
      • [Key ML Terminology](CourseNote/基于TensorFlow的机器学习速成课程/Key ML Terminology.md)
    • 集训营
      • 任务说明
      • 算法实践1.1模型构建
      • 算法实践1.2模型构建之集成模型
      • 算法实践2.1数据预处理
    • 李宏毅机器学习
      • 10DNN训练Tips
        • Chapter 18
      • 16无监督学习
        • Chapter 25
    • 贪心NLP
      • 贪心NLP笔记
    • Cs 224 N 2019
      • [A Simple But Tough To Beat Baseline For Sentence Embeddings](CourseNote/cs224n2019/A Simple but Tough-to-beat Baseline for Sentence Embeddings.md)
      • [Lecture 01 Introduction And Word Vectors](CourseNote/cs224n2019/Lecture 01 Introduction and Word Vectors.md)
      • [Lecture 02 Word Vectors 2 And Word Senses](CourseNote/cs224n2019/Lecture 02 Word Vectors 2 and Word Senses.md)
      • [Lecture 03 Word Window Classification Neural Networks And Matrix Calculus](CourseNote/cs224n2019/Lecture 03 Word Window Classification, Neural Networks, and Matrix Calculus.md)
      • [Lecture 04 Backpropagation And Computation Graphs](CourseNote/cs224n2019/Lecture 04 Backpropagation and Computation Graphs.md)
      • [Lecture 05 Linguistic Structure Dependency Parsing](CourseNote/cs224n2019/Lecture 05 Linguistic Structure Dependency Parsing.md)
      • [Lecture 06 The Probability Of A Sentence Recurrent Neural Networks And Language Models](CourseNote/cs224n2019/Lecture 06 The probability of a sentence Recurrent Neural Networks and Language Models.md)
      • Stanford NLP
    • Deep Learning Book Goodfellow
      • Books
        • Deep Learning Book Chapter Summaries Master
      • 提纲
      • C 5
      • C 6
      • [Part I Applied Math And Machine Learning Basics](CourseNote/Deep-Learning-Book-Goodfellow/Part I - Applied Math and Machine Learning basics.md)
    • Lihang
    • NLP实战高手课
      • 极客时间_NLP实战高手课
    • 工具&资料
    • 机器学习、深度学习面试知识点汇总
    • 七月kaggle课程
    • 算法工程师
    • 贪心科技机器学习必修知识点特训营
    • 唐宇迪机器学习
    • 语言及工具
    • AI技术内参
    • Suggestions
  • Data Related
    • 数据质量
      • 置信学习
    • 自然语言处理中的数据增广_车万翔
      • 自然语言处理中的数据增广
    • Mixup
    • 数据不均衡问题
    • 数据增强的方法
  • Knowledge Graph
    • Information Extraction
      • 联合抽取
        • PRGC
      • Code
        • BERT微调
      • NER
        • 阅读理解做NER
          • MRC
        • FLAT
        • Global Pointer
        • 命名实体识别NER
    • Keyword Extraction
      • 关键词抽取
    • 小米在知识表示学习的探索与实践
    • KG
  • Multi Task
    • EXT 5
      • Ex T 5
  • NLG
    • Dailogue
      • 比赛
        • 对话评估比赛
          • [simpread-DSTC10 开放领域对话评估比赛冠军方法总结](NLG/Dailogue/比赛/对话评估比赛/simpread-DSTC10 开放领域对话评估比赛冠军方法总结.md)
      • 任务型对话
        • DST
          • DST概述
        • NLG
          • NLG概述
        • NLU
          • NLU概述
        • 任务型对话概述
        • simpread-任务型对话系统预训练最新研究进展
      • 问答型对话
        • 检索式问答
          • 基于预训练模型的检索式对话系统
          • 检索式文本问答
        • 业界分享
          • 低资源场景下的知识图谱表示学习和问答_阿里_李杨
          • QQ浏览器搜索智能问答
        • 问答型对话系统概述
      • 闲聊型对话
        • 闲聊型对话系统概述
      • 业界分享
        • 人工智能与心理咨询
        • 腾讯多轮对话机器人
        • 微软小冰
        • 小布助手闲聊生成式算法
        • 美团智能客服实践_江会星
        • 去哪儿智能客服探索和实践
        • 实时语音对话场景下的算法实践_阿里_陈克寒
        • 智能语音交互中的无效query识别_小米_崔世起
        • UNIT智能对话
      • 主动对话
      • EVA
        • EVA分享
        • EVA模型
      • PLATO
      • RASA
    • Machine Translation
      • 业界分享
        • 爱奇艺台词翻译分享
      • Paper
        • Deep Encoder Shallow Decoder
    • RAGRelated
    • Text 2 SQL
      • M SQL
        • [M SQL 2](NLG/Text2SQL/M-SQL/M-SQL (2).md)
      • [Text2SQL Baseline解析](NLG/Text2SQL/Text2SQL Baseline解析.md)
      • Text 2 SQL
    • Text Summarization
      • [文本摘要][paper]CTRLSUM
      • 文本摘要
  • Pre Training
    • 业界分享
      • 超大语言模型与语言理解_黄民烈
        • 超大语言模型与语言理解
      • 大模型的加速算法_腾讯微信
        • 大模型的加速算法
      • 孟子轻量化预训练模型
      • 悟道文汇文图生成模型
      • 悟道文澜图文多模态大模型
      • 语义驱动可视化内容创造_微软
        • 语义驱动可视化内容创造
    • Base
      • Attention
      • Mask
        • NLP中的Mask
      • Position Encoding
        • 位置编码
    • BERT
      • ALBERT
      • Bert
        • Venv
          • Lib
            • Site Packages
              • idna-3.2.dist-info
                • LICENSE
              • Markdown-3.3.4.dist-info
                • LICENSE
              • Tensorflow
                • Include
                  • External
                    • Libjpeg Turbo
                      • LICENSE
                  • Unsupported
                    • Eigen
                      • CXX 11
                        • Src
                          • Tensor
              • Werkzeug
                • Debug
                  • Shared
                    • ICON LICENSE
        • CONTRIBUTING
        • Multilingual
      • Ro BER Ta
      • BERT
      • BERT面试问答
      • BERT源码解析
      • NSP BERT
    • BERT Flow
    • BERT Zip
      • Distilling The Knowledge In A Neural Network
      • TINYBERT
      • 模型压缩
    • CPM
    • CPT
      • 兼顾理解和生成的中文预训练模型CPT
    • ELECTRA
    • EL Mo
    • ERNIE系列语言模型
    • GPT
    • MBART
    • NEZHA
    • NLG Sum
      • [simpread-预训练时代下的文本生成|模型 & 技巧](Pre-training/NLGSum/simpread-预训练时代下的文本生成|模型 & 技巧.md)
    • Prompt
      • 预训练模型的提示学习方法_刘知远
        • 预训练模型的提示学习方法
    • T 5
      • Unified SKG
      • T 5
    • Transformer
    • Uni LM
    • XL Net
    • 预训练语言模型
    • BERT变种
  • Recsys
    • 多任务Multi-task&推荐
    • 推荐介绍
    • 推荐系统之召回与精排
      • 代码
        • Python
          • Recall
            • Deep Match Master
              • Docs
                • Source
                  • Examples
                  • FAQ
                  • Features
                  • History
                  • Model Methods
                  • Quick Start
    • 业界分享
      • 腾讯基于知识图谱长视频推荐
    • 召回
    • Sparrow Rec Sys
    • 深度学习推荐系统实战
    • 推荐模型
    • Deep FM
  • Search
    • 搜索
    • 业界分享
      • 爱奇艺搜索排序算法实践
      • 语义搜索技术和应用
    • 查询关键字理解
    • 搜索排序
    • BM 25
    • KDD21-淘宝搜索中语义向量检索技术
    • query理解
    • TFIDF
  • Self Supervised Learning
    • Contrastive Learning
      • 业界分享
        • 对比学习在微博内容表示的应用_张俊林
      • Paper
      • R Drop
      • Sim CSE
    • 自监督学习
  • Text Classification
    • [多标签分类(Multi-label Classification)](TextClassification/多标签分类(Multi-label Classification)/多标签分类(Multi-label Classification).md)
    • Fast Text
    • Text CNN
    • 文本分类
  • Text Matching
    • 文本匹配和多轮检索
    • CNN SIM
    • Word Embedding
      • Skip Gram
      • Glove
      • Word 2 Vec
    • 文本匹配概述
  • Tool
    • 埋点
    • 向量检索(Faiss等)
    • Bigdata
      • 大数据基础task1_创建虚拟机+熟悉linux
      • 任务链接
      • Mr
      • Task1参考答案
      • Task2参考答案
      • Task3参考答案
      • Task4参考答案
      • Task5参考答案
    • Docker
    • Elasticsearch
    • Keras
    • Numpy
    • Python
      • 可视化
        • Interactivegraphics
        • Matplotlib
        • Tkinter
        • Turtle
      • 数据类型
        • Datatype
      • python爬虫
        • Python Scraping Master
          • phantomjs-2.1.1-windows
        • Regularexp
        • Scrapying
        • Selenium
      • 代码优化
      • 一行代码
      • 用python进行语言检测
      • Debug
      • Exception
      • [Features Tricks](Tool/python/Features & Tricks.md)
      • Fileprocess
      • Format
      • Functional Programming
      • I Python
      • Magic
      • Math
      • Os
      • Others
      • Pandas
      • Python Datastructure
      • Python操作数据库
      • Streamlit
      • Time
    • Pytorch
      • Dive Into DL Py Torch
        • 02 Softmax And Classification
        • 03 Mlp
        • 04 Underfit Overfit
        • 05 Gradient Vanishing Exploding
        • 06 Text Preprocess
        • 07 Language Model
        • 08 Rnn Basics
        • 09 Machine Translation
        • 10 Attention Seq 2 Seq
        • 11 Transformer
        • 12 Cnn
        • 14 Batchnorm Resnet
        • 15 Convexoptim
        • 16 Gradientdescent
        • 17 Optim Advance
    • Spark
      • Pyspark
        • pyspark之填充缺失的时间数据
      • Spark
    • SQL
      • 数据库
      • Hive Sql
      • MySQL实战45讲
    • Tensor Flow
      • TensorFlow入门
  • Common
  • NLP知识体系
Powered by GitBook
On this page
  • 计算机视觉
  • 边缘检测示例
  • 更多边缘检测内容
  • Padding
  • 卷积步长
  • 卷积为何有效
  • 单层卷积网络
  • 简单卷积网络示例
  • 池化层
  • 卷积神经网络示例
  • 为什么使用卷积
  • Deep convolutional models: case studies
  • Case studies
  • Practical advices for using ConvNets
  • Object detection algorithms
  • 目标定位
  • 特征点检测
  • 目标检测
  • 卷积的滑动窗口实现
  • Bounding Box预测
  • 交并比
  • 非极大值抑制
  • Anchor Boxes
  • YOLO算法
  • RPN网络
  • 目标检测算法实践(补充)
  • Special applications: Face recognition & Neural style transfer
  • Face Recognition
  • Neural Style Transfer
  • 常见面试题

Was this helpful?

  1. Basic Know
  2. Deep Learning

CNN

PreviousMLstrategyNextRNN及其应用

Last updated 3 years ago

Was this helpful?

Foundations of Convolutional Neural Networks

计算机视觉

Computer Vision Problems:

  • Image Classification

  • Object detection

  • Neural Style Transfer

边缘检测示例

Vertical edge detection

更多边缘检测内容

通过卷积操作可以找出水平或垂直边缘(比如栏杆)

Sober filter

10−120−210−1\begin{matrix} 1 & 0 & -1 \\ 2 & 0 & -2 \\ 1 & 0 & -1 \\ \end{matrix}121​000​−1−2−1​

Scharr filter

30−3100−1030−3\begin{matrix} 3 & 0 & -3 \\ 10 & 0 & -10 \\ 3 & 0 & -3 \\ \end{matrix}3103​000​−3−10−3​

或者使用神经网络反向传播学习filter

Padding

卷积后的维度是(n-f+1)×(n-f+1)

缺点:

1.每次做卷积操作时,图像都会缩小

2.角落边的像素点输出较少,丢掉了很多边缘信息

四周填充padding, 填充层数为p输出维度变成(n+2p-f+1)×(n+2p-f+1)

Valid convolutions:n×n * f×f ——> (n-f+1)×(n-f+1)

Same convolutions:Pad so that output size is the same as the input size

(n+2p-f+1)×(n+2p-f+1),令n+2p-f+1=n, p=(f-1)/2

计算机视觉里f一般是奇数,因为

1.如果f是偶数,只能进行不对称的填充

2.奇数维filter有一个中心点,便于指出过滤器的位置

卷积步长

n×n image f×f filter

padding p stride s

输出为$\lfloor (n+2p-f)/s+1\rfloor × \lfloor (n+2p-f)/s+1\rfloor$

cross-correlation vs. convolution

卷积为何有效

只检测红色的垂直边缘

检测所有颜色的垂直边缘

多个过滤器

单层卷积网络

简单卷积网络示例

channel(depth)越来越大,Width和Height越来越小

Types of layer in a convolutional network

  • Convolution

  • Pooling

  • Fully connected

池化层

Max pooling, Average pooling

Hyperparameters:

f:filter size

s:stride

$n_H×n_W×n_C——>\lfloor \frac{n_H-f}s+1\rfloor × \lfloor \frac{n_W-f}s+1\rfloor×n_H$

No parameters to learn!

卷积神经网络示例

为什么使用卷积

参数共享和稀疏连接

Parameter sharing: A feature detector (such as a vertical edge detector) that's useful in one part of the image is probably useful in another part of the image.

Sparsity of connections: In each layer, each output value depends only on a small number of inputs.

Use gradient descent to optimize parameters to reduce $J$

Deep convolutional models: case studies

Case studies

为什么要进行实例探究

经典网络

LeNet-5

AlexNet

VGG-16

残差网络

Residual Nerworks(ResNets)

Residual block

残差网络为什么有用

  • 残差网络有什么意义? 残差连接的主要作用是允许从前层直接访问特征,这让信息在整个网络中传播变得更加容易。

残差块学习恒等函数非常容易,效率并不比一般网络低

网络中的网络以及1×1卷积

谷歌Inception网络

不需要人工选择过滤器维度,把所有可能扔给他,自己训练

Inception网络

即GoogleNet

Practical advices for using ConvNets

使用开源的实现方案

Github

迁移学习

数据不够,使用类似的神经网络的代码和权重,创造自己的输出层,训练输出层权重

这时可以提前计算好输出层之前的激活函数的输出,存到硬盘。这样之后再训练就可以减少计算成本

也可以重新训练多层的权重,数据量够的情况下。

如果数据足够多,训练所有的权重,将下载的权重作为初始化权重

数据扩充

Mirroring镜像, Random Cropping随机裁剪, Rotation旋转, Shearing剪切, Local warping局部弯曲

Color shifting颜色变换

Advanced: PCA, AlexNet paper "PCA color augumentation"

计算机视觉现状

Two sources of knowledge

  • Labeled data

  • Hand engineered features/network architecture/other components

数据量少,更多的还是用手工特征工程

Tips for doing well on benchmarks/winning competitions

Ensembling

  • Train several networks independently and average their outputs

Multi-crop at test time

  • Run classifier on multiple versions of test images and average results

  • 10-crop:对图像及镜像取中间的、四个角的图进行训练

Use open source code

  • Use architectures of networks published in the literature

  • Use open source implementations if possible

  • Use pretrained models and fine-tune on your dataset

Object detection algorithms

目标定位

不仅要判断图片物体是什么,还要判断其具体位置

除了物体类别,还要让神经网络输出物体的边框的四个数字,(bx, by, bh, bw)物体的中心点位置,高度,宽度

特征点检测

landmark detection

输出每个特征点的坐标,比如人脸识别中的眼睛、嘴巴、微笑等脸部特征

人体姿态检测,设定关键特征点,标注,训练,确定人物姿态动作

目标检测

Sliding windows detection滑动窗口目标检测方法

以固定幅度滑动窗口,遍历图像的每个区域,把这些剪切后的小图像输入卷积网络,然后进行分类

重复多次,扩大窗口大小

步幅小——成本高,步幅大——性能低

卷积的滑动窗口实现

Bounding Box预测

YOLO algorithm

将图像分成很多个格子,对每个格子,都有一个标签y,就是上面目标定位中的y

不是对每个格子分别运行算法,而是利用卷积一次实现,所以运行速度很快,经常用于实时检测

交并比

Intersection over union(IoU)

= size of intersection/size of union

其中intersection和union是预测边框与真实边框的交集和并集

Correct if IoU>=0.5

非极大值抑制

non-max suppression

Anchor Boxes

YOLO算法

putting it together: YOLO algorithm

RPN网络

目标检测算法实践(补充)

Special applications: Face recognition & Neural style transfer

Face Recognition

什么是人脸识别

Face verification vs. face recognition

Verification

  • Input image, name/ID

  • Output whether the input image is that of the claimed person

Recognition

  • Has a database of K persons

  • Get an input image

  • Output ID if the image is any of the K persons (or “not recognized”)

One-shot learning

根据一张照片学习

Learning from one example to recognize the person again

Learning a "similarity" function

d(img1, img2) = degree of difference between images

If d(img1, img2) ≤ τ, "same" else "different"

Siamese网络

用同样的卷积神经网络架构和参数,两个img作为输入,得到两个img的encoding,比较两个encoding的距离

Goal of learning

Parameters of NN define an encoding $f(x^{(i)})$

Learn parameters so that:

​ If $x^{(i)}, x^{(j)}$ are the same person, $||f(x^{(i)})-f(x^{(j)})||^2$ is small.

​ If $x^{(i)}, x^{(j)}$ are the different person, $||f(x^{(i)})-f(x^{(j)})||^2$ is large.

[Taigman et. al., 2014. DeepFace closing the gap to human level performance]

Triplet 损失

为了阻止学习到的所有编码都是一样的,要加一个margin,并且拉大了正负样本两者之间的距离

因为要求的训练集很大,成本较高,所以不必从头开始,可以下载别人的预训练模型

论文:A unified embedding for face recognition and clustering

面部验证与二分类

最后一层进行二分类,同一个人输出1,否则输出0

Neural Style Transfer

什么是神经风格迁移

深度卷积网络在学什么

靠后的隐藏单元会看到更大的图片块

[Zeiler and Fergus., 2013, Visualizing understanding convolutional networks]

代价函数

内容代价函数

风格损失函数

Say you are using layer 𝑙’s activation to measure “style.” Define style as correlation between activations across channels.

How correlated are the activations across different channels?

相关系数描述了这些不同特征同时出现的概率

一维到三维卷积推广

14×1 5×1 ——> 10×16 (16 filters) 5×16——> 6×32 (32filters)

14×14×14×1 5×5×5×1 ——>10×10×10×16 (16 filters) 5×5×5×16 ——> 6×6×6×32 (32filters)

常见面试题

在处理图像时,为什么使用卷积而不仅仅是 FC 层? 这个问题非常有趣,因为公司通常不会问这样的问题。正如你所料,一家专注于计算机视觉的公司问了这个问题。这个问题的答案由两部分组成。首先,卷积保留、编码并实际使用图像的空间信息。如果我们只使用 FC 层,就没有相关的空间信息。其次,卷积神经网络(CNN)提供了部分内置的平移方差,因为每个卷积核都相当于自己的过滤器和特征检测器。

是什么让 CNN 具备平移不变性? 如上所述,每个卷积核都是自己的过滤器和特征检测器。因此,假设你正在进行对象检测,对象在图像中的位置并不重要,因为我们将以滑动窗口的方式在整个图像上应用卷积。

为什么分段 CNN 通常具有编码器和解码器结构? 编码器 CNN 基本上可以被认为是特征提取网络,而解码器使用这些信息来预测图像片段(通过“解码”特征并放大到原始图像大小)。

为什么我们在分类 CNN 中有最大池化(max-pooling)? 这也是我在面试一个计算机视觉相关职位是被问到的一个问题。CNN 中的最大池化可以减少计算,因为在池化后,特征图变得更小了。因为你正在进行最大程度的激活,所以不会丢失太多的语义信息。还有一种理论认为,最大池化有助于为 CNN 提供更多的方差平移。

为什么要使用很多小的卷积核,比如 3x3,而不是更大的卷积核?VGGNet 论文( 对此做了很好的解释。有两个原因:首先,你可以使用几个较小的卷积核来获取相同的感知字段并捕获更多的空间上下文,使用较小的卷积核意味着较少的参数和计算。其次,因为对于较小的卷积核,你需要使用更多的过滤器,这样就能够使用更多的激活函数,你的 CNN 就可以学习更具辨别力的映射函数。

参考

https://arxiv.org/pdf/1409.1556.pdf)
https://mp.weixin.qq.com/s/2mIuy4t3QUdSo0xaBuJRXA
https://medium.com/@jonathan_hui/what-do-we-learn-from-region-based-object-detectors-faster-r-cnn-r-fcn-fpn-7e354377a7c9
edgedetect
edgedetect1
conv
rgb
layer
notation
lenet1
lenet2
lenet5
alexnet
vgg16
resnets1
resnets2
whyresnets
1by1
inception
inception1
inception2
inception3
inception4
objdetect1
objdetect2
objdetect3
objdetect4
objdetect5
objdetect6
anchor1
anchor2
anchor3
yolo1
yolo2
yolo3
rcnn
face1
face2
face3
face4
nst1
nst2
nst3
nst4
nst5
nst6
nst7
nst8
nst9
nst10
nst11
nst12