KR20200066143A - Method for lighting neural network using ruduction-repetition block and apparatus using the same - Google Patents

Method for lighting neural network using ruduction-repetition block and apparatus using the same Download PDF

Info

Publication number
KR20200066143A
KR20200066143A KR1020190070950A KR20190070950A KR20200066143A KR 20200066143 A KR20200066143 A KR 20200066143A KR 1020190070950 A KR1020190070950 A KR 1020190070950A KR 20190070950 A KR20190070950 A KR 20190070950A KR 20200066143 A KR20200066143 A KR 20200066143A
Authority
KR
South Korea
Prior art keywords
neural network
layer
block
reduced
layers
Prior art date
Application number
KR1020190070950A
Other languages
Korean (ko)
Inventor
김혜진
오상윤
이종은
Original Assignee
한국전자통신연구원
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 한국전자통신연구원 filed Critical 한국전자통신연구원
Priority to US16/698,711 priority Critical patent/US20200175353A1/en
Publication of KR20200066143A publication Critical patent/KR20200066143A/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology

Abstract

Disclosed are a method for reducing a neural network using a reduction-repetition block and an apparatus therefor. The method for reducing a neural network, according to an embodiment of the present invention, includes the steps of: accumulating output values for at least one of a layer and a reduced repeating block constituting a neural network in condensed decoding connection (CDC); and reducing the neural network by reducing the same to a feature map generated to correspond to the data accumulated in the CDC based on a preset reduction layer.

Description

축소 반복 블록을 이용한 뉴럴 네트워크 경량화 방법 및 이를 위한 장치 {METHOD FOR LIGHTING NEURAL NETWORK USING RUDUCTION-REPETITION BLOCK AND APPARATUS USING THE SAME}Method for reducing neural network using reduced repetition block and device therefor {METHOD FOR LIGHTING NEURAL NETWORK USING RUDUCTION-REPETITION BLOCK AND APPARATUS USING THE SAME}

본 발명은 뉴럴 네트워크를 설계하는 기술에 관한 것으로, 특히 네트워크의 기존 성능을 유지하면서도 전력을 적게 소모하면서 빠르게 동작하는 경량화된 뉴럴 네트워크 구조를 설계하기 위한 기술에 관한 것이다.The present invention relates to a technique for designing a neural network, and more particularly, to a technique for designing a lightweight neural network structure that operates quickly while consuming less power while maintaining the existing performance of the network.

뉴럴 네트워크의 설계는 수많은 시도를 반복해서 수행하고, 그 중 좋은 성능을 갖는 네트워크 구조를 선택하는 방식으로 이루어져 왔다. 이러한 방식은 디자인 탐색 영역(DESIGN SPACE EXPLORATION, DSE)이 매우 넓기 때문에 효과적인 결론을 도출하는 데에 많은 시간을 필요로 한다는 단점이 있다. The design of the neural network has been made by repeatedly performing numerous attempts and selecting a network structure having good performance. The disadvantage of this method is that the DESIGN SPACE EXPLORATION (DSE) is very wide, so it takes a lot of time to draw an effective conclusion.

또한, 종래에는 백본 네트워크(BACKBONE NETWORK)라 불리는 네트워크 구조를 참고하여 각각의 응용 목적에 맞게 수정하는 형태로 네트워크를 설계해왔다. 널리 알려진 백본 네트워크로는 LeNet, AlexNet, GoogLeNet, VGGNet, ResNet 등이 있다. 이렇게 응용 분야에서 목적에 맞게 변형된 네트워크들은 큰 틀 안에서 또 다시 세부 네트워크 구조의 변형을 수행할 수 있다. In addition, in the related art, networks have been designed in a form that is modified according to each application purpose by referring to a network structure called a backbone network. Popular backbone networks include LeNet, AlexNet, GoogLeNet, VGGNet, and ResNet. In this application, networks that have been modified for purpose can perform detailed network structure modification again within a large framework.

일반적으로 뉴럴 네트워크는 1x1 컨벌루션 레이어(CONVOLUTION LAYER)들의 연결(CONCATIENATION) 및 연결을 건너 뛸(SKIP CONNECTION) 위치 외에도 상관 계층(CORRELATION LATER)이라든가 팽창 계층(DILATION LAYER) 등의 단일 레이어, 풀링 레이어(POOLING LATER), 시그모이드 레이어(SIGMOID LAYER), FC 레이어 등 단일 레이어로서 연속적인 컨벌루션 이외의 일을 하는 주요 레이어들로 구성될 수 있다.In general, a neural network is a single layer such as a correlation layer (CORRELATION LATER) or expansion layer (DILATION LAYER), a pooling layer (POOLING), as well as a location of 1x1 convolutional layers (CONVOLUTION LAYER) and SKIP CONNECTION. LATER), SIGMOID LAYER, FC layer, etc., which can be composed of main layers that work other than continuous convolution.

지금까지는 이러한 다양한 레이어들을 모두 개별적으로 고려하면서 뉴럴 네트워크를 설계하였으나, 디자인의 탐색 영역이 너무 넓어지게 되면서 고려해야 할 부분이 매우 많아지게 되었다. 즉, 큰 틀 이외에도 고려해야 할 부분이 많아지는 문제점이 존재하는 것이다. Until now, the neural network was designed by considering all of these various layers individually, but as the search area of the design became too wide, there were many things to consider. That is, there is a problem in that there are many parts to be considered in addition to the large frame.

다시 말해서, 탐색해야 할 영역이 많다면 탐색에 필요한 시간이 더 많이 소요되고, 복잡한 네트워크일수록 탐색 영역의 복잡도는 더 높아질 수 밖에 없다. 또한, 뉴럴 네트워크는 DEEP 네트워크일수록 소요되는 학습 시간의 단위가 몇 시간이 아닌 수 일이 걸리기 때문에 많은 실험을 하려면 굉장히 많은 시간이 소요될 수 밖에 없다. 이 때문에 뉴럴 네트워크 구조의 디자인 탐색은 어느 정도 합리적인 선에서 타협하여 구조 탐색을 마치는 게 일반적이었다.In other words, if there are many areas to be searched, it takes more time to search, and the more complicated the network, the higher the complexity of the search area. In addition, the neural network is a DEEP network, so it takes a lot of time to do many experiments because the unit of learning time required is several days instead of hours. For this reason, it was common for the design exploration of the neural network structure to be compromised at a reasonable level to complete the exploration of the structure.

한국 공개 특허 제10-2018-0077260호, 2018년 7월 6일 공개(명칭: 신경망의 실행 순서 결정)Published Korean Patent No. 10-2018-0077260, published on July 6, 2018 (name: Neural Network Execution Order Decision)

본 발명의 목적은 뉴럴 네트워크의 설계 탐색 범위를 감소시켜 적은 연산만으로도 계산이 빠르고, 전력 소모가 적은 구조의 네트워크를 설계하는 것이다.An object of the present invention is to design a network having a fast computation and low power consumption with only a small amount of computation by reducing the design search range of the neural network.

또한, 본 발명의 목적은 기존에 발표된 네트워크를 저전력, 경량화, 고속화시킬 수 있도록 리모델링하는 것이다.In addition, an object of the present invention is to remodel the existing network to be low power, light weight, and high speed.

또한, 본 발명의 목적은 반복 블록을 기반으로 적절한 깊이 수준의 뉴럴 네트워크를 설계하여 계산량의 과도한 팽창을 방지하는 것이다.In addition, it is an object of the present invention to design an appropriate depth level neural network based on a repeating block to prevent excessive expansion of the computational amount.

또한, 본 발명의 목적은 반복 블록을 이용한 블록 단위의 모델 설계를 통해 네트워크를 설계함에 있어 레이어 단위의 조합 수를 감소시켜 상대적으로 용이하게 네트워크 구조를 설계하는 것이다.In addition, an object of the present invention is to design a network structure relatively easily by reducing the number of combinations of layer units in designing a network through a block-based model design using repeating blocks.

또한, 본 발명의 목적은 반복 블록 혹은 이전에 출력된 레이어들을 쌓아 CDC에 축적하고, 이를 축소 레이어를 기반으로 축소함으로써 상대적으로 계산량이 적은 가벼운 네트워크 구조를 설계하는 것이다.In addition, an object of the present invention is to design a lightweight network structure having a relatively small amount of computation by accumulating iterative blocks or previously output layers and accumulating them in the CDC and reducing them based on the reduction layer.

상기한 목적을 달성하기 위한 본 발명에 따른 뉴럴 네트워크 경량화 방법은 뉴럴 네트워크(NEURAL NETWORK)를 구성하는 레이어 및 축소 반복 블록 중 적어도 하나에 대한 출력값을 CDC(CONDENSED DECODING CONNECTION)에 축적하는 단계; 및 기설정된 축소 레이어를 기반으로 상기 CDC에 축적된 데이터에 상응하게 생성된 특징 맵(FEATURE MAP)으로 축소하여 상기 뉴럴 네트워크를 경량화하는 단계를 포함한다.In order to achieve the above object, a method for reducing the weight of a neural network according to the present invention comprises accumulating output values for at least one of a layer and a reduced repetition block constituting a neural network in CDC (CONDENSED DECODING CONNECTION); And reducing the neural network by reducing it to a feature map (FEATURE MAP) generated corresponding to the data accumulated in the CDC based on a preset reduction layer.

이 때, 축소 반복 블록은 상기 뉴럴 네트워크의 전체 구조 중 기설정된 분류 조건에 따라 블록 단위로 분류된 복수개의 블록 구간들이 각각 최적의 성능을 낼 수 있도록 레이어 축소와 레이어 팽창을 반복적으로 수행하는 구간에 상응할 수 있다.At this time, the reduced repeating block is a section in which the plurality of block sections classified in block units according to a preset classification condition among the entire structure of the neural network repeatedly performs layer reduction and layer expansion so as to achieve optimal performance. May correspond.

이 때, 뉴럴 네트워크 경량화 방법은 상기 복수개의 블록 구간들마다 하이퍼 파라미터의 설정에 기반한 축소 반복 블록 후보군을 생성하는 단계; 및 성능평가를 기반으로 상기 축소 반복 블록 후보군 중 최적의 성능을 갖는 어느 하나의 축소 반복 블록 후보를 상기 축소 반복 블록으로 선정하는 단계를 더 포함할 수 있다.At this time, the neural network weighting method includes generating a reduced repetition block candidate group based on setting of a hyper parameter for each of the plurality of block sections; And selecting one of the reduced repetition block candidates having optimal performance from the reduced repetition block candidate group as the reduced repetition block based on performance evaluation.

이 때, 축소 반복 블록 후보군은 상기 하이퍼 파라미터의 값이 서로 상이한 복수개의 축소 반복 블록 후보들을 포함할 수 있다.At this time, the reduced repetition block candidate group may include a plurality of reduced repetition block candidates having different values of the hyperparameters.

이 때, 뉴럴 네트워크 경량화 방법은 상기 뉴럴 네트워크가 상기 블록 단위로 구성되지 않은 기개발된 뉴럴 네트워크일 경우, 상기 기설정된 분류 조건을 기반으로 상기 기개발된 뉴럴 네트워크를 블록 단위로 분류하는 단계를 더 포함할 수 있다.At this time, the neural network light weighting method further comprises classifying the previously developed neural network into block units based on the preset classification condition when the neural network is a previously developed neural network that is not composed of the block units. It can contain.

이 때, 기설정된 분류 조건은 연속된 복수개의 컨벌루션 레이어(CONVOLUTION LAYER)들을 서브 샘플링 레이어(SUB-SAMPLING LATER) 기준으로 분류하는 제1 분류 조건, 연속된 복수개의 컨벌루션 레이어들을 스킵 커넥션(SKIP CONNECTION)을 갖는 레이어 기준으로 분류하는 제2 분류 조건, 서브 샘플링 레이어를 포함하지 않는 연속된 복수개의 컨벌루션 레이어들을 기설정된 연속 횟수 기준으로 분류하는 제3 분류 조건, 레이어들 간의 깊이 있는 연결 구간(DEPTH CONCATENATION)을 하나의 블록 구간으로 분류하는 제4 분류 조건 및 연속된 복수개의 컨벌루션 레이어들과 다른 성격을 갖는 레이어를 기준으로 분류하는 제5 분류 조건 중 적어도 하나를 포함할 수 있다.At this time, the preset classification condition is a first classification condition that classifies a plurality of convolutional layers (CONVOLUTION LAYER) based on a sub-sampling layer (SUB-SAMPLING LATER), and skips connections of a plurality of consecutive convolutional layers (SKIP CONNECTION) A second classification condition to classify on the basis of a layer having a, a third classification condition to classify a plurality of consecutive convolutional layers that do not include a sub-sampling layer based on a predetermined number of consecutive times, and a deep connection section between layers (DEPTH CONCATENATION) It may include at least one of a fourth classification condition to classify a single block period and a fifth classification condition to classify a plurality of consecutive convolutional layers based on a layer having a different characteristic.

이 때, 하이퍼 파라미터는 커널 사이즈, 최대 레이어 개수, 레이어 최소 깊이, 레이어 최대 깊이, 총 반복 횟수, 총 경우의 수, 축소된 레이어의 개수 및 축소된 채널의 개수 중 적어도 하나를 포함할 수 있다.At this time, the hyper parameter may include at least one of a kernel size, a maximum number of layers, a minimum layer depth, a maximum layer depth, a total number of iterations, a total number of cases, a reduced number of layers, and a reduced number of channels.

이 때, 축소 반복 블록은 종방향 및 횡방향에 상응하게 축적될 수 있다.At this time, the collapsed repeating block may accumulate in the longitudinal and transverse directions.

이 때, 기설정된 축소 레이어는 1X1 커널 사이즈를 갖는 레이어에 상응할 수 있다.At this time, the preset reduction layer may correspond to a layer having a 1X1 kernel size.

이 때, 기설정된 축소 레이어는 상기 특징 맵에 상응하게 축적된 복수개의 채널들을 상기 축소된 채널의 개수만큼 축소시킬 수 있다.At this time, the preset reduction layer may reduce a plurality of channels accumulated corresponding to the feature map by the number of the reduced channels.

또한, 본 발명의 일실시예에 따른 뉴럴 네트워크 경량화 장치는, 뉴럴 네트워크(NEURAL NETWORK)를 구성하는 레이어 및 축소 반복 블록 중 적어도 하나에 대한 출력값을 축적하는 CDC(CONDENSED DECODING CONNECTION); 1X1 커널 사이즈를 갖는 축소 레이어; 및 상기 출력값을 상기 CDC에 축적하고, 상기 축소 레이어를 기반으로 상기 CDC에 축적된 데이터에 상응하게 생성된 특징 맵(FEATURE MAP)으로 축소하여 상기 뉴럴 네트워크를 경량화하는 프로세서를 포함한다.In addition, the neural network weight reduction apparatus according to an embodiment of the present invention, CDC (CONDENSED DECODING CONNECTION) to accumulate the output value for at least one of the layer and the reduced repetition block constituting the neural network (NEURAL NETWORK); A reduction layer having a 1X1 kernel size; And a processor that accumulates the output value in the CDC and reduces the neural network by reducing the feature map (FEATURE MAP) generated corresponding to the data accumulated in the CDC based on the reduction layer.

이 때, 축소 반복 블록은 상기 뉴럴 네트워크의 전체 구조 중 기설정된 분류 조건에 따라 블록 단위로 분류된 복수개의 블록 구간들이 각각 최적의 성능을 낼 수 있도록 레이어 축소와 레이어 팽창을 반복적으로 수행하는 구간에 상응할 수 있다.At this time, the reduced repeating block is a section in which the plurality of block sections classified in block units according to a preset classification condition among the entire structure of the neural network repeatedly performs layer reduction and layer expansion so as to achieve optimal performance. May correspond.

이 때, 프로세서는 상기 복수개의 블록 구간들마다 하이퍼 파라미터의 설정에 기반한 축소 반복 블록 후보군을 생성하고, 성능평가를 기반으로 상기 축소 반복 블록 후보군 중 최적의 성능을 갖는 어느 하나의 축소 반복 블록 후보를 상기 축소 반복 블록으로 선정할 수 있다.At this time, the processor generates a reduced repetition block candidate group based on the setting of a hyper parameter for each of the plurality of block sections, and selects any one of the reduced repetition block candidates having optimal performance among the reduced repetition block candidate groups based on performance evaluation. It can be selected as the reduced repetition block.

이 때, 축소 반복 블록 후보군은 상기 하이퍼 파라미터의 값이 서로 상이한 복수개의 축소 반복 블록 후보들을 포함할 수 있다.At this time, the reduced repetition block candidate group may include a plurality of reduced repetition block candidates having different values of the hyperparameters.

이 때, 프로세서는 상기 뉴럴 네트워크가 상기 블록 단위로 구성되지 않은 기개발된 뉴럴 네트워크일 경우, 상기 기설정된 분류 조건을 기반으로 상기 기개발된 뉴럴 네트워크를 블록 단위로 분류할 수 있다.At this time, the processor may classify the previously developed neural network in block units based on the preset classification condition when the neural network is a previously developed neural network that is not configured in the block unit.

이 때, 기설정된 분류 조건은 연속된 복수개의 컨벌루션 레이어(CONVOLUTION LAYER)들을 서브 샘플링 레이어(SUB-SAMPLING LATER) 기준으로 분류하는 제1 분류 조건, 연속된 복수개의 컨벌루션 레이어들을 스킵 커넥션(SKIP CONNECTION)을 갖는 레이어 기준으로 분류하는 제2 분류 조건, 서브 샘플링 레이어를 포함하지 않는 연속된 복수개의 컨벌루션 레이어들을 기설정된 연속 횟수 기준으로 분류하는 제3 분류 조건, 레이어들 간의 깊이 있는 연결 구간(DEPTH CONCATENATION)을 하나의 블록 구간으로 분류하는 제4 분류 조건 및 연속된 복수개의 컨벌루션 레이어들과 다른 성격을 갖는 레이어를 기준으로 분류하는 제5 분류 조건 중 적어도 하나를 포함할 수 있다.At this time, the preset classification condition is a first classification condition that classifies a plurality of convolutional layers (CONVOLUTION LAYER) based on a sub-sampling layer (SUB-SAMPLING LATER), and skips connections of a plurality of consecutive convolutional layers (SKIP CONNECTION) A second classification condition to classify on the basis of a layer having a, a third classification condition to classify a plurality of consecutive convolutional layers that do not include a sub-sampling layer based on a predetermined number of consecutive times, and a deep connection section between layers (DEPTH CONCATENATION) It may include at least one of a fourth classification condition to classify a single block period and a fifth classification condition to classify a plurality of consecutive convolutional layers based on a layer having a different characteristic.

이 때, 하이퍼 파라미터는 커널 사이즈, 최대 레이어 개수, 레이어 최소 깊이, 레이어 최대 깊이, 총 반복 횟수, 총 경우의 수, 축소된 레이어의 개수 및 축소된 채널의 개수 중 적어도 하나를 포함할 수 있다.At this time, the hyper parameter may include at least one of a kernel size, a maximum number of layers, a minimum layer depth, a maximum layer depth, a total number of iterations, a total number of cases, a reduced number of layers, and a reduced number of channels.

이 때, 축소 반복 블록은 종방향 및 횡방향에 상응하게 축적될 수 있다.At this time, the collapsed repeating block may accumulate in the longitudinal and transverse directions.

이 때, 기설정된 축소 레이어는 상기 특징 맵에 상응하게 축적된 복수개의 채널들을 상기 축소된 채널의 개수만큼 축소시킬 수 있다.At this time, the preset reduction layer may reduce a plurality of channels accumulated corresponding to the feature map by the number of the reduced channels.

본 발명에 따르면, 뉴럴 네트워크의 설계 탐색 범위를 감소시켜 적은 연산만으로도 계산이 빠르고, 전력 소모가 적은 구조의 네트워크를 설계할 수 있다.According to the present invention, it is possible to design a network having a fast calculation and a low power consumption structure with less computation by reducing the design search range of the neural network.

또한, 본 발명은 기존에 발표된 네트워크를 저전력, 경량화, 고속화시킬 수 있도록 리모델링할 수 있다.In addition, the present invention can be remodeled so that the previously announced network can be reduced in power, weight, and speed.

또한, 본 발명은 반복 블록을 기반으로 적절한 깊이 수준의 뉴럴 네트워크를 설계하여 계산량의 과도한 팽창을 방지할 수 있다.In addition, the present invention can prevent excessive expansion of the calculation amount by designing a neural network having an appropriate depth level based on a repeating block.

또한, 본 발명은 반복 블록을 이용한 블록 단위의 모델 설계를 통해 네트워크를 설계함에 있어 레이어 단위의 조합 수를 감소시켜 상대적으로 용이하게 네트워크 구조를 설계할 수 있다.In addition, the present invention can design a network structure relatively easily by reducing the number of combinations of layer units in designing a network by designing a block unit model using a repeating block.

또한, 반복 블록 혹은 이전에 출력된 레이어들을 쌓아 CDC에 축적하고, 이를 축소 레이어를 기반으로 축소함으로써 상대적으로 계산량이 적은 가벼운 네트워크 구조를 설계할 수 있다.In addition, it is possible to design a light network structure with a relatively small amount of computation by stacking repeating blocks or previously output layers and accumulating them in the CDC and reducing them based on the reduction layer.

도 1 내지 도 2는 본 발명의 일실시예에 따른 뉴럴 네트워크 경량화 시스템을 나타낸 도면이다.
도 3은 본 발명의 일실시예에 따른 뉴럴 네트워크 경량화 방법을 나타낸 동작 흐름도이다.
도 4 내지 도 6은 본 발명에 따른 블록 구간을 분류하는 과정의 일 예를 나타낸 도면이다.
도 7은 본 발명에 따른 축소 반복 블록 후보군에 대한 성능 평가를 기반으로 축소 반복 블록을 선정하는 과정의 일 예를 나타낸 도면이다.
도 8은 본 발명에 따른 횡방향 반복 블록의 일 예를 나타낸 도면이다.
도 9 내지 도 10은 본 발명에 따른 종방향 반복 블록의 일 예를 나타낸 도면이다.
도 11 내지 도 12는 본 발명에 따라 뉴럴 네트워크 경량화를 수행한 실시예를 나타낸 도면이다.
도 13은 본 발명의 일실시예에 따른 뉴럴 네트워크 경량화 장치를 나타낸 블록도이다.
도 14는 본 발명의 일실시예에 따른 뉴럴 네트워크 경량화 구조를 나타낸 도면이다.
도 15 내지 도 16은 본 발명에 따른 뉴럴 네트워크 경량화 방법을 통해 네트워크가 경량화되는 일 예를 나타낸 도면이다.
1 to 2 is a view showing a neural network lightweight system according to an embodiment of the present invention.
3 is an operation flowchart showing a method for reducing a neural network according to an embodiment of the present invention.
4 to 6 are views showing an example of a process of classifying a block section according to the present invention.
7 is a diagram illustrating an example of a process of selecting a reduced repeating block based on performance evaluation of a reduced repeating block candidate group according to the present invention.
8 is a view showing an example of a transverse repeating block according to the present invention.
9 to 10 are views showing an example of a longitudinal repeating block according to the present invention.
11 to 12 are views showing an embodiment in which the neural network is reduced in weight according to the present invention.
13 is a block diagram showing a neural network light weighting apparatus according to an embodiment of the present invention.
14 is a view showing a neural network lightweight structure according to an embodiment of the present invention.
15 to 16 are views showing an example in which the network is reduced in weight through the neural network lightweighting method according to the present invention.

본 발명을 첨부된 도면을 참조하여 상세히 설명하면 다음과 같다. 여기서, 반복되는 설명, 본 발명의 요지를 불필요하게 흐릴 수 있는 공지 기능, 및 구성에 대한 상세한 설명은 생략한다. 본 발명의 실시형태는 당 업계에서 평균적인 지식을 가진 자에게 본 발명을 보다 완전하게 설명하기 위해서 제공되는 것이다. 따라서, 도면에서의 요소들의 형상 및 크기 등은 보다 명확한 설명을 위해 과장될 수 있다.If described in detail with reference to the accompanying drawings the present invention. Here, repeated descriptions, well-known functions that may unnecessarily obscure the subject matter of the present invention, and detailed description of the configuration will be omitted. Embodiments of the present invention are provided to more fully describe the present invention to those skilled in the art. Therefore, the shape and size of elements in the drawings may be exaggerated for a more clear description.

이하, 본 발명에 따른 바람직한 실시예를 첨부된 도면을 참조하여 상세하게 설명한다.Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings.

도 1 내지 도 2는 본 발명의 일실시예에 따른 뉴럴 네트워크 경량화 시스템을 나타낸 도면이다.1 to 2 is a view showing a neural network lightweight system according to an embodiment of the present invention.

먼저 도 1을 참조하면, 본 발명의 일실시예에 따른 뉴럴 네트워크 경량화 시스템에서는 먼저 뉴럴 네트워크의 설계자가 응용 분야에 맞게 조밀한 구조로 뉴럴 네트워크를 설계할 수 있다. 이 때, 설계자는 디자인 범위에서 가장 복잡하고 포괄적인 구조로 뉴럴 네트워크를 설계할 수 있다. 즉, 설계자가 원하는 성능을 얻을 수 있도록 충분히 큰 구조의 뉴럴 네트워크를 설계할 수 있으며, 설계시 성능 이외의 방향에 대해서는 크기 고려하지 않을 수 있다.Referring first to FIG. 1, in a neural network lightweight system according to an embodiment of the present invention, a neural network designer can design a neural network in a compact structure according to an application field. At this time, the designer can design the neural network with the most complex and comprehensive structure in the design scope. That is, it is possible to design a neural network having a sufficiently large structure so that the designer can obtain desired performance, and the size may not be considered for directions other than performance when designing.

이와 같은 방식으로 최초 설계된 뉴럴 네트워크(110)는 본 발명의 일실시예에 따른 뉴럴 네트워크 경량화 장치(100)로 입력되어 최적 뉴럴 네트워크(120)의 형태로 경량화 될 수 있다. The neural network 110 initially designed in this way may be inputted to the neural network lightening apparatus 100 according to an embodiment of the present invention, and thus may be lightened in the form of an optimal neural network 120.

예를 들어, 도 2를 참조하면, 본 발명의 일실시예에 따른 뉴럴 네트워크 경량화 장치(200)에 충분히 큰 구조로 최초 설계된 뉴럴 네트워크가 입력되면, 입력된 네트워크를 구성하는 레이어나 축소 반복 블록 중 적어도 하나에 대한 출력값을 CDC에 축적할 수 있다. For example, referring to FIG. 2, when a neural network initially designed with a sufficiently large structure is input to the neural network lightening apparatus 200 according to an embodiment of the present invention, either a layer or a reduced repeating block constituting the input network The output value for at least one can be accumulated in the CDC.

이 때, 본 발명에서는 최초 설계된 뉴럴 네트워크(110)가 아니더라도 기개발된 뉴럴 네트워크를 경량화 장치(100)로 입력하여 최적 뉴럴 네트워크(120)의 형태로 경량화할 수도 있다.At this time, in the present invention, even if the neural network 110 is not designed for the first time, the previously developed neural network may be input to the lightweight device 100 to reduce the weight to the optimal neural network 120.

이 후, 뉴럴 네트워크 경량화 장치(200)에서는 축소 레이어를 기반으로 CDC에 축적된 데이터들을 기반으로 생성된 특징 맵(feature map)으로 축소시킴으로써 뉴럴 네트워크를 경량화할 수 있다.Thereafter, the neural network lightweight device 200 may reduce the neural network by reducing the data accumulated in the CDC based on the reduction layer to a feature map generated based on the reduction layer.

도 3은 본 발명의 일실시예에 따른 뉴럴 네트워크 경량화 방법을 나타낸 동작 흐름도이다.3 is an operation flowchart showing a method for reducing a neural network according to an embodiment of the present invention.

도 3을 참조하면, 본 발명의 일실시예에 따른 뉴럴 네트워크 경량화 방법은 뉴럴 네트워크(NEURAL NETWORK)를 구성하는 레이어 및 축소 반복 블록 중 적어도 하나에 대한 출력값을 CDC(CONDENSED DECODING CONNECTION)에 축적한다(S310).Referring to FIG. 3, in the method for reducing the weight of a neural network according to an embodiment of the present invention, output values of at least one of a layer and a reduced repetition block constituting a neural network (NEURAL NETWORK) are accumulated in a CDD (CONDENSED DECODING CONNECTION) ( S310).

예를 들어, 축소 반복 블록의 경우, 도 14에 도시된 것처럼 1x1 convolution으로 축소된 output들을 CDC(1410)에 축적할 수 있다. 이와 같이 CDC(1410)에 output이 축적되어 만들어진 긴 채널들은 하이퍼 파라미터에 상응하는 축소된 레이어 개수(rcn)로 축소될 수 있는데, 단계(S320)을 통해 설명하도록 한다.For example, in the case of a reduced repeating block, outputs reduced to 1×1 convolution may be accumulated in the CDC 1410 as illustrated in FIG. 14. As described above, long channels created by accumulating output in the CDC 1410 may be reduced to a reduced number of layers rcn corresponding to hyper parameters, which will be described through step S320.

이 때, CDC에 축적되는 output은 도 14와 같은 축소 반복 블록(1400)의 출력값 이외에도 뉴럴 네트워크를 구성하는 적어도 하나의 레이어에 의한 output을 포함할 수도 있다.At this time, the output accumulated in the CDC may include output by at least one layer constituting the neural network in addition to the output value of the reduced repetition block 1400 shown in FIG. 14.

즉, 많은 정보를 CDC에 쌓아 이를 축소시킴으로써 성능은 유지하면서도 계산량이 적은 가벼운 네트워크 구조를 갖도록 할 수 있다.That is, by storing a lot of information in the CDC and reducing it, it is possible to have a light network structure with little computational complexity while maintaining performance.

이 때, 축소 반복 블록은 뉴럴 네트워크의 전체 구조 중 기설정된 분류 조건에 따라 블록 단위로 분류된 복수개의 블록 구간들이 각각 최적의 성능을 낼 수 있도록 레이어 축소와 레이어 팽창을 반복적으로 수행하는 구간에 상응할 수 있다.At this time, the reduced repetition block corresponds to a section in which layer reduction and layer expansion are repeatedly performed so that a plurality of block sections classified in block units according to a predetermined classification condition among the entire structure of the neural network can each achieve optimal performance. can do.

예를 들어, 블록 단위로 구성된 뉴럴 네트워크에 대해서, 블록 단위로 분류된 복수개의 블록 구간들마다 최적의 성능을 갖는 축소 레이어를 계층별로 축적함으로써 축소 반복 블록을 생성할 수 있다.For example, for a neural network composed of block units, a reduced repetitive block may be generated by accumulating a reduced layer having optimal performance for each of a plurality of block sections classified in block units for each layer.

이 때, 도 3에는 도시하지 아니하였으나, 본 발명의 일실시예에 따른 뉴럴 네트워크 경량화 방법은 복수개의 블록 구간들마다 하이퍼 파라미터의 설정에 기반한 축소 반복 블록 후보군을 생성할 수 있고, 반복적인 성능평가를 기반으로 축소 반복 블록 후보군 중 최적의 성능을 갖는 어느 하나의 축소 반복 블록 후보를 축소 반복 블록으로 선정할 수 있다.At this time, although not shown in FIG. 3, in the method of reducing the neural network according to an embodiment of the present invention, a reduced repetitive block candidate group based on setting of a hyper parameter for each of a plurality of block sections can be generated, and repeated performance evaluation Based on the, any one of the reduced-repetition block candidates having optimal performance among the reduced-repetition block candidate groups may be selected as the reduced-repetition block.

이 때, 성능평가는 1X1 커널 사이즈에 상응하게 레이어 축소를 수행하고, 3X3 커널 사이즈에 상응하게 레이어 팽창을 수행하여 수행될 수 있다.In this case, the performance evaluation may be performed by performing layer reduction corresponding to the 1X1 kernel size and performing layer expansion corresponding to the 3X3 kernel size.

예를 들어, 도 7과 같이 본 발명의 일실시예에 따른 성능평가 모듈(700)로 적어도 하나의 축소 반복 블록 후보를 순차적으로 입력하여 축소 반복 블록을 선정할 수 있다. 즉, 1번째 축소 반복 블록 후보군(710)이 입력되는 경우, 축소 반복 블록 디자인 스키마에 따라 레이어 깊이의 축소 혹은 복원을 위한 팽창을 반복하면서 성능평가를 수행할 수 있다. 이 후, 1번째 축소 반복 블록 후보군(710)에서 성능이 최적화된 1번째 축소 반복 블록을 선정할 수 있다. 이와 같은 과정을 적어도 하나의 축소 반복 블록 후보군마다 수행함으로써 뉴럴 네트워크를 구성할 적어도 하나의 축소 반복 블록을 선정할 수 있다.For example, as shown in FIG. 7, at least one reduced iteration block candidate may be sequentially input to the performance evaluation module 700 according to an embodiment of the present invention to select a reduced iteration block. That is, when the first reduced repetition block candidate group 710 is input, performance evaluation may be performed while repeating expansion for reduction or restoration of layer depth according to a reduction repetition block design scheme. Thereafter, the first reduced iteration block with optimized performance may be selected from the first reduced iteration block candidate group 710. By performing this process for each candidate group of at least one reduced repetition block, at least one reduced repetition block constituting the neural network can be selected.

이와 같은 반복적 성능평가는, 하이퍼 파라미터를 기반으로 레이어 깊이의 축소와 복원을 위한 팽창을 반복적으로 수행하면서 해당 블록의 성능을 평가하는 과정에 해당할 수 있다. 이러한 과정을 통해 최적의 성능을 갖는 축소 반복 블록 디자인을 찾아낼 수 있다.The iterative performance evaluation may correspond to a process of evaluating the performance of the corresponding block while repeatedly performing the reduction and reduction of the layer depth based on the hyper parameter. Through this process, it is possible to find a miniaturized iterative block design with optimal performance.

즉, 본 발명에 따르면 축소 반복 블록 후보군에 포함되는 각각의 축소 반복 블록 후보의 하이퍼 파라미터들이 이전 레이어 혹은 이전 축소 반복 블록 후보의 파라미터 값을 고려하여 제한적으로 결정되기 때문에 축소 반복 블록을 디자인하기 위한 경우의 수가 강력하게 제한될 수 있다. 따라서 축소 반복 블록 후보군마다 최적의 디자인을 탐색하는 시간이 절약될 수 있다.That is, according to the present invention, since the hyperparameters of each of the reduced repetition block candidates included in the reduced repetition block candidate group are limitedly determined by considering the parameter values of the previous layer or the previous reduced repetition block candidate, the case for designing the reduced repetition block The number of can be strongly limited. Therefore, the time to search for an optimal design for each reduced iteration block candidate group can be saved.

이 때, 축소 반복 블록 후보군은 하이퍼 파라미터의 값이 서로 상이한 복수개의 축소 반복 블록 후보들을 포함할 수 있다. At this time, the reduced repetition block candidate group may include a plurality of reduced repetition block candidates having different hyperparameter values.

이 때, 복수개의 축소 반복 블록 후보들은 하이퍼 파라미터들에 의해 한정된 범위 내에서 생성될 수 있다.At this time, a plurality of reduced repetition block candidates may be generated within a range defined by hyper parameters.

이 때, 하이퍼 파라미터는 커널 사이즈, 최대 레이어 개수, 레이어 최소 깊이, 레이어 최대 깊이, 총 반복 횟수, 총 경우의 수, 축소된 레이어의 개수 및 축소된 채널의 개수 중 적어도 하나를 포함할 수 있다.At this time, the hyper parameter may include at least one of a kernel size, a maximum number of layers, a minimum layer depth, a maximum layer depth, a total number of iterations, a total number of cases, a reduced number of layers, and a reduced number of channels.

예를 들어, 커널 사이즈(KERNEL SIZE)는 인셉션(INCEPTION) 모듈에서 선택한 커널 중 가장 효과적이라고 알려진 1과 3으로 주로 선택될 수 있다. For example, the kernel size (KERNEL SIZE) may be mainly selected as 1 and 3, which are known to be the most effective kernels selected in the INCEPTION module.

또한, 최대 레이어 개수(MAX_RRBLK)는 폭(STRIDE)이 1을 초과하는 컨벌루션 레이어의 총 개수와 컨벌루션 효과와 상이한 특이 레이어들의 총 개수를 합한 것에 상응할 수 있다.Also, the maximum number of layers (MAX_RRBLK) may correspond to a sum of the total number of convolutional layers having a width (STRIDE) greater than 1 and the total number of distinctive layers different from the convolutional effect.

또한, 레이어 최소 깊이(MIN_RD)는 블록의 최소 층 깊이 개수를 의미하는 값으로, 만약 첫 번째 축소 반복 블록 후보일 경우에는 이전의 레이어들이 쌓은 층의 깊이 중 가장 작은 값으로 최소 깊이를 정할 수 있다. 또한, 첫 번째 축소 반복 블록 후보가 아닐 경우에는 이전의 축소 반복 블록 후보의 깊이 값들 중 가장 작은 깊이 값에 2를 곱한 값으로 레이어 최소 깊이를 정할 수 있다. 이와 같은 레이어 최소 깊이는 [수학식 1]과 같이 나타낼 수 있다.In addition, the minimum layer depth (MIN_RD) is a value indicating the minimum number of layer depths of a block. If the candidate is the first reduced repetition block, the minimum depth may be determined as the smallest value among the layers stacked by the previous layers. . In addition, if it is not the first reduced repeating block candidate, the minimum depth of the layer may be determined by multiplying the smallest depth value among the depth values of the previous reduced repeating block candidate. The minimum depth of the layer may be expressed as [Equation 1].

[수학식 1][Equation 1]

min_Rd = min_depthprev_complex * 2 (이전 축소 반복 블록 후보가 있는 경우)min_Rd = min_depth prev_complex * 2 (if there is a previous reduced repeat block candidate)

min_Rd = min_depthprev_all_layers (첫 번째 축소 반복 블록 후보일 경우)min_Rd = min_depth prev_all_layers (for the first reduced iteration block candidate)

min_Rdnext = min_Rdprev * 2min_Rd next = min_Rd prev * 2

min_Rd < max_Rdmin_Rd <max_Rd

또한, 레이어 최대 깊이(MAX_RD)는 블록의 최대 층 깊이 개수를 의미하는 값으로, 복수개의 축소 반복 블록 후보들의 각 레이어들 중 가장 큰 특징(feature) 깊이 값이 레이어 최대 깊이에 상응할 수 있다. 단, 레이어 최대 깊이는 레이어 최소 깊이에 2를 곱한 값보다 작아질 수는 없다. 이와 같은 레이어 최대 깊이는 [수학식 2]와 같이 나타낼 수 있다.In addition, the maximum layer depth MAX_RD is a value indicating the maximum number of layer depths of a block, and the largest feature depth value of each layer of a plurality of reduced repetition block candidates may correspond to the maximum layer depth. However, the maximum layer depth cannot be smaller than the minimum layer depth multiplied by 2. The maximum depth of the layer may be expressed as [Equation 2].

[수학식 2][Equation 2]

max_Rd = max_depthpacked_layers max_Rd = max_depth packed_layers

max_Rdnext = max_Rdprev/2max_Rd next = max_Rd prev /2

min_Rd * 2 ≤ max_Rd ≤ max_depthpacked_layers min_Rd * 2 ≤ max_Rd ≤ max_depth packed_layers

또한, 총 반복 횟수(REPETITION)는 레이어 최소 깊이와 레이어 최대 깊이에 따른 축소 반복 블록 후보의 총 반복 횟수를 의미하는 값으로, 최소 1에서 축소 반복 블록 후보들의 각 레이어들의 총 개수를 2로 나누고 올림한 값까지의 범위 내에서 정수 값으로 정할 수 있다. 이 때, 반복 횟수는 최소 값에서부터 시작해서 필요한 성능이 확보될 때까지 점진적으로 증가시켜서 뉴럴 네트워크의 규모를 필요한 만큼 늘려나갈 수 있다. 이와 같은 총 반복 횟수는 [수학식 3]과 같이 나타낼 수 있다.In addition, the total number of repetitions (REPETITION) is a value indicating the total number of repetitions of the reduced repetition block candidates according to the minimum layer depth and the maximum layer depth. It can be set to an integer value within a range up to one value. At this time, the number of repetitions starts from the minimum value and gradually increases until the required performance is obtained, so that the size of the neural network can be increased as necessary. The total number of repetitions can be expressed as [Equation 3].

[수학식 3] [Equation 3]

1 ≤ repetition ≤

Figure pat00001
Figure pat00002
1 ≤ repetition ≤
Figure pat00001
Figure pat00002

또한, 총 경우의 수(TC_RRBLK)는 하나의 축소 반복 블록 후보에서 시도될 수 있는 총 경우의 수를 의미하는 값으로, 레이어 최대 깊이로 가능한 모든 경우의 수가 C개라고 한다면 총 경우의 수는 C * C(+1/2 개로 한정될 수 있다. 이와 같은 총 경우의 수는 [수학식 4]와 같이 나타낼 수 있다.In addition, the total number of cases (TC_RRBLK) is a value that means the total number of cases that can be tried in one reduced repetition block candidate. If the number of all possible cases with the maximum depth of the layer is C, the total number of cases is C. * It can be limited to C(+1/2). The total number of cases like this can be expressed as [Equation 4].

[수학식 4][Equation 4]

tc_RRblk = C * (C+1)/2 (C가 취할 수 있는 최대 값은 log2max_Rd)tc_RRblk = C * (C+1)/2 (maximum value that C can take is log 2 max_Rd)

특히, 커널 사이즈와 총 반복 횟수는 중요한 역할에 해당할 수 있다.In particular, the kernel size and the total number of iterations can play an important role.

이 때, 축소 반복 블록은 1X1 커널 사이즈를 갖는 레이어와 3X3 커널 사이즈를 갖는 레이어로 구성되되, 상기 1X1 커널 레이어의 출력값을 스킵 커넥션(SKIP CONNECTION)으로 사용할 수 있다.At this time, the reduced repetition block is composed of a layer having a 1X1 kernel size and a layer having a 3X3 kernel size, and the output value of the 1X1 kernel layer can be used as a skip connection.

이 때, 축소 반복 블록은 종방향 및 횡방향에 상응하게 CDC에 축적될 수 있다. At this time, the reduced repeat block may be accumulated in the CDC corresponding to the longitudinal and transverse directions.

이 때, 축소 반복 블록이 종방향으로 축적되는 경우에는 네트워크의 깊이가 깊어질 수 있고, 횡방향으로 축적되는 경우에는 네트워크의 너비가 넓어질 수 있다. At this time, when the reduced repeating block is accumulated in the longitudinal direction, the depth of the network may be deep, and when accumulated in the transverse direction, the width of the network may be widened.

예를 들어, 도 8을 참조하면, 횡방향 반복 블록(800)의 경우, 1x1 컨벌루션 레이어(810, 830)와 깊이 간 일대일 대응(Depth-Wise)으로 컨벌루션 계산을 수행하는 3x3 DW 컨벌루션 레이어(820, 840)가 반복되어 가로로 계속 늘어나는 형태에 상응할 수 있다. 이 때, 횡방향 반복 블록(800)은 마지막에 1x1 커널 사이즈로 입력 사이즈를 맞춰준 뒤 3x3 커널 사이즈로 디코더(decoder) 단으로 넘겨주거나 다음 번 블록이 시작되도록 할 수 있으며, 1x1 커널 사이즈의 skip connection을 기반으로 입력 크기를 맞추어 디코더 단의 입력으로 보낼 수도 있다. For example, referring to FIG. 8, in the case of the transverse repeat block 800, a 3x3 DW convolution layer 820 that performs convolution calculation with a 1-to-one correspondence (Depth-Wise) between 1x1 convolution layers 810 and 830 and depth , 840) may be repeated to correspond to a form that continues to extend horizontally. At this time, the lateral repeating block 800 may adjust the input size to the 1x1 kernel size at the end, and then pass it to the decoder stage with the 3x3 kernel size or start the next block, and skip the 1x1 kernel size. It is also possible to adjust the input size based on the connection and send it to the input of the decoder stage.

즉, 앞의 1x1 컨벌루션 레이어(810)와 3x3 DW 컨벌루션 레이어(820)는 reduction-expansion이 반복되는 구간에 상응할 수 있고, 뒤의 1x1 컨벌루션 레이어(830)는 skip connection에 상응하는 것으로 다음 블록 또는 디코더 단으로 정보를 보내주는 역할을 할 수 있다. That is, the previous 1x1 convolutional layer 810 and the 3x3 DW convolutional layer 820 may correspond to a section in which reduction-expansion is repeated, and the subsequent 1x1 convolutional layer 830 corresponds to a skip connection. It can serve to send information to the decoder stage.

이 때, 3x3 DW 컨벌루션 레이어(820, 840)는 레이어와 가중치의 각 채널들이 깊이 1의 일대일 대응으로 컨벌루션 계산을 수행할 수 있다.At this time, the 3x3 DW convolutional layers 820 and 840 may perform convolutional calculation in a one-to-one correspondence of depth 1 of each channel of the layer and the weight.

이 때, 횡방향 반복 블록(800) 밖에 위치하는 1x1 컨벌루션 레이어는 3x3 DW 컨벌루션 레이어(840)의 커널 사이즈 조정을 위해서 적용될 수도 있다. 또한, 디코더 부분이 존재하는 경우 마지막 3x3 컨벌루션 레이어가 존재하는 것이 보다 효과적인 구조에 해당할 수 있다. 반면에, 디코더 부분이 없을 경우에는 3x3 컨벌루션 레이어가 아닌 3x3 DW 컨벌루션 레이어를 수행하는 것이 보다 효과적일 수 있다.At this time, the 1x1 convolutional layer located outside the lateral repeating block 800 may be applied to adjust the kernel size of the 3x3 DW convolutional layer 840. In addition, when the decoder portion is present, it may be a more effective structure to have the last 3x3 convolution layer. On the other hand, if there is no decoder part, it may be more effective to perform a 3x3 DW convolutional layer rather than a 3x3 convolutional layer.

다른 예를 들어, 도 9를 참조하면, 종방향 반복 블록(900)은 도 10에 도시된 것과 같은 형태로 네트워크의 깊이가 더 깊어지도록 할 수 있다. For another example, referring to FIG. 9, the longitudinal repeating block 900 may make the network deeper in the form as shown in FIG. 10.

이 때, 축소 반복 블록에서 출력된 값은 다음 레이어 및 디코더 중 어느 하나로 입력될 수 있다.At this time, the value output from the reduced repetition block may be input to one of the next layer and decoder.

이와 같이 본 발명의 일실시예에 따른 축소 반복 블록은 종방향이나 횡방향에 특정한 제한을 두지 않고 축적이 가능하므로 보다 다양한 구조의 네트워크를 경량화하는데 사용될 수 있다. As described above, the reduced repetition block according to an embodiment of the present invention can be used to lighten a network having various structures because it is possible to accumulate without specific restrictions in the longitudinal or transverse directions.

또한, 본 발명의 일실시예에 따른 뉴럴 네트워크 경량화 방법은 기설정된 축소 레이어를 기반으로 CDC에 축적된 데이터에 상응하게 생성된 특징 맵(FEATURE MAP)으로 축소하여 뉴럴 네트워크를 경량화한다(S320).In addition, in the method of reducing the neural network according to an embodiment of the present invention, the neural network is lightweighted by reducing it to a feature map (FEATURE MAP) generated corresponding to data accumulated in the CDC based on a preset reduction layer (S320).

이 때, 기설정된 축소 레이어는 1X1 커널 사이즈를 갖는 레이어에 상응할 수 있다.At this time, the preset reduction layer may correspond to a layer having a 1X1 kernel size.

예를 들어, 도 14를 참조하면, CDC(1410)에서는 축적된 데이터에 상응하는 특징 맵을 생성할 수 있는데, 이렇게 생성된 특징 맵은 1X1 커널 사이즈를 갖는 축소 레이어(1420)를 통해 축소되어 디코더(Decoder) 네트워크로 전달될 수 있다. For example, referring to FIG. 14, the CDC 1410 may generate a feature map corresponding to the accumulated data, and the generated feature map is reduced through a reduction layer 1420 having a 1X1 kernel size and a decoder. (Decoder) can be delivered to the network.

이 때, 기설정된 축소 레이어는 특징 맵에 상응하게 축적된 복수개의 채널들을 축소된 채널의 개수만큼 축소시킬 수 있다.At this time, the preset reduction layer may reduce a plurality of channels accumulated corresponding to the feature map by the number of reduced channels.

예를 들어, 도 5를 참조하면, 축소 레이어에서는 CDC에 축적된 복수개의 채널들을 축소된 채널의 개수(rcn)에 해당하는 하이퍼 파라미터에 상응하는 채널로 축소함으로써 뉴럴 네트워크를 rcn에 해당하는 정도로 경량화시킬 수 있다.For example, referring to FIG. 5, in the reduction layer, a plurality of channels accumulated in the CDC is reduced to a channel corresponding to a hyper parameter corresponding to the number of the reduced channels (rcn), thereby reducing the neural network to a degree equivalent to rcn. I can do it.

이 때, 경량화 이전의 뉴럴 네트워크와 경량화된 뉴럴 네트워크의 모델 크기 차이는 기설정된 범위 이내에 상응할 수 있다.At this time, the difference in model size between the pre-lightweight neural network and the light-weighted neural network may correspond within a predetermined range.

예를 들어, 도 11 내지 도 12를 참조하면, 2D 영상으로부터 거리를 측정하는 depth estimation 알고리즘을 본 발명의 일실시예에 따른 뉴럴 네트워크 경량화 방법으로 리모델링한 실시예를 보여준다. 이 때, 도 11에 도시된 네트워크는 기존의 알고리즘에 해당하고, 도 12에 도시된 네트워크는 본 발명의 일실시예에 따른 축소 반복 블록에 기반한 뉴럴 네트워크의 경량화를 수행한 알고리즘에 해당할 수 있다. For example, referring to FIGS. 11 to 12, an embodiment in which a depth estimation algorithm for measuring a distance from a 2D image is remodeled using a neural network weight reduction method according to an embodiment of the present invention is shown. At this time, the network illustrated in FIG. 11 corresponds to an existing algorithm, and the network illustrated in FIG. 12 may correspond to an algorithm that performs weight reduction of a neural network based on a reduced iteration block according to an embodiment of the present invention. .

도 11에서 본 발명에 따른 기설정된 분류 조건을 적용해 보면, 첫 번째 컨벌루션 레이어(Conv1)는 바로 뒤에 풀링 레이어(Pool1)를 만나기 때문에 블록으로 묶기에는 너무 작아 블록 구간으로 설정되지 않았다. 마찬가지로 두 번째 컨벌루션 레이어(Conv2)도 첫 번째 컨벌루션 레이어(Conv1)와 같은 이유로 블록 구간으로 설정되지 않을 수 있다.In FIG. 11, when the preset classification condition according to the present invention is applied, the first convolution layer Conv1 meets the pooling layer Pool1 immediately after, so it is not set to a block section because it is too small to be bundled into blocks. Similarly, the second convolution layer Conv2 may not be set as a block section for the same reason as the first convolution layer Conv1.

그러나, 세 번째 컨벌루션 레이어(Conv3), 네 번째 컨벌루션 레이어(Conv4), 다섯 번째 컨벌루션 레이어(Conv5)는 각각 두 개의 연속된 레이어들이 존재하기 때문에 각각 블록 구간(1110, 1120, 1130)으로 설정될 수 있다. However, the third convolutional layer (Conv3), the fourth convolutional layer (Conv4), and the fifth convolutional layer (Conv5) may be set to block sections 1110, 1120, and 1130, respectively, because there are two consecutive layers. have.

따라서, 블록 구간(1110, 1120, 1130)에서는 성능평가에 의한 축소 반복 블록을 선정하여 도 12에 도시된 것과 같이 축소 반복 블록(1210, 1220, 1230)을 적용한 형태로 뉴럴 네트워크를 경량화할 수 있다. Accordingly, in the block sections 1110, 1120, and 1130, a reduced repetition block by performance evaluation is selected, and the neural network can be reduced in weight by applying the reduced repetition blocks 1210, 1220, and 1230 as shown in FIG. .

이 때, 도 11과 도 12를 참조하면, 축소 반복 블록을 이용하여 뉴럴 네트워크를 경량화하면 모델 정보가 풍부해지고 성능이 향상되는 반면에 모델 크기가 거의 변경되지 않는 것을 알 수 있다.At this time, referring to FIGS. 11 and 12, it can be seen that when the neural network is lightened using a reduced iteration block, model information is enriched and performance is improved, while the model size is hardly changed.

또한, 도 15 내지 도 16을 참조하면, 경량화되기 이전의 뉴럴 네트워크 구조와 본 발명의 일실시예에 따라 경량화된 뉴럴 네트워크의 구조를 비교해볼 수 있다. In addition, referring to FIGS. 15 to 16, it is possible to compare the structure of a neural network before being reduced in weight with the structure of a lightweight network according to an embodiment of the present invention.

먼저, 도 15를 참조하면, 경량화되기 이전의 뉴럴 네트워크는 복수개의 컨벌루션 레이어들이 반복되어 배열된 형태로 구조화되어 있는 것을 볼 수 있다. 이러한 뉴럴 네트워크를 본 발명의 일실시예에 따른 뉴럴 네트워크 경량화 장치로 입력하는 경우, 도 16에 도시된 것과 같은 구조로 경량화될 수 있다. First, referring to FIG. 15, it can be seen that the neural network before lightening is structured in a plurality of convolutional layers repeatedly arranged. When the neural network is input to the neural network light weighting apparatus according to an embodiment of the present invention, it can be lightened with a structure as shown in FIG. 16.

즉, 도 15에서 복수개의 컨벌루션 레이어들이 반복되던 구간에 반복 블록을 기반으로 한 반복 블록 구간(1610, 1620, 1630)을 생성하고, 반복 블록 구간(1610, 1620, 1630)의 출력값을 CDC에 축적하여 축소시킴으로써 전체 네트워크 구조가 도 15에 도시된 네트워크보다 간소화된 것을 확인할 수 있다. That is, in FIG. 15, a repetition block section 1610, 1620, 1630 based on a repetition block is generated in a section in which a plurality of convolution layers are repeated, and the output values of the repetition block sections 1610, 1620, 1630 are accumulated in the CDC. By reducing it, it can be seen that the overall network structure is simplified than the network shown in FIG. 15.

이와 같이 네트워크 구조가 간소화됨에 따라 네트워크 연산량이 줄어듬과 동시에 네트워크 성능은 유지할 수 있으므로 보다 효과적인 네트워크 설계를 수행할 수 있다. As the network structure is simplified as described above, since the amount of network computation is reduced and network performance can be maintained, more efficient network design can be performed.

또한, 도 3에는 도시하지 아니하였으나, 본 발명의 일실시예에 따른 뉴럴 네트워크 경량화 방법은 뉴럴 네트워크가 블록 단위로 구성되지 않은 기개발된 뉴럴 네트워크일 경우, 기설정된 분류 조건을 기반으로 기개발된 뉴럴 네트워크를 블록 단위로 분류할 수 있다.In addition, although not shown in FIG. 3, in the method of reducing the neural network according to an embodiment of the present invention, when the neural network is a pre-developed neural network that is not configured in block units, it is previously developed based on preset classification conditions. Neural networks can be classified in blocks.

즉, 경량화를 위해 입력되는 기개발된 뉴럴 네트워크는 설계자의 목적에 의해 충분히 크고 복잡하게 설계된 상태이므로, 이와 같은 뉴럴 네트워크를 경량화하기 위해서는 먼저 축소(REDUCTION)와 복구(RECONSTRUCTION)을 수행하는 블록이라고 할 수 있는 축소 반복 블록을 적용하기 위한 블록 구간을 분류할 수 있다. That is, since the previously developed neural network inputted for weight reduction is sufficiently large and complicatedly designed for the purpose of the designer, in order to reduce the weight of such a neural network, it is said to be a block that first performs REDUCTION and RECONSTRUCTION. It is possible to classify a block section for applying a reduced repeatable block.

이 때, 기설정된 분류 조건은 연속된 복수개의 컨벌루션 레이어(CONVOLUTION LAYER)들을 서브 샘플링 레이어(SUB-SAMPLING LATER) 기준으로 분류하는 제1 분류 조건, 연속된 복수개의 컨벌루션 레이어들을 스킵 커넥션(SKIP CONNECTION)을 갖는 레이어 기준으로 분류하는 제2 분류 조건, 서브 샘플링 레이어를 포함하지 않는 연속된 복수개의 컨벌루션 레이어들을 기설정된 연속 횟수 기준으로 분류하는 제3 분류 조건, 레이어들 간의 깊이 있는 연결 구간(DEPTH CONCATENATION)을 하나의 블록 구간으로 분류하는 제4 분류 조건 및 연속된 복수개의 컨벌루션 레이어들과 다른 성격을 갖는 레이어를 기준으로 분류하는 제5 분류 조건 중 적어도 하나를 포함할 수 있다.At this time, the preset classification condition is a first classification condition that classifies a plurality of convolutional layers (CONVOLUTION LAYER) based on a sub-sampling layer (SUB-SAMPLING LATER), and skips connections of a plurality of consecutive convolutional layers (SKIP CONNECTION) A second classification condition to classify on the basis of a layer having a, a third classification condition to classify a plurality of consecutive convolutional layers that do not include a sub-sampling layer based on a predetermined number of consecutive times, and a deep connection section between layers (DEPTH CONCATENATION) It may include at least one of a fourth classification condition to classify a single block period and a fifth classification condition to classify a plurality of consecutive convolutional layers based on a layer having a different characteristic.

예를 들어, 도 4에 도시된 것처럼 연속되는 컨벌루션 레이어(convolution layer)들이 존재하고, 이들 사이에 풀링 레이어와 같은 서브 샘플링 레이어(sub-sampling layer)가 있다고 가정할 수 있다. 이러한 경우에는 제1 분류 조건에 따라 서브 샘플링 레이어를 기준으로 블록 구간(410, 420)을 분류할 수 있다.For example, it can be assumed that there are consecutive convolutional layers as shown in FIG. 4, and there is a sub-sampling layer such as a pooling layer between them. In this case, the block periods 410 and 420 may be classified based on the sub-sampling layer according to the first classification condition.

이 때, 서브 샘플링 레이어는 max pooling layer, average pooling layer 등을 포함할 수 있다.At this time, the sub-sampling layer may include a max pooling layer, an average pooling layer, and the like.

하지만, 도 4에 도시된 CONV2와 같이 컨벌루션 레이어가 연속되지 않은 하나의 레이어(single layer)일 경우에는 블록 구간으로 분류하지 않을 수 있다.However, if the convolutional layer is a single layer that is not continuous, such as CONV2 shown in FIG. 4, it may not be classified as a block section.

다른 예를 들어, 도 5를 참조하면, residual skip connection을 가지는 조밀한 컨벌루션 레이어들(510, 520)이 존재하는 경우, 제2 분류 조건에 따라 스킵 커넥션을 갖는 레이어를 경계로 스킵 커넥션을 포함한 그 앞의 레이어들을 하나의 블록 구간으로 분류할 수 있다. 이 때, 도 5에 도시된 주요 매개 변수는 감소 매개 변수 rr, 확장 매개 변수 re 및 반복 매개 변수 r에 상응할 수 있으며, 이들을 통해 깊고 풍부한 구조의 다양한 인코더/디코더 모델을 생성할 수 있다. 이 때, 반복에 의한 각 출력은 도 5에 도시된 것처럼 CDCs에 쌓이거나 또는 디코더로 보내기 위해 1x1 컨벌루션 레이어(530)로 보내질 수 있다. 이 때, CDCs는 인코딩을 통해 추출된 여러 feature들의 묶음에 해당할 수 있다. For another example, referring to FIG. 5, when dense convolutional layers 510 and 520 having residual skip connections exist, a layer having a skip connection according to the second classification condition, including a skip connection as a boundary, The previous layers can be classified into one block section. At this time, the main parameters shown in FIG. 5 may correspond to the reduction parameter rr, the extension parameter re, and the iteration parameter r, through which various encoder/decoder models having a deep and rich structure can be generated. At this time, each output by repetition may be accumulated in CDCs as shown in FIG. 5 or sent to a 1x1 convolutional layer 530 for transmission to a decoder. At this time, CDCs may correspond to a bundle of various features extracted through encoding.

또 다른 예를 들면, 연속된 컨벌루션 레이어들의 층의 개수가 많고, 서브 샘플링 레이어만을 기준으로 블록 구간을 분류하기 어려운 경우에는 제3 분류 조건에 따라 기설정된 연속 횟수를 기준으로 연속된 컨벌루션 레이어들을 나누어 블록 구간으로 분류할 수 있다. For another example, when the number of consecutive convolutional layers is large and it is difficult to classify a block section based on only the sub-sampling layer, the consecutive convolutional layers are divided based on a preset number of consecutive times according to the third classification condition. It can be classified as a block section.

이 때, 네트워크 아키텍처 층의 깊이 설계에 따라 다르지만, pervasive한 성격의 output depth를 우선적으로 분류할 수 있다.At this time, although it depends on the depth design of the network architecture layer, it is possible to preferentially classify the output depth of the pervasive nature.

만약, Object recognition 모델인 YOLO v2의 compute intensive 구간을 예로 설명하면, output depth 기준으로 512-1024-512-1024-512-1024-1024-1024-64-1024에 상응하는 구조에서 pervasive depth를 512, 1024로 잡고 블록 구간을 분류할 수 있다. 이 때, 블록 구간은 각각 (512-1024-512-1024-512) 및 (1024-1024-1024-64-1024)에 상응하게 분류될 수 있다. If the compute intensive section of YOLO v2, which is an object recognition model, is described as an example, pervasive depth is 512, in a structure corresponding to 512-1024-512-1024-512-1024-1024-1024-64-1024 based on output depth. It is possible to classify the block section by holding 1024. At this time, the block period may be classified according to (512-1024-512-1024-512) and (1024-1024-1024-64-1024), respectively.

또 다른 예를 들면, 도 6에 도시된 것처럼 N개의 컨벌루션 레이어들(610, 620, 630, 640)이 깊이 있게 연결(DEPTH CONCATENATION) 구간이 존재하면 제4 분류 조건에 따라 해당 구간에 포함된 컨벌루션 레이어들을 하나의 블록 구간으로 분류할 수 있다.For another example, as shown in FIG. 6, if there are deeply connected (DEPTH CONCATENATION) sections of N convolutional layers 610, 620, 630, and 640, convolution included in the section according to the fourth classification condition Layers may be classified into one block section.

또 다른 예를 들면, 연속되는 컨벌루션 레이어들과 달리 다른 성격을 가미하는 레이어가 존재하는 경우, 제5 분류 조건에 따라 해당 레이어를 기준으로 블록 구간을 분류할 수 있다.For another example, if there are layers having different characteristics, unlike the continuous convolutional layers, the block section may be classified based on the corresponding layer according to the fifth classification condition.

또한, 도 3에는 도시하지 아니하였으나, 본 발명의 일실시예에 따른 뉴럴 네트워크 경량화 방법은 상술한 바와 같이 본 발명의 일실시예에 따른 뉴럴 네트워크 경량화 과정에서 발생되는 다양한 정보를 별도의 저장 모듈에 저장할 수 있다.In addition, although not shown in FIG. 3, the method of reducing the neural network according to an embodiment of the present invention is described above, in a separate storage module, various information generated in the process of reducing the neural network according to an embodiment of the present invention. Can be saved.

이와 같은 본 발명의 일실시예에 따른 뉴럴 네트워크 경량화 방법을 통해 뉴럴 네트워크의 설계 탐색 범위를 감소시켜 적은 연산만으로도 계산이 빠르고, 전력 소모가 적은 구조의 뉴럴 네트워크를 설계할 수 있다.The neural network weighting method according to an embodiment of the present invention can reduce the design search range of the neural network, thereby designing a neural network having a fast calculation and a low power consumption with only a small amount of computation.

또한, 기존에 발표된 뉴럴 네트워크를 저전력, 경량화, 고속화시킬 수 있도록 리모델링할 수 있으며, 축소 반복 블록을 기반으로 적절한 깊이 수준의 뉴럴 네트워크를 설계하여 계산량의 과도한 팽창을 방지할 수도 있다.In addition, the previously announced neural network can be remodeled for low power, light weight, and high speed, and it is also possible to design an appropriate depth level neural network based on a reduced iteration block to prevent excessive expansion of computational power.

또한, 본 발명의 일실시예에 따른 뉴럴 네트워크 경량화 방법은 CNN을 기반으로 하는 딥러닝의 구조 설계에 범용적으로 적용될 수 있는 것으로 AI, 특히 영상을 포함하는 딥러닝의 전반에 걸친 분야에 적용 가능할 수 있다.In addition, the neural network weight reduction method according to an embodiment of the present invention can be applied universally to the structure design of deep learning based on CNN, and may be applicable to fields across AI, especially deep learning including video. Can be.

도 13은 본 발명의 일실시예에 따른 뉴럴 네트워크 경량화 장치를 나타낸 블록도이다.13 is a block diagram showing a neural network light weighting apparatus according to an embodiment of the present invention.

도 13을 참조하면, 본 발명의 일실시예에 따른 뉴럴 네트워크 경량화 장치는 CDC(1310), 축소 레이어(1320) 및 프로세서(1330)를 포함한다.Referring to FIG. 13, a neural network weighting apparatus according to an embodiment of the present invention includes a CDC 1310, a reduction layer 1320, and a processor 1330.

프로세서(1330)는 뉴럴 네트워크(NEURAL NETWORK)를 구성하는 레이어 및 축소 반복 블록 중 적어도 하나에 대한 출력값을 CDC(CONDENSED DECODING CONNECTION)(1310)에 축적한다The processor 1330 accumulates the output values of at least one of the layers and the reduced repetition blocks constituting the NEURAL NETWORK in the CDD (CONDENSED DECODING CONNECTION) 1310.

이 때, CDC(1310)는 뉴럴 네트워크(NEURAL NETWORK)를 구성하는 레이어 및 축소 반복 블록 중 적어도 하나에 대한 출력값을 축적할 수 있다.At this time, the CDC 1310 may accumulate output values for at least one of a layer and a reduced repetition block constituting a NEURAL NETWORK.

예를 들어, 축소 반복 블록의 경우, 도 14에 도시된 것처럼 1x1 convolution으로 축소된 output들을 CDC(1410)에 축적할 수 있다. 이와 같이 CDC(1410)에 output이 축적되어 만들어진 긴 채널들은 하이퍼 파라미터에 상응하는 축소된 레이어 개수(rcn)로 축소될 수 있는데, 단계(S320)을 통해 설명하도록 한다.For example, in the case of a reduced repeating block, outputs reduced to 1×1 convolution may be accumulated in the CDC 1410 as illustrated in FIG. 14. As described above, long channels created by accumulating output in the CDC 1410 may be reduced to a reduced number of layers rcn corresponding to hyper parameters, which will be described through step S320.

이 때, CDC에 축적되는 output은 도 14와 같은 축소 반복 블록(1400)의 출력값 이외에도 뉴럴 네트워크를 구성하는 적어도 하나의 레이어에 의한 output을 포함할 수도 있다.At this time, the output accumulated in the CDC may include output by at least one layer constituting the neural network in addition to the output value of the reduced repetition block 1400 shown in FIG. 14.

즉, 많은 정보를 CDC에 쌓아 이를 축소시킴으로써 성능은 유지하면서도 계산량이 적은 가벼운 네트워크 구조를 갖도록 할 수 있다.That is, by storing a lot of information in the CDC and reducing it, it is possible to have a light network structure with little computational complexity while maintaining performance.

이 때, 축소 반복 블록은 뉴럴 네트워크의 전체 구조 중 기설정된 분류 조건에 따라 블록 단위로 분류된 복수개의 블록 구간들이 각각 최적의 성능을 낼 수 있도록 레이어 축소와 레이어 팽창을 반복적으로 수행하는 구간에 상응할 수 있다.At this time, the reduced repetition block corresponds to a section in which layer reduction and layer expansion are repeatedly performed so that a plurality of block sections classified in block units according to predetermined classification conditions among the entire structure of the neural network can each achieve optimal performance. can do.

예를 들어, 블록 단위로 구성된 뉴럴 네트워크에 대해서, 블록 단위로 분류된 복수개의 블록 구간들마다 최적의 성능을 갖는 축소 레이어를 계층별로 축적함으로써 축소 반복 블록을 생성할 수 있다.For example, for a neural network composed of block units, a reduced repetitive block may be generated by accumulating a reduced layer having optimal performance for each of a plurality of block sections classified in block units for each layer.

또한, 프로세서(1330)는 복수개의 블록 구간들마다 하이퍼 파라미터의 설정에 기반한 축소 반복 블록 후보군을 생성할 수 있고, 반복적인 성능평가를 기반으로 축소 반복 블록 후보군 중 최적의 성능을 갖는 어느 하나의 축소 반복 블록 후보를 축소 반복 블록으로 선정할 수 있다.In addition, the processor 1330 may generate a reduced repetition block candidate group based on the setting of a hyper parameter for each of a plurality of block sections, and reduce any one of the reduced repetition block candidate groups having optimal performance based on repetitive performance evaluation. A repeating block candidate can be selected as a reduced repeating block.

이 때, 성능평가는 1X1 커널 사이즈에 상응하게 레이어 축소를 수행하고, 3X3 커널 사이즈에 상응하게 레이어 팽창을 수행하여 수행될 수 있다.In this case, the performance evaluation may be performed by performing layer reduction corresponding to the 1X1 kernel size and performing layer expansion corresponding to the 3X3 kernel size.

예를 들어, 도 7과 같이 본 발명의 일실시예에 따른 성능평가 모듈(700)로 적어도 하나의 축소 반복 블록 후보를 순차적으로 입력하여 축소 반복 블록을 선정할 수 있다. 즉, 1번째 축소 반복 블록 후보군(710)이 입력되는 경우, 축소 반복 블록 디자인 스키마에 따라 레이어 깊이의 축소 혹은 복원을 위한 팽창을 반복하면서 성능평가를 수행할 수 있다. 이 후, 1번째 축소 반복 블록 후보군(710)에서 성능이 최적화된 1번째 축소 반복 블록을 선정할 수 있다. 이와 같은 과정을 적어도 하나의 축소 반복 블록 후보군마다 수행함으로써 뉴럴 네트워크를 구성할 적어도 하나의 축소 반복 블록을 선정할 수 있다.For example, as shown in FIG. 7, at least one reduced iteration block candidate may be sequentially input to the performance evaluation module 700 according to an embodiment of the present invention to select a reduced iteration block. That is, when the first reduced repetition block candidate group 710 is input, performance evaluation may be performed while repeating expansion for reduction or restoration of layer depth according to a reduction repetition block design scheme. Thereafter, the first reduced iteration block with optimized performance may be selected from the first reduced iteration block candidate group 710. By performing this process for each candidate group of at least one reduced repetition block, at least one reduced repetition block constituting the neural network can be selected.

이와 같은 반복적 성능평가는, 하이퍼 파라미터를 기반으로 레이어 깊이의 축소와 복원을 위한 팽창을 반복적으로 수행하면서 해당 블록의 성능을 평가하는 과정에 해당할 수 있다. 이러한 과정을 통해 최적의 성능을 갖는 축소 반복 블록 디자인을 찾아낼 수 있다.The iterative performance evaluation may correspond to a process of evaluating the performance of the corresponding block while repeatedly performing the reduction and reduction of the layer depth based on the hyper parameter. Through this process, it is possible to find a miniaturized iterative block design with optimal performance.

즉, 본 발명에 따르면 축소 반복 블록 후보군에 포함되는 각각의 축소 반복 블록 후보의 하이퍼 파라미터들이 이전 레이어 혹은 이전 축소 반복 블록 후보의 파라미터 값을 고려하여 제한적으로 결정되기 때문에 축소 반복 블록을 디자인하기 위한 경우의 수가 강력하게 제한될 수 있다. 따라서 축소 반복 블록 후보군마다 최적의 디자인을 탐색하는 시간이 절약될 수 있다.That is, according to the present invention, when designing a reduced repetition block because hyperparameters of each reduced repetition block candidate included in the reduced repetition block candidate group are limitedly determined by considering parameter values of a previous layer or a previous reduced repetition block candidate The number of can be strongly limited. Therefore, time to search for an optimal design for each reduced iteration block candidate group can be saved.

이 때, 축소 반복 블록 후보군은 하이퍼 파라미터의 값이 서로 상이한 복수개의 축소 반복 블록 후보들을 포함할 수 있다. At this time, the reduced repetition block candidate group may include a plurality of reduced repetition block candidates having different hyperparameter values.

이 때, 복수개의 축소 반복 블록 후보들은 하이퍼 파라미터들에 의해 한정된 범위 내에서 생성될 수 있다.At this time, a plurality of reduced repetition block candidates may be generated within a range defined by hyper parameters.

이 때, 하이퍼 파라미터는 커널 사이즈, 최대 레이어 개수, 레이어 최소 깊이, 레이어 최대 깊이, 총 반복 횟수, 총 경우의 수, 축소된 레이어의 개수 및 축소된 채널의 개수 중 적어도 하나를 포함할 수 있다.At this time, the hyper parameter may include at least one of a kernel size, a maximum number of layers, a minimum layer depth, a maximum layer depth, a total number of iterations, a total number of cases, a reduced number of layers, and a reduced number of channels.

예를 들어, 커널 사이즈(KERNEL SIZE)는 인셉션(INCEPTION) 모듈에서 선택한 커널 중 가장 효과적이라고 알려진 1과 3으로 주로 선택될 수 있다. For example, the kernel size (KERNEL SIZE) may be mainly selected as 1 and 3, which are known to be the most effective kernels selected in the INCEPTION module.

또한, 최대 레이어 개수(MAX_RRBLK)는 폭(STRIDE)이 1을 초과하는 컨벌루션 레이어의 총 개수와 컨벌루션 효과와 상이한 특이 레이어들의 총 개수를 합한 것에 상응할 수 있다.Also, the maximum number of layers (MAX_RRBLK) may correspond to a sum of the total number of convolutional layers having a width (STRIDE) greater than 1 and the total number of distinctive layers different from the convolutional effect.

또한, 레이어 최소 깊이(MIN_RD)는 블록의 최소 층 깊이 개수를 의미하는 값으로, 만약 첫 번째 축소 반복 블록 후보일 경우에는 이전의 레이어들이 쌓은 층의 깊이 중 가장 작은 값으로 최소 깊이를 정할 수 있다. 또한, 첫 번째 축소 반복 블록 후보가 아닐 경우에는 이전의 축소 반복 블록 후보의 깊이 값들 중 가장 작은 깊이 값에 2를 곱한 값으로 레이어 최소 깊이를 정할 수 있다. 이와 같은 레이어 최소 깊이는 [수학식 1]과 같이 나타낼 수 있다.In addition, the minimum layer depth (MIN_RD) is a value indicating the minimum number of layer depths of a block. If the candidate is the first reduced repetition block, the minimum depth may be determined as the smallest value among the layers stacked by the previous layers. . In addition, if it is not the first reduced repeating block candidate, the minimum depth of the layer may be determined by multiplying the smallest depth value among the depth values of the previous reduced repeating block candidate. The minimum depth of the layer may be expressed as [Equation 1].

[수학식 1][Equation 1]

min_Rd = min_depthprev_complex * 2 (이전 축소 반복 블록 후보가 있는 경우)min_Rd = min_depth prev_complex * 2 (if there is a previous reduced repeat block candidate)

min_Rd = min_depthprev_all_layers (첫 번째 축소 반복 블록 후보일 경우)min_Rd = min_depth prev_all_layers (for the first reduced iteration block candidate)

min_Rdnext = min_Rdprev * 2min_Rd next = min_Rd prev * 2

min_Rd < max_Rdmin_Rd <max_Rd

또한, 레이어 최대 깊이(MAX_RD)는 블록의 최대 층 깊이 개수를 의미하는 값으로, 복수개의 축소 반복 블록 후보들의 각 레이어들 중 가장 큰 특징(feature) 깊이 값이 레이어 최대 깊이에 상응할 수 있다. 단, 레이어 최대 깊이는 레이어 최소 깊이에 2를 곱한 값보다 작아질 수는 없다. 이와 같은 레이어 최대 깊이는 [수학식 2]와 같이 나타낼 수 있다.In addition, the maximum layer depth MAX_RD is a value indicating the maximum number of layer depths of a block, and the largest feature depth value of each layer of a plurality of reduced repetition block candidates may correspond to the maximum layer depth. However, the maximum layer depth cannot be smaller than the minimum layer depth multiplied by 2. The maximum depth of the layer may be expressed as [Equation 2].

[수학식 2][Equation 2]

max_Rd = max_depthpacked_layers max_Rd = max_depth packed_layers

max_Rdnext = max_Rdprev/2max_Rd next = max_Rd prev /2

min_Rd * 2 ≤ max_Rd ≤ max_depthpacked_layers min_Rd * 2 ≤ max_Rd ≤ max_depth packed_layers

또한, 총 반복 횟수(REPETITION)는 레이어 최소 깊이와 레이어 최대 깊이에 따른 축소 반복 블록 후보의 총 반복 횟수를 의미하는 값으로, 최소 1에서 축소 반복 블록 후보들의 각 레이어들의 총 개수를 2로 나누고 올림한 값까지의 범위 내에서 정수 값으로 정할 수 있다. 이 때, 반복 횟수는 최소 값에서부터 시작해서 필요한 성능이 확보될 때까지 점진적으로 증가시켜서 뉴럴 네트워크의 규모를 필요한 만큼 늘려나갈 수 있다. 이와 같은 총 반복 횟수는 [수학식 3]과 같이 나타낼 수 있다.In addition, the total number of repetitions (REPETITION) is a value indicating the total number of repetitions of the reduced repetition block candidates according to the minimum layer depth and the maximum layer depth. It can be set to an integer value within a range up to one value. At this time, the number of repetitions starts from the minimum value and gradually increases until the required performance is obtained, so that the size of the neural network can be increased as necessary. The total number of repetitions can be expressed as [Equation 3].

[수학식 3][Equation 3]

1 ≤ repetition ≤

Figure pat00003
Figure pat00004
1 ≤ repetition ≤
Figure pat00003
Figure pat00004

또한, 총 경우의 수(TC_RRBLK)는 하나의 축소 반복 블록 후보에서 시도될 수 있는 총 경우의 수를 의미하는 값으로, 레이어 최대 깊이로 가능한 모든 경우의 수가 C개라고 한다면 총 경우의 수는 C * C(+1/2 개로 한정될 수 있다. 이와 같은 총 경우의 수는 [수학식 4]와 같이 나타낼 수 있다.In addition, the total number of cases (TC_RRBLK) is a value that means the total number of cases that can be tried in one reduced repetition block candidate. If the number of all possible cases with the maximum depth of the layer is C, the total number of cases is C. * It can be limited to C(+1/2). The total number of cases like this can be expressed as [Equation 4].

[수학식 4][Equation 4]

tc_RRblk = C * (C+1)/2 (C가 취할 수 있는 최대 값은 log2max_Rd)tc_RRblk = C * (C+1)/2 (maximum value that C can take is log 2 max_Rd)

특히, 커널 사이즈와 총 반복 횟수는 중요한 역할에 해당할 수 있다.In particular, the kernel size and the total number of iterations can play an important role.

이 때, 축소 반복 블록은 1X1 커널 사이즈를 갖는 레이어와 3X3 커널 사이즈를 갖는 레이어로 구성되되, 상기 1X1 커널 레이어의 출력값을 스킵 커넥션(SKIP CONNECTION)으로 사용할 수 있다.At this time, the reduced repetition block is composed of a layer having a 1X1 kernel size and a layer having a 3X3 kernel size, and the output value of the 1X1 kernel layer can be used as a skip connection.

이 때, 축소 반복 블록은 종방향 및 횡방향에 상응하게 CDC에 축적될 수 있다. At this time, the reduced repeat block may be accumulated in the CDC corresponding to the longitudinal and transverse directions.

이 때, 축소 반복 블록이 종방향으로 축적되는 경우에는 네트워크의 깊이가 깊어질 수 있고, 횡방향으로 축적되는 경우에는 네트워크의 너비가 넓어질 수 있다. At this time, when the reduced repeating block is accumulated in the longitudinal direction, the depth of the network may be deep, and when accumulated in the transverse direction, the width of the network may be widened.

예를 들어, 도 8을 참조하면, 횡방향 반복 블록(800)의 경우, 1x1 컨벌루션 레이어(810, 830)와 깊이 간 일대일 대응(Depth-Wise)으로 컨벌루션 계산을 수행하는 3x3 DW 컨벌루션 레이어(820, 840)가 반복되어 가로로 계속 늘어나는 형태에 상응할 수 있다. 이 때, 횡방향 반복 블록(800)은 마지막에 1x1 커널 사이즈로 입력 사이즈를 맞춰준 뒤 3x3 커널 사이즈로 디코더(decoder) 단으로 넘겨주거나 다음 번 블록이 시작되도록 할 수 있으며, 1x1 커널 사이즈의 skip connection을 기반으로 입력 크기를 맞추어 디코더 단의 입력으로 보낼 수도 있다. For example, referring to FIG. 8, in the case of the transverse repeat block 800, a 3x3 DW convolution layer 820 that performs convolution calculation with a 1-to-one correspondence (Depth-Wise) between 1x1 convolution layers 810 and 830 and depth , 840) may be repeated to correspond to a form that continues to extend horizontally. At this time, the lateral repeating block 800 may adjust the input size to the 1x1 kernel size at the end, and then pass it to the decoder stage with the 3x3 kernel size or start the next block, and skip the 1x1 kernel size. It is also possible to adjust the input size based on the connection and send it to the input of the decoder stage.

즉, 앞의 1x1 컨벌루션 레이어(810)와 3x3 DW 컨벌루션 레이어(820)는 reduction-expansion이 반복되는 구간에 상응할 수 있고, 뒤의 1x1 컨벌루션 레이어(830)는 skip connection에 상응하는 것으로 다음 블록 또는 디코더 단으로 정보를 보내주는 역할을 할 수 있다. That is, the previous 1x1 convolutional layer 810 and the 3x3 DW convolutional layer 820 may correspond to a section in which reduction-expansion is repeated, and the subsequent 1x1 convolutional layer 830 corresponds to a skip connection. It can serve to send information to the decoder stage.

이 때, 3x3 DW 컨벌루션 레이어(820, 840)는 레이어와 가중치의 각 채널들이 깊이 1의 일대일 대응으로 컨벌루션 계산을 수행할 수 있다.At this time, the 3x3 DW convolutional layers 820 and 840 may perform convolutional calculation in a one-to-one correspondence of depth 1 of each channel of the layer and the weight.

이 때, 횡방향 반복 블록(800) 밖에 위치하는 1x1 컨벌루션 레이어는 3x3 DW 컨벌루션 레이어(840)의 커널 사이즈 조정을 위해서 적용될 수도 있다. 또한, 디코더 부분이 존재하는 경우 마지막 3x3 컨벌루션 레이어가 존재하는 것이 보다 효과적인 구조에 해당할 수 있다. 반면에, 디코더 부분이 없을 경우에는 3x3 컨벌루션 레이어가 아닌 3x3 DW 컨벌루션 레이어를 수행하는 것이 보다 효과적일 수 있다.At this time, the 1x1 convolutional layer located outside the lateral repeating block 800 may be applied to adjust the kernel size of the 3x3 DW convolutional layer 840. In addition, when the decoder portion is present, it may be a more effective structure to have the last 3x3 convolution layer. On the other hand, if there is no decoder part, it may be more effective to perform a 3x3 DW convolutional layer rather than a 3x3 convolutional layer.

다른 예를 들어, 도 9를 참조하면, 종방향 반복 블록(900)은 도 10에 도시된 것과 같은 형태로 네트워크의 깊이가 더 깊어지도록 할 수 있다. For another example, referring to FIG. 9, the longitudinal repeating block 900 may make the network deeper in the form as shown in FIG. 10.

이 때, 축소 반복 블록에서 출력된 값은 다음 레이어 및 디코더 중 어느 하나로 입력될 수 있다.At this time, the value output from the reduced repetition block may be input to one of the next layer and decoder.

이와 같이 본 발명의 일실시예에 따른 축소 반복 블록은 종방향이나 횡방향에 특정한 제한을 두지 않고 축적이 가능하므로 보다 다양한 구조의 네트워크를 경량화하는데 사용될 수 있다. As described above, the reduced repetition block according to an embodiment of the present invention can be used to lighten a network having various structures because it is possible to accumulate without specific restrictions in the longitudinal or transverse directions.

또한, 프로세서(1330)는 기설정된 축소 레이어(1320)를 기반으로 CDC에 축적된 데이터에 상응하게 생성된 특징 맵(FEATURE MAP)으로 축소하여 뉴럴 네트워크를 경량화한다In addition, the processor 1330 reduces the neural network by reducing the feature map (FEATURE MAP) generated corresponding to the data accumulated in the CDC based on the preset reduction layer 1320.

이 때, 기설정된 축소 레이어(1320)는 1X1 커널 사이즈를 갖는 레이어에 상응할 수 있다.At this time, the preset reduction layer 1320 may correspond to a layer having a 1X1 kernel size.

예를 들어, 도 14를 참조하면, CDC(1410)에서는 축적된 데이터에 상응하는 특징 맵을 생성할 수 있는데, 이렇게 생성된 특징 맵은 1X1 커널 사이즈를 갖는 축소 레이어(1420)를 통해 축소되어 디코더(Decoder) 네트워크로 전달될 수 있다. For example, referring to FIG. 14, the CDC 1410 may generate a feature map corresponding to the accumulated data, and the generated feature map is reduced through a reduction layer 1420 having a 1X1 kernel size and a decoder. (Decoder) can be delivered to the network.

이 때, 기설정된 축소 레이어는 특징 맵에 상응하게 축적된 복수개의 채널들을 축소된 채널의 개수만큼 축소시킬 수 있다.At this time, the preset reduction layer may reduce a plurality of channels accumulated corresponding to the feature map by the number of reduced channels.

예를 들어, 도 5를 참조하면, 축소 레이어에서는 CDC에 축적된 복수개의 채널들을 축소된 채널의 개수(rcn)에 해당하는 하이퍼 파라미터에 상응하는 채널로 축소함으로써 뉴럴 네트워크를 rcn에 해당하는 정도로 경량화시킬 수 있다.For example, referring to FIG. 5, in the reduction layer, a plurality of channels accumulated in the CDC is reduced to a channel corresponding to a hyper parameter corresponding to the number of the reduced channels (rcn), thereby reducing the neural network to a degree equivalent to rcn. I can do it.

이 때, 경량화 이전의 뉴럴 네트워크와 경량화된 뉴럴 네트워크의 모델 크기 차이는 기설정된 범위 이내에 상응할 수 있다.At this time, the difference in model size between the pre-lightweight neural network and the light-weighted neural network may correspond within a predetermined range.

예를 들어, 도 11 내지 도 12를 참조하면, 2D 영상으로부터 거리를 측정하는 depth estimation 알고리즘을 본 발명의 일실시예에 따른 뉴럴 네트워크 경량화 방법으로 리모델링한 실시예를 보여준다. 이 때, 도 11에 도시된 네트워크는 기존의 알고리즘에 해당하고, 도 12에 도시된 네트워크는 본 발명의 일실시예에 따른 축소 반복 블록에 기반한 뉴럴 네트워크의 경량화를 수행한 알고리즘에 해당할 수 있다. For example, referring to FIGS. 11 to 12, an embodiment in which a depth estimation algorithm for measuring a distance from a 2D image is remodeled using a neural network weight reduction method according to an embodiment of the present invention is shown. At this time, the network illustrated in FIG. 11 corresponds to an existing algorithm, and the network illustrated in FIG. 12 may correspond to an algorithm that performs weight reduction of a neural network based on a reduced iteration block according to an embodiment of the present invention. .

도 11에서 본 발명에 따른 기설정된 분류 조건을 적용해 보면, 첫 번째 컨벌루션 레이어(Conv1)는 바로 뒤에 풀링 레이어(Pool1)를 만나기 때문에 블록으로 묶기에는 너무 작아 블록 구간으로 설정되지 않았다. 마찬가지로 두 번째 컨벌루션 레이어(Conv2)도 첫 번째 컨벌루션 레이어(Conv1)와 같은 이유로 블록 구간으로 설정되지 않을 수 있다.In FIG. 11, when the preset classification condition according to the present invention is applied, the first convolution layer Conv1 meets the pooling layer Pool1 immediately after, so it is not set to a block section because it is too small to be bundled into blocks. Similarly, the second convolution layer Conv2 may not be set as a block section for the same reason as the first convolution layer Conv1.

그러나, 세 번째 컨벌루션 레이어(Conv3), 네 번째 컨벌루션 레이어(Conv4), 다섯 번째 컨벌루션 레이어(Conv5)는 각각 두 개의 연속된 레이어들이 존재하기 때문에 각각 블록 구간(1110, 1120, 1130)으로 설정될 수 있다. However, the third convolutional layer (Conv3), the fourth convolutional layer (Conv4), and the fifth convolutional layer (Conv5) may be set to block sections 1110, 1120, and 1130, respectively, because there are two consecutive layers. have.

따라서, 블록 구간(1110, 1120, 1130)에서는 성능평가에 의한 축소 반복 블록을 선정하여 도 12에 도시된 것과 같이 축소 반복 블록(1210, 1220, 1230)을 적용한 형태로 뉴럴 네트워크를 경량화할 수 있다. Accordingly, in the block sections 1110, 1120, and 1130, a reduced repetition block by performance evaluation is selected, and the neural network can be reduced in weight by applying the reduced repetition blocks 1210, 1220, and 1230 as shown in FIG. .

이 때, 도 11과 도 12를 참조하면, 축소 반복 블록을 이용하여 뉴럴 네트워크를 경량화하면 모델 정보가 풍부해지고 성능이 향상되는 반면에 모델 크기가 거의 변경되지 않는 것을 알 수 있다.At this time, referring to FIGS. 11 and 12, it can be seen that when the neural network is lightened using a reduced iteration block, model information is enriched and performance is improved, while the model size is hardly changed.

또한, 도 15 내지 도 16을 참조하면, 경량화되기 이전의 뉴럴 네트워크 구조와 본 발명의 일실시예에 따라 경량화된 뉴럴 네트워크의 구조를 비교해볼 수 있다. In addition, referring to FIGS. 15 to 16, it is possible to compare the structure of a neural network before being reduced in weight with the structure of a lightweight network according to an embodiment of the present invention.

먼저, 도 15를 참조하면, 경량화되기 이전의 뉴럴 네트워크는 복수개의 컨벌루션 레이어들이 반복되어 배열된 형태로 구조화되어 있는 것을 볼 수 있다. 이러한 뉴럴 네트워크를 본 발명의 일실시예에 따른 뉴럴 네트워크 경량화 장치로 입력하는 경우, 도 16에 도시된 것과 같은 구조로 경량화될 수 있다. First, referring to FIG. 15, it can be seen that the neural network before lightening is structured in a plurality of convolutional layers repeatedly arranged. When the neural network is input to the neural network light weighting apparatus according to an embodiment of the present invention, it can be lightened with a structure as shown in FIG. 16.

즉, 도 15에서 복수개의 컨벌루션 레이어들이 반복되던 구간에 반복 블록을 기반으로 한 반복 블록 구간(1610, 1620, 1630)을 생성하고, 반복 블록 구간(1610, 1620, 1630)의 출력값을 CDC에 축적하여 축소시킴으로써 전체 네트워크 구조가 도 15에 도시된 네트워크보다 간소화된 것을 확인할 수 있다. That is, in FIG. 15, a repetition block section 1610, 1620, 1630 based on a repetition block is generated in a section in which a plurality of convolution layers are repeated, and the output values of the repetition block sections 1610, 1620, 1630 are accumulated in the CDC. By reducing it, it can be seen that the overall network structure is simplified than the network shown in FIG. 15.

이와 같이 네트워크 구조가 간소화됨에 따라 네트워크 연산량이 줄어듬과 동시에 네트워크 성능은 유지할 수 있으므로 보다 효과적인 네트워크 설계를 수행할 수 있다. As the network structure is simplified as described above, since the amount of network computation is reduced and network performance can be maintained, more efficient network design can be performed.

또한, 프로세서(1330)는 뉴럴 네트워크가 블록 단위로 구성되지 않은 기개발된 뉴럴 네트워크일 경우, 기설정된 분류 조건을 기반으로 기개발된 뉴럴 네트워크를 블록 단위로 분류할 수 있다.In addition, when the neural network is a pre-developed neural network in which the neural network is not configured in block units, the processor 1330 may classify the pre-developed neural network in block units based on preset classification conditions.

즉, 경량화를 위해 입력되는 기개발된 뉴럴 네트워크는 설계자의 목적에 의해 충분히 크고 복잡하게 설계된 상태이므로, 이와 같은 뉴럴 네트워크를 경량화하기 위해서는 먼저 축소(REDUCTION)와 복구(RECONSTRUCTION)을 수행하는 블록이라고 할 수 있는 축소 반복 블록을 적용하기 위한 블록 구간을 분류할 수 있다. That is, since the previously developed neural network inputted for weight reduction is sufficiently large and complicatedly designed for the purpose of the designer, in order to reduce the weight of such a neural network, it is said to be a block that first performs REDUCTION and RECONSTRUCTION. It is possible to classify a block section for applying a reduced repeatable block.

이 때, 기설정된 분류 조건은 연속된 복수개의 컨벌루션 레이어(CONVOLUTION LAYER)들을 서브 샘플링 레이어(SUB-SAMPLING LATER) 기준으로 분류하는 제1 분류 조건, 연속된 복수개의 컨벌루션 레이어들을 스킵 커넥션(SKIP CONNECTION)을 갖는 레이어 기준으로 분류하는 제2 분류 조건, 서브 샘플링 레이어를 포함하지 않는 연속된 복수개의 컨벌루션 레이어들을 기설정된 연속 횟수 기준으로 분류하는 제3 분류 조건, 레이어들 간의 깊이 있는 연결 구간(DEPTH CONCATENATION)을 하나의 블록 구간으로 분류하는 제4 분류 조건 및 연속된 복수개의 컨벌루션 레이어들과 다른 성격을 갖는 레이어를 기준으로 분류하는 제5 분류 조건 중 적어도 하나를 포함할 수 있다.At this time, the preset classification condition is a first classification condition that classifies a plurality of convolutional layers (CONVOLUTION LAYER) based on a sub-sampling layer (SUB-SAMPLING LATER), and skips connections of a plurality of consecutive convolutional layers (SKIP CONNECTION) A second classification condition to classify on the basis of a layer having a, a third classification condition to classify a plurality of consecutive convolutional layers that do not include a sub-sampling layer based on a predetermined number of consecutive times, and a deep connection section between layers (DEPTH CONCATENATION) It may include at least one of a fourth classification condition to classify a single block period and a fifth classification condition to classify a plurality of consecutive convolutional layers based on a layer having a different characteristic.

예를 들어, 도 4에 도시된 것처럼 연속되는 컨벌루션 레이어(convolution layer)들이 존재하고, 이들 사이에 풀링 레이어와 같은 서브 샘플링 레이어(sub-sampling layer)가 있다고 가정할 수 있다. 이러한 경우에는 제1 분류 조건에 따라 서브 샘플링 레이어를 기준으로 블록 구간(410, 420)을 분류할 수 있다.For example, it can be assumed that there are consecutive convolutional layers as shown in FIG. 4, and there is a sub-sampling layer such as a pooling layer between them. In this case, the block periods 410 and 420 may be classified based on the sub-sampling layer according to the first classification condition.

이 때, 서브 샘플링 레이어는 max pooling layer, average pooling layer 등을 포함할 수 있다.At this time, the sub-sampling layer may include a max pooling layer, an average pooling layer, and the like.

하지만, 도 4에 도시된 CONV2와 같이 컨벌루션 레이어가 연속되지 않은 하나의 레이어(single layer)일 경우에는 블록 구간으로 분류하지 않을 수 있다.However, if the convolutional layer is a single layer that is not continuous, such as CONV2 shown in FIG. 4, it may not be classified as a block section.

다른 예를 들어, 도 5를 참조하면, residual skip connection을 가지는 조밀한 컨벌루션 레이어들(510, 520)이 존재하는 경우, 제2 분류 조건에 따라 스킵 커넥션을 갖는 레이어를 경계로 스킵 커넥션을 포함한 그 앞의 레이어들을 하나의 블록 구간으로 분류할 수 있다. 이 때, 도 5에 도시된 주요 매개 변수는 감소 매개 변수 rr, 확장 매개 변수 re 및 반복 매개 변수 r에 상응할 수 있으며, 이들을 통해 깊고 풍부한 구조의 다양한 인코더/디코더 모델을 생성할 수 있다. 이 때, 반복에 의한 각 출력은 도 5에 도시된 것처럼 CDCs에 쌓이거나 또는 디코더로 보내기 위해 1x1 컨벌루션 레이어(530)로 보내질 수 있다. 이 때, CDCs는 인코딩을 통해 추출된 여러 feature들의 묶음에 해당할 수 있다. For another example, referring to FIG. 5, when dense convolutional layers 510 and 520 having residual skip connections exist, a layer having a skip connection according to the second classification condition, including a skip connection as a boundary, The previous layers can be classified into one block section. At this time, the main parameters shown in FIG. 5 may correspond to the reduction parameter rr, the extension parameter re, and the iteration parameter r, through which various encoder/decoder models having a deep and rich structure can be generated. At this time, each output by repetition may be accumulated in CDCs as shown in FIG. 5 or sent to a 1x1 convolutional layer 530 for transmission to a decoder. At this time, CDCs may correspond to a bundle of various features extracted through encoding.

또 다른 예를 들면, 연속된 컨벌루션 레이어들의 층의 개수가 많고, 서브 샘플링 레이어만을 기준으로 블록 구간을 분류하기 어려운 경우에는 제3 분류 조건에 따라 기설정된 연속 횟수를 기준으로 연속된 컨벌루션 레이어들을 나누어 블록 구간으로 분류할 수 있다. For another example, when the number of consecutive convolutional layers is large and it is difficult to classify a block section based on only the sub-sampling layer, the consecutive convolutional layers are divided based on a preset number of consecutive times according to the third classification condition. It can be classified as a block section.

이 때, 네트워크 아키텍처 층의 깊이 설계에 따라 다르지만, pervasive한 성격의 output depth를 우선적으로 분류할 수 있다.At this time, although it depends on the depth design of the network architecture layer, it is possible to preferentially classify the output depth of the pervasive nature.

만약, Object recognition 모델인 YOLO v2의 compute intensive 구간을 예로 설명하면, output depth 기준으로 512-1024-512-1024-512-1024-1024-1024-64-1024에 상응하는 구조에서 pervasive depth를 512, 1024로 잡고 블록 구간을 분류할 수 있다. 이 때, 블록 구간은 각각 (512-1024-512-1024-512) 및 (1024-1024-1024-64-1024)에 상응하게 분류될 수 있다. If the compute intensive section of YOLO v2, which is an object recognition model, is described as an example, pervasive depth is 512, in a structure corresponding to 512-1024-512-1024-512-1024-1024-1024-64-1024 based on output depth. It is possible to classify the block section by holding 1024. At this time, the block period may be classified according to (512-1024-512-1024-512) and (1024-1024-1024-64-1024), respectively.

또 다른 예를 들면, 도 6에 도시된 것처럼 N개의 컨벌루션 레이어들(610, 620, 630, 640)이 깊이 있게 연결(DEPTH CONCATENATION) 구간이 존재하면 제4 분류 조건에 따라 해당 구간에 포함된 컨벌루션 레이어들을 하나의 블록 구간으로 분류할 수 있다.For another example, as shown in FIG. 6, if there are deeply connected (DEPTH CONCATENATION) sections of N convolutional layers 610, 620, 630, and 640, convolution included in the section according to the fourth classification condition Layers may be classified into one block section.

또 다른 예를 들면, 연속되는 컨벌루션 레이어들과 달리 다른 성격을 가미하는 레이어가 존재하는 경우, 제5 분류 조건에 따라 해당 레이어를 기준으로 블록 구간을 분류할 수 있다.For another example, if there are layers having different characteristics, unlike the continuous convolutional layers, the block section may be classified based on the corresponding layer according to the fifth classification condition.

한편, 뉴럴 네트워크 경량화 장치는 메모리가 탑재되어 그 장치 내에서 정보를 저장할 수 있다. 일 구현예의 경우, 메모리는 컴퓨터로 판독 가능한 매체이다. 일 구현 예에서, 메모리는 휘발성 메모리 유닛일 수 있으며, 다른 구현예의 경우, 메모리는 비휘발성 메모리 유닛일 수도 있다. 일 구현예의 경우, 저장장치는 컴퓨터로 판독 가능한 매체이다. 다양한 서로 다른 구현 예에서, 저장장치는 예컨대 하드디스크 장치, 광학디스크 장치, 혹은 어떤 다른 대용량 저장장치를 포함할 수도 있다.On the other hand, a neural network lightweight device is equipped with a memory and can store information in the device. In one implementation, the memory is a computer-readable medium. In one implementation, the memory may be a volatile memory unit, and in other implementations, the memory may be a non-volatile memory unit. In one embodiment, the storage device is a computer-readable medium. In various different implementations, the storage device may include, for example, a hard disk device, an optical disk device, or some other mass storage device.

이와 같은 본 발명의 일실시예에 따른 뉴럴 네트워크 경량화 장치를 이용함으로써 뉴럴 네트워크의 설계 탐색 범위를 감소시켜 적은 연산만으로도 계산이 빠르고, 전력 소모가 적은 구조의 뉴럴 네트워크를 설계할 수 있다.By using the neural network light weighting apparatus according to an embodiment of the present invention, the design search range of the neural network is reduced to design a neural network having a fast calculation and a low power consumption structure with less computation.

또한, 기존에 발표된 뉴럴 네트워크를 저전력, 경량화, 고속화시킬 수 있도록 리모델링할 수 있으며, 축소 반복 블록을 기반으로 적절한 깊이 수준의 뉴럴 네트워크를 설계하여 계산량의 과도한 팽창을 방지할 수도 있다.]In addition, the previously announced neural network can be remodeled for low power, light weight, and high speed, and an appropriate depth level neural network can be designed based on a reduced iteration block to prevent excessive expansion of computational power.]

이상에서와 같이 본 발명에 따른 축소 반복 블록을 이용한 뉴럴 네트워크 경량화 방법 및 이를 위한 장치는 상기한 바와 같이 설명된 실시예들의 구성과 방법이 한정되게 적용될 수 있는 것이 아니라, 상기 실시예들은 다양한 변형이 이루어질 수 있도록 각 실시예들의 전부 또는 일부가 선택적으로 조합되어 구성될 수도 있다.As described above, the method and apparatus for reducing the neural network using the reduced repetition block according to the present invention are not limited to the configuration and method of the above-described embodiments, and the above embodiments have various modifications. All or part of each of the embodiments may be selectively combined to be configured.

100, 200: 뉴럴 네트워크 경량화 장치
110: 최초 설계된 뉴럴 네트워크 120: 최적 뉴럴 네트워크
410. 420, 600, 1110, 1120, 1130: 블록 구간
510, 530, 810, 830: 1X1 컨벌루션 레이어
520, 820, 840: 3X3 DW 컨벌루션 레이어
610, 620, 630, 640: 컨벌루션 레이어
700: 성능평가 모듈 710: 1번째 축소 반복 블록 후보군
720: 1번째 축소 반복 블록 800: 횡방향 반복 블록
900: 종방향 반복 블록 1140: 버려지는 구간
1210, 1220, 1230, 1400: 축소 반복 블록
1310, 1410: CDC 1320, 1420: 축소 레이어
1330: 프로세서 1610~1630: 반복 블록 구간
100, 200: Neural network weight reduction device
110: Initially designed neural network 120: Optimal neural network
410. 420, 600, 1110, 1120, 1130: block section
510, 530, 810, 830: 1X1 convolutional layer
520, 820, 840: 3X3 DW convolutional layer
610, 620, 630, 640: convolutional layer
700: Performance evaluation module 710: 1st reduction repeat block candidate group
720: 1st reduction repeat block 800: Transverse repeat block
900: Longitudinal repeat block 1140: Discarded section
1210, 1220, 1230, 1400: Reduced repeat block
1310, 1410: CDC 1320, 1420: Shrink layer
1330: processor 1610~1630: repeat block section

Claims (19)

뉴럴 네트워크(NEURAL NETWORK)를 구성하는 레이어 및 축소 반복 블록 중 적어도 하나에 대한 출력값을 CDC(CONDENSED DECODING CONNECTION)에 축적하는 단계; 및
기설정된 축소 레이어를 기반으로 상기 CDC에 축적된 데이터에 상응하게 생성된 특징 맵(FEATURE MAP)으로 축소하여 상기 뉴럴 네트워크를 경량화하는 단계
를 포함하는 것을 특징으로 하는 뉴럴 네트워크 경량화 방법.
Accumulating output values for at least one of a layer and a reduced repetition block constituting a neural network in CDC (CONDENSED DECODING CONNECTION); And
Lightening the neural network by reducing to a feature map (FEATURE MAP) generated corresponding to the data accumulated in the CDC based on a preset reduction layer.
Neural network weighting method comprising a.
청구항 1에 있어서,
상기 축소 반복 블록은
상기 뉴럴 네트워크의 전체 구조 중 기설정된 분류 조건에 따라 블록 단위로 분류된 복수개의 블록 구간들이 각각 최적의 성능을 낼 수 있도록 레이어 축소와 레이어 팽창을 반복적으로 수행하는 구간에 상응하는 것을 특징으로 하는 뉴럴 네트워크 경량화 방법.
The method according to claim 1,
The reduced repeat block
In the overall structure of the neural network, a plurality of block sections classified in block units according to a predetermined classification condition corresponds to a section in which layer reduction and layer expansion are repeatedly performed so as to achieve optimal performance, respectively. Network lightweighting method.
청구항 2에 있어서,
상기 뉴럴 네트워크 경량화 방법은
상기 복수개의 블록 구간들마다 하이퍼 파라미터의 설정에 기반한 축소 반복 블록 후보군을 생성하는 단계; 및
성능평가를 기반으로 상기 축소 반복 블록 후보군 중 최적의 성능을 갖는 어느 하나의 축소 반복 블록 후보를 상기 축소 반복 블록으로 선정하는 단계를 더 포함하는 것을 특징으로 하는 뉴럴 네트워크 경량화 방법.
The method according to claim 2,
The neural network weight reduction method
Generating a reduced repetition block candidate group based on setting of a hyper parameter for each of the plurality of block sections; And
And selecting one of the reduced repetition block candidates having optimal performance among the reduced repetition block candidate groups as the reduced repetition block based on performance evaluation.
청구항 3에 있어서,
상기 축소 반복 블록 후보군은
상기 하이퍼 파라미터의 값이 서로 상이한 복수개의 축소 반복 블록 후보들을 포함하는 것을 특징으로 하는 뉴럴 네트워크 경량화 방법.
The method according to claim 3,
The reduced repeat block candidate group
The method of weight reduction of a neural network, characterized in that it comprises a plurality of reduced repetition block candidates having different values of the hyper parameters.
청구항 2에 있어서,
상기 뉴럴 네트워크 경량화 방법은
상기 뉴럴 네트워크가 상기 블록 단위로 구성되지 않은 기개발된 뉴럴 네트워크일 경우, 상기 기설정된 분류 조건을 기반으로 상기 기개발된 뉴럴 네트워크를 블록 단위로 분류하는 단계를 더 포함하는 것을 특징으로 하는 뉴럴 네트워크 경량화 방법.
The method according to claim 2,
The neural network weight reduction method
If the neural network is a pre-developed neural network that is not configured in the block unit, the neural network further comprising classifying the pre-developed neural network in block units based on the preset classification condition. Light weight method.
청구항 2에 있어서,
상기 기설정된 분류 조건은
연속된 복수개의 컨벌루션 레이어(CONVOLUTION LAYER)들을 서브 샘플링 레이어(SUB-SAMPLING LATER) 기준으로 분류하는 제1 분류 조건, 연속된 복수개의 컨벌루션 레이어들을 스킵 커넥션(SKIP CONNECTION)을 갖는 레이어 기준으로 분류하는 제2 분류 조건, 서브 샘플링 레이어를 포함하지 않는 연속된 복수개의 컨벌루션 레이어들을 기설정된 연속 횟수 기준으로 분류하는 제3 분류 조건, 레이어들 간의 깊이 있는 연결 구간(DEPTH CONCATENATION)을 하나의 블록 구간으로 분류하는 제4 분류 조건 및 연속된 복수개의 컨벌루션 레이어들과 다른 성격을 갖는 레이어를 기준으로 분류하는 제5 분류 조건 중 적어도 하나를 포함하는 것을 특징으로 하는 뉴럴 네트워크 경량화 방법.
The method according to claim 2,
The preset classification conditions
A first classification condition for classifying consecutive convolutional layers (CONVOLUTION LAYER) on the basis of a sub-sampling layer (SUB-SAMPLING LATER); 2 Classification conditions, a third classification condition that classifies a plurality of consecutive convolutional layers that do not include a sub-sampling layer based on a preset number of consecutive times, and classifies a deep connection section (DEPTH CONCATENATION) between layers into one block period A neural network weighting method comprising at least one of a fourth classification condition and a fifth classification condition that is classified based on a plurality of consecutive convolutional layers and layers having different characteristics.
청구항 3에 있어서,
상기 하이퍼 파라미터는
커널 사이즈, 최대 레이어 개수, 레이어 최소 깊이, 레이어 최대 깊이, 총 반복 횟수, 총 경우의 수, 축소된 레이어의 개수 및 축소된 채널의 개수 중 적어도 하나를 포함하는 것을 특징으로 하는 뉴럴 네트워크 경량화 방법.
The method according to claim 3,
The hyper parameter
A neural network weighting method comprising at least one of a kernel size, a maximum number of layers, a minimum layer depth, a maximum layer depth, a total number of iterations, a total number of cases, a reduced number of layers, and a reduced number of channels.
청구항 1에 있어서,
상기 축소 반복 블록은
종방향 및 횡방향에 상응하게 축적되는 것을 특징으로 하는 뉴럴 네트워크 경량화 방법.
The method according to claim 1,
The reduced repeat block
A method for weight reduction in a neural network, characterized in that it accumulates correspondingly in the longitudinal and transverse directions.
청구항 1에 있어서,
상기 기설정된 축소 레이어는
1X1 커널 사이즈를 갖는 레이어에 상응하는 것을 특징으로 하는 뉴럴 네트워크 경량화 방법.
The method according to claim 1,
The preset reduction layer
A neural network weighting method characterized by corresponding to a layer having a 1X1 kernel size.
청구항 7에 있어서,
상기 기설정된 축소 레이어는
상기 특징 맵에 상응하게 축적된 복수개의 채널들을 상기 축소된 채널의 개수만큼 축소시키는 것을 특징으로 하는 뉴럴 네트워크 경량화 방법.
The method according to claim 7,
The preset reduction layer
A method for reducing the weight of a neural network, characterized in that a plurality of channels accumulated corresponding to the feature map is reduced by the number of the reduced channels.
뉴럴 네트워크(NEURAL NETWORK)를 구성하는 레이어 및 축소 반복 블록 중 적어도 하나에 대한 출력값을 축적하는 CDC(CONDENSED DECODING CONNECTION);
1X1 커널 사이즈를 갖는 축소 레이어; 및
상기 출력값을 상기 CDC에 축적하고, 상기 축소 레이어를 기반으로 상기 CDC에 축적된 데이터에 상응하게 생성된 특징 맵(FEATURE MAP)으로 축소하여 상기 뉴럴 네트워크를 경량화하는 프로세서
를 포함하는 것을 특징으로 하는 뉴럴 네트워크 경량화 장치.
CDC (CONDENSED DECODING CONNECTION) that accumulates output values for at least one of a layer and a reduced repetition block constituting a neural network;
A reduction layer having a 1X1 kernel size; And
A processor that accumulates the output value in the CDC and reduces it to a feature map (FEATURE MAP) generated corresponding to the data accumulated in the CDC based on the reduction layer, thereby reducing the weight of the neural network
Neural network weighting device comprising a.
청구항 11에 있어서,
상기 축소 반복 블록은
상기 뉴럴 네트워크의 전체 구조 중 기설정된 분류 조건에 따라 블록 단위로 분류된 복수개의 블록 구간들이 각각 최적의 성능을 낼 수 있도록 레이어 축소와 레이어 팽창을 반복적으로 수행하는 구간에 상응하는 것을 특징으로 하는 뉴럴 네트워크 경량화 장치.
The method according to claim 11,
The reduced repeat block
In the overall structure of the neural network, a plurality of block sections classified in block units according to a predetermined classification condition corresponds to a section in which layer reduction and layer expansion are repeatedly performed so as to achieve optimal performance, respectively. Network lightweight device.
청구항 12에 있어서,
상기 프로세서는
상기 복수개의 블록 구간들마다 하이퍼 파라미터의 설정에 기반한 축소 반복 블록 후보군을 생성하고, 성능평가를 기반으로 상기 축소 반복 블록 후보군 중 최적의 성능을 갖는 어느 하나의 축소 반복 블록 후보를 상기 축소 반복 블록으로 선정하는 것을 특징으로 하는 뉴럴 네트워크 경량화 장치.
The method according to claim 12,
The processor
A reduced repetition block candidate group based on the setting of a hyper parameter is generated for each of the plurality of block sections, and any one of the reduced repetition block candidates having optimal performance among the reduced repetition block candidate groups is based on performance evaluation as the reduced repetition block Neural network weight reduction device characterized in that it is selected.
청구항 13에 있어서,
상기 축소 반복 블록 후보군은
상기 하이퍼 파라미터의 값이 서로 상이한 복수개의 축소 반복 블록 후보들을 포함하는 것을 특징으로 하는 뉴럴 네트워크 경량화 장치.
The method according to claim 13,
The reduced repeat block candidate group
And a plurality of reduced repetition block candidates having different values of the hyperparameters.
청구항 12에 있어서,
상기 프로세서는
상기 뉴럴 네트워크가 상기 블록 단위로 구성되지 않은 기개발된 뉴럴 네트워크일 경우, 상기 기설정된 분류 조건을 기반으로 상기 기개발된 뉴럴 네트워크를 블록 단위로 분류하는 것을 특징으로 하는 뉴럴 네트워크 경량화 장치.
The method according to claim 12,
The processor
When the neural network is a pre-developed neural network that is not composed of the block unit, the neural network weighting apparatus characterized in that the pre-developed neural network is classified in block units based on the preset classification condition.
청구항 12에 있어서,
상기 기설정된 분류 조건은
연속된 복수개의 컨벌루션 레이어(CONVOLUTION LAYER)들을 서브 샘플링 레이어(SUB-SAMPLING LATER) 기준으로 분류하는 제1 분류 조건, 연속된 복수개의 컨벌루션 레이어들을 스킵 커넥션(SKIP CONNECTION)을 갖는 레이어 기준으로 분류하는 제2 분류 조건, 서브 샘플링 레이어를 포함하지 않는 연속된 복수개의 컨벌루션 레이어들을 기설정된 연속 횟수 기준으로 분류하는 제3 분류 조건, 레이어들 간의 깊이 있는 연결 구간(DEPTH CONCATENATION)을 하나의 블록 구간으로 분류하는 제4 분류 조건 및 연속된 복수개의 컨벌루션 레이어들과 다른 성격을 갖는 레이어를 기준으로 분류하는 제5 분류 조건 중 적어도 하나를 포함하는 것을 특징으로 하는 뉴럴 네트워크 경량화 장치.
The method according to claim 12,
The preset classification conditions
A first classification condition for classifying consecutive convolutional layers (CONVOLUTION LAYER) on the basis of a sub-sampling layer (SUB-SAMPLING LATER); 2 Classification conditions, a third classification condition that classifies a plurality of consecutive convolutional layers that do not include a sub-sampling layer based on a preset number of consecutive times, and classifies a deep connection section (DEPTH CONCATENATION) between layers into one block period And at least one of a fourth classification condition and a fifth classification condition that is classified based on a plurality of consecutive convolutional layers and layers having different characteristics.
청구항 13에 있어서,
상기 하이퍼 파라미터는
커널 사이즈, 최대 레이어 개수, 레이어 최소 깊이, 레이어 최대 깊이, 총 반복 횟수, 총 경우의 수, 축소된 레이어의 개수 및 축소된 채널의 개수 중 적어도 하나를 포함하는 것을 특징으로 하는 뉴럴 네트워크 경량화 장치.
The method according to claim 13,
The hyper parameter
A neural network weighting device comprising at least one of a kernel size, a maximum number of layers, a minimum layer depth, a maximum layer depth, a total number of iterations, a total number of cases, a reduced number of layers, and a reduced number of channels.
청구항 11에 있어서,
상기 축소 반복 블록은
종방향 및 횡방향에 상응하게 축적되는 것을 특징으로 하는 뉴럴 네트워크 경량화 장치.
The method according to claim 11,
The reduced repeat block
A neural network lightening device characterized in that it accumulates correspondingly in the longitudinal and transverse directions.
청구항 17에 있어서,
상기 기설정된 축소 레이어는
상기 특징 맵에 상응하게 축적된 복수개의 채널들을 상기 축소된 채널의 개수만큼 축소시키는 것을 특징으로 하는 뉴럴 네트워크 경량화 장치.
The method according to claim 17,
The preset reduction layer
A neural network weighting apparatus characterized in that a plurality of channels accumulated corresponding to the feature map is reduced by the number of the reduced channels.
KR1020190070950A 2018-11-30 2019-06-14 Method for lighting neural network using ruduction-repetition block and apparatus using the same KR20200066143A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/698,711 US20200175353A1 (en) 2018-11-30 2019-11-27 Method for neural-network-lightening using repetition-reduction block and apparatus for the same

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR1020180152723 2018-11-30
KR20180152723 2018-11-30

Publications (1)

Publication Number Publication Date
KR20200066143A true KR20200066143A (en) 2020-06-09

Family

ID=71082678

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020190070950A KR20200066143A (en) 2018-11-30 2019-06-14 Method for lighting neural network using ruduction-repetition block and apparatus using the same

Country Status (1)

Country Link
KR (1) KR20200066143A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20200027890A (en) * 2018-09-05 2020-03-13 주식회사 스트라드비젼 Learning method, learning device for detecting obstacles and testing method, testing device using the same
WO2022145564A1 (en) * 2020-12-29 2022-07-07 국민대학교산학협력단 Model automatic compression method and device for deep-learning model serving optimization, and method for providing cloud inference service using same
WO2023224207A1 (en) * 2022-05-20 2023-11-23 주식회사 엔씨소프트 Electronic device, method, and computer-readable storage medium for identifying object from image data

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20180077260A (en) 2015-12-02 2018-07-06 구글 엘엘씨 Determine the order of execution of the neural network

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20180077260A (en) 2015-12-02 2018-07-06 구글 엘엘씨 Determine the order of execution of the neural network

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20200027890A (en) * 2018-09-05 2020-03-13 주식회사 스트라드비젼 Learning method, learning device for detecting obstacles and testing method, testing device using the same
WO2022145564A1 (en) * 2020-12-29 2022-07-07 국민대학교산학협력단 Model automatic compression method and device for deep-learning model serving optimization, and method for providing cloud inference service using same
WO2023224207A1 (en) * 2022-05-20 2023-11-23 주식회사 엔씨소프트 Electronic device, method, and computer-readable storage medium for identifying object from image data

Similar Documents

Publication Publication Date Title
CN106991646B (en) Image super-resolution method based on dense connection network
CN110321999B (en) Neural network computational graph optimization method
KR20200066143A (en) Method for lighting neural network using ruduction-repetition block and apparatus using the same
CN111144329B (en) Multi-label-based lightweight rapid crowd counting method
JP6872264B2 (en) Methods and equipment for transforming CNN layers to optimize CNN parameter quantization used in mobile devices or precision small networks through hardware optimization
CN112487168B (en) Semantic question-answering method and device of knowledge graph, computer equipment and storage medium
US20200210843A1 (en) Training and application method of a multi-layer neural network model, apparatus and storage medium
KR20200027426A (en) Method and device for providing integrated feature map using ensemble of multiple outputs from convolutional neural network
CN113747163B (en) Image coding and decoding method and compression method based on context recombination modeling
CN113347422B (en) Coarse-grained context entropy coding method
CN114332094A (en) Semantic segmentation method and device based on lightweight multi-scale information fusion network
CN112668708A (en) Convolution operation device for improving data utilization rate
CN108875914B (en) Method and device for preprocessing and post-processing neural network data
Huai et al. Zerobn: Learning compact neural networks for latency-critical edge systems
CN116469100A (en) Dual-band image semantic segmentation method based on Transformer
KR101136200B1 (en) System, method, and computer-readable recording medium for importance sampling of partitioned domains
KR101990735B1 (en) Method and apparatus for scalable graph mining using graph pre-partitioning
CN116051850A (en) Neural network target detection method, device, medium and embedded electronic equipment
US20200175353A1 (en) Method for neural-network-lightening using repetition-reduction block and apparatus for the same
CN112905526A (en) FPGA implementation method for various types of convolution
CN114881221A (en) Mapping scheme optimization method and device, electronic equipment and readable storage medium
JP7245058B2 (en) Data processing device and data processing method
Freire et al. Enhancing the sparse matrix storage using reordering techniques
CN112001492A (en) Mixed flow type acceleration framework and acceleration method for binary weight Densenet model
KR102608565B1 (en) Acoustic scene classification method and leanring method for acoustic scene classification

Legal Events

Date Code Title Description
A201 Request for examination