이전 내용 보러가기
[Thesis]The Latest Trends inAttention Mechanisms andTheir Applicationin Medical Imaging Review and Summary - 1
Abstract4차 산업 혁명의 핵심 기술 중 하나인 딥러닝은 기존의 규칙 기반(rule-based) 알고리즘 또는 딥러닝을 제외한 머신러닝 알고리즘 대비뛰어난 특징 추출 능력(1)과 성능, 그리고 재현성(reproduci
dev-heesxxung.tistory.com
들어가기 전
학습 과정에서 네트워크로 하여금 중요한 특징들에 더 집중하고, 그렇지 않은 특징에는 덜 집중하도록 능동적으로 학습하게 하는 기법 -> 어텐션 기법
종류 :
- 하드 어텐션
- 소프트 어텐션
확연한 차이 : 생성되는 어텐션 지도
하드 어텐션 : 생성되는 어텐션 지도가 중요 특징 영역은 1, 나머지 부분은 0으로 구성된 이진 마스크 형태
소프트 어텐션 : 어텐션 지도 전반에 걸쳐 값이 존재하되 중요 영역의 값이 나머지 영역에 비해 훨씬 큰 값을 가지는 형태
선택하는 종류에 따라 상층 관계(trade-off) 존재
하드 어텐션
- 처리 과정에서 전체 영상이 아닌 특정 영역만 저장되기에 계산과 메모리 사용량을 효과적으로 줄일 수 있음.
- 이진 마스크를 잘라내는 과정이 미분 가능하지 않아 일반적인 딥러닝의 역전파 알고리즘으로는 학습할 수 없고 강화 학습과 같은 더 까다로운 방법으로 학습해야 함.
소프트 어텐션
- 종종 하드 어텐션보다 더 많은 메모리와 계산을 요구
- 생성과정이 미분 가능하여 일반적인 딥러닝 모델과 함께 역전파 알고리즘으로 쉽게 종단 간 학습이 가능하다는 장점 존재
하드 어텐션
하드 어텐션 : 역전파 알고리즘을 활용한 종단 간 학습이 어렵고, 강화 학습 등을 사용해야 한다는 점에서 소프트 어텐션 대비 기술 자체의 복잡도가 높음.
강화 학습 기반의 하드 어텐션은 순환 어텐션 모델(recurrent attention model; RAM)을 이용하여 학습.

RAM은 위의 사진과 같이 핵심적인 정보를 포함하고 있는 영역을 순환적으로 탐색해가는 모델.
순환 신경망(CNN 혹은 RNN) 및 강화 학습을 활용
- 현재 위치를 기준으로 서로 다른 크기 및 상황 정보를 가지는 두 개의 패치를 추출
- 이를 신경망에 투입하여 정보를 압축
- 이전 단계에서 추출된 메모리 정보와 함께 RNN 기반의 Long Short Term Memory(LSTM)에 투입하여 현재까지 탐색한 정보를 종합
- LSTM의 출력을 기반으로 완전 연결층을 통해 다음 탐색 위치 선정
위의 과정을 강화 학습으로 학습하여 미리 정해진 n 단계 동안 반복적으로 시행한 후 최종적으로 마지막 단계에서 추출된 지역의 영상 정보만을 토대로 분류 진행
- 해당 방법론을 통해 훨씬 적은 파라미터를 사용
- 기존의 합성곱 신경망 기반의 방법 대비 필적할 만한 분류 성능, 분류에 핵심적인 영역을 추출하여 그 부분에 집중 할 수 있도록 함
그러나 패치 기반의 방법이므로 추출되는 정보가 제한적 => 핵심 영역으로 접근하기 위해 굉장히 많은 학습 반복이 필요할 수 있고, 이러한 단점은 분류하고자 하는 클래스의 수가 많고, 다양할수록 더 심화될 것으로 예상
최근 발표되는 하드 어텐션 기반 방법 => 강화 학습 없이도 하드 어텐션을 적용할 수 있는 방법 택
정리 :
모델이 어느 영역에 집중했는지 분석 가능할 뿐 아니라, 모델로 하여금 핵심 영역에 더 집중하도록 함으로써 추가적인 성능 향상을 도출
장점 : 집중해야 할 영역을 지도(guide) 하기 위한 경계 박스(bounding box)를 굳이 만들지 않아도 네트워크로 하여금 집중 영역을 스스로 생성하게 함으로써 해당 영역에 대한 더 정밀한 분석 가능
단점 :강화 학습을 이용하거나 딥러닝 기반으로 구현하기 위해서는 위 논문처럼 네트워크의 각 모듈별로 끊어서 학습을 진행해야 하기 때문에 구현이 불편
하드 어텐션 적용 연구
"Thorax disease classification with attention guided convolutional neural network"
진행 과정
:
- 전체 영상으로 이미 학습된 모델의 특징 지도로부터 모델이 집중한 핵심 영역을 뽑아냄
- 전체 영상에서 해당 영역만 추출하여 이어지는 네트워크로 하여금 핵심 영역만 관찰하도록 강제하는 방식으로 하드 어텐션 기반 학습을 구현

전역 모듈(global branch), 지역 모듈(local branch), 그리고 융합 모듈(fusion branch)로 구성
전역 모듈 :
진행 과정 :
- 전체 의료 영상을 입력으로 받아 어떤 질환에 속하는지 분류를 학습
- 마지막 합성곱 신경망 층에서 획득된 특징 지도에서 히트맵을 산출 이를 문턱값 처리(thresholding) 하여 분류 과정에서 모델이 집중한 핵심 영역만 남기는 이진 마스크를 생성
지역 모듈 :
진행 과정 :
- 전역 모듈에서 생성된 이진 마스크를 이용하여 전체 영상에서 그에 상응하는 부분을 잘라낸 후 해당 국소 영역만을 입력으로 받아 또 한 번의 분류를 학습
융합 모듈 :
진행 과정 :
- 전역 모듈과 지역 모듈에서 압축한 정보가 내장되어 있는 노드(nodes)를 결합(concatenation)
- 이를 기반으로 최종 분류를 학습

해당 논문에서 하드 어텐션 기반의 집중 영역 추출 과정(mask inference)은 위 식처럼 전역 모듈의 최종 합성곱 신경망 층의 특징 지도에 절대값을 취한 뒤 채널 축을 따라 각 픽셀 별 최대값을 추출
위 방식은 특정 클래스에 대한 가중치를 사용하지 않고 모델이 계산 과정에서 전반적으로 주목한 부분을 표현
실험 결과, 전체 영상과 국소 영상 모두를 활용하는 융합 모듈의 분류 정확도가 전역 모듈, 지역 모듈 각각의 정확도보다 높게 측정
추출된 집중 영역이 네트워크로 하여금 전체 영상에 존재하는 불필요한 노이즈보다는 분류에 핵심적인 정보가 내포되어 있는 병변 영역에 집중하게 함으로써 성능을 향상
소프트 어텐션과 적용 논문
학습 과정이 미분 가능하기 때문에 딥러닝 네트워크에 쉽게 결합 가능
=>유넷과 같은 기존의 딥러닝 모델에 소프트 어텐션을 위한 모듈을 결합한 후, 역전파 알고리즘을 이용하여 어텐션 모듈 및 그 외 부분이 함께 종단 간 학습되는 형태로 구현이 가능
적용 논문 : Attention gated networks: learning to leverage salient regions in medical images
=> 소프트 어텐션 기법을 유넷에 결합하였을 때(이를 어텐션 유넷이라 한다) 3차원복부 CT 영상 분할에 있어 일반 유넷에 비해 굉장히 적은 파라미터만을 추가로 활용하고도 훨씬 향상된 분할 결과를 도출할 수 있다고 보고

추가된 어텐션 게이트(attention gate)만 제외하면 나머지 부분의 구조는 일반 3D 유넷과 거의 동일

먼저 x는 인코더 층의 특징 지도(Fig. 16에서 x)를 의미하며, g는 x보다 한 단계 더 인코딩(encoding) 된 한 층 아래의 특징 지도(Fig. 16에서 g)를 의미
- 어텐션 게이트의 역할은 인코더의 특징 지도 x를 디코더에 스킵 커넥션 해주기전에, 핵심 영역을 더 활성화해주는 격자별 가중치(α)를 곱해줌으로써 네트워크로 하여금 그 부분에 더 집중하도록 하는 것
- α를 계산하는데 필요한 정보를 얻기 위해 영상의 상황 정보(context)가 더 많이 내장되어 있는 한 층 아래의 특징 지도 g와 함께 시그모이드(sigmoid), 정류 선형 유닛(rectified linear unit)과 같은 비선형적인 처리를 진행함을 파악할 수 있음.
결론
어텐션 기법은 모델의 판단 근거를 시각화함으로써 딥러닝을 임상에 적용하는 데 있어 하나의 안전장치 역할을 할 것으로 기대
학습 가능한 어텐션의 경우 목적과 연관된 핵심 영역에 더 집중하도록 학습되는데, 이 과정에서 학습 데이터와 분포가 다른 데이터 및 적대적 공격에 대한 모델의 일반화 능력 향상을 기대 가능. => 촬영 변수가 다양한 MRI나 방사선량을 조절하며 촬영하는 CT 등 촬영 장치나 그 목적에 따라 영상의 화질 및 대조도가 변화하는 의료 영상을 분석함에 있어 딥러닝의 범용성을 높이는 데 핵심적으로 기여할 것으로 생각
의학적으로 아직 명확히 연구되지 않은 새로운 진단법의 발견을 위해서도 어텐션 기법이 효과적으로 활용될 수 있을 것으로 보임 =>
Yune 등(52)은 손 방사선 사진(hand radiograph)을 통해 성별을 구별하는 딥러닝 모델을 구축함으로써 영상의학과 전문의 대비 훨씬 높은 정확도(영상의학과 전문의: 58%, 딥러닝 모델: 95.9%)뿐 아니라 구체적으로 영상의 어느 부분을 통해 남녀의 구별이 가능한지를 시각화
Ref
LeCun Y, Bengio Y, Hinton G. Deep learning. Nature 2015;521:436-444
2. Gulshan V, Peng L, Coram M, Stumpe MC, Wu D, Narayanaswamy A, et al. Development and validation of a
deep learning algorithm for detection of diabetic retinopathy in retinal fundus photographs. JAMA
2016;316:2402-2410
3. Kickingereder P, Isensee F, Tursunova I, Petersen J, Neuberger U, Bonekamp D, et al. Automated quantita-
tive tumour response assessment of MRI in neuro-oncology with artificial neural networks: a multicentre,
retrospective study. Lancet Oncol 2019;20:728-740
4. Bello GA, Dawes TJW, Duan J, Biffi C, De Marvao A, Howard LSGE, et al. Deep learning cardiac motion analy-
sis for human survival prediction. Nat Mach Intell 2019;1:95-104
5. Eo T, Jun Y, Kim T, Jang J, Lee HJ, Hwang D. KIKI-net: cross-domain convolutional neural networks for re-
constructing undersampled magnetic resonance images. Magn Reson Med 2018;80:2188-2201
6. Jun Y, Eo T, Shin H, Kim T, Lee HJ, Hwang D. Parallel imaging in time-of-flight magnetic resonance angiogra-
phy using deep multistream convolutional neural networks. Magn Reson Med 2019;81:3840-3853
7. Eo T, Shin H, Jun Y, Kim T, Hwang D. Accelerating Cartesian MRI by domain-transform manifold learning in
phase-encoding direction. Med Image Anal 2020;63:101689
8. Han Y, Ye JC. Framing U-Net via deep convolutional framelets: application to sparse-view CT. IEEE Trans Med
Imaging 2018;37:1418-1429
9. Kim S, Jang H, Jang J, Lee YH, Hwang D. Deep-learned short tau inversion recovery imaging using multi-
contrast MR images. Magn Reson Med 2020 [in press] doi: https://doi.org/10.1002/mrm.28327
10. Jun Y, Eo T, Kim T, Shin H, Hwang D, Bae SH, et al. Deep-learned 3D black-blood imaging using automatic
labelling technique and 3D convolutional neural networks for detecting metastatic brain tumors. Sci Rep
2018;8:9450
11. Yala A, Schuster T, Miles R, Barzilay R, Lehman C. A deep learning model to triage screening mammograms:
a simulation study. Radiology 2019;293:38-46
12. De Fauw J, Ledsam JR, Romera-Paredes B, Nikolov S, Tomasev N, Blackwell S, et al. Clinically applicable
deep learning for diagnosis and referral in retinal disease. Nat Med 2018;24:1342-1350
13. Collins FS, Varmus H. A new initiative on precision medicine. N Engl J Med 2015;372:793-795
14. Kang D, Park JE, Kim YH, Kim JH, Oh JY, Kim J, et al. Diffusion radiomics as a diagnostic model for atypical
manifestation of primary central nervous system lymphoma: development and multicenter external valida-
tion. Neuro Oncol 2018;20:1251-1261
15. Lao J, Chen Y, Li ZC, Li Q, Zhang J, Liu J, et al. A deep learning-based radiomics model for prediction of sur-
vival in glioblastoma multiforme. Sci Rep 2017;7:10353
16. Ardila D, Kiraly AP, Bharadwaj S, Choi B, Reicher JJ, Peng L, et al. End-to-end lung cancer screening with
three-dimensional deep learning on low-dose chest computed tomography. Nat Med 2019;25:954-961
17. Schelb P, Kohl S, Radtke JP, Wiesenfarth M, Kickingereder P, Bickelhaupt S, et al. Classification of cancer at
prostate MRI: deep learning versus clinical PI-RADS assessment. Radiology 2019;293:607-617
18. Lindsey R, Daluiski A, Chopra S, Lachapelle A, Mozer M, Sicular S, et al. Deep neural network improves frac-
ture detection by clinicians. Proc Natl Acad Sci U S A 2018;115:11591-11596
19. Esteva A, Kuprel B, Novoa RA, Ko J, Swetter SM, Blau HM, et al. Dermatologist-level classification of skin can-
cer with deep neural networks. Nature 2017;542:115-118
20. Rauschecker AM, Rudie JD, Xie L, Wang J, Duong MT, Botzolakis EJ, et al. Artificial intelligence system ap-
proaching neuroradiologist-level differential diagnosis accuracy at brain MRI. Radiology 2020;295:626-637
21. Baltruschat IM, Nickisch H, Grass M, Knopp T, Saalbach A. Comparison of deep learning approaches for
multi-label chest X-ray classification. Sci Rep 2019;9:6381
22. Wang X, Peng Y, Lu L, Lu Z, Bagheri M, Summers RM. Chestx-ray8: hospital-scale chest x-ray database and
benchmarks on weakly-supervised classification and localization of common thorax diseases. Proceedings
of the 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR); 2017 Jul 21-26; Honolulu,
HI, USA: IEEE; 2017:2097-2106
23. Kim H, Jung DC, Choi BW. Exploiting the vulnerability of deep learning-based artificial intelligence models
in medical imaging: adversarial attacks. J Korean Soc Radiol 2019;80:259-273
24. Jetley S, Lord NA, Lee N, Torr PH. Learn to pay attention. ArXiv Preprint 2018;arXiv:1804.02391
25. Wen PY, Macdonald DR, Reardon DA, Cloughesy TF, Sorensen AG, Galanis E, et al. Updated response assess-
ment criteria for high-grade gliomas: response assessment in neuro-oncology working group. J Clin Oncol
2010;28:1963-1972
26. Theiler R, Stucki G, Schütz R, Hofer H, Seifert B, Tyndall A, et al. Parametric and non-parametric measures in
the assessment of knee and hip osteoarthritis: interobserver reliability and correlation with radiology. Os-
teoarthritis Cartilage 1996;4:35-42
27. Mnih V, Heess N, Graves A. Recurrent models of visual attention. Proceedings of Advances in Neural Infor-
mation Processing Systems 27 (NIPS 2014); 2014 Dec 8-13; Montreal, Canada: NIPS; 2014:2204-2212
28. Zhou B, Khosla A, Lapedriza A, Oliva A, Torralba A. Learning deep features for discriminative localization.
Proceedings of the 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR); 2016 Jun 27-
30; Las Vegas, NV, USA: IEEE; 2016:2921-2929
29. Selvaraju RR, Cogswell M, Das A, Vedantam R, Parikh D, Batra D. Grad-CAM: visual explanations from deep
networks via gradient-based localization. Proceedings of the IEEE International Conference on Computer
Vision (ICCV); 2017 Oct 22-29; Venice, Italy: IEEE; 2017:618-626
30. Simonyan K, Vedaldi A, Zisserman A. Deep inside convolutional networks: visualising image classification
models and saliency maps. ArXiv Preprint 2013;arXiv:1312.6034
31. Bach S, Binder A, Montavon G, Klauschen F, Müller KR, Samek W. On pixel-wise explanations for non-linear
classifier decisions by layer-wise relevance propagation. PLoS One 2015;10:e0130140
32. Bien N, Rajpurkar P, Ball RL, Irvin J, Park A, Jones E, et al. Deep-learning-assisted diagnosis for knee magnet-
ic resonance imaging: development and retrospective validation of MRNet. PLoS Med 2018;15:e1002699
33. Cheng CT, Ho TY, Lee TY, Chang CC, Chou CC, Chen CC, et al. Application of a deep learning algorithm for de-
tection and visualization of hip fractures on plain pelvic radiographs. Eur Radiol 2019;29:5469-5477
34. Kim B, Seo J, Jeon S, Koo J, Choe J, Jeon T. Why are saliency maps noisy? Cause of and solution to noisy sa-
liency maps. Proceedings of the 2019 IEEE/CVF International Conference on Computer Vision Workshop
(ICCVW); 2019 Oct 27-28; Seoul, Korea (South): IEEE; 2019:4149-4157
35. Pasa F, Golkov V, Pfeiffer F, Cremers D, Pfeiffer D. Efficient deep network architectures for fast chest X-ray tu-
berculosis screening and visualization. Sci Rep 2019;9:6268
36. Böhle M, Eitel F, Weygandt M, Ritter K. Layer-wise relevance propagation for explaining deep neural network
decisions in MRI-based Alzheimer’s disease classification. Front Aging Neurosci 2019;11:194
37. Radiopaedia. Rad_doc, rID 47997, “Childhood Pneumonia”. Available at. https://radiopaedia.org/cases/
childhood-pneumonia-1?lang=us. Published Sep 13, 2016. Accessed Aug 1, 2020
38. Ypsilantis PP, Montana G. Learning what to look in chest X-rays with a recurrent visual attention model. ArXiv
Preprint 2017;arXiv:1701.06452
39. Guan Q, Huang Y, Zhong Z, Zheng Z, Zheng L, Yang Y. Thorax disease classification with attention guided
convolutional neural network. Pattern Recognit Lett 2020;131:38-45
40. Schlemper J, Oktay O, Schaap M, Heinrich M, Kainz B, Glocker B, et al. Attention gated networks: learning to
leverage salient regions in medical images. Med Image Anal 2019;53:197-207
41. Menze BH, Jakab A, Bauer S, Kalpathy-Cramer J, Farahani K, Kirby J, et al. The multimodal brain tumor im-
age segmentation benchmark (BRATS). IEEE Trans Med Imaging 2014;34:1993-2024
42. Bakas S, Akbari H, Sotiras A, Bilello M, Rozycki M, Kirby JS, et al. Advancing The Cancer Genome Atlas glioma
MRI collections with expert segmentation labels and radiomic features. Sci Data 2017;4:170117
43. Bakas S, Reyes M, Jakab A, Bauer S, Rempfler M, Crimi A, et al. Identifying the best machine learning algo-
rithms for brain tumor segmentation, progression assessment, and overall survival prediction in the BRATS
challenge. ArXiv Preprint 2018;arXiv:1811.02629
44. Hu J, Shen L, Sun G. Squeeze-and-excitation networks. Proceedings of the 2018 IEEE/CVF Conference on
Computer Vision and Pattern Recognition (CVPR 2018); 2018 Jun 18-22; Salt Lake City, UT, USA: IEEE; 2018:
7132-7141
45. Rundo L, Han C, Nagano Y, Zhang J, Hataya R, Militello C, et al. USE-Net: Incorporating Squeeze-and-Excita-
tion blocks into U-Net for prostate zonal segmentation of multi-institutional MRI datasets. Neurocomputing
2019;365:31-43
46. Guha Roy A, Siddiqui S, Pölsterl S, Navab N, Wachinger C. ‘Squeeze & excite’ guided few-shot segmentation
of volumetric images. Med Image Anal 2020;59:101587
47. Zhou C, Ding C, Wang X, Lu Z, Tao D. One-pass multi-task networks with cross-task guided attention for
brain tumor segmentation. IEEE Trans Image Process 2020 [in press] doi: https://doi.org/10.1109/
TIP.2020.2973510
48. Li S, Dong M, Du G, Mu X. Attention dense-u-net for automatic breast mass segmentation in digital mammo-
gram. IEEE Access 2019;7:59037-59047
49. Pesce E, Joseph Withey S, Ypsilantis PP, Bakewell R, Goh V, Montana G. Learning to detect chest radiographs
containing pulmonary lesions using visual attention networks. Med Image Anal 2019;53:26-38
50. Zhang J, Xie Y, Xia Y, Shen C. Attention residual learning for skin lesion classification. IEEE Trans Med Imaging
2019;38:2092-2103
51. Ni ZL, Bian GB, Xie XL, Hou ZG, Zhou XH, Zhou YJ. RASNet: segmentation for tracking surgical instruments in
surgical videos using refined attention segmentation network. Annu Int Conf IEEE Eng Med Biol Soc 2019:
5735-5738
52. Yune S, Lee H, Kim M, Tajmir SH, Gee MS, Do S. Beyond human perception: sexual dimorphism in hand and
wrist radiographs is discernible by a deep learning model. J Digit Imaging 2019;32:665-671
53. Rajpurkar P, Irvin J, Ball RL, Zhu K, Yang B, Mehta H, et al. Deep learning for chest radiograph diagnosis: a
retrospective comparison of the CheXNeXt algorithm to practicing radiologists. PLoS Med 2018;15:e1002686
54. Lee H, Yune S, Mansouri M, Kim M, Tajmir SH, Guerrier CE, et al. An explainable deep-learning algorithm for
the detection of acute intracranial haemorrhage from small datasets. Nat Biomed Eng 2019;3:173-182
55. Oh Y, Park S, Ye JC. Deep learning COVID-19 features on CXR using limited training data sets. IEEE Trans Med
Imaging 2020;39:2688-2700
56. Li L, Qin L, Xu Z, Yin Y, Wang X, Kong B, et al. Artificial intelligence distinguishes COVID-19 from community
acquired pneumonia on chest CT: evaluation of the diagnostic accuracy. Radiology 2020;296:E65-E71
57. Cohen JP, Dao L, Morrison P, Roth K, Bengio Y, Shen B, et al. Predicting covid-19 pneumonia severity on
chest x-ray with deep learning. ArXiv Preprint 2020;arXiv:2005.11856
58. Shaikh M, Kollerathu VA, Krishnamurthi G. Recurrent attention mechanism networks for enhanced classifi-
cation of biomedical images. Proceedings of the 2019 IEEE 16th International Symposium on Biomedical
Imaging (ISBI 2019); 2019 Apr 8-11; Venice, Italy: IEEE; 2019:1260-1264
59. Wu L, Wang Y, Gao J, Li X. Where-and-when to look: deep siamese
후기
이번 논문은 굉장히 길어서 (평균 9페이지 이내) 현재 하는 일을 하면서 한 번에 포스팅하기엔 어려움이 있어 나눠 올리게 되었는데.
내용도 굉장히 흥미로웠고, 특히 논문들과 관련 내용에 대해 서칭하다 보니 글을 읽으면서 어느정도 성장함을 느낄 수 있었다.
