KR102446792B1 - Apparatus and Method for Generating Relevance-weighted Class Activation Map for Explaining Artificial Neural Networks - Google Patents

Apparatus and Method for Generating Relevance-weighted Class Activation Map for Explaining Artificial Neural Networks Download PDF

Info

Publication number
KR102446792B1
KR102446792B1 KR1020210037408A KR20210037408A KR102446792B1 KR 102446792 B1 KR102446792 B1 KR 102446792B1 KR 1020210037408 A KR1020210037408 A KR 1020210037408A KR 20210037408 A KR20210037408 A KR 20210037408A KR 102446792 B1 KR102446792 B1 KR 102446792B1
Authority
KR
South Korea
Prior art keywords
layer
relevance
map
class
feature map
Prior art date
Application number
KR1020210037408A
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 KR1020210037408A priority Critical patent/KR102446792B1/en
Application granted granted Critical
Publication of KR102446792B1 publication Critical patent/KR102446792B1/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/08Learning methods
    • G06N3/082Learning methods modifying the architecture, e.g. adding, deleting or silencing nodes or connections
    • 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

A blockchain-based decentralized authorization protocol method of the present invention includes: a step in which an authorization flow begins when a client requests authorization from a resource owner; a step of redirecting the resource owner's client agent to an authorization endpoint of an authorization server after receiving the client's request; a step in which if a resource owner approves an authorization request, the authorization server redirects the resource owner's web browser to a redirection URI; a step in which upon redirection, the authorization server includes an authorization authorization code and status information in the redirection URI and transmits the authorization to the client; a step in which the client transmits an authorization code and a redirect URI to a token endpoint of the authorization server and requests issuance of an access token; a step in which the authorization server verifies the authorization token, and if the authorization authorization code is valid, an access token is issued to the client; a step in which the client requests access to the resource to the resource server through the access token; and a step in which the resource server verifies the access token, and if the access token is valid, the client (200) is provided with a resource corresponding to the range of access rights permitted by the access token. The present invention is interoperable with OAuth 2.0.

Description

인공 신경망을 설명하기 위한 관련성 가중 클래스 활성화 맵 생성 장치 및 방법{Apparatus and Method for Generating Relevance-weighted Class Activation Map for Explaining Artificial Neural Networks}Apparatus and Method for Generating Relevance-weighted Class Activation Map for Explaining Artificial Neural Networks

본 발명은 클래스 활성화 맵 생성 장치 및 방법에 관한 것으로, 인공 신경망을 설명하기 위한 관련성 가중 클래스 활성화 맵 생성 장치 및 방법에 관한 것이다.The present invention relates to an apparatus and method for generating a class activation map, and to an apparatus and method for generating a relevance-weighted class activation map for describing an artificial neural network.

인공 신경망에 대한 응용 분야가 증가하고, 이에 다양한 인공 신경망이 개발됨에 따라 인공 신경망(또는 딥 러닝 모델)을 설명하는 능력도 점점 더 중요 해지고 있다. 특히 인공 신경망의 실제 적용에 앞서 딥 러닝 모델의 추론과 결과 생성 과정을 분석하는 것이 중요하다.As the application fields for artificial neural networks increase and various artificial neural networks are developed, the ability to describe artificial neural networks (or deep learning models) is also becoming more and more important. In particular, it is important to analyze the inference and result generation process of the deep learning model before the actual application of the artificial neural network.

일 예로 의료 분야에 이용되는 인공 신경망으로 의료 영상으로부터 암 발생 여부를 진단하는 인공 신경망의 경우, 해당 인공 신경망이 어떠한 추론 과정과 결과 생성 과정을 통해 암 진단을 수행하였는지를 분석할 필요가 있다. 이는 학습 완료된 것으로 판단되어 암 진단을 수행하는 인공 신경망이 실제로는 암 병변 부위가 아닌 다른 부위를 기준으로 암 발생 여부를 판별하여 오진을 수행했을 가능성이 있기 때문이다. 즉 암 진단을 수행한 인공 신경망이 실제로 암 병변 영역에 주의를 기울여 암을 진단하였는지 여부를 검증할 수 있도록 인공 신경망의 동작을 분석할 필요가 있다.For example, in the case of an artificial neural network used in the medical field for diagnosing whether cancer occurs from a medical image, it is necessary to analyze which reasoning process and result generation process the artificial neural network performs to diagnose cancer. This is because there is a possibility that the artificial neural network, which is judged to have been learned and performs cancer diagnosis, actually performed a misdiagnosis by determining whether cancer has occurred based on a site other than the cancer lesion site. That is, it is necessary to analyze the operation of the artificial neural network so that it can be verified whether the artificial neural network that has performed cancer diagnosis actually diagnoses cancer by paying attention to the cancer lesion region.

이와 같이 딥 러닝 모델의 추론과 결과 생성 과정을 분석하는 학문을 설명가능 인공 지능(Explainable AI: 이하 XAI)라 하며, 이러한 XAI에서 대표적인 방법으로 클래스 활성화맵(Class Activation Mapping: CAM)을 이용하는 방법이 있다. CAM 기반 방법은 컴퓨터 비전(Computer Vision) 분야에서 널리 사용되는 컨볼루션 신경망(Convolutional Neural Network: 이하 CNN)을 설명하기 위해 이용되는 방법으로, CNN에 의해 구분되는 각 클래스를 분류하기 위해 CNN이 주목한 영역을 시각적으로 표시하는 기법이다. 이때, CAM 기반 방법은 적어도 하나의 컨볼루션 레이어를 포함하는 CNN의 마지막 레이어가 분류된 클래스값을 획득하기 위해 주목한 영역을 추적한다.Such a study that analyzes the inference and result generation process of deep learning models is called Explainable AI (XAI). have. The CAM-based method is a method used to describe a convolutional neural network (CNN) widely used in the field of computer vision. It is a technique to visually mark an area. In this case, the CAM-based method tracks the area that the last layer of the CNN including at least one convolutional layer pays attention to to obtain a classified class value.

다만 CAM 기반 방법은 CNN에서 마지막 레이어가 주목한 영역만을 추적하므로, 하나의 컨볼루션 레이어만으로 구성된 CNN에서는 효과적이나, 다수의 컨볼루션 레이어를 포함하는 CNN에 적용하기 어렵다. 이에 현재는 주로 Grad-CAM 또는 Gram-CAM++ 이 이용되고 있다. CAM이 특정 컨볼루션 레이어에서 추출된 특징맵(feature map)이므로, Grad-CAM 또는 Gram-CAM++는 CAM과 특정 레이어에에서 획득된 특징맵의 각 픽셀 사이 변화를 추정하여 기울기 맵(Gradient map)을 획득하고, 획득된 기울기 맵을 이용하여 특징맵에 대한 가중치를 계산하여 가중함으로써, 가중 클래스 활성화 맵(gradient-weighted Class Activation Map)을 생성하는 방식이다.However, the CAM-based method is effective in a CNN consisting of only one convolutional layer because it tracks only the region that the last layer pays attention to in the CNN, but it is difficult to apply to a CNN including multiple convolutional layers. For this reason, Grad-CAM or Gram-CAM++ is mainly used now. Since CAM is a feature map extracted from a specific convolutional layer, Grad-CAM or Gram-CAM++ calculates a gradient map by estimating the change between each pixel of the feature map acquired from CAM and a specific layer. It is a method of generating a weighted class activation map (gradient-weighted class activation map) by calculating and weighting weights for the feature map using the obtained gradient map.

그러나 Grad-CAM 또는 Gram-CAM++ 기법은 CAM과 선택된 특정 특징맵 사이의 기울기를 곧바로 추정하여 기울기 맵을 획득하므로, CAM과 선택된 레이어 사이의 레이어의 개수가 증가할수록, CAM과 선택된 특정 특징맵을 출력하는 레이어 사이에 배치되는 다수의 레이어의 동작 특성을 제대로 반영할 수 없어 추정된 기울기에 많은 노이즈가 포함되고 불연속적이 되어 그 성능이 크게 저하되는 문제가 있다. 이를 부서진 그래디언트 문제(shattered gradient problem)라 하며, 이와 같은 부서진 그래디언트 문제로 인해 Grad-CAM 또는 Gram-CAM++를 대체하여 다수의 레이어가 포함된 인공 신경망의 다수의 레이어 각각이 각 클래스에 대해 주목한 영역을 정확하게 분석할 수 있는 새로운 기법이 요구되고 있다.However, since the Grad-CAM or Gram-CAM++ technique obtains a gradient map by directly estimating the gradient between the CAM and the selected specific feature map, as the number of layers between the CAM and the selected layer increases, the CAM and the selected specific feature map are output. Since the operation characteristics of a plurality of layers disposed between the layers to be used are not properly reflected, a lot of noise is included in the estimated slope and becomes discontinuous, resulting in a problem in that the performance is greatly deteriorated. This is called the shattered gradient problem, and due to such a shattered gradient problem, it replaces Grad-CAM or Gram-CAM++, where each of the multiple layers of an artificial neural network with multiple layers pays attention to each class. A new technique that can accurately analyze the

한국 공개 특허10-2021-0002018호 (2021.01.06 공개)Korean Patent Publication No. 10-2021-0002018 (published on Jan. 6, 2021)

본 발명의 목적은 인공 신경망의 다수의 레이어 각각이 각 클래스에 대해 주의한 영역을 정확하게 추정할 수 있는 클래스 활성화 맵 생성 장치 및 방법을 제공하는데 있다.SUMMARY OF THE INVENTION It is an object of the present invention to provide an apparatus and method for generating a class activation map capable of accurately estimating a region that each of a plurality of layers of an artificial neural network pays attention to for each class.

상기 목적을 달성하기 위한 본 발명의 일 실시예에 따른 클래스 활성화 맵 생성 장치는 다수의 레이어를 포함하는 각각 입력되는 영상 또는 이전 레이어에서 출력된 특징맵을 인가받아 미리 학습된 방식에 따라 특징을 추출하여 특징맵을 출력하고, 최종 출력된 특징맵을 미리 학습된 방식에 따라 분류하여 기지정된 다수의 클래스에 대응하는 다수의 개별 클래스 분류 결과를 획득하는 신경망; 상기 다수의 클래스 중 하나의 클래스를 타겟 클래스로 선택하고, 상기 다수의 레이어 중 하나의 레이어를 타겟 레이어로 선택하는 클래스/레이어 선택부; 및 상기 신경망의 최종 레이어에서 출력되는 상기 다수의 개별 클래스 분류 결과 중 상기 타겟 클래스에 대응하는 개별 클래스 분류 결과를 초기 관련성으로 설정하고, 설정된 초기 관련성을 상기 최종 레이어로부터 상기 타겟 레이어까지 각 레이어의 가중치 및 활성화 함수에 따라 인접한 이전 레이어로 역전파하여 각 레이어에 대한 관련성 가중치를 획득하며, 획득된 관련성 가중치를 대응하는 레이어에서 출력된 특징맵에 가중합하여 관련성 가중 클래스 활성화 맵을 획득하는 관련성 가중 CAM 획득부를 포함한다.In order to achieve the above object, an apparatus for generating a class activation map according to an embodiment of the present invention receives an input image including a plurality of layers or a feature map output from a previous layer and extracts features according to a pre-learned method a neural network for outputting a feature map and classifying the finally output feature map according to a pre-learned method to obtain a plurality of individual class classification results corresponding to a plurality of predetermined classes; a class/layer selection unit that selects one of the plurality of classes as a target class and selects one of the plurality of layers as a target layer; and an individual class classification result corresponding to the target class among the plurality of individual class classification results output from the final layer of the neural network is set as an initial relevance, and the set initial relevance is weighted for each layer from the final layer to the target layer. and a relevance-weighted CAM obtained by backpropagating to an adjacent previous layer according to the activation function to obtain a relevance weight for each layer, and weighting the obtained relevance weight to a feature map output from the corresponding layer to obtain a relevance-weighted class activation map includes wealth.

상기 관련성 가중 CAM 획득부는 상기 초기 관련성을 설정하고, 상기 초기 관련성을 레이어별 관련성 전파(Layer-wise Relevance Propagation: 이하 LRP) 기법에 따라 순차적으로 이전 레이어로 전파하여, 각 레이어에 대한 관련성 맵을 획득하는 관련성 전파부; 각 레이어에 대한 상기 관련성 맵 각각을 글로벌 평균 풀링하여 관련성 가중치를 획득하는 관련성 가중치 획득부; 및 각 레이어에 대한 상기 관련성 가중치를 대응하는 레이어에서 출력된 특징맵에 가중합하여 상기 관련성 가중 클래스 활성화 맵을 획득하는 관련성 가중부를 포함할 수 있다.The relevance-weighted CAM obtaining unit sets the initial relevance, and sequentially propagates the initial relevance to the previous layer according to a layer-wise relevance propagation (LRP) technique to obtain a relevance map for each layer. relevance propagation unit; a relevance weight obtaining unit that obtains relevance weights by pooling the global average of each relevance map for each layer; and a relevance weighting unit configured to obtain the relevance weighted class activation map by weighting the relevance weight for each layer to a feature map output from a corresponding layer.

상기 관련성 전파부는 다수의 레이어 중 제l+1 레이어의 각 노드(q)에서 인접한 제l 레이어의 노드(p)로 전파되는 관련성(Rp l)을 수학식 The relevance propagation unit calculates the relevance (R p l ) propagated from each node (q) of the 1+1 layer among the plurality of layers to the node (p) of the first layer adjacent to the equation

Figure 112021034060651-pat00001
Figure 112021034060651-pat00001

(여기서 ap l 은 신경망의 제l 레이어의 제p 노드의 활성화값을 나타내며, Wpq (l,l+1) 는 제l 레이어의 제p 노드와 제l+1 레이어의 제q 노드 사이의 가중치를 나타내며, m는 제l 레이어의 전체 노드에 대한 인덱스를 나타낸다.)에 따라 계산하여 전파할 수 있다.(Here, a p l represents the activation value of the p-th node of the first layer of the neural network, and W pq (l,l+1) is between the p-th node of the first layer and the q-th node of the 1+1 layer. represents a weight, and m represents an index for all nodes of the first layer).

상기 관련성 가중치 획득부는 타겟 클래스(c)에 대한 레이어별 관련성 맵(Rk c)으로부터 각 레이어에 대한 상기 관련성 가중치(αk c)를 수학식 The relevance weight obtaining unit calculates the relevance weight (α k c ) for each layer from the layer-by-layer relevance map (R k c ) for the target class (c).

Figure 112021034060651-pat00002
Figure 112021034060651-pat00002

(여기서 k 는 레이어 식별자를 나타내고, x, y는 제k 레이어에 대한 관련성 맵(Rk c)의 노드 좌표를 나타낸다.)에 따라 획득할 수 있다.(Here, k indicates a layer identifier, and x and y indicate node coordinates of the relevance map (R k c ) for the k-th layer.).

상기 관련성 가중부는 각 레이어에 대한 상기 관련성 가중치를 대응하는 각 레이어에서 출력된 특징맵과 원소 곱하고, 채널 방향에서 전역 평균 풀링하여 2차원으로 변환하여 각 레이어에 대한 관련성 가중 특징맵을 획득하며, 획득된 각 레이어에 대한 관련성 가중 특징맵을 누적 합산하여 상기 관련성 가중 클래스 활성화 맵을 획득할 수 있다.The relevance weighting unit elementally multiplies the relevance weight for each layer with the feature map output from each corresponding layer, pools the global average in the channel direction, and transforms it into two dimensions to obtain a relevance weighted feature map for each layer, and obtain The relevance-weighted class activation map may be obtained by accumulating and summing the relevance-weighted feature maps for each layer.

상기 관련성 가중부는 각 레이어에 대한 관련성 가중 특징맵을 동일한 크기로 변환한 후 누적 합산할 수 있다.The relevance weighting unit may convert the relevance weighted feature map for each layer to the same size and then cumulatively sum them.

상기 관련성 가중부는 상기 관련성 가중 클래스 활성화 맵의 크기를 획득된 영상의 크기로 업스케일링할 수 있다.The relevance weighting unit may upscale the size of the relevance weighting class activation map to the size of the obtained image.

상기 목적을 달성하기 위한 본 발명의 다른 실시예에 따른 클래스 활성화 맵 생성 방법은 다수의 레이어를 포함하는 각각 입력되는 영상 또는 이전 레이어에서 출력된 특징맵을 인가받아 미리 학습된 방식에 따라 특징을 추출하여 특징맵을 출력하고, 최종 출력된 특징맵을 미리 학습된 방식에 따라 분류하여 기지정된 다수의 클래스에 대응하는 다수의 개별 클래스 분류 결과를 획득하는 신경망을 설명하기 위한 클래스 활성화 맵을 생성하는 클래스 활성화 맵 생성 방법에 있어서,In a method for generating a class activation map according to another embodiment of the present invention for achieving the above object, each input image including a plurality of layers or a feature map output from a previous layer is applied and features are extracted according to a pre-learned method to output a feature map and classify the final output feature map according to a pre-learned method to generate a class activation map for describing a neural network that obtains a plurality of individual class classification results corresponding to a plurality of predefined classes In the activation map generation method,

상기 다수의 클래스 중 하나의 클래스를 타겟 클래스로 선택하고, 상기 다수의 레이어 중 하나의 레이어를 타겟 레이어로 선택하는 단계; 상기 신경망에 영상을 입력하여 다수의 레이어를 포함하는 각각 입력되는 영상 또는 이전 레이어에서 출력된 특징맵을 인가받아 미리 학습된 방식에 따라 특징을 추출하여 특징맵을 출력하고, 최종 출력된 특징맵을 미리 학습된 방식에 따라 분류하여 기지정된 다수의 클래스에 대응하는 다수의 개별 클래스 분류 결과를 획득하는 단계; 및 상기 신경망의 최종 레이어에서 출력되는 상기 다수의 개별 클래스 분류 결과 중 상기 타겟 클래스에 대응하는 개별 클래스 분류 결과를 초기 관련성으로 설정하고, 설정된 초기 관련성을 상기 최종 레이어로부터 상기 타겟 레이어까지 각 레이어의 가중치 및 활성화 함수에 따라 인접한 이전 레이어로 역전파하여 각 레이어에 대한 관련성 가중치를 획득하며, 획득된 관련성 가중치를 대응하는 레이어에서 출력된 특징맵에 가중합하여 관련성 가중 클래스 활성화 맵을 획득하는 단계를 포함한다.selecting one of the plurality of classes as a target class and selecting one of the plurality of layers as a target layer; An image is input to the neural network, each input image including a plurality of layers or a feature map output from a previous layer is applied, features are extracted according to a pre-learned method, and a feature map is output, and the final output feature map is applied. obtaining a plurality of individual class classification results corresponding to a plurality of predetermined classes by classifying according to a pre-learned method; and an individual class classification result corresponding to the target class among the plurality of individual class classification results output from the final layer of the neural network is set as an initial relevance, and the set initial relevance is weighted for each layer from the final layer to the target layer. and obtaining a relevance weight for each layer by backpropagating to an adjacent previous layer according to the activation function, and weighting the obtained relevance weight to a feature map output from the corresponding layer to obtain a relevance-weighted class activation map. .

따라서, 본 발명의 실시예에 따른 클래스 활성화 맵 생성 장치 및 방법은 클래스 활성화 맵을 레이어별 전파 기법에 따라 각 레이어의 배치 순서에 역순에 따라 순차적으로 전파하여 인공 신경망의 특정 레이어가 각 클래스에 대해 주의한 영역을 정확하게 추적하여 관련성 가중 클래스 활성화 맵을 생성할 수 있도록 한다. 그러므로 깊은 깊이를 갖는 인공 신경망의 클래스 분류에 대한 추론 및 결과 생성 과정을 정확하게 설명하여 분석할 수 있도록 한다.Therefore, the class activation map generation apparatus and method according to an embodiment of the present invention sequentially propagate the class activation map in the reverse order to the arrangement order of each layer according to the propagation technique for each layer, so that a specific layer of the artificial neural network is generated for each class. It accurately tracks the areas of attention, allowing the creation of relevance-weighted class activation maps. Therefore, it is possible to accurately explain and analyze the inference and result generation process for class classification of an artificial neural network with deep depth.

도 1은 본 발명의 일 실시예에 따른 클래스 활성화 맵 생성 장치의 개략적 구조를 나타낸다.
도 2는 도 1의 클래스 활성화 맵 생성 장치의 동작을 설명하기 위한 도면이다.
도 3은 인공 신경망의 일 예에 대한 동작을 설명하기 위한 도면이다.
도 4 및 도 5는 도 3의 인공 신경망에서 컨볼루션 커널의 동작을 설명하기 위한 도면이다.
도 6은 관련성 전파부의 동작을 설명하기 위한 도면이다.
도 7 내지 도 8은 본 실시예에 따른 클래스 활성화 맵 생성 장치의 성능을 나타낸다.
도 9는 본 발명의 일 실시예에 따른 클래스 활성화 맵 생성 방법을 나타낸다.
1 shows a schematic structure of an apparatus for generating a class activation map according to an embodiment of the present invention.
FIG. 2 is a diagram for explaining an operation of the class activation map generating apparatus of FIG. 1 .
3 is a diagram for explaining an operation of an example of an artificial neural network.
4 and 5 are diagrams for explaining an operation of a convolution kernel in the artificial neural network of FIG. 3 .
6 is a diagram for explaining the operation of the relevance propagation unit.
7 to 8 show the performance of the class activation map generating apparatus according to the present embodiment.
9 illustrates a method for generating a class activation map according to an embodiment of the present invention.

본 발명과 본 발명의 동작상의 이점 및 본 발명의 실시에 의하여 달성되는 목적을 충분히 이해하기 위해서는 본 발명의 바람직한 실시예를 예시하는 첨부 도면 및 첨부 도면에 기재된 내용을 참조하여야만 한다. In order to fully understand the present invention, the operational advantages of the present invention, and the objects achieved by the practice of the present invention, reference should be made to the accompanying drawings illustrating preferred embodiments of the present invention and the contents described in the accompanying drawings.

이하, 첨부한 도면을 참조하여 본 발명의 바람직한 실시예를 설명함으로써, 본 발명을 상세히 설명한다. 그러나, 본 발명은 여러 가지 상이한 형태로 구현될 수 있으며, 설명하는 실시예에 한정되는 것이 아니다. 그리고, 본 발명을 명확하게 설명하기 위하여 설명과 관계없는 부분은 생략되며, 도면의 동일한 참조부호는 동일한 부재임을 나타낸다. Hereinafter, the present invention will be described in detail by describing preferred embodiments of the present invention with reference to the accompanying drawings. However, the present invention may be embodied in several different forms, and is not limited to the described embodiments. In addition, in order to clearly explain the present invention, parts irrelevant to the description are omitted, and the same reference numerals in the drawings indicate the same members.

명세서 전체에서, 어떤 부분이 어떤 구성요소를 "포함"한다고 할 때, 이는 특별히 반대되는 기재가 없는 한 다른 구성요소를 제외하는 것이 아니라, 다른 구성요소를 더 포함할 수 있는 것을 의미한다. 또한, 명세서에 기재된 "...부", "...기", "모듈", "블록" 등의 용어는 적어도 하나의 기능이나 동작을 처리하는 단위를 의미하며, 이는 하드웨어나 소프트웨어 또는 하드웨어 및 소프트웨어의 결합으로 구현될 수 있다. Throughout the specification, when a part "includes" a certain component, it does not exclude other components unless otherwise stated, meaning that other components may be further included. In addition, terms such as "... unit", "... group", "module", and "block" described in the specification mean a unit that processes at least one function or operation, which is hardware, software, or hardware. and a combination of software.

도 1은 본 발명의 일 실시예에 따른 클래스 활성화 맵 생성 장치의 개략적 구조를 나타내고, 도 2는 도 1의 클래스 활성화 맵 생성 장치의 동작을 설명하기 위한 도면이다.FIG. 1 shows a schematic structure of an apparatus for generating a class activation map according to an embodiment of the present invention, and FIG. 2 is a diagram for explaining an operation of the apparatus for generating a class activation map of FIG. 1 .

도 1을 참조하면, 본 실시예에 따른 클래스 활성화 맵 생성 장치는 영상 획득부(110), 신경망(120), 후처리부(130), 클래스/레이어 선택부(140) 및 관련성 가중 CAM 획득부(150)를 포함할 수 있다.Referring to FIG. 1 , the apparatus for generating a class activation map according to the present embodiment includes an image acquisition unit 110 , a neural network 120 , a post-processing unit 130 , a class/layer selection unit 140 , and a relevance-weighted CAM acquisition unit ( 150) may be included.

영상 획득부(110)는 사전에 학습된 신경망(120)의 추론과 결과 생성 과정, 즉 동작을 분석하기 위한 영상을 획득한다. 영상 획득부(110)는 카메라 또는 CCTV와 같이 영상을 획득할 수 있는 영상 획득 장치로 구현되거나, 미리 획득된 영상이 저장된 메모리 등으로 구현될 수 있다. 또한 경우에 따라서는 다른 장치로부터 네트워크를 통해 영상을 전송받는 통신 장치 등으로 구현될 수도 있다.The image acquisition unit 110 acquires an image for analyzing the pre-trained inference and result generation process of the neural network 120 , that is, a motion. The image acquisition unit 110 may be implemented as an image acquisition device capable of acquiring an image, such as a camera or CCTV, or a memory in which a previously acquired image is stored. Also, in some cases, it may be implemented as a communication device that receives an image from another device through a network.

신경망(120)은 딥 러닝 모델로 구현되어 미리 학습된 인공 신경망으로서, 영상 획득부(110)에서 획득한 영상을 인가받아 미리 학습된 방식에 따라 인가된 영상의 특징을 추출하여 특징맵을 획득하고, 획득된 특징맵의 클래스를 분류한다. 이때, 신경망(120)은 영상이 기지정된 다수의 클래스 각각에 대응하는 수준을 추출하는 방식으로 분류할 수 있다.The neural network 120 is a pre-trained artificial neural network implemented as a deep learning model, and receives the image acquired from the image acquisition unit 110, extracts the features of the applied image according to the pre-learned method to obtain a feature map, , classify the acquired feature map class. In this case, the neural network 120 may classify the image by extracting a level corresponding to each of a plurality of predetermined classes.

신경망(120)은 특징 추출부(121) 및 클래스 분류부(123)를 포함할 수 있다. 특징 추출부(121)는 미리 학습된 방식에 따라 인가되는 영상의 특징을 추출하여 특징맵을 획득한다. 여기서 특징 추출부(121)는 학습에 의해 가중치가 설정된 다수의 레이어를 포함하고, 다수의 레이어 각각은 영상 또는 이전 레이어에서 획득한 특징맵을 인가받아 설정된 가중치를 적용하여 대응하는 특징맵을 출력하도록 구성된다.The neural network 120 may include a feature extraction unit 121 and a class classification unit 123 . The feature extraction unit 121 obtains a feature map by extracting features of an image to be applied according to a pre-learned method. Here, the feature extraction unit 121 includes a plurality of layers whose weights are set by learning, and each of the plurality of layers receives a feature map obtained from an image or a previous layer and applies the set weight to output a corresponding feature map. is composed

클래스 분류부(123)는 특징 추출부(121)에서 최종 획득된 최종 특징맵을 인가받고, 미리 학습된 방식에 따라 최종 특징맵이 기지정된 다수의 클래스 각각에 대응하는 수준을 계산하여 클래스 분류 결과(y)를 도출한다. 여기서 클래스 분류 결과(y)는 기지정된 다수의 클래스 각각에 대응 수준을 나타내는 개별 클래스 분류 결과(yc)의 집합으로 획득될 수 있으며, 개별 클래스 분류 결과(yc) 각각은 수치값으로 획득될 수 있다.The class classification unit 123 receives the final feature map finally obtained from the feature extraction unit 121 and calculates a level corresponding to each of a plurality of classes for which the final feature map is predetermined according to a pre-learned method, resulting in class classification (y) is derived. Here, the class classification result (y) may be obtained as a set of individual class classification results (y c ) indicating a corresponding level to each of a plurality of predetermined classes, and each of the individual class classification results (y c ) is to be obtained as a numerical value. can

한편 후처리부(130)는 신경망(120)에서 획득된 개별 클래스 분류 결과(yc)를 기반으로 신경망(120)의 활용 목적에 따른 미리 지정된 동작을 수행한다. 일 예로 후처리부(130)는 개별 클래스 분류 결과(yc)에 기반하여 각 클래스에 대응하는 객체가 영상에 포함되어 있는지 여부를 식별하거나, 암과 같은 특정 질병의 발생 여부를 판단할 수 있다. 후처리부(130)는 일 예로 개별 클래스 분류 결과(yc)를 기지정된 방식에 따라 확률값으로 변환하여 객체의 포함 여부를 식별하도록 구성될 수 있다.Meanwhile, the post-processing unit 130 performs a predetermined operation according to the purpose of using the neural network 120 based on the individual class classification result y c obtained from the neural network 120 . For example, the post-processing unit 130 may identify whether an object corresponding to each class is included in the image based on the individual class classification result y c , or determine whether a specific disease such as cancer occurs. The post-processing unit 130 may be configured to, for example, convert an individual class classification result y c into a probability value according to a predetermined method to identify whether an object is included.

본 실시예에서 신경망(120)은 도 2에 도시된 바와 같이, 일 예로 CNN 또으로 구현될 수 있으며, CNN으로부터 파생된 ResNet(Residual Network) 등으로 구현될 수 있다. 특징 추출부(121)는 n개 컨볼루션 레이어를 포함하여 n개의 특징맵(A1 C, A2 C, …, An C)을 획득할 수 있다. 그리고 클래스 분류부(123) 또한 적어도 하나의 레이어를 포함하여 구성될 수 있으며, 클래스 분류부(123)는 신경망(120)의 활용 목적에 따라 개별 클래스 분류 결과(yc)를 추출하기 위한 다양한 구조의 네트워크로 구성될 수 있다. 여기서 클래스 분류부(123)의 적어도 하나의 각각은 일 예로 FC 레이어(Fully Connected layer)로 구성될 수 있다.In this embodiment, as shown in FIG. 2 , the neural network 120 may be implemented as CNN or as an example, and may be implemented as ResNet (Residual Network) derived from CNN. The feature extractor 121 may obtain n feature maps A 1 C , A 2 C , ..., A n C including n convolutional layers. And the class classification unit 123 may also be configured to include at least one layer, and the class classification unit 123 has various structures for extracting individual class classification results (y c ) according to the purpose of using the neural network 120 . can be configured as a network of Here, each of at least one of the class classification unit 123 may be configured as an FC layer (Fully Connected layer), for example.

도 1에서는 설명의 편의를 위하여 후처리부(130)를 신경망(120)과 별도의 구성으로 도시하였으나, 신경망(120)은 후처리부(130)를 포함하여 구성될 수도 있다.In FIG. 1 , the post-processing unit 130 is illustrated as a separate configuration from the neural network 120 for convenience of explanation, but the neural network 120 may be configured to include the post-processing unit 130 .

클래스/레이어 선택부(140)는 신경망(120)이 분류할 수 있는 기지정된 다수의 클래스 중 하나의 클래스를 타겟 클래스(c)로 선택하고, 특징 추출부(121)의 다수의 레이어 중 하나의 레이어를 타겟 레이어(t)로 선택한다. 여기서 클래스/레이어 선택부(140)는 사용자 명령에 따라 타겟 클래스(c) 및 타겟 레이어(t)를 선택할 수 있다.The class/layer selection unit 140 selects one of a plurality of predefined classes that can be classified by the neural network 120 as the target class (c), and selects one of the plurality of layers of the feature extraction unit 121 . Select the layer as the target layer (t). Here, the class/layer selector 140 may select the target class c and the target layer t according to a user command.

관련성 가중 CAM 획득부(150)는 특징 추출부(121)의 다수의 레이어 중 클래스/레이어 선택부(140)에 의해 선택된 타겟 레이어(t)가 다수의 클래스 중 타겟 클래스(c)를 분류하기 위해 입력된 영상 또는 특징맵에서 어느 부분에 대해 주의하였는지를 나타내는 CAM을 획득한다. 이때 관련성 가중 CAM 획득부(150)는 기존의 Grad-CAM 또는 Gram-CAM++ 기법과 달리 선택된 클래스에 대응하는 개별 클래스 분류 결과(yc)와 선택된 레이어에서 출력되는 특징맵 사이의 기울기를 곧바로 계산하지 않는다.The relevance-weighted CAM acquisition unit 150 determines that the target layer t selected by the class/layer selection unit 140 among the multiple layers of the feature extraction unit 121 classifies the target class c among the multiple classes. A CAM indicating which part was paid attention to in the input image or feature map is acquired. At this time, the relevance-weighted CAM acquisition unit 150 does not directly calculate the gradient between the individual class classification result (y c ) corresponding to the selected class and the feature map output from the selected layer, unlike the existing Grad-CAM or Gram-CAM++ techniques. does not

대신 본 실시예의 관련성 가중 CAM 획득부(150)는 신경망(120)의 다수의 레이어 사이의 관련성(Relevance)(R)을 최종 레이어로부터 선택된 타겟 레이어(t)까지 순차적으로 전파시킨다. 즉 각 레이어의 동작을 역순으로 추적하여 각 레이어 사이의 관련성을 획득한다. 이와 같이 신경망(120)을 다수의 레이어 단위로 분할하고, 분할된 다수의 레이어 중 최종 레이어로부터 순차적으로 인접한 이전 레이어와의 관련성(R)을 순차 전파하는 기법을 여기서는 레이어별 관련성 전파(Layer-wise Relevance Propagation: 이하 LRP) 기법이라 한다.Instead, the relevance-weighted CAM obtainer 150 of the present embodiment sequentially propagates the relevance (R) between the multiple layers of the neural network 120 from the final layer to the selected target layer (t). That is, by tracing the operation of each layer in the reverse order, the relevance between each layer is obtained. In this way, a technique of dividing the neural network 120 into a plurality of layer units and sequentially propagating the relevance (R) with the previous adjacent layer from the last layer among the plurality of divided layers is described here as layer-wise relevance propagation (Layer-wise). It is called Relevance Propagation (LRP) technique.

Grad-CAM 또는 Gram-CAM++ 기법과 같이 신경망의 출력인 개별 클래스 분류 결과(yc)와 선택된 레이어 사이의 관련성을 곧바로 추정하는 기법의 경우, 부서진 그래디언트 문제로 인해 레이어의 수에 따라 추정된 레이어까지의 관련성에 대한 오차가 크게 증가하지만, 개별 클래스 분류 결과(yc)와 선택된 레이어 사이의 관련성(R)을 LRP 기법에 따라 레이어 단위로 역순으로 순차 추정하는 경우, 레이어의 개수가 증가하더라도 추정되는 관련성에 오차가 증가하는 것을 최대한 억제할 수 있다.In the case of techniques that directly estimate the relation between the individual class classification result (y c ), which is the output of a neural network, and the selected layer, such as the Grad-CAM or Gram-CAM++ technique, up to the estimated layer according to the number of layers due to the broken gradient problem. Although the error on the relevance of , increases significantly, when the relevance (R) between the individual class classification result (y c ) and the selected layer is sequentially estimated on a layer-by-layer basis according to the LRP technique, even if the number of layers increases, the estimated It is possible to suppress as much as possible an increase in the error in relevance.

그리고 관련성 가중 CAM 획득부(150)는 최종 레이어로부터 타겟 레이어(t)까지 전파되어 각 레이어로 획득된 관련성(R)에 기반하여, 타겟 레이어(t)로부터 최종 레이어까지의 각 레이어가 타겟 클래스(c)에 대한 개별 클래스 분류 결과(yc)를 도출하기 위해 수행한 영역별 기여도를 나타내는 관련성 가중치(α)를 획득한다.And the relevance-weighted CAM obtainer 150 is propagated from the final layer to the target layer (t) and based on the relevance (R) obtained with each layer, each layer from the target layer (t) to the final layer is the target class ( In order to derive the individual class classification result (y c ) for c), a relevance weight (α) indicating the contribution for each domain is obtained.

상기한 부서진 그래디언트 문제는 각 컨볼루션 레이어에 포함된 활성화 함수(activation function)를 고려하지 않는 것이 주요 오차로 발생하므로, LRP 기법을 적용하는 본 실시예에서는 레이어 단위로 관련성을 역전파하면서 각 레이어의 활성화 함수를 함께 고려함으로써, 오차의 증가를 최소화할 수 있다.Since the above-mentioned broken gradient problem occurs as a major error in not considering the activation function included in each convolutional layer, in this embodiment of applying the LRP technique, the relevance of each layer is backpropagated layer by layer. By considering the activation function together, an increase in error can be minimized.

그리고 관련성 가중 CAM 획득부(150)는 선택된 타겟 레이어(t)로부터 최종 레이어까지 각 레이어에서 획득된 특징맵(Ak c)에 대응하는 각 레이어에 대해 획득된 관련성 가중치(αk)를 가중합하여 선택된 레이어가 영상의 각 영역별로 선택된 클래스를 분류하기 위해 주의한 수준을 나타내는 관련성 가중 클래스 활성화 맵(LRelevance-CAM)을 획득한다.And the relevance weighted CAM obtainer 150 weights and sums the relevance weights (α k ) obtained for each layer corresponding to the feature map (A k c ) obtained from each layer from the selected target layer (t) to the final layer. A relevance-weighted class activation map (L Relevance-CAM ) indicating the level at which the selected layer pays attention to classify the selected class for each region of the image is acquired.

관련성 가중 CAM 획득부(150)는 관련성 전파부(151), 관련성 가중치 획득부(153) 및 관련성 가중부(155)를 포함할 수 있다.The relevance weighted CAM obtainer 150 may include a relevance propagation unit 151 , a relevance weight obtainer 153 , and a relevance weighting unit 155 .

관련성 전파부(151)는 클래스/레이어 선택부(140)에서 선택된 개별 클래스 분류 결과(yc)와 신경망(120)의 최종 레이어로부터 선택된 타겟 레이어(t)까지의 각 레이어의 가중치 및 활성화 함수를 인가받고, 인가된 개별 클래스 분류 결과(yc)를 신경망(120)의 각 레이어의 가중치 및 활성화 함수를 기반으로 레이어의 배치 순서의 역순으로 전파하여, 타겟 레이어(t)까지 인접한 레이어의 픽셀들(노드) 사이의 관련성(Rp)을 계산하여 관련성 맵(R)을 획득한다.The relevance propagation unit 151 transmits the individual class classification result (y c ) selected by the class/layer selection unit 140 and the weight and activation function of each layer from the final layer of the neural network 120 to the selected target layer (t). The received and applied individual class classification result (y c ) is propagated in the reverse order of the arrangement order of the layers based on the weight and activation function of each layer of the neural network 120, and pixels of the adjacent layer up to the target layer (t) A relevance map (R) is obtained by calculating the relevance (R p ) between (nodes).

관련성 가중치 획득부(153)는 관련성 전파부(151)에서 획득된 각 레이어에 대한 관련성 맵(Rk)의 관련성 값(Rp)들을 글로벌 평균 풀링(Global Average Pooling)하여 관련성 가중치(αk)를 획득한다.The relevance weight acquisition unit 153 performs global average pooling of the relevance values (R p ) of the relevance map (R k ) for each layer obtained by the relevance propagation unit 151 to obtain the relevance weight (α k ) to acquire

그리고 관련성 가중부(155)는 관련성 가중치 획득부(153)에서 타겟 레이어(t)로부터 최종 레이어까지 각 레이어에 대해 획득된 관련성 가중치(αk)와 신경망(120)의 각 레이어에서 출력된 특징맵(Ak c)을 원소곱하여 가중하여, 관련성 가중 특징맵을 획득하고, 관련성 가중 특징맵을 누적 합산하여 관련성 가중 클래스 활성화 맵(LRelevance-CAM)을 획득한다. 여기서 관련성 가중부(155)는 타겟 레이어(t)에서 출력된 특징맵이 3차원인 경우, 3차원의 특징맵 또한 채널 방향으로 글로벌 평균 풀링한 후 관련성 가중치를 원소곱하거나, 3차원의 특징맵에 관련성 가중치를 원소곱한 이후, 채널 방향으로 글로벌 평균 풀링하여 2차원으로 변환하여 관련성 가중 특징맵을 획득하고, 관련성 가중 특징맵을 누적 합산하여 관련성 가중 클래스 활성화 맵을 획득할 수도 있다.In addition, the relevance weighting unit 155 includes the relevance weight α k obtained for each layer from the target layer t to the final layer in the relevance weight obtaining unit 153 and the feature map output from each layer of the neural network 120 . (A k c ) is multiplied and weighted to obtain a relevance-weighted feature map, and the relevance-weighted feature map is accumulated and summed to obtain a relevance-weighted class activation map (L Relevance-CAM ). Here, when the feature map output from the target layer t is three-dimensional, the relevance weighting unit 155 performs an elemental multiplication with the relevance weights after pooling the global average of the three-dimensional feature map in the channel direction, or a three-dimensional feature map. After elemental multiplication by the relevance weight, the global average pooling in the channel direction is converted to two-dimensionally to obtain a relevance-weighted feature map, and the relevance-weighted feature map is accumulated and summed to obtain a relevance-weighted class activation map.

따라서 관련성 가중 클래스 활성화 맵은 타겟 레이어가 타겟 클래스의 특징을 추출함에 있어 입력된 영상 또는 특징맵에서 어느 영역에 주의를 기울였는지 나타내는 2차원 맵으로 획득될 수 있다. 다만 신경망(120)의 다수의 레이어 각각이 입력되는 영상 또는 특징맵에서 특징을 추출하여 특징맵을 생성하는 경우, 특징맵의 크기가 입력 영상에 대비하여 작아진다.Accordingly, the relevance-weighted class activation map may be obtained as a two-dimensional map indicating which region in the input image or feature map the target layer paid attention to when extracting the target class feature. However, when a feature map is generated by extracting features from an image or feature map to which each of a plurality of layers of the neural network 120 are input, the size of the feature map is reduced compared to the input image.

이에 관련성 가중부(155)는 각 레이어에 대해 획득된 2차원의 관련성 가중 특징맵이 동일한 2차원 크기로 변환한 후 합산할 수 있다. 또한 영상에서 레이어의 관심 영역을 정확히 확인할 수 있도록, 관련성 가중부(155)는 관련성 가중 클래스 활성화 맵의 크기를 영상 획득부(110)에서 획득한 영상의 크기로 업스케일링할 수 있다.Accordingly, the relevance weighting unit 155 may convert the two-dimensional relevance-weighted feature maps obtained for each layer to the same two-dimensional size and then add them. In addition, the relevance weighting unit 155 may upscale the size of the relevance weighting class activation map to the size of the image acquired by the image obtaining unit 110 so that the region of interest of the layer can be accurately identified in the image.

이하에서는 관련성 가중 CAM 획득부(150)의 동작을 도면을 참조하여 더욱 상세하게 설명한다. 다만 관련성 가중 CAM 획득부(150)의 동작을 설명하기 위해서는 신경망(120)의 동작을 우선 살펴볼 필요가 있다. 이에 신경망(120)의 동작을 우선 설명하고, 이후, 관련성 가중 CAM 획득부(150)의 동작을 설명한다.Hereinafter, the operation of the relevance-weighted CAM acquisition unit 150 will be described in more detail with reference to the drawings. However, in order to describe the operation of the relevance-weighted CAM acquisition unit 150 , it is necessary to first look at the operation of the neural network 120 . Accordingly, the operation of the neural network 120 will be described first, and then the operation of the relevance-weighted CAM acquisition unit 150 will be described.

도 3은 인공 신경망의 일 예에 대한 동작을 설명하기 위한 도면이고, 도 4 및 도 5는 도 3의 인공 신경망에서 컨볼루션 커널의 동작을 설명하기 위한 도면이다.3 is a diagram for explaining an operation of an example of an artificial neural network, and FIGS. 4 and 5 are diagrams for explaining an operation of a convolution kernel in the artificial neural network of FIG. 3 .

도 3은 인공 신경망의 일 예로 CNN을 도시하였으며, CNN에서 영상 인식, 음성 인식, 자연어 처리, 필기체 인식 등에 이용되는 LeNET-5를 도시하였다. 도 3에 도시된 바와 같이, LeNET-5는 32 X 32 크기의 입력 영상(Input)을 인가받아, 컨볼루션 연산 및 서브 샘플링 연산(여기서는 풀링 연산)을 반복적으로 수행하며 특징 맵(feature map)을 추출하고, 특징 맵에서 추출된 특징을 기반으로 기지정된 클래스 중 가장 가능성이 큰 클래스에 대응하는 값을 선택하도록 구성된다.3 shows CNN as an example of an artificial neural network, and shows LeNET-5 used in CNN for image recognition, voice recognition, natural language processing, handwriting recognition, and the like. As shown in FIG. 3 , LeNET-5 receives an input image having a size of 32 X 32, repeatedly performs a convolution operation and a sub-sampling operation (here, a pooling operation), and generates a feature map. and select a value corresponding to the most probable class among the predetermined classes based on the features extracted from the feature map.

여기서 특징 추출 동작(Feature extraction)은 특징 추출부(121)에 의해 수행되며, 컨볼루션 연산과 서브 샘플링 연산은 동일한 컨볼루션 레이어(C1, C2, C3)에서 수행된다. 그리고 분류 동작(Classification) 동작은 클래스 분류부(123)에 의해 수행되며, 2개의 완전 연결 레이어(Fully Connected Layer)(FC1, FC2)에서 수행된다. 즉 도 3의 신경망(120)은 5개의 레이어로 구성되며, 32 X 32 크기의 입력 영상(Input)을 인가받아 기지정된 10개의 클래스 중 적어도 하나의 클래스로 분류하여 출력한다.Here, the feature extraction operation is performed by the feature extraction unit 121, and the convolution operation and the sub-sampling operation are performed on the same convolutional layers C1, C2, and C3. And the classification operation is performed by the class classification unit 123, and is performed in two fully connected layers FC1 and FC2. That is, the neural network 120 of FIG. 3 is composed of five layers, receives an input image having a size of 32 X 32, classifies it into at least one class among 10 predefined classes, and outputs it.

그리고 다수의 레이어(C1, C2, C3, FC1, FC2) 각각은 학습에 의해 설정된 다수의 가중치를 포함하는 커널(Kernel)을 포함하여 구성된다.In addition, each of the plurality of layers C1, C2, C3, FC1, and FC2 is configured to include a kernel including a plurality of weights set by learning.

도 4에 도시된 바와 같이, 커널을 포함하는 다수의 레이어 각각은 입력 영상 또는 이전 레이어에서 획득된 특징맵을 인가받아 컨볼루션 연산과 같이 기지정된 연산을 수행하여 출력 특징맵을 출력한다.As shown in FIG. 4 , each of a plurality of layers including a kernel receives an input image or a feature map obtained from a previous layer, performs a predetermined operation such as a convolution operation, and outputs an output feature map.

이때 커널은 도 5에 도시된 바와 같이, 입력되는 영상 또는 특징맵의 각 픽셀(또는 원소)(x)을 대응하는 가중치(w)로 가중합(∑xw)하고, 기지정된 활성화 함수(φ)로 활성화하여 출력되는 특징맵의 각 원소인 특징(o)을 추출한다.At this time, as shown in FIG. 5 , the kernel weights-sum (∑xw) each pixel (or element) (x) of an input image or feature map with a corresponding weight (w), and a predetermined activation function (φ) The feature (o), which is each element of the feature map that is activated by , is extracted.

도 6은 관련성 전파부의 동작을 설명하기 위한 도면이다.6 is a diagram for explaining the operation of the relevance propagation unit.

도 6에 도시된 바와 같이, 본 실시예에서 관련성 전파부(151)는 LRP 기법에 기반하여, 관련성을 최종 레이어로부터 선택된 타겟 레이어(t)까지 레이어 단위로 역방향으로 순차적으로 역전파할 수 있다.As shown in FIG. 6 , in this embodiment, the relevance propagation unit 151 may sequentially backpropagate the relevance from the final layer to the selected target layer t in the layer by layer in the reverse direction based on the LRP technique.

LRP 기법에 따르면 제l+1 레이어의 각 노드(q)에서 인접한 제l 레이어의 노드(p)로 전파되는 관련성(Rp l)은 수학식 1에 따라 전파될 수 있다.According to the LRP technique, the association R p l propagated from each node q of the 1+1-th layer to the node p of the first layer adjacent thereto may be propagated according to Equation 1.

Figure 112021034060651-pat00003
Figure 112021034060651-pat00003

여기서 Rp l 은 제l 레이어의 제p 노드의 관련성 값(Relevance value), Rq l+1 은 제l+1 레이어의 제q 노드의 관련성 값을 나타내고, ap l 은 신경망의 제l 레이어의 제p 노드의 활성화값(activation value)을 나타내며, Wpq (l,l+1) 는 제l 레이어의 제p 노드와 제l+1 레이어의 제q 노드 사이의 가중치를 나타낸다. 그리고 m는 제l 레이어의 전체 노드에 대한 인덱스를 나타낸다.Here, R p l represents the relevance value of the p-th node of the first layer, R q l+1 represents the relevance value of the q-th node of the 1+1 layer, and a p l represents the first layer of the neural network. represents the activation value of the p-th node of , and W pq (l,l+1) represents the weight between the p-th node of the first layer and the q-th node of the 1+1 layer. And m represents an index for all nodes of the first layer.

수학식 1은 제l+1 레이어의 제q 노드의 값을 제l 레이어의 제p 노드의 값으로 분해할 수 있도록 한다. 수학식 1에서 분자항은 제l 레이어의 제p 노드와 제l+1 레이어의 제q 노드 사이의 가중치로 고려될 수 있으며, 분모항은 제l+1 레이어의 제q 노드와 연결된 제l 레이어의 모든 노드와의 가중치와 활성화 값을 곱한 값의 합으로 제l+1 레이어의 관련성(Rq l+1)을 분배하기 위한 정규화 항목(normalize term)으로 볼 수 있다.Equation 1 allows the value of the qth node of the 1+1th layer to be decomposed into the value of the pth node of the 1st layer. In Equation 1, the numerator term may be considered as a weight between the p-th node of the first layer and the q-th node of the 1+1 layer, and the denominator term is the first layer connected to the q-th node of the 1+1 layer. It can be seen as a normalization term for distributing the relevance (R q l+1 ) of the 1+1 layer as the sum of the weights and activation values of all nodes of .

이에 초기 관련성이 설정되면, 수학식 1에 따라 설정된 초기 관련성을 타겟 레이어(t)까지 이전 레이어로 순차적으로 전파하여, 타겟 레이어(t)에 대한 관련성을 모두 계산함으로써 관련성 맵(R)을 획득할 수 있다. 관련성 전파부(151)는 신경망(120)의 클래스 분류 결과(y) 중 선택된 타겟 클래스(c)에 대응하는 개별 클래스 분류 결과(yc)를 타겟 클래스에 대한 초기 관련성(Rc)으로 설정할 수 있다.When the initial relevance is set, the relevance map R is obtained by sequentially propagating the initial relevance set according to Equation 1 to the previous layer up to the target layer t, and calculating all relevance to the target layer t. can The relevance propagation unit 151 may set the individual class classification result (y c ) corresponding to the selected target class (c) among the class classification results (y) of the neural network 120 as the initial relevance (R c ) to the target class. have.

관련성 가중치 획득부(153)는 관련성 전파부(151)가 타겟 클래스(c)에 대해 각 레이어에 대해 획득한 관련성 맵(Rk c)을 수학식 2에 따라 전역 평균 풀링하여 각 레이어(k)에서 출력되는 특징맵(Ak c)들 각각에 대한 관련성 가중치(αk c)를 계산한다.The relevance weight obtaining unit 153 pools the global average of the relevance map R k c obtained by the relevance propagation unit 151 for each layer with respect to the target class c according to Equation 2 to obtain each layer (k). Calculate the relevance weight (α k c ) for each of the feature maps (A k c ) output from .

Figure 112021034060651-pat00004
Figure 112021034060651-pat00004

여기서 k 는 레이어 식별자를 나타내고, x, y는 제k 레이어에 대한 관련성 맵(Rk c)의 노드 좌표를 나타낸다. Here, k denotes a layer identifier, and x and y denote node coordinates of the relevance map (R k c ) for the k-th layer.

수학식 2에 따라 타겟 클래스(c)에 대한 각 레이어(k)의 관련성 가중치(αk c)가 계산되면, 관련성 가중부(155)는 계산된 관련성 가중치(αk c)를 대응하는 각 레이어(k)에서 출력된 특징맵(Ak c)에 가중하여 관련성 가중 특징맵(αk c Ak c)을 획득하고, 획득된 관련성 가중 특징맵(αk c Ak c)을 합산하여 타겟 클래스(c) 및 타겟 레이어(k)에 대한 가중 클래스 활성화 맵(LRelevance-CAM)을 획득한다.When the relevance weight α k c of each layer k with respect to the target class c is calculated according to Equation 2, the relevance weighting unit 155 applies the calculated relevance weight α k c to each layer corresponding to A relevance-weighted feature map (α k c A k c ) is obtained by weighting the feature map (A k c ) output in (k), and the obtained relevance-weighted feature map (α k c A k c ) is summed to target the target. Obtain a weighted class activation map (L Relevance-CAM ) for class (c) and target layer (k).

관련성 가중부(155)는 수학식 3에 따라 가중치(αk c)와 특징맵(Ak c)으로부터 가중 클래스 활성화 맵(LRelevance-CAM)을 획득할 수 있다.The relevance weighting unit 155 may obtain a weighted class activation map L Relevance-CAM from the weight α k c and the feature map A k c according to Equation 3 .

Figure 112021034060651-pat00005
Figure 112021034060651-pat00005

그리고 관련성 가중부(155)는 수학식 3에 따라 획득된 관련성 가중 클래스 활성화 맵(LRelevance-CAM)의 크기를 신경망(120)에 입력되는 영상의 크기로 업스케일링하여 출력할 수 있다.In addition, the relevance weighting unit 155 may upscale the size of the relevance weighted class activation map L Relevance-CAM obtained according to Equation 3 to the size of the image input to the neural network 120 and output it.

도 7 및 도 8은 본 실시예에 따른 클래스 활성화 맵 생성 장치의 성능을 나타낸다.7 and 8 show the performance of the class activation map generating apparatus according to the present embodiment.

도 7 내지 도 8에서는 본 실시예에 따른 클래스 활성화 맵 생성 장치의 성능을 비교하기 위해, 본 실시예에 따라 획득되는 관련성 가중 클래스 활성화 맵(Relevance-CAM)과 기존의 클래스 활성화 맵 생성 기법인 Grad-CAM, Grad-CAM++ 및 Score-CAM에 의해 획득된 클래스 활성화 맵을 함께 도시하였다.7 to 8, in order to compare the performance of the apparatus for generating a class activation map according to the present embodiment, the relevance-weighted class activation map (Relevance-CAM) obtained according to the present embodiment and the existing class activation map generation technique, Grad Class activation maps obtained by -CAM, Grad-CAM++ and Score-CAM are shown together.

그리고 도 7에서는 신경망을 구성하는 4개의 레이어(layer1 ~ layer4) 각각에 대한 CAM을 도시하였다. 도 7을 살펴보면, 최종 레이어인 제4 레이어(layer4)에 대한 CAM은 모두 유사하게 입력 영상에서 나비가 포함된 영역에 대해 주목하고 있음을 알 수 있다. 그러나 기존의 클래스 활성화 맵 생성 기법인 Grad-CAM, Grad-CAM++ 및 Score-CAM에서는 제2 레이어(layer2)에 대한 CAM에서 이미 나비 영역이 아닌 영역에도 상당부분 주목하고 있을 뿐만 아니라, 나비 영역에서도 일부만을 주목하고 있음을 알 수 있다. 이는 실제 제2 레이어(layer2)가 주목한 영역을 나타내고 있는 것일 수도 있으나, 기존의 클래스 활성화 맵 생성 기법의 오류로 인해 제2 레이어(layer2)가 주목한 영역을 정확하게 추출하지 못해서 발생한 문제일 수도 있다.In addition, in FIG. 7 , the CAM for each of the four layers (layer1 to layer4) constituting the neural network is shown. Referring to FIG. 7 , it can be seen that all of the CAMs for the fourth layer (layer4), which are the final layers, similarly pay attention to the region including the butterfly in the input image. However, in the existing class activation map generation techniques, Grad-CAM, Grad-CAM++, and Score-CAM, the CAM for the second layer (layer2) already pays a lot of attention to the non-butterfly region as well as only a part in the butterfly region. It can be seen that attention is paid to This may actually indicate the area that the second layer (layer2) paid attention to, but it may be a problem caused by not accurately extracting the area of interest by the second layer (layer2) due to an error in the existing class activation map generation technique. .

그에 비해 본 실시예에 따른 클래스 활성화 맵 생성 장치가 획득한 CAM의 경우, 제2 레이어(layer2) 뿐만 아니라 제1 레이어(layer1)에서 이미 나비 영역이 정확하게 도출됨을 알 수 있다. 이로서 제1 레이어(layer1)가 이미 나비 영역을 정확하게 주목하였음에도 기존의 클래스 활성화 맵 생성 기법이 이를 제대로 분석하지 못한 것임을 알 수 있다.In contrast, in the case of the CAM obtained by the apparatus for generating a class activation map according to the present embodiment, it can be seen that the butterfly region is already accurately derived from the first layer as well as the second layer (layer2). As a result, it can be seen that even though the first layer (layer1) has already paid attention to the butterfly region accurately, the existing class activation map generation method fails to properly analyze it.

한편, 도 8은 다양한 객체가 포함된 영상에 대한 레이어별 CAM을 나타낸다. 도 8에서도 기존의 클래스 활성화 맵 생성 기법인 Grad-CAM, Grad-CAM++ 및 Score-CAM에 의해 획득된 CAM과 비교하여 도시하였다. 도 8을 참조하면, 본 실시예에 따른 클래스 활성화 맵 생성 장치는 다양한 객체가 포함된 영상, 특히 왼쪽 아래와 같이 다수의 객체가 포함된 영상에서도 각 레이어가 주목한 영역을 나타내는 CAM을 정확하게 추출할 수 있다.Meanwhile, FIG. 8 shows CAM for each layer for an image including various objects. In FIG. 8, it is shown in comparison with the CAM obtained by the existing class activation map generation techniques, Grad-CAM, Grad-CAM++, and Score-CAM. Referring to FIG. 8 , the apparatus for generating a class activation map according to the present embodiment can accurately extract a CAM indicating a region focused by each layer from an image including various objects, particularly from an image including a plurality of objects as shown below on the left. have.

도 9는 본 발명의 일 실시예에 따른 클래스 활성화 맵 생성 방법을 나타낸다.9 illustrates a method for generating a class activation map according to an embodiment of the present invention.

도 1 내지 도 6을 참조하여, 본 실시예에 따른 클래스 활성화 맵 생성 방법을 설명하면, 우선 신경망에서 분석하고자 하는 타겟 클래스(c) 및 타겟 레이어(t)를 선택한다(S10). 그리고 타겟 클래스(c)가 포함된 영상을 획득한다(S20). 영상이 획득되면, 신경망(120)의 특징 추출부(121)가 획득된 영상을 인가받고, 미리 학습된 방식에 따라 특징을 추출하여 특징맵(Ak c)을 획득한다(S30). 이때 신경망(120)은 다수의 레이어를 포함하여 구성될 수 있으며, 다수의 레이어 각각은 영상 또는 이전 레이어에서 출력되는 특징맵을 인가받아 특징을 추출하여 각 레이어별 특징맵(Ak C)을 획득한다. 신경망(120)은 다수의 특징맵(A1 C, A2 C, …, An C)을 획득할 수 있다.A method of generating a class activation map according to the present embodiment will be described with reference to FIGS. 1 to 6 . First, a target class c and a target layer t to be analyzed in the neural network are selected ( S10 ). Then, an image including the target class (c) is acquired (S20). When the image is acquired, the feature extraction unit 121 of the neural network 120 receives the acquired image, extracts features according to a pre-learned method, and obtains a feature map A k c (S30). At this time, the neural network 120 may be configured to include a plurality of layers, and each of the plurality of layers receives a feature map output from an image or a previous layer and extracts features to obtain a feature map (A k C ) for each layer. do. The neural network 120 may acquire a plurality of feature maps A 1 C , A 2 C , ..., A n C .

각 레이어별 특징맵(Ak C)이 획득되면, 클래스 분류부(123)가 미리 학습된 방식에 따라 최종 특징맵(An C)이 기지정된 다수의 클래스 각각에 대응하는 수준을 계산하여 다수의 개별 클래스 분류 결과(yc)로 구성된 클래스 분류 결과(y)를 획득한다(S40).When the feature map (A k C ) for each layer is obtained, the class classifier 123 calculates the level corresponding to each of the plurality of classes in which the final feature map (A n C ) is predetermined according to a previously learned method. A class classification result (y) composed of an individual class classification result (y c ) is obtained ( S40 ).

이후 다수의 개별 클래스 분류 결과(yc) 중 선택된 클래스에 대응하는 개별 클래스 분류 결과(yc)를 초기 관련성(Rc)으로 설정한다(S50). 그리고 설정된 초기 관련성(Rc)을 신경망(120)의 최종 레이어로부터 역순으로 순차적으로 역전파하여, 레이어별 관련성 맵(Rk c)을 획득한다(S60).Thereafter, the individual class classification result (y c ) corresponding to the selected class among the plurality of individual class classification results (y c ) is set as the initial relevance (R c ) ( S50 ). Then, the set initial relevance (R c ) is sequentially back-propagated from the final layer of the neural network 120 in reverse order to obtain a relevance map (R k c ) for each layer ( S60 ).

관련성이 타겟 레이어(t)까지 전파되었는지 판별한다(S70). 만일 관련성이 타겟 레이어(t)까지 전파된 것으로 판별되면, 각 레이어에 대한 관련성 맵(Rk c) 각각을 전역 평균 풀링하여, 각 레이어에 대한 관련성 가중치(αk c)를 획득한다(S80).It is determined whether the association has propagated to the target layer t (S70). If it is determined that the relevance has propagated to the target layer t, the global average pools each relevance map R k c for each layer to obtain a relevance weight α k c for each layer (S80) .

각 레이어에 대한 관련성 가중치(αk c)가 획득되면, 레이어별 관련성 가중치(αk c)를 대응하는 레이어에서 출력된 특징맵(Ak c)과 원소곱하여 가중하고, 특징맵(Ak c)의 채널 방향으로 전역 평균 풀링하여 2차원으로 변환하여 각 레이어에 대한 관련성 가중 특징맵(αk c Ak c))을 획득하고, 각 레이어에 대한 관련성 가중 특징맵(αk c Ak c))을 합하여, 타겟 클래스(t) 및 타겟 레이어(k)에 대한 관련성 가중 클래스 활성맵(LRelevance-CAM)을 획득할 수 있다. 여기서 특징맵(Ak c)의 채널 방향으로 전역 평균 풀링하는 것은 획득된 영상과 동일하게 2차원의 관련성 가중 클래스 활성맵(LRelevance-CAM)을 획득하기 위해서이며, 각 레이어에 대한 관련성 가중 특징맵(αk c Ak c))는 동일한 2차원 크기로 변형될 수 있다.When the relevance weight (α k c ) for each layer is obtained, the relevance weight (α k c ) for each layer is elementally multiplied with the feature map (A k c ) output from the corresponding layer and weighted, and the feature map (A k c ) is weighted. ) by pooling the global average in the channel direction to obtain a relevance-weighted feature map (α k c A k c ) for each layer by transforming it into two dimensions, and a relevance-weighted feature map (α k c A k c ) for each layer. )), it is possible to obtain a relevance weighted class activity map (L Relevance-CAM ) for the target class (t) and the target layer (k). Here, the global average pooling in the channel direction of the feature map (A k c ) is to obtain a two-dimensional relevance-weighted class activity map (L Relevance-CAM ) identical to the obtained image, and the relevance-weighted feature for each layer The map α k c A k c ) can be transformed to the same two-dimensional size.

추가적으로 획득된 관련성 가중 클래스 활성맵(LRelevance-CAM)의 크기가 획득된 영상과 상이한 경우, 관련성 가중 클래스 활성맵(LRelevance-CAM)의 크기가 영상과 동일해지도록 업스케일링할 수 있다.When the size of the additionally acquired relevance-weighted class activity map (L Relevance-CAM ) is different from the acquired image, the size of the relevance-weighted class activity map (L Relevance-CAM ) may be upscaled to be the same as the image.

본 발명에 따른 방법은 컴퓨터에서 실행시키기 위한 매체에 저장된 컴퓨터 프로그램으로 구현될 수 있다. 여기서 컴퓨터 판독가능 매체는 컴퓨터에 의해 액세스 될 수 있는 임의의 가용 매체일 수 있고, 또한 컴퓨터 저장 매체를 모두 포함할 수 있다. 컴퓨터 저장 매체는 컴퓨터 판독가능 명령어, 데이터 구조, 프로그램 모듈 또는 기타 데이터와 같은 정보의 저장을 위한 임의의 방법 또는 기술로 구현된 휘발성 및 비휘발성, 분리형 및 비분리형 매체를 모두 포함하며, ROM(판독 전용 메모리), RAM(랜덤 액세스 메모리), CD(컴팩트 디스크)-ROM, DVD(디지털 비디오 디스크)-ROM, 자기 테이프, 플로피 디스크, 광데이터 저장장치 등을 포함할 수 있다.The method according to the present invention may be implemented as a computer program stored in a medium for execution by a computer. Here, the computer-readable medium may be any available medium that can be accessed by a computer, and may include all computer storage media. Computer storage media includes both volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, and read dedicated memory), RAM (Random Access Memory), CD (Compact Disk)-ROM, DVD (Digital Video Disk)-ROM, magnetic tape, floppy disk, optical data storage, and the like.

본 발명은 도면에 도시된 실시예를 참고로 설명되었으나 이는 예시적인 것에 불과하며, 본 기술 분야의 통상의 지식을 가진 자라면 이로부터 다양한 변형 및 균등한 타 실시예가 가능하다는 점을 이해할 것이다.Although the present invention has been described with reference to the embodiment shown in the drawings, which is only exemplary, those skilled in the art will understand that various modifications and equivalent other embodiments are possible therefrom.

따라서, 본 발명의 진정한 기술적 보호 범위는 첨부된 청구범위의 기술적 사상에 의해 정해져야 할 것이다.Accordingly, the true technical protection scope of the present invention should be defined by the technical spirit of the appended claims.

110: 영상 획득부 120: 신경망
121: 특징 추출부 123: 클래스 분류부
130: 후처리부 140: 클래스/레이어 선택부
150: 관련성 가중 CAM 획득부 151: 관련성 전파부
153: 관련성 가중치 획득부 155: 관련성 가중부
110: image acquisition unit 120: neural network
121: feature extraction unit 123: class classification unit
130: post-processing unit 140: class / layer selection unit
150: Relevance weighted CAM acquisition unit 151: Relevance propagation unit
153: relevance weighting unit 155: relevance weighting unit

Claims (16)

다수의 레이어를 포함하는 각각 입력되는 영상 또는 이전 레이어에서 출력된 특징맵을 인가받아 미리 학습된 방식에 따라 특징을 추출하여 특징맵을 출력하고, 최종 출력된 특징맵을 미리 학습된 방식에 따라 분류하여 기지정된 다수의 클래스에 대응하는 다수의 개별 클래스 분류 결과를 획득하는 신경망;
상기 다수의 클래스 중 하나의 클래스를 타겟 클래스로 선택하고, 상기 다수의 레이어 중 하나의 레이어를 타겟 레이어로 선택하는 클래스/레이어 선택부; 및
상기 신경망의 최종 레이어에서 출력되는 상기 다수의 개별 클래스 분류 결과 중 상기 타겟 클래스에 대응하는 개별 클래스 분류 결과를 초기 관련성으로 설정하고, 설정된 초기 관련성을 상기 최종 레이어로부터 상기 타겟 레이어까지 각 레이어의 가중치 및 활성화 함수에 따라 인접한 이전 레이어로 역전파하여 각 레이어에 대한 관련성 가중치를 획득하며, 획득된 관련성 가중치를 대응하는 레이어에서 출력된 특징맵에 가중합하여 관련성 가중 클래스 활성화 맵을 획득하는 관련성 가중 CAM 획득부를 포함하는 클래스 활성화 맵 생성 장치.
Each input image including a plurality of layers or a feature map output from a previous layer is received, features are extracted according to a pre-learned method, a feature map is output, and the finally output feature map is classified according to a pre-learned method a neural network to obtain a plurality of individual class classification results corresponding to a plurality of predetermined classes;
a class/layer selection unit that selects one of the plurality of classes as a target class and selects one of the plurality of layers as a target layer; and
Among the plurality of individual class classification results output from the final layer of the neural network, an individual class classification result corresponding to the target class is set as an initial relevance, and the set initial relevance is determined by the weight of each layer from the final layer to the target layer and A relevance-weighted CAM acquisition unit that acquires relevance weights for each layer by backpropagating to an adjacent previous layer according to the activation function, and weights and sums the obtained relevance weights to a feature map output from the corresponding layer to obtain a relevance-weighted class activation map Containing class activation map generator.
제1항에 있어서, 상기 관련성 가중 CAM 획득부는
상기 초기 관련성을 설정하고, 상기 초기 관련성을 레이어별 관련성 전파(Layer-wise Relevance Propagation: 이하 LRP) 기법에 따라 순차적으로 이전 레이어로 전파하여, 각 레이어에 대한 관련성 맵을 획득하는 관련성 전파부;
각 레이어에 대한 상기 관련성 맵 각각을 글로벌 평균 풀링하여 관련성 가중치를 획득하는 관련성 가중치 획득부; 및
각 레이어에 대한 상기 관련성 가중치를 대응하는 레이어에서 출력된 특징맵에 가중합하여 상기 관련성 가중 클래스 활성화 맵을 획득하는 관련성 가중부를 포함하는 클래스 활성화 맵 생성 장치.
The method of claim 1, wherein the relevance-weighted CAM acquisition unit
a relevance propagation unit that sets the initial relevance and sequentially propagates the initial relevance to a previous layer according to a layer-wise relevance propagation (LRP) technique to obtain a relevance map for each layer;
a relevance weight obtaining unit that obtains relevance weights by pooling the global average of each relevance map for each layer; and
and a relevance weighting unit configured to obtain the relevance weighted class activation map by weighting the relevance weight for each layer to a feature map output from a corresponding layer.
제2항에 있어서, 상기 관련성 전파부는
다수의 레이어 중 제l+1 레이어의 각 노드(q)에서 인접한 제l 레이어의 노드(p)로 전파되는 관련성(Rp l)을 수학식
Figure 112021034060651-pat00006

(여기서 ap l 은 신경망의 제l 레이어의 제p 노드의 활성화값을 나타내며, Wpq (l,l+1) 는 제l 레이어의 제p 노드와 제l+1 레이어의 제q 노드 사이의 가중치를 나타내며, m는 제l 레이어의 전체 노드에 대한 인덱스를 나타낸다.)
에 따라 계산하여 전파하는 클래스 활성화 맵 생성 장치.
The method of claim 2, wherein the relevance propagation unit
Relevance (R p l ) propagated from each node (q) of the 1+1-th layer among the plurality of layers to the node (p) of the first layer adjacent to the equation
Figure 112021034060651-pat00006

(Here, a p l represents the activation value of the p-th node of the first layer of the neural network, and W pq (l,l+1) is between the p-th node of the first layer and the q-th node of the 1+1 layer. represents the weight, and m represents the index for all nodes of the first layer.)
Class activation map generator that computes and propagates according to
제3항에 있어서, 상기 관련성 가중치 획득부는
타겟 클래스(c)에 대한 레이어별 관련성 맵(Rk c)으로부터 각 레이어에 대한 상기 관련성 가중치(αk c)를 수학식
Figure 112021034060651-pat00007

(여기서 k 는 레이어 식별자를 나타내고, x, y는 제k 레이어에 대한 관련성 맵(Rk c)의 노드 좌표를 나타낸다.)
에 따라 획득하는 클래스 활성화 맵 생성 장치.
The method of claim 3, wherein the relevance weight obtaining unit
Equation for the relevance weight (α k c ) for each layer from the relevance map (R k c ) for each layer for the target class (c)
Figure 112021034060651-pat00007

(Here, k indicates a layer identifier, and x and y indicate node coordinates of the relevance map (R k c ) for the k-th layer.)
Class activation map generation device to obtain according to.
제4항에 있어서, 상기 관련성 가중부는
각 레이어에 대한 상기 관련성 가중치를 대응하는 각 레이어에서 출력된 특징맵과 원소 곱하고, 채널 방향에서 전역 평균 풀링하여 2차원으로 변환하여 각 레이어에 대한 관련성 가중 특징맵을 획득하며, 획득된 각 레이어에 대한 관련성 가중 특징맵을 누적 합산하여 상기 관련성 가중 클래스 활성화 맵을 획득하는 클래스 활성화 맵 생성 장치.
The method of claim 4, wherein the relevance weighting unit
The relevance weight for each layer is elementally multiplied with the feature map output from each layer corresponding to it, the global average is pooled in the channel direction and converted into two dimensions to obtain a relevance-weighted feature map for each layer, A class activation map generating apparatus for acquiring the relevance-weighted class activation map by accumulating and summing the relevance-weighted feature maps for
제5항에 있어서, 상기 관련성 가중부는
각 레이어에 대한 관련성 가중 특징맵을 동일한 크기로 변환한 후 누적 합산하는 클래스 활성화 맵 생성 장치.
The method of claim 5, wherein the relevance weighting unit
A class activation map generator that converts the relevance-weighted feature map for each layer to the same size and then accumulates them.
제4항에 있어서, 상기 관련성 가중부는
상기 관련성 가중 클래스 활성화 맵의 크기를 획득된 영상의 크기로 업스케일링하는 클래스 활성화 맵 생성 장치.
The method of claim 4, wherein the relevance weighting unit
A class activation map generating apparatus for upscaling the size of the relevance-weighted class activation map to the size of an acquired image.
제1항에 있어서, 상기 신경망은
각각 입력되는 영상 또는 이전 레이어에서 출력된 특징맵을 인가받아 미리 학습된 방식에 따라 특징을 추출하여 특징맵을 출력하는 다수의 레이어를 포함하는 특징 추출부; 및
상기 특징 추출부에서 최종 출력된 특징맵을 인가받고, 미리 학습된 방식에 따라 최종 출력된 특징맵이 기지정된 다수의 클래스 각각에 대응하는 수준을 계산하여 상기 다수의 개별 클래스 분류 결과를 획득하는 클래스 분류부를 포함하는 클래스 활성화 맵 생성 장치.
The method of claim 1, wherein the neural network
a feature extractor including a plurality of layers for receiving each input image or a feature map output from a previous layer, extracting features according to a pre-learned method, and outputting a feature map; and
A class that receives the feature map finally output from the feature extraction unit, calculates the level corresponding to each of a plurality of classes for which the feature map finally output according to a pre-learned method, and obtains the plurality of individual class classification results A class activation map generating device including a classifier.
다수의 레이어를 포함하는 각각 입력되는 영상 또는 이전 레이어에서 출력된 특징맵을 인가받아 미리 학습된 방식에 따라 특징을 추출하여 특징맵을 출력하고, 최종 출력된 특징맵을 미리 학습된 방식에 따라 분류하여 기지정된 다수의 클래스에 대응하는 다수의 개별 클래스 분류 결과를 획득하는 신경망을 설명하기 위한 클래스 활성화 맵을 생성하는 클래스 활성화 맵 생성 방법에 있어서,
상기 다수의 클래스 중 하나의 클래스를 타겟 클래스로 선택하고, 상기 다수의 레이어 중 하나의 레이어를 타겟 레이어로 선택하는 단계;
상기 신경망에 영상을 입력하여 다수의 레이어를 포함하는 각각 입력되는 영상 또는 이전 레이어에서 출력된 특징맵을 인가받아 미리 학습된 방식에 따라 특징을 추출하여 특징맵을 출력하고, 최종 출력된 특징맵을 미리 학습된 방식에 따라 분류하여 기지정된 다수의 클래스에 대응하는 다수의 개별 클래스 분류 결과를 획득하는 단계; 및
상기 신경망의 최종 레이어에서 출력되는 상기 다수의 개별 클래스 분류 결과 중 상기 타겟 클래스에 대응하는 개별 클래스 분류 결과를 초기 관련성으로 설정하고, 설정된 초기 관련성을 상기 최종 레이어로부터 상기 타겟 레이어까지 각 레이어의 가중치 및 활성화 함수에 따라 인접한 이전 레이어로 역전파하여 각 레이어에 대한 관련성 가중치를 획득하며, 획득된 관련성 가중치를 대응하는 레이어에서 출력된 특징맵에 가중합하여 관련성 가중 클래스 활성화 맵을 획득하는 단계를 포함하는 클래스 활성화 맵 생성 방법.
Each input image including a plurality of layers or a feature map output from a previous layer is received, features are extracted according to a pre-learned method, a feature map is output, and the finally output feature map is classified according to a pre-learned method In the class activation map generation method for generating a class activation map to describe a neural network that obtains a plurality of individual class classification results corresponding to a plurality of predetermined classes,
selecting one of the plurality of classes as a target class and selecting one of the plurality of layers as a target layer;
An image is input to the neural network, each input image including a plurality of layers or a feature map output from a previous layer is applied, features are extracted according to a pre-learned method, and a feature map is output, and the final output feature map is applied. obtaining a plurality of individual class classification results corresponding to a plurality of predetermined classes by classifying according to a pre-learned method; and
Among the plurality of individual class classification results output from the final layer of the neural network, an individual class classification result corresponding to the target class is set as an initial relevance, and the set initial relevance is determined by the weight of each layer from the final layer to the target layer and A class comprising the step of obtaining a relevance weight for each layer by backpropagating to an adjacent previous layer according to the activation function, and weighting the obtained relevance weight to a feature map output from the corresponding layer to obtain a relevance weighted class activation map How to create an activation map.
제9항에 있어서, 상기 관련성 가중 클래스 활성화 맵을 획득하는 단계는
상기 초기 관련성을 설정하고, 상기 초기 관련성을 레이어별 관련성 전파(Layer-wise Relevance Propagation: 이하 LRP) 기법에 따라 순차적으로 이전 레이어로 전파하여, 각 레이어에 대한 관련성 맵을 획득하는 단계;
각 레이어에 대한 상기 관련성 맵 각각을 글로벌 평균 풀링하여 관련성 가중치를 획득하는 단계; 및
상기 관련성 가중 클래스 활성화 맵을 획득하기 위해 각 레이어에 대한 상기 관련성 가중치를 대응하는 레이어에서 출력된 특징맵에 가중합하는 단계를 포함하는 클래스 활성화 맵 생성 방법.
10. The method of claim 9, wherein obtaining the relevance weighted class activation map comprises:
obtaining a relevance map for each layer by setting the initial relevance and sequentially propagating the initial relevance to a previous layer according to a layer-wise relevance propagation (LRP) technique;
obtaining a relevance weight by pooling the global average of each of the relevance maps for each layer; and
and weighting the relevance weight for each layer to a feature map output from a corresponding layer to obtain the relevance-weighted class activation map.
제10항에 있어서, 상기 관련성 맵을 획득하는 단계는
다수의 레이어 중 제l+1 레이어의 각 노드(q)에서 인접한 제l 레이어의 노드(p)로 전파되는 관련성(Rp l)을 수학식
Figure 112021034060651-pat00008

(여기서 ap l 은 신경망의 제l 레이어의 제p 노드의 활성화값을 나타내며, Wpq (l,l+1) 는 제l 레이어의 제p 노드와 제l+1 레이어의 제q 노드 사이의 가중치를 나타내며, m는 제l 레이어의 전체 노드에 대한 인덱스를 나타낸다.)
에 따라 계산하여 전파하는 클래스 활성화 맵 생성 방법.
The method of claim 10, wherein obtaining the relevance map comprises:
Relevance (R p l ) propagated from each node (q) of the 1+1-th layer among the plurality of layers to the node (p) of the first layer adjacent to the equation
Figure 112021034060651-pat00008

(Here, a p l represents the activation value of the p-th node of the first layer of the neural network, and W pq (l,l+1) is between the p-th node of the first layer and the q-th node of the 1+1 layer. represents the weight, and m represents the index for all nodes of the first layer.)
How to create a class activation map that computes and propagates according to .
제11항에 있어서, 상기 관련성 가중치를 획득하는 단계는
타겟 클래스(c)에 대한 레이어별 관련성 맵(Rk c)으로부터 각 레이어에 대한 상기 관련성 가중치(αk c)를 수학식
Figure 112021034060651-pat00009

(여기서 k 는 레이어 식별자를 나타내고, x, y는 제k 레이어에 대한 관련성 맵(Rk c)의 노드 좌표를 나타낸다.)
에 따라 획득하는 클래스 활성화 맵 생성 방법.
12. The method of claim 11, wherein obtaining the relevance weight comprises:
Equation for the relevance weight (α k c ) for each layer from the relevance map (R k c ) for each layer for the target class (c)
Figure 112021034060651-pat00009

(Here, k indicates a layer identifier, and x and y indicate node coordinates of the relevance map (R k c ) for the k-th layer.)
How to create a class activation map to acquire according to.
제12항에 있어서, 상기 특징맵에 가중합하는 단계는
각 레이어에 대한 상기 관련성 가중치를 대응하는 각 레이어에서 출력된 특징맵과 원소곱하고, 채널 방향에서 전역 평균 풀링하여 2차원으로 변환하여 각 레이어에 대한 관련성 가중 특징맵을 획득하는 단계; 및
상기 관련성 가중 클래스 활성화 맵을 각 레이어에 대한 관련성 가중 특징맵을 누적 합산하여 획득하는 단계를 포함하는 클래스 활성화 맵 생성 방법.
13. The method of claim 12, wherein the weighting of the feature map comprises:
obtaining a relevance-weighted feature map for each layer by elementally multiplying the relevance weight for each layer with a feature map output from each corresponding layer, pooling the global average in the channel direction, and transforming it into two dimensions; and
and acquiring the relevance-weighted class activation map by accumulating and summing relevance-weighted feature maps for each layer.
제13항에 있어서, 상기 특징맵에 가중합하는 단계는
상기 누적 합산하여 획득하는 단계 이전, 각 레이어에 대한 관련성 가중 특징맵을 동일한 크기로 변환하는 단계를 더 포함하는 클래스 활성화 맵 생성 방법.
14. The method of claim 13, wherein the weighting of the feature map comprises:
The method of generating a class activation map further comprising the step of converting the relevance-weighted feature map for each layer to the same size before the step of acquiring the cumulative summation step.
제14항에 있어서, 상기 특징맵에 가중합하는 단계는
상기 누적 합산하여 획득하는 단계 이후, 상기 관련성 가중 클래스 활성화 맵의 크기를 획득된 영상의 크기로 업스케일링하는 단계를 더 포함하는 클래스 활성화 맵 생성 방법.
15. The method of claim 14, wherein the step of weighting the feature map
and upscaling the size of the relevance-weighted class activation map to the size of the obtained image after the cumulative summation and acquisition step.
제9항에 있어서, 상기 다수의 개별 클래스 분류 결과를 획득하는 단계는
각각 입력되는 영상 또는 이전 레이어에서 출력된 특징맵을 인가받아 미리 학습된 방식에 따라 특징을 추출하여 각 레이어에 대응하는 다수의 특징맵을 출력하는 단계; 및
최종 출력된 특징맵을 인가받고, 미리 학습된 방식에 따라 최종 출력된 특징맵이 기지정된 다수의 클래스 각각에 대응하는 수준을 계산하여 상기 다수의 개별 클래스 분류 결과를 획득하는 단계를 포함하는 클래스 활성화 맵 생성 방법.
The method of claim 9, wherein the obtaining of the plurality of individual class classification results comprises:
receiving each input image or a feature map output from a previous layer, extracting features according to a pre-learned method, and outputting a plurality of feature maps corresponding to each layer; and
Class activation comprising the step of receiving the finally output feature map and calculating a level corresponding to each of a plurality of classes for which the final output feature map is predetermined according to a pre-learned method to obtain the plurality of individual class classification results How to create a map.
KR1020210037408A 2021-03-23 2021-03-23 Apparatus and Method for Generating Relevance-weighted Class Activation Map for Explaining Artificial Neural Networks KR102446792B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020210037408A KR102446792B1 (en) 2021-03-23 2021-03-23 Apparatus and Method for Generating Relevance-weighted Class Activation Map for Explaining Artificial Neural Networks

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020210037408A KR102446792B1 (en) 2021-03-23 2021-03-23 Apparatus and Method for Generating Relevance-weighted Class Activation Map for Explaining Artificial Neural Networks

Publications (1)

Publication Number Publication Date
KR102446792B1 true KR102446792B1 (en) 2022-09-22

Family

ID=83445649

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020210037408A KR102446792B1 (en) 2021-03-23 2021-03-23 Apparatus and Method for Generating Relevance-weighted Class Activation Map for Explaining Artificial Neural Networks

Country Status (1)

Country Link
KR (1) KR102446792B1 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20170134508A (en) * 2015-03-20 2017-12-06 프라운호퍼 게젤샤프트 쭈르 푀르데룽 데어 안겐반텐 포르슝 에. 베. Relevance Score Assignment to Artificial Neural Networks
KR20210002018A (en) 2019-06-28 2021-01-06 로베르트 보쉬 게엠베하 Method for estimating a global uncertainty of a neural network

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20170134508A (en) * 2015-03-20 2017-12-06 프라운호퍼 게젤샤프트 쭈르 푀르데룽 데어 안겐반텐 포르슝 에. 베. Relevance Score Assignment to Artificial Neural Networks
KR20210002018A (en) 2019-06-28 2021-01-06 로베르트 보쉬 게엠베하 Method for estimating a global uncertainty of a neural network

Similar Documents

Publication Publication Date Title
CN109948796B (en) Self-encoder learning method, self-encoder learning device, computer equipment and storage medium
EP3608907B1 (en) Replay spoofing detection for automatic speaker verification system
CN114863368B (en) Multi-scale target detection model and method for road damage detection
JP2020038664A (en) Method and device for providing integrated feature map by using ensemble of a plurality of outputs from convolutional neural network
Chen et al. A self-supervised approach to pixel-level change detection in bi-temporal RS images
CN111860248B (en) Visual target tracking method based on twin gradual attention-guided fusion network
Pan et al. Hierarchical support vector machine for facial micro-expression recognition
KR102166016B1 (en) A domain-aware method for image-to-image translations
KR102446792B1 (en) Apparatus and Method for Generating Relevance-weighted Class Activation Map for Explaining Artificial Neural Networks
CN113705276A (en) Model construction method, model construction device, computer apparatus, and medium
CN112862023B (en) Object density determination method and device, computer equipment and storage medium
Cao et al. Aggregated deep saliency prediction by self-attention network
KR101937585B1 (en) Cost Aggregation Apparatus and Method for Depth Image Generation, and Recording Medium thereof
JP2023010582A (en) Method of anonymizing and tracking object in space and anonymization tracking device using the same
Xiao et al. Feature-level image fusion
CN113780305B (en) Significance target detection method based on interaction of two clues
US20230289957A1 (en) Disease diagnosis method using neural network trained by using multi-phase biometric image, and disease diagnosis system performing same
CN113192085A (en) Three-dimensional organ image segmentation method and device and computer equipment
Dai et al. Understanding a deep neural network based on neural-path coding
EP3748540A1 (en) Deep neural network visualisation
Schlegel Towards Crime Forecasting Using Deep Learning
KR20200092801A (en) Method for medical diagnosis using neural network trained by multi-phase biomedical image, medical diagnosis system performing the same
KR102517801B1 (en) generation method of personal identification information using electrocardiogram and personal identification method using the information
Lesser et al. Integrated signal processing and signal understanding
Ning et al. The Importance of Anti-Aliasing in Tiny Object Detection