> For the complete documentation index, see [llms.txt](https://baozoulin.gitbook.io/neural-networks-and-deep-learning/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://baozoulin.gitbook.io/neural-networks-and-deep-learning/di-si-men-ke-juan-ji-shen-jing-wang-luo-convolutional-neural-networks/convolutional-neural-networks/special-applications/411-yi-wei-dao-san-wei-tui-guang-ff08-1d-and3d-generalizations-of-models.md).

# 4.10 一维到三维推广（1D and 3D generalizations of models）

## 1D卷积

将2D卷积推广到1D卷积：

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

二维数据的卷积是将同一个5×5特征检测器应用于图像中不同的位置（编号1所示），最后得到10×10的输出结果。1维过滤器可以在不同的位置中应用类似的方法（编号3，4，5所示）

当对这个1维信号使用卷积，将一个14维的数据与5维数据进行卷积，并产生一个10维输出：

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

如果有16个过滤器，最后会获得一个10×16的数据：

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

对于卷积网络的下一层，如果输入一个10×16数据，可以使用一个5维过滤器进行卷积，需要16个通道进行匹配，如果有32个过滤器，另一层的输出结果就是6×32：

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

## 3D卷积

当进行**CT**扫描时，人体躯干的不同切片数据本质上是3维的

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

如果有一个**3D**对象是14×14×14：

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

过滤器也是3D的，如果使用5×5×5过滤器进行卷积，将会得到一个10×10×10的结果输出，如果使用16个过滤器，输出将是10×10×10×16

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

如果下一层卷积使用5×5×5×16维度的过滤器再次卷积，如果有32个过滤器，最终将得到一个6×6×6×32的输出
