[Paper Review] An Introduction to Convolutional Neural Networks

zioni·2026년 5월 19일

논문 리뷰

목록 보기
4/6
post-thumbnail

O’Shea, K., & Nash, R. (2015). An Introduction to Convolutional Neural Networks. http://arxiv.org/abs/1511.08458


Convolutional Neural Networks(CNN)

1 Introduction

  • Artificial Neural Networks (ANNs) are computational processing systems of which are heavily inspired by way biological nervous systems operate.
  • load the input, usually in the form of a multidimensional vector to the input layer of which will distribute it to the hidden layers.
  • The hidden layers will then make decisions from the previous layer and weigh up how a stochastic change within itself detriments or improves the final output
  • Convolutional Neural Networks (CNNs) are analogous to traditional ANNs in that they are comprised of neurons that self-optimise through learning.
  • CNNs are primarily used in the field of pattern recognition within images.
  • One of the largest limitations of traditional forms of ANN is that they tend to struggle with the computational complexity required to compute image data.

  • 초기 ANNs은 입력값을 벡터로 받아서 모든 뉴런과 연결하는 방식인데 이미지가 입력값으로 들어오면 많은 연결과 파라미터가 필요하다 ⇒ 연산량 증가 문제

  • MNIST dataset을 예시로 들어보면 28x28x1(가로픽셀수x세로픽셀수x흑백) 크기의 이미지를 처리하면 총픽셀수가 784개

  • 만약 64x64크기의 이미지인데 컬러 이미지라면 RGB의 정보도 포함되어 64x64x3(RGB) 이므로 계산량은 12,288로 매우 많음


1.1 Overfitting

  • 파라미터 수가 많으면 ANNS의 hidden layer수를 늘리면 되는 거 아닌가? ⇒ No!
    1. 계산량이 많아 전력을 많이 쓰게 되고 시간이 많이 듦
    2. 또 다른 이유는 Overfitting(과적합)
  • Overfitting is basically when a network is unable to learn effectively due to a number of reasons.
  • The less parameters required to train, the less likely the network will overfit - and of course, improve the predictive performance of the model.

  • Overfitting은 학습 데이터에만 지나치게 맞춰져서, 한 번도 보지 못한 새로운 데이터에 대한 예측력이 크게 떨어지는 현상
  • ANNs로 이미지를 처리하면 파라미터 수가 너무 많아져 hidden layer를 늘려야 하는데 그러면 모델이 복잡해짐
  • 모델이 복잡해지면 학습 데이터의 세세한 노이즈까지 외울 가능성이 커짐
  • 파라미터가 많다는 것은 입력 데이터에 대한 정보가 매우 많다는 것이고 모델이 복잡하다는 것은 그 정보를 하나하나 다 본다는 뜻임
  • 따라서 모델이 복잡해지면 입력 데이터에 대한 모든 정보를 다 가지고 있어 과적합의 가능성이 생기는 것임
  • 좀 더 자세히 설명해보면 모델이 복잡하다는 것은 입력 데이터에 대한 모든 정보를 학습하는데 그러기 때문에 그 입력 데이터에 대해서는 전문가지만 새로운 데이터가 들어오게 된다면? 문외한이 되는 것임
  • 그래서 모델에서 중요한 것은 훈련 데이터에 대한 전문가가 되는 것이 아니라 훈련 데이터로 학습하고 처음 보는 새로운 데이터가 들어왔을 때 정확히 예측할 수 있는 학습 능력이 중요함

2 CNN architecture

  • CNNs primarily focus on the basis that the input will be comprised of images.
  • One of the key differences is that the neurons that the layers within the CNNs are comprised of neurons organised into three dimensions, the spatial dimensionality of the input(height ad the width) and the depth. & the depth refers the third dimension of a activation volume.
  • Unlike standard ANNs, the neurons within any given layer will only connect to a small region of the layer preceding it.

  • CNNs는 입력이미지 = height x width x depth (세로 픽셀 x 가로 픽셀 x 채널 수) 즉, 입력이미지를 3차원 구조로 봄
  • CNNs의 뉴런은 이전 layer 전체가 아니라 국소 영역만 봄
  • 이미지 데이터의 특징은 공간 구조가 있다는 것 ⇒ 공간 정보가 중요
  • ANNs는 이미지를 1차원 벡터처럼 펼쳐서 처리하는 경우가 많은데 CNNs는 이미지를 원래 형태에 가깝게 봄 ⇒ CNNs는 공간 정보를 가지고 있음

2.1 Overall architecture

  • CNNs are comprised of three types of layers - convolutional layers, pooling layers, fully-connected layers
  • four key areas
    1. the input layer will hold the pixel values of the image
    2. The convolution layer will determine the output of neurons of which are connected to local regions of the input through the calculation of the scalar product between their weights and the region connected to the input volume.
    3. The pooling layer will then simply perform downsampling along the spatial dimensionality of the given input, further reducing the number of parameters within that activation.
    4. The fully-connected layers will then perform the same duties found in standard ANNs and attempt to produce class scores from the activations, to be used for classification.

  • CNNs는 세 종류의 layer로 구성됨 - convolutional layers, pooling layers, fully-connected layers
  • 입력 데이터 → 특징 찾기 → 크기 줄이기 → 판단
  • convolution layer : 특징 찾는 곳
    • 입력 이미지를 보고 중요한 특징이 있는 곳을 찾음
  • ReLU : 의미 있는 반응만 남기는 곳 ⇒ activation function
    • 특징이 약하거나 의미 없는 부분은 버리고, 강하게 반응한 부분만 남김
  • pooling layer : feature map의 크기를 줄임
    • feature map은 이미지의 특징을 담은 map
    • 이미지의 세부 위치 하나하나보다, 중요한 특징이 존재하는지가 더 중요
  • fully-connected layer : 최종 판단
    • 앞에서 뽑은 특징들을 보고 이 이미지가 어떤 class인지 판단하는 부분
    • class score를 생성하여 classification에 사용

⇒ 정리하면 CNN이 이미지를 입력받아 convolution layer에서 특징을 추출하고, pooling layer에서 크기를 줄이며, fully-connected layer에서 최종 class score를 계산하는 구조


2.2 Convolutional layer

  • The layers parameters focus around the use of learnable kernels.
  • When the data hits a convolutional layer, the layer convolves each filter across the spatial dimensionality of the input to produce a 2D activation map.
  • As we glide through the input, the scalar product is calculated for each value in that kernel.
  • From this the network will learn kernels that ‘fire’ when they see a specific feature at a given spatial position of the input. ⇒ activations
  • Every kernel will have a corresponding activation map, of which will be stacked along the depth dimension to form the full output volume from the convolutional layer.
  • every neuron in a convolutional layer is only connected to small region of the input volume.
  • The dimensionality of this region is commonly referred to as the receptive field size of the neuron.
  • Convolutional layers are also able to significantly reduce the complexity of the model through the optimisation of its output - three hyperparameters : depth, stride, zero-padding
  • The depth of the output volume produced by the convolutional layers can be manually set through the number of neurons within the layer to a the same region of the input.
  • Reducing the depth can significantly minimise the total number of neurons of the network, but it can also significantly reduce the pattern recognition capabilities of the model.
  • the stride in which we set the depth around the spatial dimensionality of the input in order to place the receptive field.
  • Zero-padding is the simple process of padding the border of the input, and is an effective method to give further control as to the dimensionality of the output volumes.
  • If the calculated result from this equation is not equal to a whole integer then the stride has been incorrectly set, as the neurons will be unable to fit neatly across the given input.
  • Parameter sharing works on the assumption that if one region feature is useful to compute at a set spatial region, then it is likely to be useful in another region.

  • convolutional layer는 작은 kernel을 이미지 위에 움직이면서 특징을 찾고, 그 결과를 activation map으로 만듦
  • convolutional layer는 이미지 특징을 뽑는 핵심 층
  • CNN이 학습하며서 적절한 filter 값을 스스로 찾음 ⇒ learnable kernels
  • kernel은 작은 필터
  • kernel은 움직이면서 입력이미지의 영역과 자신의 weight를 곱함 ⇒ scalar product
  • kernel이 움직이면서 각 위치마다 값 하나를 만듦 → 움직이면서 여러 개의 값을 만듦 ⇒ activation map(feature map)
  • kernel이 움직이면서 자신이 찾는 특징을 만나면 강하게 반응(fire)
  • kernel 하나당 activation map 하나가 나옴
  • activation map들을 depth 방향으로 쌓으면 convolutional layer의 출력 volume이 됨
  • receptive field size는 한 뉴런이 바라보는 입력 영역의 크기
  • depth는 출력 activation map의 개수 = filter 개수
    • filter 적음 → 단순한 특징만 찾음 ⇒ 성능이 떨어짐
    • filter 많음 → 다양한 특징을 찾음 ⇒ 계산량과 파라미터 증가
  • stride는 kernel이 이동하는 간격
    • stride가 커질수록 output의 height와 width가 작아짐
  • zero-padding은 입력 이미지의 바깥쪽에 0을 둘러주는 것
  • zero-padding하면 출력 크기 조절 가능 및 가장자리 정보 보존 가능
  • parameter sharing은 예를 들어 세로선이라는 특징이 있는데 그것이 이미지 왼쪽에 있을 수도, 오른쪽에 있을 수도 있음 → 위치마다 서로 다른 세로선 탐지기를 만들어야 할까? → NO! → 하나의 세로선 filter를 이미지 전체에 반복해서 적용 ⇒ 같은 kernel을 여러 위치에서 공유

2.3 Pooling layer

  • Pooling layers aim to gradually reduce the dimensionality of the representation, and thus further reduce the number of parameters and the computational complexity of the model.
  • The pooling layer operates over each activation map in the input, ad scales its dimensionality using the “MAX” function.
  • In most CNNs, these come in the form of max-pooling layers with kernels of a dimensionality of 2x2 applied with a stride of 2 along the spatial dimensions of the input.
  • General pooling layers are comprised of pooling neurons that are able to perform a multitude of common operations including L1/L2-normalization, and average pooling.

  • pooling layer는 feature map의 크기를 줄여서 계산량을 줄이고, 중요한 특징만 남기는 층
  • pooling layer는 height와 width는 줄이고 depth는 보존 ⇒ 다른 말로, feature map의 개수는 그대로 두고, 각 feature map의 공간 크기만 줄임
  • pooling은 각 activation map마다 따로 적용됨 ⇒ feature map의 개수를 줄이는 것이 절대 아님 ❌
  • pooling은 feature map을 압축하는 과정 → 중요한 특징은 남기고, 세부 정보 일부는 버림

2.4 Fully-connected layer

  • The fully-connected layer contains neurons which are directly connected to the neurons in the two adjacent layers, without being connected to any layers within them.

  • fully-connected layer는 특징들을 모아서 최종 분류를 수행하는 층

3. Recipes

  • stacking multiple convolutional layers allows for more complex features of the input vector to be selected.
  • The input layer should be recursively divisible by two. Common numbers include 32x32, 64x64, 96x96, 128x128 and 224x224.

  • layer가 깊어질수록 특징의 수준이 올라감

4. Conclusion

  • Convolutional Neural Networks differ to other forms of Artificial Neural Network in that instead of focusing on the entirety of the problem domain, knowledge about the specific type of input is exploited. This in turn allows for a much simpler network architecture to be set up.


Convolution(합성곱)이 무엇인가?

profile
감자애오

0개의 댓글