深度学习入门(3) - CNN

CNN

Convolutional Layer

We use a filter to slide over the image spatially (computing dot products)

Interspersed with activation function as well

What it learns?

First-layer conv filters: local image templates (Often learns oriented edges, opposing colors)

Problems:
  1. For large images, we need many layers to get information about the whole image

​ Solution: Downsample inside the network

  1. Feature map shrinks with each layer

    Solution: Padding : adding zeros around the input

Pooling layer

-> downsampling

Without parameters that needs to be learnt.

ex:

max pooling

Aver pooling

...

FC layer(Fully Connected)

The last layer should always be a FC layer.

Batch normalization

we need to force inputs to be nicely scaled at each layer so that we can do the optimization more easily.

Usually inserted after FC layer / Convolutional layer, before non-linearity

Pros:

make the network easier to train

robust to initialization

Cons:

behaves differently during training and testing

Architechtures (History of ImageNet Challenge)

AlexNet

Input 3 * 277 * 277

Layer filters 64 kernel 11 stride 4 pad 2

We need to pay attention to the Memory, pramas, flop size

ZFNet

larger AlexNet

VGG

Rules:

  1. All conv 3*3 stride 1 pad 1
  2. max pool 2*2 stride 2
  3. after pool double channels

Stages:

conv-conv-pool

conv-conv-pool

conv-conv-pool

conv-conv-conv-pool

conv-conv-conv-pool

GoogLeNet

Stem network: aggressively downsamples input

Inception module:

Use such local unit with different kernal size

Use 1*1 Bottleneck to reduce channel dimensions

At the end, rather than flatting to destroy the spatial information with giant parameters

GoogLeNet use average pooling: 7 * 7 * 1024 -> 1024

There is only on FClayer at the last.

找到瓶颈位置,尽可能降低需要学习的参数数量/内存占用

Auxiliary Classifiers:

To help the deep network converge (batch normalization was not invented then): Auxiliary classification outputs to inject additional gradient at lower layers

Residual Networks

We find out that, somtimes we make the net deeper but it turns out to be underfitted.

Deeper network should strictly have the capability to do whatever a shallow one can, but it's hard to learn the parameters.

So we need the residual network!

This can help learning Identity, with all the parameters to be 0.

The still imitate VGG with its sat b

ResNeXt

Adding grops improves preforamance with same computational complexity.

MobileNets

reduce cost to make it affordable on mobile devices

Transfer learning

We can pretrain the model on a dataset.

When applying it to a new dataset, just finetune/Use linear classifier on the top layers.

Froze the main body of the net.

有一定争议,不需要预训练也能在2-3x的时间达到近似的效果

相关推荐
wangqiaowq3 分钟前
CV 后端打包
人工智能
AKAMAI3 分钟前
Akamai Valkey 托管数据库:企业 AI 的实时内存解决方案
人工智能·云计算
染指11105 分钟前
118.Agent-LangChain核心组件-StructuredOutPut结构化输出-工具策略(ToolStrategy )
人工智能·langchain·agent·agents
kaixin_啊啊9 分钟前
中国研究生数学建模竞赛(华为杯)学习笔记——AI绘图方法
人工智能·笔记·学习·数学建模
Thomas.Sir12 分钟前
第13课:PyTorch|经典CNN网络模型从零复现【从LeNet到VGG的逐行实现】
网络·pytorch·cnn
夏日的盒盒13 分钟前
Science期刊下与膝关节相关的论文
人工智能·深度学习·医学·医学影像分析·膝关节
Agent工坊14 分钟前
告别「帮我写个 Prompt」:我用 LangGraph + Vue3 搭了一个本地提示词生成器 PromptOps
人工智能
桃西西呀17 分钟前
本地 RAG 问答 Agent:切片即建模,幻觉即责任
人工智能·llm·agent
wizardpisces21 分钟前
Claude Code 是 Angular,Codex 是 Vue,DeepSeek 想当 React
前端·人工智能
XianMing的博客21 分钟前
《Attention Is All You Need》学习记录(从零吃透版)
人工智能·大模型