머신러닝 분야의 임베딩에 대한 상세한 가이드 (The Full Guide to Embeddings in Machine Learning)


머신러닝 분야의 임베딩에 대한 상세한 가이드 / The Full Guide to Embeddings in Machine Learning

Akruti Acharya, Published May 19, 2023•Edited May 19, 2023 • 6 min read

AI 임베딩(embedding)은 우수한 학습 데이터를 생성하여 데이터 품질을 향상시키고 수동 라벨링의 필요성을 줄입니다. 입력 데이터를 컴퓨터가 읽기 좋은 형태로 변환함으로써, 기업은 AI 기술을 활용하여 워크플로우를 혁신하고 프로세스를 간소화하며 성능을 최적화할 수 있습니다.

AI embeddings offer the potential to generate superior training data, enhancing data quality and minimizing manual labeling requirements. By converting input data into machine-readable formats, businesses can leverage AI technology to transform workflows, streamline processes, and optimize performance.

머신러닝은 우리의 생활과 업무 방식을 변화시킬 수 있는 잠재력을 가진 강력한 도구입니다. 그러나, 머신러닝 모델의 성공 여부는 모델 개발에 사용한 학습 데이터의 품질에 크게 좌우됩니다. 고품질의 학습 데이터는 정확하고 신뢰할 수 있는 머신러닝 결과를 얻기 위해 가장 중요한 요소로 꼽힙니다.

Machine learning is a powerful tool that has the potential to transform the way we live and work. However, the success of any machine learning model depends heavily on the quality of the training data that is used to develop it. High-quality training data is often considered to be the most critical factor in achieving accurate and reliable machine learning results.

이 글에서는 머신러닝에서 고품질 학습 데이터의 중요성과 AI 임베딩이 이를 개선하는데 어떻게 도움이 되는지 살펴봅니다. 주요 내용은 다음과 같습니다:

In this blog, we’ll discuss the importance of high-quality training data in machine learning and how AI embeddings can help improve it. We will cover:

  • 고품질 학습 데이터의 중요성
  • AI 임베딩을 사용한 고품질 학습 데이터 생성
  • 임베딩 활용을 보여주는 사례 연구
  • AI 임베딩 활용의 모범 사례
  • Importance of high-quality training data
  • Creating high-quality training data using AI embeddings
  • Case studies demonstrating the use of embeddings
  • Best practices for using AI embeddings

고품질 학습 데이터의 중요성 / Importance of High-Quality Training Data

머신러닝에서 고품질 학습 데이터가 중요한 이유는 머신러닝 모델의 정확성과 신뢰성에 직접적인 영향을 미치기 때문입니다. 모델이 패턴을 정확하게 학습하고 예측하려면 다양하고 정확하면서 편향(bias)되지 않은 대량의 데이터로 학습해야 합니다. 학습에 사용되는 데이터의 품질이 낮거나 부정확하고 편향된 데이터가 포함되어 있으면 정확도가 떨어지고 잠재적으로 예측 결과가 편향됩니다.

The importance of high-quality training data in machine learning lies in the fact that it directly impacts the accuracy and reliability of machine learning models. For a model to accurately learn patterns and make predictions, it needs to be trained on large volumes of diverse, accurate, and unbiased data. If the data used for training is low-quality or contains inaccuracies and biases, it will produce less accurate and potentially biased predictions.

모델 학습에 사용되는 데이터셋의 품질은 ChatGPT 및 Google의 BERT와 같은 기초 모델을 포함해 모든 유형의 AI 모델에 적용됩니다. 워싱턴 포스트에서는 세계에서 가장 인기 있고 강력한 대규모 언어 모델(LLM)을 학습하는 데 사용되는 방대한 데이터셋을 자세히 살펴봤습니다. 특히 이 기사에서는 Google의 C4 데이터세트의 내용을 검토하면서 특히 LLM을 학습시킬 때 품질과 양이 똑같이 중요하다는 사실을 발견했습니다.

The quality of datasets being used to train models applies to every type of AI model, including Foundation Models, such as ChatGPT and Google’s BERT. The Washington Post took a closer look at the vast datasets being used to train some of the world’s most popular and powerful large language models (LLMs). In particular, the article reviewed the content of Google’s C4 dataset, finding that quality and quantity are equally important, especially when training LLMs.

이미지 인식 작업에서 모델을 학습시키는 데 사용되는 학습 데이터에 부정확하거나 불완전한 레이블(label, 정답)이 있는 이미지가 포함되어 있으면 모델이 예측에서 유사한 이미지를 정확하게 인식하거나 분류하지 못할 수 있습니다.

In image recognition tasks, if the training data used to teach the model contains images with inaccurate or incomplete labels, then the model may not be able to recognize or classify similar images in its predictions accurately.

동시에 학습 데이터가 특정 집단이나 인구 통계에 편향된 경우 모델이 이러한 편향을 학습하고 복제하여 특정 집단을 불공정하거나 차별적으로 대우할 수 있습니다. 예를 들어, 구글도 최근 Vision AI 모델이 인종차별적 결과를 생성하면서 편견의 함정에 빠졌습니다.

At the same time, if the training data is biased towards certain groups or demographics, then the model may learn and replicate those biases, leading to unfair or discriminatory treatment of certain groups. For instance, Google, too, succumbed to bias traps in a recent incident where its Vision AI model generated racist outcomes.


위 BDD 데이터셋의 이미지에는 보행자가 remotebook으로 레이블이 지정되어 있는데, 이는 분명히 잘못 표기된 것입니다.

The images in the BDD dataset have a pedestrian labeled as remote and book, which is clearly annotated wrongly.

따라서 정확하고 편향되지 않은 머신러닝 모델을 만들기 위해서는 고품질의 학습 데이터를 사용하는 것이 중요합니다. 이를 위해서는 적절하고 다양한 데이터 소스를 선택하고, 학습에 사용하기 전에 데이터를 정리 및 전처리하고 레이블을 정확하게 지정해야 합니다.

Hence, using high-quality training data is crucial to ensuring accurate and unbiased machine learning models. This involves selecting appropriate and diverse data sources and ensuring the data is cleaned, preprocessed, and labeled accurately before being used for training.

머신러닝 분야에서 임베딩이란 무엇인가요? / What is an Embedding in Machine Learning?

인공지능 분야에서 임베딩은 데이터 포인트들의 집합으로, 데이터 포인트들 간의 내포된 관계와 패턴을 보여주는 저차원 공간에 수학적으로 표현됩니다. 임베딩은 이미지, 텍스트 또는 오디오와 같은 복잡한 데이터 유형을 머신러닝 알고리즘이 쉽게 처리할 수 있는 방식으로 표현하기 위해 주로 사용됩니다.

In artificial intelligence, an embedding is a mathematical representation of a set of data points in a lower-dimensional space that captures their underlying relationships and patterns. Embeddings are often used to represent complex data types, such as images, text, or audio, in a way that machine learning algorithms can easily process.

임베딩은 전문가가 명시적으로 정의하는 것이 아니라, 모델이 대규모 데이터셋을 학습하며 알게 된다는 점에서 다른 머신 러닝 기법과 다릅니다. 이를 통해 모델은 사람이 식별하기 어렵거나 불가능한 데이터들 간의 복잡한 패턴과 관계를 학습할 수 있습니다.

Embeddings differ from other machine learning techniques in that they are learned through training a model on a large dataset rather than being explicitly defined by a human expert. This allows the model to learn complex patterns and relationships in the data that may be difficult or impossible for a human to identify.

학습이 완료되면 임베딩은 분류 모델이나 회귀 모델과 같은 다른 머신러닝 모델의 특징(feature)으로 사용할 수 있습니다. 이를 통해 모델은 입력 그 자체(raw input)가 아닌 (임베딩된 데이터를 사용하여) 데이터 간의 기본 패턴과 관계를 기반으로 예측이나 결정을 내릴 수 있습니다.

Once learned, embeddings can be used as features for other machine learning models, such as classifiers or regressors. This allows the model to make predictions or decisions based on the underlying patterns and relationships in the data, rather than just the raw input.

:bulb: 심지어 OpenAI와 같은 회사에서는 데이터에서 임베딩을 추출하는 서비스도 제공합니다. 자세히 알아보기.

:bulb:To make things easier, companies like OpenAI also offer services to extract embeddings from your data. Read to find out more.

임베딩의 유형 / Types of Embeddings

머신러닝 분야에서는 다음과 같은 여러 유형의 임베딩을 사용할 수 있습니다.

Several types of embeddings can be used in machine learning, including

이미지 임베딩 / Image Embeddings

이미지 임베딩은 저차원 공간에서 이미지를 표현하는 데 사용됩니다. 이러한 임베딩은 색상 및 질감과 같은 이미지의 시각적 특징을 캡처하여 머신러닝 모델이 이미지 분류객체 감지와 같은 컴퓨터 비전 작업을 수행할 수 있도록 합니다.

Image embeddings are used to represent images in a lower-dimensional space. These embeddings capture the visual features of an image, such as color and texture, allowing machine learning models to perform image classification, object detection, and other computer vision tasks.

이미지 임베딩의 시각화 예시. 여기서는 BDD 데이터셋Encord 플랫폼에서 2D 임베딩 플롯으로 시각화했습니다.

Example of visualization of image embeddings. Here the BDD dataset is visualized in a 2D embedding plot on the Encord platform.

워드 임베딩 / Word Embeddings

워드 임베딩은 단어를 저차원 공간에서 벡터로 표현하는 데 사용됩니다. 이러한 임베딩은 단어 간의 의미와 관계를 포착하여 머신러닝 모델이 자연어를 더 잘 이해하고 처리할 수 있도록 합니다.

Word embeddings are used to represent words as vectors in a low-dimensional space. These embeddings capture the meaning and relationships between words, allowing machine learning models to better understand and process natural language.


워드 임베딩 시각화 예시
Example of visualization of word embeddings.

출처 / Source

그래프 임베딩 / Graph Embeddings

그래프 임베딩은 서로 연결된 노드들의 네트워크인 그래프를 저차원 공간에서 벡터로 표현하는 데 사용됩니다. 이러한 임베딩은 그래프에서 노드 간의 관계를 포착하여 머신러닝 모델이 노드 분류링크 예측 작업을 수행할 수 있도록 합니다.

Graph embeddings are used to represent graphs, which are networks of interconnected nodes, as vectors in a low-dimensional space. These embeddings capture the relationships between nodes in a graph, allowing machine learning models to perform node classification and link prediction tasks.

그래프 임베딩 예시

좌측: 소셜 네트워크를 나타내는 잘 알려진 Karate 그래프.
우측: DeepWalk를 사용하여 그래프의 노드를 연속 공간에 임베딩한 모습.

Left: The well-known Karate graph representing a social network.
Right: A continuous space embedding of the nodes of the graph using DeepWalk.

임베딩은 저차원 공간에서 데이터의 본질을 표현함으로써 다른 방법으로는 명확하지 않을 수 있는 복잡한 패턴과 관계를 효율적으로 계산하고 발견할 수 있도록 합니다. 이러한 이점 덕분에 이후 설명할 다양한 AI 임베딩 활용 사례들에 적용할 수 있습니다.

By capturing the essence of the data in a lower-dimensional space, embeddings enable efficient computation and discovery of complex patterns and relationships that might not be otherwise apparent. These benefits enable various applications of AI embeddings, as discussed below.

임베딩의 활용 분야 / Applications of Embeddings

AI 임베딩은 데이터 생성 및 머신러닝 분야에서 다음과 같이 다양한 용도로 활용됩니다.

AI embeddings have numerous applications in data creation and machine learning, including

데이터 품질 개선 / Improving Data Quality

AI 임베딩은 노이즈를 줄이고, 이상값(outlier)을 제거하며, 의미 관계를 포착하여 데이터 품질을 개선하는 데 도움이 될 수 있습니다. 이는 데이터를 보다 구조화해야 하거나 누락된 값을 포함해야 하는 시나리오에서 특히 유용합니다. 예를 들어, 자연어 처리에서 단어 임베딩은 비슷한 의미를 가진 단어들을 서로 가깝게 표현하여 더 나은 의미 이해를 가능하게 하고, 다양한 언어 관련 작업의 정확성을 향상시킬 수 있습니다.

AI embeddings can help improve data quality by reducing noise, removing outliers, and capturing semantic relationships. This is particularly useful in scenarios where the data needs to be more structured or contain missing values. For example, in natural language processing, word embeddings can represent words with similar meanings closer together, enabling better semantic understanding and enhancing the accuracy of various language-related tasks.

:bulb: 학습 데이터의 품질을 개선하는 5가지 방법](5 Ways to Improve The Quality of Labeled Data)을 읽어보세요.

:bulb: Read 5 ways to improve the quality of the training data.

수동 데이터 라벨링의 필요성 감소 / Reducing the Need for Manual Data Labeling

AI 임베딩은 임베딩 표현을 기반으로 데이터에 자동으로 라벨을 지정할 수 있습니다. 이는 특히 대규모 데이터셋을 다룰 때 시간과 리소스를 절약할 수 있습니다.

AI embeddings can automatically label data based on its embedding representation. This can save time and resources, especially when dealing with large datasets.

연산량 감소 / Reducing Computation

임베딩은 고차원 데이터를 저차원 공간에 표현하기 때문에 연산량을 줄이는 데 유용합니다. 예를 들어, 256 x 256 이미지를 처리할 때는 65,536픽셀을 처리해야 해서, 직접 사용하기에는 피쳐들이 많습니다. CNN을 사용하는 경우에는 (이미지) 정보를 포함하는 1000차원의 특징 벡터로 변환할 수 있습니다. 이렇게 압축을 하게되면 연산 요구량이 크게 - 여기에서는 약 65배 가량 - 줄어들면서도 필수적인 디테일을 희생하지 않고 효율적으로 이미지를 처리하고 분석할 수 있습니다.

Embeddings are useful in reducing computation by representing high-dimensional data in a lower-dimensional space. For example, a 256 x 256 image contains 65,536 pixels in image processing, resulting in many features if directly used. Using a CNN, the image can be transformed into a 1000-dimensional feature vector, consolidating the information. This compression significantly reduces computational requirements, approximately 65 times less, allowing for more efficient image processing and analysis without sacrificing essential details.

향상된 자연어 처리(NLP) / Enhancing Natual Language Processing (NLP)

워드 임베딩은 감정 분석, 번역, 챗봇 개발과 같은 NLP 애플리케이션에서 널리 사용됩니다. 단어를 벡터 형태로 표현하면 머신러닝 알고리즘이 단어들 간의 관계를 더 쉽게 이해할 수 있습니다.

Word embeddings are widely used in NLP applications such as sentiment analysis, language translation, and chatbot development. Mapping words to vector representations makes it easier for machine learning algorithms to understand the relationships between words.

자연어 처리 과정

출처 / Source

추천 시스템 개선 / Improving Recommendation Systems

추천 시스템의 일종인 협업 필터링(CF)은 사용자 및 아이템 임베딩을 사용하여 개인화된 추천을 제공합니다. 사용자 및 항목 데이터를 벡터 공간에 임베딩하여 알고리즘이 유사한 아이템을 식별하고 사용자에게 추천할 수 있습니다.

Collaborative filtering, a type of recommendation system uses user and item embeddings to make personalized recommendations. By embedding user and item data in a vector space, the algorithm, can identify similar items and recommend them to users.

이미지 및 비디오 처리 향상 / Enhancing Image and Video Processing

객체 감지, 인식 및 분류에서 이미지 및 비디오 임베딩을 사용할 수 있습니다. 이미지와 비디오를 벡터 표현으로 매핑하면 머신러닝 알고리즘이 그 안에 있는 다양한 객체를 식별하고 분류하는 것이 더 쉬워집니다.

Image and video embeddings can be used for object detection, recognition, and classification. Mapping images and videos to vector representations makes it easier for machine learning algorithms to identify and classify different objects within them.


이렇듯 AI 임베딩은 다양한 곳에서 사용되며 데이터 품질을 개선하고 수동 데이터 라벨링의 필요성을 줄이는 등 많은 이점을 제공합니다. 이제 고품질 학습 데이터를 생성하기 위해 AI 임베딩을 활용하면 어떤 이점이 있는지 자세히 살펴보겠습니다.

Hence, the applications of AI embeddings are diverse and offer many benefits, including improving data quality and reducing the need for manual data labeling. Now, let's delve into how this can be beneficial when utilizing AI embeddings for generating high-quality training data.

데이터 생성 시 임베딩의 이점 / Benefits of Embeddings in Data Creation

데이터 생성에 임베딩을 사용하면 얻을 수 있는 몇 가지 이점은 다음과 같습니다:

Here are a few of the benefits of using embeddings in data creation:

더 크고 다양한 데이터셋 생성 / Create a Larger and Diverse Dataset

임베딩은 데이터들 간의 패턴과 관계를 자동으로 식별함으로써 수동 라벨링으로 놓칠 수 있는 공백을 메우고 이상값을 식별하는 데 도움이 될 수 있습니다. 예를 들어 임베딩은 데이터 내에서 학습된 패턴과 관계를 활용하여 부족한 부분을 채우는 데 도움이 될 수 있습니다.

By automatically identifying patterns and relationships within data, embeddings can help to fill in gaps and identify outliers that might be missed by manual labeling. For example, embeddings can help fill in gaps by leveraging the learned patterns and relationships within the data.

AI 모델은 누락된 값에 대해 주변 데이터의 임베딩을 분석하여, 이에 입각한 추정 또는 예측을 할 수 있으므로 보다 완전하고 신뢰할 수 있는 데이터 분석이 가능합니다. 이는 학습을 위한 보다 포괄적이고 대표적인 데이터를 제공하여 머신러닝 모델의 정확도를 향상시키는데 도움이 됩니다.

AI models can make informed estimations or predictions for missing values by analyzing the surrounding representations, allowing for more complete and reliable data analysis.This can help improve the accuracy of machine learning models by providing more comprehensive and representative data for training.

출처 / Source

편향 감소 / Reduce Bias

학습 데이터에 AI 임베딩을 사용하면 데이터 간의 관계와 패턴을 보다 미묘하게 이해할 수 있어 편향성을 줄일 수 있으며, 잠재적인 편향성의 원인을 식별하고 완화할 수 있습니다. 이를 통해 머신러닝 모델이 공정하고 대표성 있는 데이터로 학습되어 보다 정확하고 편향되지 않은 예측측을 할 수 있습니다.

Using AI embeddings in training data can help reduce bias by enabling a more nuanced understanding of the relationships and patterns in the data, allowing for identifying and mitigating potential sources of bias. This can help to ensure that machine learning models are trained on fair and representative data, leading to more accurate and unbiased predictions.

학습 데이터의 편향을 줄이는 5가지 방법을 자세히 알아보세요.

:bulb: Read to find out five more ways to reduce bias in your training data.

모델 성능 개선 / Improve Model Performance

AI 임베딩은 다양한 머신러닝 작업에서 효율성 향상, 일반화 개선, 성능 향상 등 여러 가지 이점을 제공합니다. 임베딩을 사용하면 복잡한 패턴을 효율적으로 계산하고 발견할 수 있으며, 과적합(overfitting)을 줄이고, 데이터의 기본 구조를 파악하여 학습 시 보지 못했던 새로운 데이터에 대해 더 잘 일반화할 수 있습니다.

AI embeddings offer several benefits such as increased efficiency, better generalization, and enhanced performance in various machine learning tasks. They enable efficient computation and discovery of complex patterns, reduce overfitting, and capture the underlying structure of the data to generalize better on new, unseen data.

임베딩을 사용하여 고품질 학습 데이터를 생성하는 방법 / How to Create High-Quality Training Data Using Embeddings

데이터 준비 / Data Preparation

첫 번째 단계는 임베딩을 위한 데이터 준비입니다. 임베딩은 입력 데이터의 품질에 따라 결과 임베딩의 품질이 결정되기 때문에 데이터 준비 단계가 매우 중요합니다.

The first step is preparing the data for embedding. The data preparation step is crucial for embedding because the input data's quality determines the resulting embeddings' quality.

첫 번째 단계는 모델 학습에 사용할 데이터를 수집하는 것입니다. 수집할 데이터는 텍스트 데이터, 이미지 데이터 또는 그래프 데이터 등이 될 것입니다. 데이터를 수집한 후에는 노이즈나 관련 없는 정보를 제거하기 위해 데이터를 정리하고 전처리를 해야 합니다. 예를 들어, 텍스트 데이터의 경우 데이터 정리에는 다음이 포함됩니다:

The first step is to collect the data you want to use for training your model. This can include text data, image data, or graph data. Once you have collected the data, you need to clean and preprocess it to remove any noise or irrelevant information. For example, in text data, data cleaning involves:

  • 텍스트를 개별 단어나 구문으로 토큰화
  • 불용어(stop word) 제거
  • 맞춤법 오류 수정
  • 구두점 제거
  • Tokenizing the text into individual words or phrases.
  • Removing stop words.
  • Correcting spelling errors.
  • Removing punctuation marks.

이미지 데이터의 경우에는 이미지의 크기를 균일한 크기로 조정하거나 잘라야 할 수도 있습니다.

You may need to resize or crop images to a uniform size for image data.

데이터가 노이즈가 많거나 구조화되지 않았거나 관련 없는 정보가 포함된 경우 임베딩이 데이터를 정확하게 나타내지 못하고 원하는 결과를 제공하지 못할 수 있습니다. 적절한 데이터 준비는 임베딩의 품질을 개선하여 보다 정확하고 효율적인 머신러닝 모델을 만드는 데 도움이 될 수 있습니다.

If the data is noisy, unstructured, or contains irrelevant information, the embeddings may not accurately represent the data and may not provide the desired results. Proper data preparation can help improve the quality of embeddings, leading to more accurate and efficient machine learning models.

예를들어, 이미지 데이터 준비의 전처리 단계에는 중복된 이미지를 제거하거나 너무 어둡거나 지나치게 밝은 이미지와 같이 정보가 없는 이미지를 제거하는 작업이 포함됩니다.

For example, the pre-processing step of image data preparation involves removing image duplicates and images that have no information like extremely dark or overly bright images.

:bulb: 컴퓨터 비전 또는 머신러닝 모델에 적합한 데이터 세트를 선택하는 방법에 대한 자세한 내용은 데이터 큐레이션 및 데이터 큐레이션 도구 블로그를 참조하세요.

:bulb: Read the blog on data curation and data curation tools to gain more insight on how to choose the right datasets for your computer vision or machine learning model.

머신러닝 기법을 사용한 임베딩 / Embedding using Machine Learning Techniques

대부분의 머신러닝 알고리즘은 입력으로 숫자 데이터를 필요로 합니다. 따라서 데이터를 숫자 형식으로 변환해야 합니다. 이러한 변환 작업은 텍스트 데이터에 대한 단어들의 가방(BoW; Bag of Word)을 만들거나 이미지를 픽셀 값으로 변환하거나 그래프 데이터를 숫자 매트릭스로 변환하는 작업 등이 있습니다.

Most machine learning algorithms require numerical data as input. Therefore, you need to convert the data into a numerical format. This can involve creating a bag of words representation for text data, converting images into pixel values, or transforming graph data into a numerical matrix.

데이터를 숫자 형식으로 변환한 후에는 머신러닝 기술을 사용하여 임베딩할 수 있습니다. 임베딩 프로세스는 데이터의 의미적 의미를 유지하면서 고차원 공간에서 저차원 공간으로 데이터를 매핑하는 작업입니다. 널리 사용되는 임베딩 기법은 다음과 같습니다:

Once you have converted the data into a numerical format, you can embed it using machine learning techniques. The embedding process involves mapping the data from a higher-dimensional space to a lower-dimensional space while preserving its semantic meaning. Some of the popular embedding techniques are:

주성분 분석(PCA) 및 특이값 분해(SVD) / Principal Component Analysis (PCA) & Single Value Decomposition (SVD)

주성분 분석(PCA; Principal Component Analysis)은 원본 데이터를 상호 연관성이 없는 (주성분이라고 부르는) 새로운 특징의 집합으로 변환하는 차원 축소 기법입니다. 이 기법은 데이터에서 가장 중요한 정보를 포착하고 덜 중요한 정보는 버리는 식으로 동작합니다.

Principal Component Analysis (PCA) is a dimensionality reduction technique that transforms the original data into a set of new, uncorrelated features (called principal components). It captures the most important information in the data while discarding the less important information.

임베딩을 위해 PCA를 수행하려면 먼저 원본 데이터를 중앙에 두고 평균과 단위 분산이 0이 되도록 스케일링합니다. 그런 다음, 중심 데이터의 공분산 행렬(covariance matrix)을 계산합니다. 그런 다음 공분산 행렬의 고유 벡터와 고유값을 계산하고 해당 고유값을 기준으로 내림차순으로 고유 벡터를 정렬합니다. 그런 다음 상위 k개의 고유 벡터를 선택하여 새로운 특징 공간을 형성합니다. 여기서 k는 임베딩되는 공간의 차원입니다.

To perform PCA for embedding, the original data is first centered and scaled to have zero mean and unit variance. Next, the covariance matrix of the centered data is calculated. The eigenvectors and eigenvalues of the covariance matrix are then computed, and the eigenvectors are sorted in descending order based on their corresponding eigenvalues. The top k eigenvectors are then selected to form the new feature space, where k is the desired dimensionality of the embedded space.

PCA를 사용하여 5개의 데이터 포인트를 변환한 예시입니다. 좌측 그래프는 원본 데이터이고, 우측 그래프는 변환된 데이터입니다. 두 차트는 동일한 데이터를 보여 주지만, 우측 그래프는 축이 주성분으로 변환된 원본 데이터를 반영합니다.

An example where we transform five data points using PCA. The left graph is our original data; the right graph would be our transformed data. The two charts show the same data, but the right graph reflects the original data transformed so that the axes are now the principal components.

출처 / Source

마지막으로, 선택한 고유 벡터(eigenvector)를 사용하여 원본 데이터를 새로운 특징 공간에 투영(projection)하여 임베딩된 값을 얻습니다. PCA는 임베딩, 특히 이미지 및 오디오 데이터에 널리 사용되는 기법으로 얼굴 인식 및 음성 인식과 같은 다양한 애플리케이션에 사용되어 왔습니다.

Finally, the original data is projected onto the new feature space using the selected eigenvectors to obtain the embedded representation. PCA is a widely used technique for embedding, particularly for image and audio data, and has been used in a variety of applications such as facial recognition and speech recognition.

특이값 분해(SVD)는 PCA 내에서 사용되므로 여기서는 이에 대해서만 간략하게 다루겠습니다. SVD는 행렬을 U , Σ(=S), V 의 세 개의 행렬로 분해합니다. 이 때 U 는 좌측 벡터 (n x n 직교 행렬), S(=Σ) 는 특이값을, V 는 우측 벡터 (p x p 직교 행렬) 를 나타냅니다.

Singular Value Decomposition (SVD) is used within PCA, so we will only cover this briefly. SVD decomposes a matrix into three matrices: U, Σ, and V. U represents the left singular vectors, S represents the singular values, and V represents the right singular vectors.

image
SVD 정리의 방정식. / Equation of the SVD theorem.

특이값과 벡터는 원래 행렬에서 가장 중요한 정보를 포착하여 차원 축소 및 임베딩 생성을 가능하게 합니다. PCA와 마찬가지로 SVD는 텍스트, 이미지, 그래프 등 다양한 유형의 데이터에 대한 임베딩을 생성하는 데 사용합니다.

The singular values and vectors capture the most important information in the original matrix, allowing for dimensionality reduction and embedding creation. Similar to PCA, SVD can be used to create embeddings for various types of data, including text, images, and graphs.

SVD는 추천 시스템, 텍스트 분류, 이미지 처리 등 다양한 머신러닝 작업에 사용되어 왔습니다. 머신러닝 모델의 성능을 향상시킬 수 있는 고품질 임베딩을 생성하는 강력한 기술입니다.

SVD has been used for various machine learning tasks, such as recommendation systems, text classification, and image processing. It is a powerful technique for creating high-quality embeddings that can improve the performance of machine learning models.

오토인코더 / Auto-Encoder

오토인코더는 비지도 학습을 사용하는 신경망 모델입니다. 입력 데이터를 저차원 표현(인코딩)에 매핑하는 인코더 네트워크와 인코딩에서 원본 입력 데이터를 재구성(디코딩)하는 디코더 네트워크로 구성됩니다. 오토인코더는 입력 데이터보다 압축되어 있으면서도 의미있는 표현을 학습하여 필수적인 특징을 효과적으로 포착하는 것을 목표로 합니다.

Autoencoders are neural network models used for unsupervised learning. They consist of an encoder network that maps the input data to a lower-dimensional representation (encoding) and a decoder network that attempts to reconstruct the original input data from the encoding. An autoencoder aims to learn a compressed and meaningful representation of the input data, effectively capturing the essential features.

오토인코더는 입력 데이터를 저차원 표현 또는 임베딩으로 압축하는 인코더 신경망으로 구성됩니다. 디코더 네트워크는 임베딩에서 원본 데이터를 재구성합니다. 인코더 네트워크는 데이터 세트에 대해 자동 인코더를 학습시켜 의미 있는 특징을 추출하고 입력 데이터를 압축된 표현으로 압축하는 방법을 학습합니다. 이러한 임베딩은 클러스터링, 시각화 또는 전이 학습과 같은 다운스트림 작업에 사용할 수 있습니다.

Autoencoders consist of an encoder neural network that compresses the input data into a lower-dimensional representation or embedding. The decoder network reconstructs the original data from the embedding. By training an eutoencoder on a dataset, the encoder network learns to extract meaningful features and compress the input data into a compact representation. These embeddings can be used for downstream tasks such as clustering, visualization, or transfer learning.

워드-투-벡 / Word2Vec

Word2Vec(워드-투-벡)은 단어를 고차원 벡터 공간에 표현하는 단어 임베딩을 생성하는 데 널리 사용되는 기법입니다. 이 기술은 대규모 텍스트 데이터에 대해 신경망을 훈련시켜 주어진 단어가 나타나는 문맥을 예측하는 방식으로 작동합니다. 그 결과 임베딩은 유사성 및 유추와 같은 단어 간의 의미론적, 구문론적 관계를 포착합니다.

Word2Vec is a popular technique for creating word embeddings, which represent words in a high-dimensional vector space. The technique works by training a neural network on a large corpus of text data, to predict the context in which a given word appears. The resulting embeddings capture semantic and syntactic relationships between words, such as similarity and analogy.

Word2Vec은 언어 번역, 텍스트 분류, 감성 분석 등 다양한 자연어 처리 작업에 효과적입니다. 또한 추천 시스템과 이미지 분석에도 응용할 수 있습니다.

Word2Vec is effective in various natural language processing tasks, such as language translation, text classification, and sentiment analysis. It also has applications in recommendation systems and image analysis.

Word2Vec을 구현하는 두 가지 주요 접근 방식은 연속-단어-가방(CBOW) 모델과 스킵그램(skip-gram) 모델입니다. CBOW는 주변 문맥을 고려하여 대상 단어를 예측하는 반면, 스킵그램은 대상 단어가 주어진 문맥을 예측합니다. 두 모델 모두 장단점이 있으며, 특정 애플리케이션과 데이터의 특성에 따라 선택이 달라집니다.

There are two main approaches to implementing Word2Vec: the Continuous Bag-of-Words (CBOW) model and the Skip-gram model. CBOW predicts a target word given its surrounding context, while Skip-gram predicts the context given a target word. Both models have their advantages and disadvantages, and the choice between them depends on the specific application and the characteristics of the data.

CBOW와 스킵그램의 도식

좌측: CBOW 아키텍처. 우측: 스킵그램 아키텍처. CBOW 아키텍처는 문맥을 기반으로 현재 단어를 예측하고, 스킵그램(skipgram)은 현재 단어가 주어졌을 때 주변 단어를 예측합니다.
Left: CBOW architecture. Right: Skip-gram architecture. The CBOW architecture predicts the current word based on the context, and the Skip-gram predicts surrounding words given the current word.

출처 / Source

글로-브 / GloVe

GloVe(글로-브)는 단어 표현을 위한 글로벌 벡터(Global Vectors)의 약자로, 단어를 벡터로 표현하는 데 사용되는 인기있는 임베딩 기법 중 하나입니다. Word2Vec과 마찬가지로 GloVe 역시 신경망 기반 접근 방식입니다. 하지만 얕은 신경망을 기반으로 하는 Word2Vec과 달리 GloVe는 글로벌 행렬 인수분해(global matrix factorization) 기법을 사용하여 단어 임베딩을 학습합니다.

GloVe, which stands for Global Vectors for Word Representation, is another popular embedding technique that is used to represent words as vectors. Like Word2Vec, GloVe is also a neural network-based approach. However, unlike Word2Vec, which is based on a shallow neural network, GloVe uses a global matrix factorization technique to learn word embeddings.

GloVe에서는 주어진 문맥에서 두 단어가 함께 나타나는 횟수를 세어 단어의 동시 등장 행렬(co-occurrence matrix)을 구성합니다. 행렬의 행은 단어를 나타내고 열은 단어가 나타나는 문맥을 나타냅니다. 그런 다음 이 행렬은 단어와 문맥에 대한 두 개의 개별 행렬로 분해됩니다. 이 두 행렬의 곱이 최종 단어 임베딩을 생성합니다.

In GloVe, the co-occurrence matrix of words is constructed by counting the number of times two words appear together in a given context. The rows of the matrix represent the words, and the columns represent the context in which the words appear. The matrix is then factorized into two separate matrices, one for words and the other for contexts. The product of these two matrices produces the final word embeddings.

image

글로브 임베딩의 예시 / Example of the GloVe embeddings.

출처 / Source

GloVe는 단어 유추, 단어 유사도, 개체명 인식(NER) 등 다양한 자연어 처리(NLP) 작업에서 우수한 성능을 발휘하는 것으로 알려져 있습니다. 또한 이미지 특징을 단어와 유사한 엔티티로 변환하고 GloVe 임베딩을 적용하여 이미지 분류 작업에도 사용되었습니다.

GloVe is known to perform well on various NLP tasks such as word analogy, word similarity, and named entity recognition. Additionally, GloVe has also been used for image classification tasks by converting image features into word-like entities and applying GloVe embeddings.

BERT

BERT(Bidirectional Encoder Representations from Transformers; 트랜스포머의 양방향 인코더 표현)는 Google에서 개발한 인기 언어 모델로, 임베딩을 비롯하여 다양한 자연어 처리(NLP) 작업에 사용되어 왔습니다. BERT는 단어의 문맥을 고려하여 단어 임베딩을 생성하기 위해 트랜스포머 아키텍처를 사용하는 딥러닝 모델입니다. 이를 통해 BERT는 단어의 의미론적 의미는 물론 문장에서 단어 간의 관계까지 파악할 수 있습니다.

BERT (Bidirectional Encoder Representations from Transformers) is a popular language model developed by Google that has been used for a variety of natural language processing (NLP) tasks, including embedding. BERT is a deep learning model that uses a transformer architecture to generate word embeddings by taking into account the context of the words. This allows BERT to capture the semantic meaning of words, as well as the relationships between words in a sentence.

Google AI Logo

BERT는 방대한 양의 텍스트 데이터로 학습된 사전 학습 모델로, 고품질의 단어 임베딩을 생성하는 강력한 도구입니다. BERT 기반 임베딩은 감성 분석, 텍스트 분류, 질문-답변(QA) 등 다양한 자연어 처리(NLP) 작업에 매우 효과적입니다. 또한 BERT를 사용하면 특정 다운스트림 작업을 미세 조정(파인튜닝)할 수 있어 더욱 정확한 결과를 얻을 수 있습니다.

BERT is a pre-trained model that has been trained on massive amounts of text data, making it a powerful tool for generating high-quality word embeddings. BERT-based embeddings are highly effective in a range of NLP tasks, including sentiment analysis, text classification, and question-answering. Additionally, BERT allows for fine-tuning specific downstream tasks, which can lead to even more accurate results.

BERT에 대한 전반적인 사전 훈련 및 미세 조정 절차

BERT에 대한 전반적인 사전 훈련 및 파인튜닝 절차 / Overall pre-training and fine-tuning procedure for BERT

출처 / Source

전반적으로 BERT는 다양한 NLP 애플리케이션에서 사용할 수 있는 고품질 단어 임베딩을 생성하는 강력한 도구입니다. BERT의 한 가지 단점은 계산 비용이 많이 들고 훈련과 추론에 상당한 리소스가 필요하다는 점입니다. 그러나 사전 학습된 BERT 모델은 특정 사용 사례에 맞게 미세 조정할 수 있으므로 값비싼 학습 비용을 낮출 수 있습니다.

Overall, BERT is a powerful tool for generating high-quality word embeddings that can be used in a wide range of NLP applications. One downside of BERT is that it can be computationally expensive, requiring significant resources for training and inference. However, pre-trained BERT models can be fine-tuned for specific use cases, reducing the need for expensive training.

t-SNE

t-SNE(t-Distributed Stochastic Neighbor Embedding)는 고차원 데이터를 시각화하기 위해 널리 사용되는 차원 축소 기법입니다. t-SNE는 주로 시각화에 사용되지만 임베딩을 생성하는 데에도 사용할 수 있습니다. 이 과정에는 t-SNE를 적용하여 데이터의 차원을 줄이고 원래 고차원 데이터의 고유한 구조를 포착하는 저차원 임베딩을 얻는 것이 포함됩니다.

t-SNE (t-Distributed Stochastic Neighbor Embedding) is a widely used dimensionality reduction technique for visualizing high-dimensional data. While t-SNE is primarily used for visualization, it can also be used to generate embeddings. The process involves applying t-SNE to reduce the dimensionality of the data and obtaining a lower-dimensional embedding that captures the inherent structure of the original high-dimensional data.

t-SNE 예시 이미지

출처 / Source

t-SNE는 고차원 공간에서 데이터 포인트 간의 유사성을 측정하는 확률 분포와 저차원 공간에서 해당 확률 분포를 생성하는 방식으로 작동합니다. 그런 다음 이 분포 사이의 Kullback-Leibler 발산을 최소화하여 포인트 간의 쌍별(pairwise) 유사성을 보존하는 임베딩을 찾습니다.

t-SNE works by creating a probability distribution that measures the similarity between data points in high-dimensional space and a corresponding probability distribution in the low-dimensional space. It then minimizes the Kullback-Leibler divergence between these distributions to find an embedding that preserves the pairwise similarities between points.

t-SNE의 결과로 나온 임베딩은 클러스터링, 이상 감지 또는 다운스트림 머신 러닝 알고리즘의 입력과 같은 다양한 용도로 사용할 수 있습니다. 그러나 t-SNE는 계산 비용이 많이 들고, 생성된 임베딩은 로컬 구조를 강조하고 포인트 간의 정확한 거리를 보존하지 못할 수 있으므로 신중하게 해석해야 한다는 점에 유의해야 합니다.

The resulting embeddings from t-SNE can be used for various purposes such as clustering, anomaly detection, or as input to downstream machine learning algorithms. However, it's important to note that t-SNE is computationally expensive, and the generated embeddings should be interpreted carefully since they emphasize local structure and may not preserve the precise distances between points

UMAP

UMAP(Uniform Manifold Approximation and Projection)은 임베딩 생성에 일반적으로 사용되는 차원 축소 기법입니다. PCA나 t-SNE와 같은 기존 방법과 달리 UMAP는 계산 효율성을 유지하면서 데이터의 로컬 및 글로벌 구조를 모두 보존하는 데 중점을 둡니다.

UMAP (Uniform Manifold Approximation and Projection) is a dimensionality reduction technique commonly used for generating embeddings. Unlike traditional methods like PCA or t-SNE, UMAP focuses on preserving both local and global structure in the data while maintaining computational efficiency.

출처 / Source

UMAP은 인근한 데이터와의 관계를 유지하면서 저차원 표현을 구축하는 방식으로 동작합니다. 이를 위해 데이터를 위상(topological) 구조로 모델링하고 데이터가 위치한 다양체(manifold)를 근사화합니다. 이 알고리즘은 인근 지점 간의 쌍방향 거리를 보존하는 저차원 임베딩을 반복적으로 최적화합니다.

UMAP works by constructing a low-dimensional representation of the data while preserving the neighborhood relationships. It achieves this by modeling the data as a topological structure and approximating the manifold on which the data lies. The algorithm iteratively optimizes a low-dimensional embedding that preserves the pairwise distances between nearby points.

데이터셋에 UMAP을 적용하면 데이터의 기본 구조와 관계를 포착하는 임베딩이 생성됩니다. 이러한 임베딩은 시각화, 클러스터링 또는 다른 머신러닝 알고리즘의 입력 등, 다양한 용도로 사용할 수 있습니다.

Applying UMAP to a dataset generates embeddings that capture the underlying structure and relationships in the data. These embeddings can be used for various purposes, such as visualization, clustering, or as input to other machine learning algorithms.

UMAP은 효율적으로 연산을 하면서도 로컬 및 글로벌 구조를 모두 보존하는 고품질 임베딩을 생성할 수 있기 때문에 이미지 분석, 유전체학, 텍스트 마이닝, 추천 시스템 등 다양한 영역에서 널리 사용하고 있습니다.

UMAP has gained popularity in various domains, including image analysis, genomics, text mining, and recommendation systems, due to its ability to generate high-quality embeddings that preserve both local and global structure while being computationally efficient.


이렇게 생성된 임베딩을 분석하고 검증하는 것은 임베딩이 기초 데이터를 정확하게 표현하는지 확인하기 위한 품질 보증의 중요한 단계입니다.

Analyzing and validating embeddings is an important step in quality assurance to ensure that the generated embeddings accurately represent the underlying data.

품질 보증을 위한 임베딩 분석 및 검증 / Analyzing and Validating Embeddings for Quality Assurance

임베딩을 분석하는 일반적인 방법 중 하나는 2D 또는 3D와 같은 저차원 공간에서 t-SNE 또는 PCA 같은 기술을 사용하여 시각화 하는 것입니다. 이를 통해 데이터의 클러스터나 패턴을 식별하고 임베딩의 품질에 대한 인사이트를 얻을 수 있습니다.

One common method for analyzing embeddings is to visualize them in a lower-dimensional space, such as 2D or 3D, using techniques like t-SNE or PCA. This can help identify clusters or patterns in the data and provide insights into the quality of the embeddings.

데이터셋의 임베딩을 생성하고 그려주는 플랫폼들도 있습니다. 이러한 플롯(plot)는 데이터셋을 저차원 공간에서 시각화하고자 할 때 유용합니다. 이 저차원 공간에서 데이터를 시각화하면 데이터의 잠재적인 문제나 편향을 더 쉽게 식별할 수 있으며, 이를 해결하여 임베딩의 품질을 개선할 수 있습니다. 임베딩을 시각화하면 특정 작업에 대한 임베딩의 품질과 유용성을 평가할 수 있는 직관적인 방법을 제공하여 다양한 모델을 평가하고 비교할 수 있습니다.

There are platforms that create and plot the embeddings of the dataset. These plots are helpful when you want to visualize your dataset in the lower-dimensional space. Visualizing the data in this lower-dimensional space makes it easier to identify any potential issues or biases in the data, which can be addressed to improve the quality of the embeddings. Visualizing embeddings can help evaluate and compare different models by providing an intuitive way to assess the quality and usefulness of the embeddings for specific tasks.

한 가지 예로, 이미지 데이터셋의 2D 임베딩 플롯을 제공하여 사용자가 특정 클러스터 내의 이미지를 시각화할 수 있는 Encord Active라는 플랫폼이 있습니다. 이를 통해 임베딩을 통해 이상값을 식별하는 과정을 간소화할 수 있습니다. 2D 임베딩 플롯은 데이터 품질뿐만 아니라 데이터셋의 라벨 품질도 검증하는 데 유용합니다.

One example is the Encord Active platform, which provides a 2D embedding plot of an image dataset, enabling users to visualize the images within a particular cluster. This simplifies the process of identifying outliers through embeddings. The 2D embedding plot is not only useful in validating the data quality but also the label quality of the dataset.

Rareplane 데이터셋의 2D 임베딩 플롯 / A 2D embedding plot of the Rareplanes dataset

임베딩의 검증에는 분류나 예측과 같은 다운스트림 작업에서 임베딩의 성능을 평가하고 다른 방법과 비교하는 작업이 포함됩니다. 이를 통해 실제 시나리오에서 임베딩의 효과를 판단하고 개선이 필요한 영역을 찾을 수 있습니다.

Validation of embeddings involves evaluating their performance on downstream tasks, such as classification or prediction, and comparing it with other methods. This can help determine the effectiveness of the embeddings in real-world scenarios and highlight areas for improvement.

임베딩 검증의 또 다른 측면은 임베딩에 존재하는 편향(bias)의 정도를 측정하는 것입니다. 임베딩이 학습 데이터의 편향을 반영하여 차별적이거나 불공정한 결과를 초래할 수 있기 때문에 이는 중요합니다. 편향-제거(de-biasing) 같은 기술을 사용하여 이러한 편향을 제거하고 임베딩이 공정하고 편향되지 않도록 할 수 있습니다.

Another aspect of validation is measuring the degree of bias present in the embeddings. This is important because embeddings can reflect biases in the training data, leading to discriminatory or unfair outcomes. Techniques like de-biasing can be used to remove these biases and ensure that the embeddings are fair and unbiased.

이제 임베딩의 생성과 분석에 대해 살펴보았으니, 임베딩이 기존 머신 러닝 알고리즘과 비교했을 때 머신러닝 모델에 어떤 이점이 있는지 사례 연구를 통해 더 깊이 이해해 보겠습니다.

Now that we have explored the creation and analysis of embeddings, let's examine a case study to gain a deeper understanding of how embeddings can benefit machine learning models when compared to traditional machine learning algorithms.

사례 연구: 임베딩과 객체 분류 / Case Study: Embeddings and Object Classification

이 사례는 임베딩이 객체 분류 알고리즘에 미치는 영향에 중점을 둡니다. 학습용 데이터셋의 임베딩을 시각화함으로써 임베딩이 데이터 처리에 미치는 영향을 살펴볼 수 있습니다.

This case study focuses on the effect of embeddings on object classification algorithms. By visualizing the embeddings of the training dataset, we can explore their impact on the process.

이미지 분류는 머신러닝의 인기있는 응용 분야로, 임베딩은 이 작업에 효과적입니다. 임베딩 기반 이미지 분류 접근 방식에는 이미지 데이터의 저차원 표현을 학습하고 이 표현을 머신러닝 모델의 입력으로 사용하는 것이 포함됩니다.

Image classification is a popular application of machine learning, and embeddings are effective for this task. Embedding-based approaches to image classification involve learning a lower-dimensional representation of the image data and using this representation as input to a machine learning model.

개 사진 분류의 예시

개 분류 예시 / Example of dog classification

임베딩을 분석하면 피처 엔지니어링을 직접 해야하는 일을 줄일 수 있습니다. 기존의 머신러닝 알고리즘에 비해 임베딩 기반 접근 방식은 더 효율적인 연산이 가능합니다. 따라서 이렇게 학습된 모델은 종종 더 높은 정확도를 보이고, 학습 시 보지 못했던(unseen) 새로운 데이터에 더 잘 일반화됩니다. 임베딩을 시각화하여 이 부분을 더 살펴보겠습니다.

Analyzing the embeddings can reduce the need for manual feature engineering. Compared to traditional machine learning algorithms, embedding-based approaches enable more efficient computation. Hence, the trained model will often achieve higher accuracy and better generalization to new, unseen data. Let's visualize the embeddings to understand this better.

임베딩 시각화 / Visualizing embeddings

여기서는 Encord Active 플랫폼을 사용하여 Caltech-101 데이터셋의 임베딩을 시각화하겠습니다.

Here, we will be using the Encord Active platform to visualize the embedding plot of the Caltech-101 dataset.

Caltech-101 데이터셋은 101개의 클래스로 분류된 객체 이미지들로 구성되어 있습니다. 데이터셋 내의 이미지들은 일반적으로 200 x 200에서 500 x 500 픽셀 범위의 중간 해상도를 갖는 서로 다른 크기를 갖습니다. 그러나 데이터셋의 차원 수는 각 이미지를 표현하는 데 사용되는 특징의 수에 따라 달라집니다. 일반적으로 대부분의 Caltech-101 이미지 피처는 수백 또는 수천 차원이며, 저차원 공간에서 시각화하는 것이 도움이 될 것입니다.

The Caltech-101 dataset consists of images of objects categorized into 101 classes. Each image in the dataset has different dimensions, but they are generally of medium resolution, with dimensions ranging from 200 x 200 to 500 x 500 pixels. However, the number of dimensions in the dataset will depend on the number of features used to represent each image. In general, most Caltech-101 image features will have hundreds or thousands of dimensions and it will be helpful to visualize it in lower-dimensional space.

Caltech-101 데이터셋의 예시 이미지

Caltech-101 데이터셋의 예시 이미지 / Example of images presented in Caltech101 dataset

출처 / Source

자주 사용하는 파이썬 환경에서 아래 명령어를 실행하면 Encord Active가 다운로드됩니다:

Run the following commands in your favorite Python environment with the following commands will download Encord Active:

python3.9 -m venv ea-venv
source ea-venv/bin/activate
# venv에서 실행 / within venv 
pip install encord-active

또는 GitHub에서 Encord Active를 다운로드하여 설치하려면 아래 명령어를 실행하세요:

Or you can follow through the following command to install Encord Active using GitHub:

pip install git+https://github.com/encord-team/encord-active

Encord Active가 설치되었는지를 확인하려면, 다음 명령어를 실행하세요:

To check if Encord Active has been installed, run:

encord-active --help

Encord Active에는 MNIST, BDD100K, TACO 데이터셋 등과 같은 다양한 예제(sandbox) 데이터셋들이 있습니다. Caltech-101 데이터셋도 그 중 하나입니다. 이러한 예제 데이터셋은 컴퓨터 비전 애플리케이션에서 벤치마크 모델을 구축하기 위해 주로 사용합니다.

Encord Active has many sandbox datasets like the MNIST, BDD100K, TACO dataset, and much more. Caltech101 dataset is one of them. These sandbox datasets are commonly used in computer vision applications for building benchmark models.

이제 Encord Active가 설치되었으므로 다음 명령을 실행하여 Caltech-101 데이터셋를 다운로드해 보겠습니다:
Now that you have Encord Active installed, let’s download the Caltech101 dataset by running the command:

encord-active download

스크립트에서 프로젝트를 선택하고 ↓ 및 ↑ 옵션을 탐색하여 Caltech-101 학습 또는 테스트 데이터셋을 선택한 뒤 Enter 키를 누릅니다. 데이터셋은 데이터 분석의 편의를 위해 데이터의 60%로 구성된 학습용셋과 나머지 40%로 구성된 테스트셋으로 미리 분할되어 있습니다.

The script asks you to choose a project, navigate the options ↓ and ↑ select the Caltech-101 train or test dataset, and hit enter. The dataset has been pre-divided into a training set comprising 60% of the data and a testing set comprising the rest 40% of the data for the convenience of analyzing the dataset.

간단합니다! 이제 데이터를 받았습니다. 브라우저에서 데이터를 시각화하려면 다음 명령을 실행합니다:

Easy! Now, you got your data. To visualize the data in the browser, run the command:

# 데이터를 다운로드 받은 경로로 이동
cd /path/to/downloaded/project
encord-active visualize

아래 이미지와 같이 웹 브라우저에 학습 데이터와 그 속성을 보여주는 웹 페이지가 열리는 것을 볼 수 있습니다.

The image below shows the webpage that opens in your browser showing the training data and its properties.

브라우저에서 데이터 시각화(데이터 = Caltech-101 전체 데이터셋의 60%인 학습 데이터)

Visualize the data in your browser (data = Caltech-101 training data-60% of Caltech-101 dataset)

2D 임베딩 플롯은 Data QualityLabel Quality 섹션의 Explorer 페이지에서 찾을 수 있습니다.

The 2D embedding plot can be found in the Explorer pages of the Data Quality and Label Quality sections.


Encord의 Data Quality Explorer 페이지에 있는 2D 임베딩 플롯
The 2D embedding plot in the Data Quality Explorer page of Encord.

여기서 보이는 2D 임베딩 플롯은 각 포인트 하나하나가 데이터셋의 데이터들을 나타내는 분산형 차트입니다. 플롯에서 각 포인트의 위치는 서로 다른 데이터들 간의 상대적 유사성 또는 비유사성을 반영합니다. 예를 들어, 플롯의 오른쪽 위 모서리에 있는 상자 또는 올가미 선택을 선택합니다. 영역을 선택하면 선택한 영역의 이미지만 시각화할 수 있습니다.

The 2D embedding plot here is a scatter plot with each point representing a data point in the dataset. The position of each point on the plot reflects the relative similarity or dissimilarity of the data points with respect to each other. For example, select the box or the Lasso Select in the upper right corner of the plot. Once you select a region, you can visualize the images only in the selected region.

이제 데이터를 2차원으로 투영하여 데이터 분석에 유용할 수 있는 유사한 데이터 포인트의 클러스터, 이상값 및 기타 패턴을 볼 수 있습니다.

By projecting the data into two dimensions, you can now see clusters of similar data points, outliers, and other patterns that may be useful for data analysis.

예를 들어, 선택한 클러스터에 하나의 이상값이 있음을 알 수 있습니다.
For example, we see in the selected cluster, there is one outlier.

Label Quality Explorer 페이지의 2D 임베딩 플롯은 각 이미지의 데이터 포인트를 보여주며 각 색상은 객체가 속한 클래스를 나타냅니다. 이를 통해 객체 레이블의 예상치 못한 관계나 모델 편향 가능성을 파악하여 이상값을 찾는데 도움이 됩니다.

The 2D embedding plot in label quality shows the data points of each image and each color represents the class the object belongs to. This helps in finding out the outliers by spotting the unexpected relationships or possible areas of model bias for object labels.

이 플롯은 데이터셋의 분리 가능성도 보여줍니다. 분리 가능한 데이터셋은 상대적으로 적은 수의 매개변수로 높은 정확도를 달성할 수 있는, 더 간단하면서도 효율적인 컴퓨터 비전 모델을 사용할 수 있기 때문에 객체 인식에 유용합니다.

This plot also shows the separability of the dataset. A separable dataset is useful for object recognition because it allows for the use of simpler and more efficient computer vision models that can achieve high accuracy with relatively few parameters.


Encord의 Label Quality Explorer 페이지에 있는 2D 임베딩 플롯
The 2D embedding plot in the Label Quality Explorer page of Encord.

분리 가능한 데이터셋은 필요한 경우 더 복잡한 모델을 탐색하기 전에 간단한 머신러닝 모델을 빠르게 개발하고 평가할 수 있기 때문에 객체 분류에 유용한 출발점입니다. 또한 데이터와 다양한 객체 클래스를 구별하도록 하는 피처(feature)을 더 잘 이해하는 데 도움이 되며, 이는 향후 더 정교한 모델을 개발하는 데 유용할 수 있습니다.

A separable dataset is a useful starting point for object classification, as it allows us to quickly develop and evaluate simple machine learning models before exploring more complex models if needed. It also helps us better understand the data and the features that distinguish the different classes of objects, which can be useful for developing more sophisticated models in the future.

:bulb: 데이터셋을 더 잘 이해하려면 Caltech-101 데이터셋에 대한 자세한 분석을 읽어보세요. 학습 데이터를 시각화하고 분석하는 방법도 알아볼 수 있습니다!

:bulb: Read the detailed analysis of the Caltech101 dataset to understand the dataset better. You can also find out how to visualize and analyze your training data!

지금까지 다양한 유형의 임베딩과 이를 사용하여 학습 데이터의 품질을 분석하고 개선하는 방법에 대해 알아보았습니다. 이제 AI 임베딩을 사용하여 학습 데이터를 생성할 때 염두에 두어야 할 몇 가지 모범 사례에 초점을 맞춰 보겠습니다.

So far, we have discussed various types of embeddings and how they can be used for analyzing and improving the quality of training data. Now, let's shift our focus to some of the best practices that should be kept in mind while using AI embeddings for creating training data.

컴퓨터 비전 및 머신러닝 분야에서의 임베딩 모범 사례 / Best Practices for Embeddings in Computer Vision & Machine Learning

다음은 학습 데이터를 위해 생성한 AI 임베딩의 품질이 우수한지 확인할 수 있는 몇 가지 모범 사례입니다:

Here are some of the best practices to sense that the AI embeddings you create for training data are of high quality:

적절한 임베딩 기법 선택하기 / Choosing an Appropriate Embedding Technique

AI 임베딩을 사용하여 고품질의 학습 데이터를 생성하려면 적절한 임베딩 기법을 선택하는 것이 중요합니다.

Choosing the appropriate embedding techniques is crucial for using AI embeddings to create high-quality training data.

데이터 유형과 목적에 따라 임베딩 기법이 달라질 수 있습니다. 임베딩 기법을 선택하기 전에 데이터와 해결해야 할 문제(작업)를 신중하게 고려하는 것이 중요합니다. 임베딩 기법에 필요한 컴퓨팅 자원과 결과 임베딩의 크기를 알아두는 것도 중요합니다.

Different embedding techniques may be more suitable for different data types and tasks. It’s essential to carefully consider the data and the task at hand before selecting an embedding technique. It is also important to remember the computational resources required for the embedding technique and the size of the resulting embeddings.

또한 AI 임베딩 분야의 최신 연구와 기술을 최신 상태로 유지하는 것도 중요합니다. 이를 통해 고품질의 학습 데이터를 생성하는 데 가장 효과적이고 효율적인 임베딩 기법을 사용할 수 있습니다.

It’s also important to stay up to date with the latest research and techniques in the field of AI embeddings. This can help ensure that the most effective and efficient embedding techniques are used for creating high-quality training data.

데이터 편향성 해결 및 다양성 보장하기 / Addressing Data Bias and Ensuring Data Diversity

학습 데이터 임베딩을 생성할 때 크고 다양한 데이터셋을 사용하는 것은 임베딩이 데이터셋의 편향성을 해결할 수 있도록 하는 좋은 방법입니다. 이렇게 하면 데이터의 모든 범위의 변화를 포착할 수 있으며 보다 정확한 임베딩을 생성할 수 있습니다.

Using a large and diverse dataset for generating embeddings for the training data is a good way to ensure the embeddings address the bias in the dataset. This helps capture the full range of variation in the data and results in more accurate embeddings.

임베딩 검증하기 / Validating the Embeddings

임베딩의 품질을 검증하기 위해 임베딩을 분석하는 것은 매우 중요한 단계입니다. 임베딩을 평가하고 검증하여 관련 정보를 캡처하고 당면한 작업에 효과적으로 사용할 수 있는지 확인해야 합니다. 저차원 공간에서 임베딩을 시각화하면 데이터의 패턴이나 클러스터를 식별하고 유효성 검사 프로세스를 지원하는 데 도움이 될 수 있습니다.

Analyzing the embeddings to validate their quality is a crucial step. The embeddings should be evaluated and validated to ensure that they capture the relevant information and can be used effectively for the task at hand. Visualization of the embeddings in a lower-dimensional space can help identify any patterns or clusters in the data and aid in the validation process.

결론 / Conclusion

결론적으로, AI 임베딩은 머신러닝에서 고품질의 학습 데이터를 생성하기 위한 강력한 도구입니다. 임베딩을 사용하면 데이터 과학자는 데이터 품질을 개선하고, 수동 데이터 라벨링의 필요성을 줄이며, 보다 효율적인 계산을 가능하게 할 수 있습니다. AI 임베딩을 사용하기 위한 모범 사례는 다음과 같습니다:

In conclusion, AI embeddings are powerful tools for creating high-quality training data in machine learning. By using embeddings, data scientists can improve data quality, reduce the need for manual data labeling, and enable more efficient computation. Best practices for using AI embeddings include:

  • 적절한 기술 선택
  • 데이터 편향성 해결 및 다양성 보장
  • 데이터 품질에 영향을 미칠 수 있는 제한 사항 이해하기
  • Choosing appropriate techniques.
  • Addressing data bias and ensuring diversity.
  • Understanding limitations that could impact data quality.

AI 임베딩은 머신러닝 분야에서 유망한 미래가 기대되는 기술이며, 가능하면 데이터 생성 시 이를 구현하는 것이 좋습니다.

AI embeddings have a promising future in machine learning, and we recommend implementing them in data creation whenever possible.

임베딩의 미래 / Future Directions

앞으로 임베딩 기술과 도구가 더욱 정교해질 뿐만 아니라 이미지와 텍스트 분류를 넘어 다양한 애플리케이션에서 임베딩의 활용도가 높아질 것으로 예상됩니다. 예를 들어, Meta AI의 새로운 모델인 ImageBIND는 이미지, 텍스트, 오디오 등 여러 형태의 데이터들을 하나의 임베딩 공간에 위치시키는 머신러닝 모델입니다. 이 모델은 여러 모달리티를 효과적으로 통합하고 다양한 멀티모달 작업의 성능을 개선할 수 있도록 설계되었습니다.

In the future, we can expect to see more sophisticated embedding techniques and tools, as well as increased use of embeddings in a wide range of applications beyond image and text classification. For example, Meta AI’s new model ImageBIND is a machine learning model that creates a joint embedding space for multiple modalities, such as images, text, and audio. The model is designed to enable the effective integration of multiple modalities and improve performance on a variety of multi-modal machine learning tasks.

:bulb: ImageBIND 설명서를 읽고 그 이유를 알아보세요!

:bulb: Read the ImageBIND explainer to understand why it is so exciting!

임베딩의 시각화 및 분석을 용이하게 하는 플랫폼의 개발은 흥미로운 연구 분야입니다. 이러한 플랫폼을 사용하면 고차원 데이터 내의 구조와 관계를 더 쉽게 탐색할 수 있으며, 다른 방법으로는 감지하기 어려운 패턴과 이상값을 식별하는 데 도움이 될 수 있습니다. 이러한 플랫폼의 한 가지 예로, 사용자가 이미지 데이터 세트를 2D 임베딩 플롯으로 시각화하고, 특정 클러스터에서 이미지를 탐색할 수 있는 Encord Active가 있습니다!

The development of platforms that facilitate the visualization and analysis of embeddings is an exciting area of research. These platforms make it easier to explore the structure and relationships within high-dimensional data and can help identify patterns and outliers that would be difficult to detect otherwise. One example of such a platform is Encord Active, which allows users to visualize their image dataset in a 2D embedding plot and explore images in specific clusters as we saw in the case study above!

2개의 좋아요