반응형

1. 문제 정의

이미지 분류 문제는 주어진 이미지 데이터에 대해 사전에 정의된 클래스(혹은 '레이블')로 할당하는 문제입니다. 이미지가 가지고 있는 다양한 의미(색, 형태 등)를 해석해 클래스로 할당하여 문제를 해결합니다. 분류 문제의 특징 중 하나는 다양한 형태로 존재하는 이미지도 하나의 클래스로 분류해야 할 필요가 있습니다. 

 

분류 문제 예시 [1]

 

2. 문제 종류

분류 문제는 레이블 유형에 따라, 분류 대상의 특성에 따라 구분할 수 있습니다. 

2.1. 레이블 유형에 따라

레이블은 쉽게 표현하면, 분류 문제에서 정답에 해당되는 것으로 해당 이미지가 어떤 유형에 속하는지를 의미합니다. 레이블의 유형에 따라 둘 중 하나(예를 들어, 사람 vs 사람 x)를 구분하는 이진 분류(Binary Classification), 여러 개의 클래스 중 하나로 분류하는 다중 클래스 분류(Multi-class Classification), 데이터가 여러 개의 클래스로 동시에 분류될 수 있는 문제입니다. 여기서 Multi-label은 데이터에 여러 개의 class가 동시에 존재하기 때문에 예측할 때마다 이진 분류를 수행합니다.

 

Multi-class vs Multi-label [2]

 

각 문제 유형마다 적용되는 손실함수가 다릅니다. 이전에 이진분류를 구현하면서 언급[3]한 것 처럼, 이진 분류는 Sigmoid, Multi-class 분류 문제는 Softmax를 통해 클래스에 해당할 확률을 구합니다. 그리고 자연스럽게 해당 손실함수인 Binary Cross Entropy(BCE), Multi-class 분류 문제는 Cross Entropy를 통해 손실을 계산합니다. 

 

그렇다면 Multi-lable 문제는 어떻게 해결할까요? 위에서 언급한 것처럼 각각의 클래스에 이진 분류 문제를 적용하게 됩니다. 즉, 모든 클래스 마다 Sigmoid로 확률을 구하고, BCE를 통해 손실을 계산합니다. 

2.2. 분류 대상 특성에 따라

이미지 분류 문제에서도 클래스의 (상대적일 수 있지만) 차이에 따라 Coarse-grained, Fine-grained 로 나눌 수 있습니다.  비교적 클래스 간 연관성이 적어 (즉, 클래스 끼리 차이가 큰 경우) 객체를 분류하는 것을 Coarse-grained라고 하며, 같은 상위 범주에서 세부적인 하위 분류를 수행하는 Fine-grained 문제가 있습니다. Fine-grained 분류 문제는 미묘한 차이에서 분류를 해야 하기 때문에 조금 더 어려운 분류 문제이기도 합니다. Fine-grained 데이터셋에 대한 분류 문제를 풀기 위한 다양한 시도들이 있으니 참고하여 문제 풀이에 영감을 받을 수 있을 것입니다. [4] 

2.3. 데이터 양에 따라 

앞서 분류했던 방식은 아니지만, 사용되는 데이터 양에 따라 학습하는 방법을 다르게 적용할 수 있습니다. 데이터 양이 충분하다면 이렇게 분류할 필요도 없이 지도학습을 통해 학습이 가능하겠지만, 데이터 양이 한정될 경우 접근 방식에 대해  Few-shot / One-shot / Zero-shot으로 크게 분류 할 수 있습니다.  

 

Few-shot 분류는 클래스 당 몇 개(Few) 데이터로 학습하고 예측하는 문제 입니다. [5] (데이터가 부족한 흔하게 발생할 수 있는 상황이라고 생각됩니다.) 하지만 이와 다르게, 클래스에 하나의 데이터만으로 예측을 수행해야 하는 One-shot 분류도 있습니다. 흔한 상황은 아니지만, 자료가 거의 없는 고대/원시 언어에 대한 학습을 시킬 때 해결한 사례가 있습니다. [6] Zero-shot 분류는 학습 없이 분류를 수행하는 것을 말합니다. 최근에 핫한 Foundation Model인 BERT, CLIP, GPT-3 등이 해당되며, Foundation Model에 기초하기 때문에 이들의 품질에 의해 크게 좌우됩니다. [7]

3. 참고자료

[1] Archit Parnami, Minwoo Lee. "Learning From Examples: A Summary of Approaches to Few-Shot Learning" 

[2] https://www.geeksforgeeks.org/multiclass-classification-vs-multi-label-classification/

 

Multiclass Classification vs Multi-label Classification - GeeksforGeeks

A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.

www.geeksforgeeks.org

[3] https://seanpark11.tistory.com/111

 

PyTorch로 Binary Classifier 구현하기 | 로지스틱 회귀, 이진 분류

1. 도입선형 분류(Linear Classifier)는 선형 회귀에 있던 것처럼 Wx+b의 선형 방정식 형태로 데이터를 분류하는 것을 말합니다. W를 바꾸게 되면 결정할 수 있는 기준(결정 경계)가 회전하게 되고, b를

seanpark11.tistory.com

[4] https://paperswithcode.com/task/fine-grained-image-classification

 

Papers with Code - Fine-Grained Image Classification

**Fine-Grained Image Classification** is a task in computer vision where the goal is to classify images into subcategories within a larger category. For example, classifying different species of birds or different types of flowers. This task is considered

paperswithcode.com

[5] https://paperswithcode.com/task/few-shot-learning

 

Papers with Code - Few-Shot Learning

**Few-Shot Learning** is an example of meta-learning, where a learner is trained on several related tasks, during the meta-training phase, so that it can generalize well to unseen (but related) tasks with just few examples, during the meta-testing phase. A

paperswithcode.com

[6] https://paperswithcode.com/task/one-shot-learning

 

Papers with Code - One-Shot Learning

One-shot learning is the task of learning information about object categories from a single training example. <span style="color:grey; opacity: 0.6">( Image credit: [Siamese Neural Networks for One-shot Image Recognition](https://www.cs.cmu.edu/~rsalakhu/p

paperswithcode.com

[7] https://paperswithcode.com/task/zero-shot-learning

 

Papers with Code - Zero-Shot Learning

**Zero-shot learning (ZSL)** is a model's ability to detect classes never seen during training. The condition is that the classes are not known during supervised learning. Earlier work in zero-shot learning use attributes in a two-step approach to infer un

paperswithcode.com

 

 

 

반응형