# 2.9 什么是端到端的深度学习？（What is end-to-end deep learning?）

以前有一些数据处理系统或者学习系统需要多个阶段的处理。端到端深度学习就是忽略所有这些不同的阶段，用单个神经网络代替它

[![](https://github.com/fengdu78/deeplearning_ai_books/raw/master/images/925b9078df981f43f5c573833d0aa9ff.png)](https://github.com/fengdu78/deeplearning_ai_books/blob/master/images/925b9078df981f43f5c573833d0aa9ff.png)

## 语音识别

目标是输入$$x$$，比如说一段音频，然后把它映射到一个输出$$y$$，就是这段音频的听写文本:

* 传统上语音识别需要很多阶段的处理。首先提取一些特征，一些手工设计的音频特征，比如**MFCC**，这种算法是用来从音频中提取一组特定的人工设计的特征。在提取出一些低层次特征之后，应用机器学习算法在音频片段中找到音位（声音的基本单位），比如“**Cat**”这个词是三个音节构成的，**Cu-**、**Ah-和**Tu-，算法把这三个音位提取出来，然后将音位串在一起构成独立的词，然后将词串起来构成音频片段的听写文本

![](/files/-Le0cd46vGSP14xCig4K)

* 端到端深度学习是训练一个巨大的神经网络，输入一段音频，输出直接是听写文本。只需要把训练集拿过来，直接学到了$$x$$和$$y$$之间的函数映射，绕过了其中很多步骤

[![](https://github.com/fengdu78/deeplearning_ai_books/raw/master/images/4ad6502dd05f5aac0c2d649d3c126250.png)](https://github.com/fengdu78/deeplearning_ai_books/blob/master/images/4ad6502dd05f5aac0c2d649d3c126250.png)

端到端深度学习的挑战之一是需要大量数据才能让系统表现良好，比如只有3000小时数据去训练语音识别系统，那传统的流水线效果很好。但当有非常大的数据集时，比如10,000小时数据或者100,000小时数据，端到端方法突然开始很厉害。所以当数据集较小时，传统流水线方法效果更好。如果数据量适中，也可以用中间件方法，如输入还是音频，然后绕过特征提取，直接尝试从神经网络输出音位

## 门禁识别系统

[![](https://github.com/fengdu78/deeplearning_ai_books/raw/master/images/cf8285f8ce5a45ba016d3b8509a766be.png)](https://github.com/fengdu78/deeplearning_ai_books/blob/master/images/cf8285f8ce5a45ba016d3b8509a766be.png)

[![](https://github.com/fengdu78/deeplearning_ai_books/raw/master/images/06720034b609c3c637afcbc15c44fe72.png)](https://github.com/fengdu78/deeplearning_ai_books/blob/master/images/06720034b609c3c637afcbc15c44fe72.png)

最好的方法是一个多步方法，首先运行一个软件来检测人脸，然后放大图像并裁剪图像，使人脸居中显示，然后红线框起来的照片再喂到神经网络里，让网络去学习，或估计那人的身份

[![](https://github.com/fengdu78/deeplearning_ai_books/raw/master/images/4ca915fa995cc2b6edb8b0282cdaf7c5.png)](https://github.com/fengdu78/deeplearning_ai_books/blob/master/images/4ca915fa995cc2b6edb8b0282cdaf7c5.png)

比起一步到位，一步学习，把这个问题分解成两个更简单的步骤更好：

* 首先弄清楚脸在哪里
* 第二步是看着脸，弄清楚这是谁

这种方法让两个学习算法分别解决两个更简单的任务，并在整体上得到更好的表现

训练第二步的方式：输入两张图片，网络将两张图比较一下，判断是否是同一个人。比如记录了10,000个员工**ID**，可以把红色框起来的图像快速比较，看看红线内的照片是不是那10000个员工之一，判断是否应该允许其进入

[![](https://github.com/fengdu78/deeplearning_ai_books/raw/master/images/803377bbfc2a9f9608cd9ac4dbfaefc3.png)](https://github.com/fengdu78/deeplearning_ai_books/blob/master/images/803377bbfc2a9f9608cd9ac4dbfaefc3.png)

为什么两步法更好：

* 解决的两个问题，每个问题实际上要简单得多
* 两个子任务的训练数据都很多

## 机器翻译

[![](https://github.com/fengdu78/deeplearning_ai_books/raw/master/images/188a6112bc3e3065f5ddfca87d8c9064.png)](https://github.com/fengdu78/deeplearning_ai_books/blob/master/images/188a6112bc3e3065f5ddfca87d8c9064.png)

传统上机器翻译系统也有一个很复杂的流水线，比如英语机翻得到文本，然后做文本分析，基本上要从文本中提取一些特征之类的，经过很多步骤，最后会将英文文本翻译成法文。因为对于机器翻译来说有很多(英文,法文)的数据对，端到端深度学习在机器翻译领域非常好用

![](/files/-Le0cd4DFidW8RxfNYJO)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://baozoulin.gitbook.io/neural-networks-and-deep-learning/di-san-men-ke-jie-gou-hua-ji-qi-xue-xi-xiang-mu-structuring-machine-learning-projects/di-san-men-ke-structuring-machine-learning-projects/ml-strategy/29-shi-yao-shi-duan-dao-duan-de-shen-du-xue-xiff1f-ff08-what-is-end-to-end-deep-learning.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
