WO2023224344A1 - 텍스트-이미지 간 대조를 기반으로 한 사전 훈련 통합 프레임워크를 제공하는 방법 및 이를 이용한 전자 장치 - Google Patents

텍스트-이미지 간 대조를 기반으로 한 사전 훈련 통합 프레임워크를 제공하는 방법 및 이를 이용한 전자 장치 Download PDF

Info

Publication number
WO2023224344A1
WO2023224344A1 PCT/KR2023/006577 KR2023006577W WO2023224344A1 WO 2023224344 A1 WO2023224344 A1 WO 2023224344A1 KR 2023006577 W KR2023006577 W KR 2023006577W WO 2023224344 A1 WO2023224344 A1 WO 2023224344A1
Authority
WO
WIPO (PCT)
Prior art keywords
domain
image
text
training
data
Prior art date
Application number
PCT/KR2023/006577
Other languages
English (en)
French (fr)
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
Priority claimed from KR1020230061358A external-priority patent/KR20230160729A/ko
Application filed by 주식회사 엘지경영개발원 filed Critical 주식회사 엘지경영개발원
Publication of WO2023224344A1 publication Critical patent/WO2023224344A1/ko

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/906Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning

Definitions

  • the present disclosure relates to a method of providing a pre-training integration framework based on text-image contrast and an electronic device using the same.
  • Embodiments of the present disclosure seek to solve the problem that large-scale multi-modal expression learning, such as the CLIP method, consumes a lot of data.
  • CLIP method learns video self-supervision together
  • DeCLIP learns natural language supervised learning with multi-view supervision, image self-supervision, text self-supervision, and nearest neighbor supervision. Perform.
  • augmented recognition function embedding is utilized.
  • SSL can be more powerful for image enhancement than VLP. This may be because some augmentations used only in SSL may break the alignment between image and test domain. Conversely, when using only weak augmentation, training from the image-to-image domain may not perform sufficiently.
  • the present disclosure utilizes an architecture that includes an augmentation agnostic image encoder and an augmentation aware projection head.
  • An electronic device providing a pre-training integrated framework based on text-image contrast includes a pre-training module, a loss application module, a score application module, and the pre-training module and loss application. a module, and a processor that controls the operation of the score application module, wherein the processor performs pre-training on a data set containing at least one of text and images corresponding to a data set domain input through the pre-training module. And, apply a loss to a plurality of positive samples among the data sets pre-trained through the loss application module, and pre-train data from a plurality of domains based on similarity through the score application module. It can be set up by applying a score to embed the set in the same space.
  • a processor of an electronic device that provides a pre-training integrated framework based on text-image contrast includes an augmentation-agnostic image encoder and an augmentation-aware projection head. ) can be set to perform pre-training for the data set domain through the pre-training module.
  • the processor of an electronic device that provides a pre-training integrated framework based on text-image contrast may perform training on a text domain, an image domain, and a text-image complex domain through the pre-training module.
  • Pre-training with data augmentation may be performed, and the image domain may be comprised of a basic image domain, a first-stage augmented image domain, and a second-stage augmented image domain and embedded in the same space.
  • a processor of an electronic device that provides a pre-training integrated framework based on text-image contrast determines whether data is augmented for the image domain and augments the data confirmed through the augmentation encoder. is set to perform pre-training to correct misalignment caused by the data augmentation through the augmented recognition projection head based on the performed encoding, and the misalignment is set to perform pre-training in the image domain. It can be characterized as an inconsistency that occurs with the text domain due to data augmentation.
  • a processor of an electronic device that provides a pre-training integrated framework based on text-image contrast may detect loss between the text domain and the image domain embedded in the same space through the loss application module. Can be set to adjust the balance.
  • a processor of an electronic device that provides a pre-training integrated framework based on text-image contrast may provide information about the text domain and the image domain embedded in the same space through the score application module. It may be characterized by measuring similarity between data included in individual domains based on different characteristics.
  • a processor of an electronic device that provides a pre-training integrated framework based on text-image contrast may apply first parameters and second parameters for each text domain and the image domain through the score application module. You can set to apply a similarity score based on .
  • a method of providing a pre-training integrated framework based on text-image contrast includes a data set including at least one of text and images corresponding to a data set domain input through a pre-training module.
  • a step of performing pre-training a step of applying a loss to a plurality of positive samples among the pre-trained data sets through a loss application module, and a plurality of samples based on similarity through a score application module. It may include applying a score for embedding a pre-trained data set from the domain in the same space.
  • negative image pairs may have higher similarity than difficult positive text pairs to images and vice versa. Therefore, in order to compare data from multiple domains in the same space, compensation for domain differences can be performed.
  • learnable parameters are used to measure similarity that can compensate for domain differences, and a new MP-NCE loss function is proposed.
  • UniCLIP contrastive text-image dictionary training
  • the processor can train the model by embedding various supervisions in one space. This allows the processor to obtain a richer expressive encoder through an independent supervision space.
  • UniCLIP compares all embeddings (data) across domains to increase batch size while minimizing additional memory consumption.
  • UniCLIP of the present disclosure can significantly outperform existing methods in a variety of single and multi-mode downstream tasks such as linear probing, zero-shot classification, fine-tuning, and image-text search.
  • FIG. 1 is a schematic block diagram of an electronic device providing an integrated framework according to various embodiments of the present disclosure.
  • Figure 2 is a schematic flowchart of a method for providing a pre-training integrated framework based on text-image contrast according to various embodiments of the present disclosure.
  • Figure 3 is an example diagram of dictionary training based on text-image contrast according to various embodiments of the present disclosure.
  • Figure 4 is an example diagram of data augmentation of an image domain according to various embodiments of the present disclosure.
  • Figure 5 is an example diagram of results related to dictionary training based on text-image contrast according to various embodiments of the present disclosure.
  • Figure 6 is a process structure diagram of a method for providing an integrated framework according to various embodiments of the present disclosure.
  • first and second are used to distinguish one component from another component, and the components are not limited by the above-mentioned terms.
  • the identification code for each step is used for convenience of explanation.
  • the identification code does not explain the order of each step, and each step may be performed differently from the specified order unless a specific order is clearly stated in the context. there is.
  • 'device according to the present disclosure includes all various devices that can perform computational processing and provide results to the user.
  • the device according to the present disclosure may include all of a computer, a server device, and a portable terminal, or may take the form of any one.
  • the computer may include, for example, a laptop, desktop, laptop, tablet PC, slate PC, etc. equipped with a web browser.
  • the server device is a server that processes information by communicating with external devices, and may include an application server, computing server, database server, file server, game server, mail server, proxy server, and web server.
  • the portable terminal is, for example, a wireless communication device that guarantees portability and mobility, such as PCS (Personal Communication System), GSM (Global System for Mobile communications), PDC (Personal Digital Cellular), PHS (Personal Handyphone System), and PDA. (Personal Digital Assistant), IMT (International Mobile Telecommunication)-2000, CDMA (Code Division Multiple Access)-2000, W-CDMA (W-Code Division Multiple Access), WiBro (Wireless Broadband Internet) terminal, smart phone ), all types of handheld wireless communication devices, and wearable devices such as watches, rings, bracelets, anklets, necklaces, glasses, contact lenses, or head-mounted-device (HMD). may include.
  • PCS Personal Communication System
  • GSM Global System for Mobile communications
  • PDC Personal Digital Cellular
  • PHS Personal Handyphone System
  • PDA Personal Digital Assistant
  • IMT International Mobile Telecommunication
  • CDMA Code Division Multiple Access
  • W-CDMA Wideband Code Division Multiple Access
  • WiBro Wireless Broadband Internet
  • smart phone smart phone
  • FIG. 1 is a schematic block diagram of an electronic device providing an integrated framework according to various embodiments of the present disclosure.
  • the electronic device 100 may include a type of server that provides a pre-training integrated framework based on text-image contrast.
  • the electronic device 100 may include, but is not limited to, a pre-training module 111, a loss application module 112, a score application module 113, a processor 120, and a memory 130 as internal components. No. Each node can exchange data with other nodes. Each node may be connected directly electrically or wired and/or wirelessly through a network.
  • the electronic device 100 of the present disclosure may perform the function of the processor 120 through a separate device instead of the processor 120.
  • the processor 120 may control the operations of the pre-training module 111, the loss application module 112, and the score application module 113.
  • the processor 120 may provide an integrated framework by pre-training based on data acquired through a communication unit (not shown) or data previously stored in the memory 130.
  • the processor 120 includes a memory 130 that stores data for an algorithm for controlling the operation of components in the electronic device 100 or a program that reproduces the algorithm, and a memory 130 stored in the memory 130. It may be implemented with at least one functional block that performs the above-described operation using data. At this time, the processor 120 and memory 130 may each be implemented as separate chips. Alternatively, the processor 120 and memory 130 may be implemented as a single chip.
  • the processor 120 may control any one or a combination of a plurality of the above-described components to implement various embodiments according to the present disclosure described in FIGS. 2 to 6 below in the electronic device 100.
  • the memory 130 may store data supporting various functions of the electronic device 100 and a program for the operation of the processor 120, and may store input/output data (e.g., images, images, etc.), a plurality of application programs (application programs or applications) running on the electronic device 100, data for operating the electronic device 100, and commands. At least some of these applications may be downloaded from an external server via wireless communication.
  • input/output data e.g., images, images, etc.
  • application programs application programs or applications
  • the memory 130 may be a flash memory type, a hard disk type, a solid state disk type, an SDD type (Silicon Disk Drive type), or a multimedia card micro type. micro type), card type memory (e.g. SD or XD memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), EEPROM (electrically erasable) It may include at least one type of storage medium among programmable read-only memory (PROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, and optical disk. Additionally, the memory is separate from the electronic device 100, but may be a database connected wired or wirelessly.
  • At least one component may be added or deleted in response to the performance of the components shown in FIG. 1. Additionally, it will be easily understood by those skilled in the art that the mutual positions of the components may be changed in response to the performance or structure of the device.
  • each component shown in FIG. 1 refers to software and/or hardware components such as Field Programmable Gate Array (FPGA) and Application Specific Integrated Circuit (ASIC).
  • FPGA Field Programmable Gate Array
  • ASIC Application Specific Integrated Circuit
  • Figure 2 is a schematic flowchart of a method for providing a pre-training integrated framework based on text-image contrast according to various embodiments of the present disclosure.
  • An electronic device uses a transformer-based architecture for both image and text encoders.
  • the electronic device may include an augmentation-agnostic image encoder.
  • the electronic devices utilize the same training hyperparameter configuration.
  • the electronic device adopts a vision transformer using learnable positional embeddings with an image encoder f I.
  • the image expression h I can be used as the last activation value of the token. Since the image encoder expresses the input image domain without information about what data augmentation was applied, the quality of expression can be sufficiently guaranteed through data augmentation.
  • the electronic device includes an augmented encoder.
  • the parameters for the individual data augmentations may need to be determined first.
  • the electronic device creates an augmentation configuration a with these parameters and can store it including information about the type and degree of transformation to be applied to the image.
  • the augmented configuration a is encoded using an augmented encoder f A , a 3-layer multi layer perceptron (3-layer MLP), and is passed to the projection head in the form of an augmented token h a .
  • the electronic device augments randomresizedcrop, color jittering, Gaussian blur, and horizontal flip & gray scale in pre-training and mediates them. It can be used as a variable.
  • the lower and upper limits of the crop area and aspect ratio may be preset. Within this range, the upper left coordinates of the crop area, the height, and the width of the crop area can be arbitrarily determined. If you crop the image using this value, the image size can be resized to 224X224. Additionally, the x, y coordinates, height, and width of the upper left corner can be converted between 0 and 1 as a ratio to the total image size. These values are included in the augmentation configuration and can contain information about any part of the entire image.
  • Color jittering may adjust four values of image, brightness, contrast, saturation, and hue in a random order.
  • the original image is returned when the first three values are 1 and the last three values are 0, and you can define the name of these values as original.
  • Each value can be determined uniformly and randomly within a predefined range depending on the origin.
  • differences from the original may be included in each augmented configuration.
  • Gaussian blur according to the embodiment can be utilized by setting the sigma to be used in the Gaussian kernel.
  • Electronic devices can be randomly sampled from a predefined range and included in the augmentation configuration.
  • Horizontal flip and gray scale according to embodiments may operate without parameters.
  • the electronic device can express application as 1 and 0 and include this in the augmented configuration.
  • An electronic device may include an augmentation-aware projection head.
  • the augmented recognition projection head may cause augmentation tokens and augmentation agnostic image features to be included in the latent space.
  • Augmented-aware projection heads can be trained to ignore augmentation effects that return misaligned data within the same semantic boundaries of the latent space.
  • a residual bottleneck block can be used in the augmented recognition projection head g I. The reason may be that the augmented recognition projection head must have a sufficient encoding function to encode augmentation information and image information at once.
  • the residual bottleneck block may contain two linear layers with GELU enabled. Here, layer normalization can be applied before the block and residual connection can be applied after the block.
  • An electronic device may include a text encoder.
  • Electronic devices can utilize transformers as text backbone networks with learnable positional embeddings.
  • raw text may be tokenized with byte pair encoding (BPE) and wrapped with a start token and a last token.
  • BPE byte pair encoding
  • the text encoder f T computes the output without an attention mask, and the last activation value of the start token can be used in the text representation h T .
  • the linear projection layer g T may be embedded in the latent space.
  • the architecture described in this way can be defined as the data embedding process below.
  • the augmented image x a Aug(x I ;a) can be described by any image x I , augmented composition a, and arbitrary text x T.
  • a processor may perform pre-training for an individual domain. Pre-training may be performed on a data set containing at least one of text and images corresponding to the input data set domain through a pre-training module (e.g., pre-training module 111 in FIG. 1).
  • a pre-training module e.g., pre-training module 111 in FIG. 1.
  • the electronic device can improve data efficiency by integrating contrastive learning that was independently used in different domains into one framework.
  • the integrated framework provided by the electronic device of the present disclosure may be referred to as UniCLIP (unified framework for contrastive language-image pretraining).
  • the electronic device solves new problems and extends existing contrastive learning in areas such as architecture, contrast loss, similarity score, etc., for an integrated framework of contrastive learning.
  • by verifying the effect of contrastive pretraining on image-text open data sets such as CC3M, CC12M, and YFCC15M higher performance can be achieved compared to the existing CLIP (contrastive language-image pretraining) method.
  • the method for providing an integrated framework of the present disclosure can define all pairs of contrastive learning within and between multiple domains in one integrated embedding space.
  • the processor may perform pre-training on the data set domain through the pre-training module based on an augmented image encoder and an augmented recognition projection head.
  • the processor may perform pre-training with data augmentation on the text domain, image domain, and text-image composite domain through the pre-training module.
  • the image domain may be composed of a basic image domain, a first-stage augmentation image domain (e.g., weak augmentation image domain), and a second-stage augmentation image domain (e.g., strong augmentation image domain), and the processor may , contrast learning (e.g., pre-training) can be performed on all domain pairs between image-text domains and between text-text domains.
  • the processor may check whether the data for the image domain is augmented and may perform encoding on whether the data confirmed through the augmented image encoder is augmented.
  • the processor performs pre-training to correct misalignment caused by the data augmentation through the augmented recognition projection head based on the performed encoding, where misalignment occurs due to data augmentation for the image domain and the text domain. There may be a discrepancy.
  • a processor may encode information about what type of data augmentation has been applied to the image domain through an augmented image encoder. This augmentation information is passed to the augmented recognition projection head, and the augmented recognition projection head can be pre-trained to correct inconsistencies resulting from data augmentation. Accordingly, the processor can fully utilize the augmented data while preventing inconsistencies from corrupting model training.
  • the processor may apply loss to a plurality of samples.
  • the processor may apply loss to a plurality of positive samples from the pre-trained data set through a loss application module (e.g., loss application module 112 of FIG. 1).
  • the processor can adjust the balance of loss between the text domain and image domain embedded in the same space through the loss application module.
  • the processor can perform balance adjustment for all domain pairs, such as text-image, image-image, and text-text domains.
  • the processor may measure similarity.
  • the processor can measure the similarity between data contained in individual domains based on different characteristics for the text domain and image domain embedded in the same space through a score application module (e.g., score application module 113 in Figure 1). there is. Accordingly, the processor can apply a similarity score based on parameters for each text domain and image domain.
  • the processor may perform embedding in one space.
  • the processor may provide an integration framework.
  • the contrastive loss function can be classified according to the number of positive and negative pairs that the loss for one data point takes. For example, triplet loss takes only a single positive pair and a single negative pair, N-pair loss and infoNCE loss take a single positive pair and multiple negative pairs, and MIL-NCE loss. and SupCon loss can take multiple positive pairs and multiple negative pairs. Since the integrated framework of the present disclosure has a plurality of positive pairs, the MIL-NCE loss and SupCon loss functions are first checked.
  • the similarity score between the i-th and j-th embeddings may be expressed as s i,j > 0.
  • the MIL-NCE loss for the i-th embedding can be expressed as Equation (4) below.
  • the MIL-NCE loss function in Equation (4) above is the similarity score of all positive pairs Maximize the sum of the similarity scores of all negative pairs. It is designed to minimize the sum of .
  • MIL-NCE loss divides the negative pair into positive scores rather than each positive pair s i,p. If there is an easy positive pair whose similarity scores are large enough to dominate the scores of the difficult positive and negative pairs because they are compared to It is not possible to receive sufficient gradients from part If, The slope from s i,q can be expressed as equation (5) below.
  • the SupCon loss for the i-th embedding can be expressed as Equation (6) below.
  • each positive pair s i,p is compared to a negative pair, but the sum of the positive scores in the denominator may still cause undesirable side effects.
  • the loss can be reduced by reducing the score and the denominator.
  • the sum of the positive scores in the denominator causes easy and difficult positive pairs to interfere with each other, so a multiple positive version of the infoNCE loss is used as shown in Equation (9) and (10) below to determine the individual positive scores. You can have pairs contribute independently to the loss.
  • equation (11) can be used as the loss function.
  • w i,p can play a role in ensuring that inter-domain and intra-domain pairs are reflected in the loss with the same contribution based on the domain relationship of the input pair. Additionally, by including the similarity score with oneself in the loss, the effect of creating a reference point for temperature and offset training can be expected.
  • the temperature may be the first parameter
  • the offset may correspond to the second parameter.
  • the processor can apply multi-positive NCE (MP-NCE), which is expanded so that infoNCE loss can be applied even in situations where multiple positive samples exist, as shown in Equation (11).
  • MP-NCE multi-positive NCE
  • MP-NCE takes the average of the infoNCE loss for each individual positive pair in the current batch, and the processor introduces the concept of w i,p, a hyperparameter that can balance the loss between domains, comparing other contrast losses. It can provide superior performance than (e.g. MIL-NCE loss, SupCon loss, etc.).
  • temperature scaled cosine similarity if temperature scaled cosine similarity is designed appropriately for contrastive learning, it can play a role in controlling the strength of the penalty for temperature difficult negative samples.
  • the integrated framework according to the embodiment processes various types of pairs at once. Therefore, there is a need to utilize a similarity measure that can take into account differences in domains.
  • contrastive learning there may be a reference point that divides positives and negatives. This can be used for hardness measuring because easy samples are far away and difficult samples are closer to the reference point. However, since all pairs have the same reference point, there may be no need to consider reference points when using only a single type of data pair. For example, even if the offset value is subtracted from the similarity score considering the reference point, it can be ignored due to the fractional reduction in the infoNCE loss (e.g., equation (3)).
  • the similarity score may need to include offsets differently. Additionally, these types may require different levels of control through specified temperatures. Therefore, it is necessary to design the similarity function to have various offset and temperature terms depending on the domain relationship of the input pair. Additionally, learnable parameters can be set so that the model can adjust appropriate values on its own. This can be expressed as equation (12) below. The concept of b D(i,j) in Equation (12) did not exist in the similarity score between two embeddings in existing contrast learning. In UniCLIP, the processor of the present disclosure can set the appropriate range of the score differently for each domain by taking advantage of the fact that each domain has different characteristics in a situation where data from multiple domains are embedded in the same space.
  • This can be referred to as a domain-dependent similarity score, and the processor can learn different appropriate temperatures and offsets for each individual domain D through UniCLIP. Accordingly, because image-image, image-text, and text-text pairs exist in the framework, the processor of the present disclosure can use three temperatures and offsets for learning.
  • Figure 3 is an example diagram of dictionary training based on text-image contrast according to various embodiments of the present disclosure.
  • simCLR can be composed of two main components. It augments the input image through data augmentation, which allows the model to operate robustly in various environments. Additionally, simCLR can perform learning by utilizing contrast loss to maximize similarity between images and minimize similarity with other images. This may be one way to utilize relatively strong augmentation.
  • CLIP is a pre-training method that learns interactions between images and text, allowing it to perform a variety of downstream tasks.
  • CLIP allows you to compare images and text in one space, allowing you to measure the similarity between images and text.
  • CLIP can perform pre-training through methods such as contrastive learning and self-supervision. In particular, it focuses on learning the characteristics between image and text, and pairs of images and corresponding texts can be used as positive pairs. However, if the image is augmented a lot, the domain relationship with the text changes significantly, so only relatively weak augmentation is possible.
  • SLIP can measure similarity between images using expressions learned using image data. This is a method that uses simCLR and CLIP together, and is a simple combination of the two methods and does not cover all domain pairs, such as text-image, image-image, and text-text domains.
  • UniCLIP allows efficient learning of all pairs between all domains, and this can be represented as an example in FIG. 3.
  • 310 and 320 may refer to domains in an integrated framework that an electronic device (eg, the electronic device 100 of FIG. 1) seeks to provide.
  • the text domain has 311 for 'dog' and 321 for 'cat'
  • the image domain has 312, 313, 314 related to 'dog' and 322, 323, 324 related to 'cat'.
  • the text domain 311 and the image domains 312, 313, and 314 included in 310 can be determined as a positive pair, which means that the text domain 321 and the image domains 322, 323, and 320 included in 320. 324), the same may be true.
  • the basic image domains among the image domains of FIG. 3 may be 312 and 322.
  • the first stage augmented image domain may correspond to 313 and 323, and the second stage augmented image domain may correspond to 314 and 324.
  • the first level enhancement may be a weak image enhancement (eg, transformation)
  • the second level enhancement may be a strong image enhancement
  • the steps may be classified according to the degree of enhancement.
  • a processor may perform pre-training on a plurality of positive samples within and between all domains, as shown in FIG. 3. Through this, the processor can provide a more elaborate and clear framework than existing methods such as simCLR, CLIP, and SLIP.
  • Figure 4 is an example diagram of data augmentation of an image domain according to various embodiments of the present disclosure.
  • image-text mismatch due to augmentation is a major problem that occurs in the process of designing contrastive learning between multiple domains in a single integrated embedding space.
  • the basic image domain may correspond to 411, and the basic text domain may correspond to 412.
  • Each image domain that is flipped, grayscale, or cropped with respect to the basic image domain may correspond to 421, 431, and 441.
  • the relationship with the basic text domain can completely change.
  • the default text domain 412 has an inconsistency in a bolded part (e.g. right) like 422 in 421, a mismatch in a bolded part (e.g. red, green) like 431 in 432, or a mismatch in a bolded part (e.g. red, green) in 441.
  • a processor may resolve such inconsistency by reflecting image augmentation information in embedding in an integrated framework.
  • Figure 5 is an example diagram of results related to dictionary training based on text-image contrast according to various embodiments of the present disclosure.
  • FIG. 5 may be an example of pre-training of a processor (eg, processor 120 of FIG. 1) for multiple domains.
  • weak augmentation may be a first-stage augmented image domain
  • strong augmentation SA
  • Text may be a text domain.
  • SA can exist in plurality by augmenting the basic image domain with data in various ways.
  • the processor may perform pre-training between image-text domains as shown in 510. Additionally, the processor may perform image-to-image domain pre-training and text-to-text pre-training as shown in 520. In other words, the processor can perform pre-training in all given domains to provide an integrated framework.
  • Figure 5 shows an example of configuring a framework tightly in one embedding space by performing pre-training.
  • Figure 6 is a process structure diagram of a method for providing an integrated framework according to various embodiments of the present disclosure.
  • An electronic device may include an augmentation-aware projection head.
  • the augmented recognition projection head may cause augmentation tokens and augmentation agnostic image features to be included in the latent space.
  • Augmented-aware projection heads can be trained to ignore augmentation effects that return misaligned data within the same semantic boundaries of the latent space.
  • a residual bottleneck block can be used in the augmented recognition projection head g I. The reason may be that the augmented recognition projection head must have a sufficient encoding function to encode augmentation information and image information at once.
  • the residual bottleneck block may contain two linear layers with GELU enabled. Here, layer normalization can be applied before the block and residual connection can be applied after the block.
  • An electronic device may include a text encoder.
  • Electronic devices can utilize transformers as text backbone networks with learnable positional embeddings.
  • raw text can be tokenized with byte pair encoding (BPE) and wrapped with a start token and a last token to generate tokenized text x.
  • BPE byte pair encoding
  • a transformer can be used for the text encoder f T with learnable positional embeddings, and a linear layer can be used for the text projection head g T .
  • the last activation value of the start token can be used as the text representation h. That is, the text encoder f T computes the output without an attention mask, and the last activation value of the start token can be used in the text representation h T .
  • a processor encodes information about what type of augmentation has been applied to the image domain through an augmented image encoder, and encodes information about this augmentation and features of the image.
  • the embedding is performed so that it passes through the augmented recognition projection head and becomes the final embedding.
  • the processor can know the augmentation information applied to the image through the augmentation recognition projection head, and the augmentation recognition projection head can correct the image-text mismatch problem caused by augmentation.
  • the information encoded through the augmented image encoder was blurry, but passed through the augmented recognition projection head, became thicker with the text, and was combined with the results of the text encoder and text projection head to be embedded in one space.
  • blurry information may mean the state before enhancement
  • dark information may mean the state after enhancement.
  • Figure 6 shows augmented learning of text and images and embedding them in one space.
  • the electronic device of the present disclosure can perform a process of displaying clearer information by correcting inconsistencies with the text represented by each image in one space.
  • the electronic device can perform a process that allows the correlation between text and images to be clearly expressed in one space through data augmentation.
  • the disclosed embodiments may be implemented in the form of a recording medium that stores instructions executable by a computer. Instructions may be stored in the form of program code, and when executed by a processor, may create program modules to perform operations of the disclosed embodiments.
  • the recording medium may be implemented as a computer-readable recording medium.
  • Computer-readable recording media include all types of recording media storing instructions that can be decoded by a computer. For example, there may be Read Only Memory (ROM), Random Access Memory (RAM), magnetic tape, magnetic disk, flash memory, optical data storage device, etc.
  • ROM Read Only Memory
  • RAM Random Access Memory
  • magnetic tape magnetic tape
  • magnetic disk magnetic disk
  • flash memory optical data storage device

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Artificial Intelligence (AREA)
  • Image Analysis (AREA)

Abstract

본 개시의 실시예에 따른 텍스트-이미지 간 대조를 기반으로 한 사전 훈련 통합 프레임워크를 제공하는 전자 장치는 사전 훈련 모듈, 로스(loss) 적용 모듈, 스코어 적용 모듈, 및 상기 사전 훈련 모듈, 로스 적용 모듈, 및 스코어 적용 모듈의 동작을 제어하는 프로세서를 포함하고, 상기 프로세서는 상기 사전 훈련 모듈을 통해 입력되는 데이터 세트 도메인에 대응하는 텍스트 및 이미지 중 적어도 하나를 포함하는 데이터 세트에 대한 사전 훈련을 수행하고, 상기 로스 적용 모듈을 통해 사전 학습된 데이터 세트 중 복수의 파지티브(positive) 샘플에 대해 로스를 적용하고, 상기 스코어 적용 모듈을 통해 유사성(similarity)을 기반으로 복수의 도메인으로부터 사전 훈련된 데이터 세트를 동일한 공간에 임베딩하기 위한 스코어를 적용하는 것으로 설정될 수 있다.

Description

텍스트-이미지 간 대조를 기반으로 한 사전 훈련 통합 프레임워크를 제공하는 방법 및 이를 이용한 전자 장치
본 개시는 텍스트-이미지 간 대조를 기반으로 한 사전 훈련 통합 프레임워크를 제공하는 방법 및 이를 이용한 전자 장치에 관한 것이다.
사전 훈련된 모델에 대한 연구는 이전부터 꾸준히 진행되어 왔다. 특히, 라벨링 코스트를 줄이기 위해, 라벨링이 되지 않은 데이터 세트를 사용하여 모델을 사전 훈련하고 다운스트림 태스크(downstream task)를 미세 조정하는 많은 셀프 슈퍼비전 학습이 수행되어 왔다. 과거에는 이러한 모델이 지도 학습 모델에서 특성 인코더보다 인코딩 능력이 낮게 평가되어 왔다.
그러나, 컴퓨팅 성능과 데이터 세트의 크기가 증가함에 따라 새로운 접근 방식을 시도할 수 있게 되었으며, 텍스트 셀프 슈퍼비전 학습 분야에서는 마스킹 자동 인코딩 및 자기 회귀 생성 기술이 주로 사용되고 있으며, 이미지 셀프 슈퍼비전 학습의 경우, 증강 기반 대조 학습이 주로 수행되고 있다.
본 개시의 실시예는 CLIP 방식과 같은 대규모 다중 모드 표현 학습은 데이터를 많이 소모하는 문제점을 해결하고자 한다. 이러한 한계를 극복하기 위해 다른 슈퍼비전으로 인한 추가 로스를 이용하여 다양한 연구가 제안되고 있다. 일반적으로 SLIP 방식은 영상 셀프 슈퍼비전을 함께 학습하고, DeCLIP은 멀티-뷰 슈퍼비전, 이미지 셀프 슈퍼비전, 텍스트 셀프 슈퍼비전과 가장 가까운 이웃에 대한 슈퍼비전(nearest neighbor supervision)을 함께 자연어 지도학습을 수행한다.
기존의 사전 훈련 방법에서는 파지티브(positive) 및 네거티브(negative) 쌍(pair)에 초점을 맞추고, 대조 로스를 계산하기 위하여 동일한 영역에서만 제공하였다. 즉, 파지티브 쌍이 텍스트일 때, 네거티브 쌍은 텍스트로만 구성되고, 파지티브 쌍이 이미지인 경우에는 네거티브 쌍은 이미지로만 구성되었었다.
본 개시에서는, 먼저, 증강 인식 기능 임베딩을 활용하게 된다. 일반적으로, SSL은 VLP보다 이미지 증강이 더 강력할 수 있다. 이는 SSL에서만 사용되는 일부 증강이 이미지-테스트 도메인 간 정렬을 깨뜨릴 수 있기 때문일 수 있다. 반대로, 약한 증강만을 사용하는 경우, 이미지-이미지 도메인으로부터의 훈련은 충분히 수행되지 않을 수 있다. 이와 같은 절충 사이에서, 본 개시는 증강 이미지 인코더(augmentation agnostic image encoder)와 증강 인식 프로젝션 헤드(augmentataion aware projection head)를 포함하는 아키텍처를 활용한다.
본 개시가 해결하고자 하는 과제들은 이상에서 언급된 과제로 제한되지 않으며, 언급되지 않은 또 다른 과제들은 아래의 기재로부터 통상의 기술자에게 명확하게 이해될 수 있을 것이다.
본 개시의 실시예에 따른 텍스트-이미지 간 대조를 기반으로 한 사전 훈련 통합 프레임워크를 제공하는 전자 장치는 사전 훈련 모듈, 로스(loss) 적용 모듈, 스코어 적용 모듈, 및 상기 사전 훈련 모듈, 로스 적용 모듈, 및 스코어 적용 모듈의 동작을 제어하는 프로세서를 포함하고, 상기 프로세서는 상기 사전 훈련 모듈을 통해 입력되는 데이터 세트 도메인에 대응하는 텍스트 및 이미지 중 적어도 하나를 포함하는 데이터 세트에 대한 사전 훈련을 수행하고, 상기 로스 적용 모듈을 통해 사전 학습된 데이터 세트 중 복수의 파지티브(positive) 샘플에 대해 로스를 적용하고, 상기 스코어 적용 모듈을 통해 유사성(similarity)을 기반으로 복수의 도메인으로부터 사전 훈련된 데이터 세트를 동일한 공간에 임베딩하기 위한 스코어를 적용하는 것으로 설정될 수 있다.
본 개시의 실시예에 따른 텍스트-이미지 간 대조를 기반으로 한 사전 훈련 통합 프레임워크를 제공하는 전자 장치의 프로세서는 증강 이미지 인코더(augmentation-agnostic image encoder) 및 증강 인식 프로젝션 헤드(augmentation-aware projection head)를 기반으로 상기 사전 훈련 모듈을 통해 상기 데이터 세트 도메인에 대한 사전 훈련을 수행하도록 설정될 수 있다.
본 개시의 실시예에 따른 텍스트-이미지 간 대조를 기반으로 한 사전 훈련 통합 프레임워크를 제공하는 전자 장치의 상기 프로세서는 상기 사전 훈련 모듈을 통해 텍스트 도메인, 이미지 도메인, 및 텍스트-이미지 복합 도메인에 대하여 데이터 증강이 적용된 사전 훈련을 수행하고, 상기 이미지 도메인은 기본 이미지 도메인, 제1 단계 증강 이미지 도메인, 및 제2 단계 증강 이미지 도메인으로 구성되어 상기 동일한 공간에 임베딩하는 것을 특징으로 할 수 있다.
본 개시의 실시예에 따른 텍스트-이미지 간 대조를 기반으로 한 사전 훈련 통합 프레임워크를 제공하는 전자 장치의 프로세서는 상기 이미지 도메인에 대한 데이터 증강 여부를 확인하고, 상기 증강 인코더를 통해 확인된 데이터 증강 여부에 대한 인코딩을 수행하고, 수행된 인코딩을 기반으로 상기 증강 인식 프로젝션 헤드를 통해 상기 데이터 증강에 의해 발생하는 불일치(misalignment)를 수정하는 사전 훈련을 수행하도록 설정되고, 상기 불일치는 상기 이미지 도메인에 대한 데이터 증강으로 인해 텍스트 도메인과 발생하는 불일치인 것을 특징으로 할 수 있다.
본 개시의 실시예에 따른 텍스트-이미지 간 대조를 기반으로 한 사전 훈련 통합 프레임워크를 제공하는 전자 장치의 프로세서는 상기 로스 적용 모듈을 통해 상기 동일한 공간에 임베딩된 상기 텍스트 도메인 및 상기 이미지 도메인 간 로스의 밸런스를 조정하도록 설정될 수 있다.
본 개시의 실시예에 따른 텍스트-이미지 간 대조를 기반으로 한 사전 훈련 통합 프레임워크를 제공하는 전자 장치의 프로세서는 상기 스코어 적용 모듈을 통해 상기 동일한 공간에 임베딩된 상기 텍스트 도메인 및 상기 이미지 도메인에 대한 상이한 특성에 기반하여 개별 도메인에 포함되어 있는 데이터 간 유사성을 측정하는 것을 특징으로 할 수 있다.
본 개시의 실시예에 따른 텍스트-이미지 간 대조를 기반으로 한 사전 훈련 통합 프레임워크를 제공하는 전자 장치의 프로세서는 상기 스코어 적용 모듈을 통해 상기 텍스트 도메인 및 상기 이미지 도메인 별 제1 파라미터 및 제2 파라미터를 기반으로 유사성 스코어를 적용하도록 설정할 수 있다.
본 개시의 실시예에 따른 텍스트-이미지 간 대조를 기반으로 한 사전 훈련 통합 프레임워크를 제공하는 방법은 사전 훈련 모듈을 통해 입력되는 데이터 세트 도메인에 대응하는 텍스트 및 이미지 중 적어도 하나를 포함하는 데이터 세트에 대한 사전 훈련을 수행하는 단계, 로스 적용 모듈을 통해 사전 학습된 데이터 세트 중 복수의 파지티브(positive) 샘플에 대해 로스를 적용하는 단계, 및 스코어 적용 모듈을 통해 유사성(similarity)을 기반으로 복수의 도메인으로부터 사전 훈련된 데이터 세트를 동일한 공간에 임베딩하기 위한 스코어를 적용하는 단계를 포함할 수 있다.
본 개시의 전술한 과제 해결 수단에 의하면, 도메인 종속 유사성(domain-dependent similarity) 측정을 통해 동일한 도메인의 데이터 쌍은 무한히 가까울 수 있지만 정보 표현 방법이 본질적으로 다르기 때문에 다른 도메인의 데이터 쌍이 완전히 동일할 수 없음을 활용할 수 있다.
또한, 본 개시의 다양한 실시예에 따르면 이러한 도메인 차이로 인해 네거티브 이미지 쌍이 이미지에 대한 어려운 파지티브 텍스트 쌍보다 더 높은 유사성을 가지며 그 반대의 경우도 쉽게 발생할 수 있다. 따라서, 여러 도메인의 데이터를 하나의 동일한 공간에서 비교하기 위해서 도메인 차이에 대한 보상을 수행할 수 있다. 본 개시에서는 도메인 차이를 보상할 수 있는 유사성 측정을 위해 학습 가능한 파라미터를 사용하며, 새로운 MP-NCE 로스 함수를 제안한다.
최근 infoNCE 로스는 SSL 및 VLP 기반 대조 학습에 사용되며, 우수한 성능을 보여준다. 본 개시에서는 다중 파지티브 쌍 형식으로 확장하여, 쉬운 파지티브와 어려운 파지티브의 상호간 방해를 줄이고자 한다. 본 개시의 실시예에 따르면 대조 텍스트-이미지 사전 훈련(UniCLIP)을 위한 통합 프레임워크가 제안된다. 이 경우, 프로세서는 다양한 슈퍼비전을 하나의 공간에 임베딩하여 모델을 훈련할 수 있다. 이를 통해, 프로세서는 독립적인 슈퍼비전 공간을 통해 더 풍부한 표현 인코더를 획득할 수 있게 된다. 또한, UniCLIP은 도메인 전체의 모든 임베딩(데이터)을 비교하여 추가적인 메모리 소비를 최소화하면서 배치의 크기를 늘릴 수 있다. 본 개시의 UniCLIP은 선형 프로빙, 제로샷 분류, 미세 조정, 및 이미지-텍스트 검색과 같은 다양한 단일 및 다중 모드 다운스트림 태스크에서 기존 방식들의 성능을 현저히 능가할 수 있다.
본 개시의 효과들은 이상에서 언급된 효과로 제한되지 않으며, 언급되지 않은 또 다른 효과들은 아래의 기재로부터 통상의 기술자에게 명확하게 이해될 수 있을 것이다.
도 1은 본 개시의 다양한 실시예에 따른 통합 프레임워크를 제공하는 전자 장치에 관한 개략적인 블록도이다.
도 2는 본 개시의 다양한 실시예에 따른 텍스트-이미지 간 대조를 기반으로 한 사전 훈련 통합 프레임워크 제공 방법에 관한 개략적인 흐름도이다.
도 3은 본 개시의 다양한 실시예에 따른 텍스트-이미지 간 대조를 기반으로 한 사전 훈련에 관한 예시도이다.
도 4는 본 개시의 다양한 실시예에 따른 이미지 도메인의 데이터 증강에 관한 예시도이다.
도 5는 본 개시의 다양한 실시예에 따른 텍스트-이미지 간 대조를 기반으로 한 사전 훈련에 관한 결과의 예시도이다.
도 6은 본 개시의 다양한 실시예에 따른 통합 프레임워크 제공 방법의 프로세스 구조도이다.
본 개시 전체에 걸쳐 동일 참조 부호는 동일 구성요소를 지칭한다. 본 개시가 실시예들의 모든 요소들을 설명하는 것은 아니며, 본 개시가 속하는 기술분야에서 일반적인 내용 또는 실시예들 간에 중복되는 내용은 생략한다. 명세서에서 사용되는 '부, 모듈, 부재, 블록'이라는 용어는 소프트웨어 또는 하드웨어로 구현될 수 있으며, 실시예들에 따라 복수의 '부, 모듈, 부재, 블록'이 하나의 구성요소로 구현되거나, 하나의 '부, 모듈, 부재, 블록'이 복수의 구성요소들을 포함하는 것도 가능하다.
명세서 전체에서, 어떤 부분이 다른 부분과 "연결"되어 있다고 할 때, 이는 직접적으로 연결되어 있는 경우뿐 아니라, 간접적으로 연결되어 있는 경우를 포함하고, 간접적인 연결은 무선 통신망을 통해 연결되는 것을 포함한다.
또한 어떤 부분이 어떤 구성요소를 "포함"한다고 할 때, 이는 특별히 반대되는 기재가 없는 한 다른 구성요소를 제외하는 것이 아니라 다른 구성요소를 더 포함할 수 있는 것을 의미한다.
명세서 전체에서, 어떤 부재가 다른 부재 "상에" 위치하고 있다고 할 때, 이는 어떤 부재가 다른 부재에 접해 있는 경우뿐 아니라 두 부재 사이에 또 다른 부재가 존재하는 경우도 포함한다.
제1, 제2 등의 용어는 하나의 구성요소를 다른 구성요소로부터 구별하기 위해 사용되는 것으로, 구성요소가 전술된 용어들에 의해 제한되는 것은 아니다.
단수의 표현은 문맥상 명백하게 예외가 있지 않는 한, 복수의 표현을 포함한다.
각 단계들에 있어 식별부호는 설명의 편의를 위하여 사용되는 것으로 식별부호는 각 단계들의 순서를 설명하는 것이 아니며, 각 단계들은 문맥상 명백하게 특정 순서를 기재하지 않는 이상 명기된 순서와 다르게 실시될 수 있다.
이하 첨부된 도면들을 참고하여 본 개시의 작용 원리 및 실시예들에 대해 설명한다.
본 명세서에서 '본 개시에 따른 장치'는 연산처리를 수행하여 사용자에게 결과를 제공할 수 있는 다양한 장치들이 모두 포함된다. 예를 들어, 본 개시에 따른 장치는, 컴퓨터, 서버 장치 및 휴대용 단말기를 모두 포함하거나, 또는 어느 하나의 형태가 될 수 있다.
여기에서, 상기 컴퓨터는 예를 들어, 웹 브라우저(WEB Browser)가 탑재된 노트북, 데스크톱(desktop), 랩톱(laptop), 태블릿 PC, 슬레이트 PC 등을 포함할 수 있다.
상기 서버 장치는 외부 장치와 통신을 수행하여 정보를 처리하는 서버로써, 애플리케이션 서버, 컴퓨팅 서버, 데이터베이스 서버, 파일 서버, 게임 서버, 메일 서버, 프록시 서버 및 웹 서버 등을 포함할 수 있다.
상기 휴대용 단말기는 예를 들어, 휴대성과 이동성이 보장되는 무선 통신 장치로서, PCS(Personal Communication System), GSM(Global System for Mobile communications), PDC(Personal Digital Cellular), PHS(Personal Handyphone System), PDA(Personal Digital Assistant), IMT(International Mobile Telecommunication)-2000, CDMA(Code Division Multiple Access)-2000, W-CDMA(W-Code Division Multiple Access), WiBro(Wireless Broadband Internet) 단말, 스마트 폰(Smart Phone) 등과 같은 모든 종류의 핸드헬드(Handheld) 기반의 무선 통신 장치와 시계, 반지, 팔찌, 발찌, 목걸이, 안경, 콘택트 렌즈, 또는 머리 착용형 장치(head-mounted-device(HMD) 등과 같은 웨어러블 장치를 포함할 수 있다.
도 1은 본 개시의 다양한 실시예에 따른 통합 프레임워크를 제공하는 전자 장치에 관한 개략적인 블록도이다.
도 1을 참고하면, 전자 장치(100)는 텍스트-이미지 간 대조를 기반으로 한 사전 훈련 통합 프레임워크를 제공하는 일종의 서버를 포함할 수 있다. 전자 장치(100)는 내부 구성요소로 사전 훈련 모듈(111), 로스 적용 모듈(112), 스코어 적용 모듈(113), 프로세서(120), 및 메모리(130)를 포함할 수 있으며, 이에 한정되지 않는다. 각각의 노드는 서로 다른 노드와 데이터를 주고받을 수 있다. 각 노드들은 직접적으로 전기적으로 연결되거나 네트워크를 통해 유선 및/또는 무선으로 연결될 수 있다. 본 개시의 전자 장치(100)는 프로세서(120) 대신 별도의 장치를 통해 프로세서(120)의 기능을 수행할 수 있다.
도 1을 참고하면, 프로세서(120)는 사전 훈련 모듈(111), 로스 적용 모듈(112), 스코어 적용 모듈(113)의 동작을 제어할 수 있다. 프로세서(120)는 통신부(미도시)를 통해 획득한 데이터 또는 미리 메모리(130)에 저장된 데이터를 기반으로 사전 훈련하여 통합 프레임워크를 제공할 수 있다.
본 개시의 실시예에 따른 프로세서(120)는 전자 장치(100) 내의 구성요소들의 동작을 제어하기 위한 알고리즘 또는 알고리즘을 재현한 프로그램에 대한 데이터를 저장하는 메모리(130) 및 메모리(130)에 저장된 데이터를 이용하여 전술한 동작을 수행하는 적어도 하나의 기능 블록으로 구현될 수 있다. 이 때, 프로세서(120)와 메모리(130)는 각각 별개의 칩으로 구현될 수 있다. 또는, 프로세서(120)와 메모리(130)는 단일의 칩으로 구현될 수도 있다.
프로세서(120)는 이하의 도 2 내지 도 6에서 설명되는 본 개시에 따른 다양한 실시예들을 전자 장치(100)에서 구현하기 위해 위에서 살펴본 구성요소들 중 어느 하나 또는 복수를 조합하여 제어할 수 있다.
실시예에 따른 메모리(130)는 전자 장치(100)의 다양한 기능을 지원하는 데이터와, 프로세서(120)의 동작을 위한 프로그램을 저장할 수 있고, 입/출력되는 데이터들(예를 들어, 이미지, 영상 등)을 저장할 있고, 전자 장치(100)에서 구동되는 다수의 응용 프로그램(application program 또는 어플리케이션(application)), 전자 장치(100)의 동작을 위한 데이터들, 명령어들을 저장할 수 있다. 이러한 응용 프로그램 중 적어도 일부는, 무선 통신을 통해 외부 서버로부터 다운로드 될 수 있다.
이러한, 메모리(130)는 플래시 메모리 타입(flash memory type), 하드디스크 타입(hard disk type), SSD 타입(Solid State Disk type), SDD 타입(Silicon Disk Drive type), 멀티미디어 카드 마이크로 타입(multimedia card micro type), 카드 타입의 메모리(예를 들어 SD 또는 XD 메모리 등), 램(random access memory; RAM), SRAM(static random access memory), 롬(read-only memory; ROM), EEPROM(electrically erasable programmable read-only memory), PROM(programmable read-only memory), 자기 메모리, 자기 디스크 및 광디스크 중 적어도 하나의 타입의 저장매체를 포함할 수 있다. 또한, 메모리는 전자 장치(100)와는 분리되어 있으나, 유선 또는 무선으로 연결된 데이터베이스가 될 수도 있다.
도 1에 도시된 구성 요소들의 성능에 대응하여 적어도 하나의 구성요소가 추가되거나 삭제될 수 있다. 또한, 구성 요소들의 상호 위치는 장치의 성능 또는 구조에 대응하여 변경될 수 있다는 것은 당해 기술 분야에서 통상의 지식을 가진 자에게 용이하게 이해될 것이다.
한편, 도 1에서 도시된 각각의 구성요소는 소프트웨어 및/또는 Field Programmable Gate Array(FPGA) 및 주문형 반도체(ASIC, Application Specific Integrated Circuit)와 같은 하드웨어 구성요소를 의미한다.
도 2는 본 개시의 다양한 실시예에 따른 텍스트-이미지 간 대조를 기반으로 한 사전 훈련 통합 프레임워크 제공 방법에 관한 개략적인 흐름도이다.
실시예에 따른 전자 장치(예: 도 1의 전자 장치(100))는 이미지와 텍스트 인코더에 모두 트랜스포머 기반 아키텍처(transformer-based architecture)를 사용한다. 일 예를 들어, 전자 장치는 증강 이미지 인코더(augmentataion-agnostic image encoder)를 포함할 수 있다. 전자 장치는 동일한 트레이닝 하이퍼 파라미터(training hyperparameter) 구성을 활용하게 된다. 또한 전자 장치는 이미지 인코더 fI로 학습 가능한 포지셔널 임베딩(learnable positional embeddings)을 사용한 비전 트랜스포머(vision transformer)를 채택한다. 이 때, 토큰의 마지막 활성값은 이미지 표현 hI가 활용될 수 있다. 이미지 인코더는 어떤 데이터 증강이 적용되었는지에 대한 정보 없이 입력 이미지 도메인을 표현하므로, 데이터 증강을 통해 충분히 보장되는 표현의 퀄리티를 가질 수 있다.
실시예에 따르면, 전자 장치는 증강 인코더를 포함한다. 일부 데이터 증강을 사용하기 위해서는, 개별 데이터 증강에 대한 매개변수를 먼저 결정해야할 수 있다. 이 경우, 전자 장치는 증강 구성 a를 이러한 매개변수로 만들며, 해당 이미지에 적용할 변형의 종류와 정도에 대한 정보를 포함하여 저장할 수 있다. 증강 구성 a는 3 레이어 멀티 레이어 퍼셉트론(3-layer multi layer perceptron, 3-layer MLP)인 증강 인코더 fA를 사용하여 인코딩되고, 증강 토큰 ha의 형태로 프로젝션 헤드로 전달된다.
실시예에 따른 전자 장치는 사전 훈련에 랜덤리사이즈크롭(randomresizedcrop), 컬러 지터링(color jittering), 가우시안 블러(gaussian blur), 및 수평 플립과 그레이 스케일(horizontal flip & gray scale)을 증강과 그 매개변수로 활용할 수 있다.
예를 들어, 랜덤리사이즈크롭은 크롭 영역과 종횡비의 하한과 상한은 기설정되어 있을 수 있다. 이 범위 내에서 크롭 영역의 왼쪽 상단 좌표, 크롭 영역의 높이, 및 너비가 임의로 결정될 수 있다. 이 값을 사용하여 이미지를 자르면 이미지 크기가 224X224로 조정될 수 있다. 그리고, 왼쪽 상단의 x, y 좌표, 높이, 너비는 전체 이미지 크기에 대한 비율로 0과 1사이로 변환될 수 있다. 이러한 값은 증강 구성에 포함되며, 전체 이미지의 어느 부분에 대한 정보를 포함할 수 있게 된다.
실시예에 따른 컬러 지터링은 이미지, 밝기, 대비, 채도, 및 색조의 4가지 값을 무작위 순서로 조정할 수 있다. 원본 이미지는 처음 세 값이 1이고, 마지막 세 값이 0일 때 반환되며, 이러한 값의 이름을 원본으로 정의할 수 있다. 각 값들은 원점에 따라 미리 정의된 범위 내에서 균일하게 무작위로 결정될 수 있다. 실시예에 따른 증간 인코딩의 경우, 원본과의 차이가 각각 증강 구성에 포함될 수 있다.
실시예에 따른 가우시안 블러는 가우서 커널에 사용할 시그마를 설정하여 활용될 수 있다. 전자 장치는 미리 정의된 범위에서 무작위로 샘플링하여 보강 구성에 포함시킬 수 있다. 실시예에 따른 수평 플립과 그레이 스케일은 매개변수 없이 작동할 수 있다. 이 경우, 전자 장치는 적용 여부를 1과 0으로 표현하고, 이를 증강 구성에 포함시킬 수 있다.
실시예에 따른 전자 장치는 증강 인식 프로젝션 헤드(augmentation-aware projection head)를 포함할 수 있다. 증강 인식 프로젝션 헤드는 증강 토큰 및 증강 불가지론 이미지 특성(augmentation agnostic image feature)이 잠재 공간에 포함되도록 할 수 있다. 증강 인식 프로젝션 헤드는 잠재 공간의 동일한 의미 체계 경계 내에서 잘못 정렬된 데이터를 반환하는 증강 효과를 무시하도록 훈련될 수 있다. 예를 들어, 널리 사용되는 MLP 대신 증강 인식 프로젝션 헤드 gI에 잔류 병목 블록(residual bottleneck block)을 사용할 수 있다. 그 이유는 증강 인식 프로젝션 헤드가 증강 정보와 이미지 정보를 한 번에 인코딩할 수 있는 충분한 인코딩 기능을 가져야 하기 때문일 수 있다. 잔류 병목 블록에는 GELU가 활성화된 두 개의 선형 레이어가 포함될 수 있다. 여기서, 레이어 정규화는 블록 앞에 적용되고 잔류 연결은 블록 뒤에 적용될 수 있다.
실시예에 따른 전자 장치는 텍스트 인코더를 포함할 수 있다. 전자 장치는 트랜스포머를 학습 가능한 포지셔널 임베딩이 있는 텍스트 백본(backbone) 네트워크로 활용할 수 있다. 이 때, 로우 텍스트(raw text)는 바이트 쌍 인코딩(byte pair encoding, BPE)으로 토큰화되고, 시작 토큰 및 마지막 토큰으로 래핑될 수 있다. 텍스트 인코더 fT는 어텐션 마스크 없이 출력을 계산하고, 시작 토큰의 마지막 활성화 값은 텍스트 표현 hT에 사용될 수 있다. 이 때, 선형 프로젝션 레이어 gT가 잠재 공간에 임베딩되어 있을 수 있다. 이와 같이 설명한 아키텍처는 아래의 데이터 임베딩 프로세스와 같이 정의될 수 있다.
Figure PCTKR2023006577-appb-img-000001
상기 수학식 (1)에서, 증강된 이미지 xa = Aug(xI;a)는 임의의 이미지 xI, 증강 구성 a, 및 임의의 텍스트 xT에 의해 설명될 수 있다.
단계 S210에서, 프로세서(예: 도 1의 프로세서(120))는 개별 도메인에 대한 사전 훈련을 수행할 수 있다. 사전 훈련 모듈(예: 도 1의 사전 훈련 모듈(111))을 통해 입력되는 데이터 세트 도메인에 대응하는 텍스트 및 이미지 중 적어도 하나를 포함하는 데이터 세트에 대한 사전 훈련을 수행할 수 있다.
실시예에 따른 전자 장치는 서로 다른 도메인에서 각각 독립적으로 활용됐던 대조 학습을 하나의 프레임워크로 통합하여 데이터 효율성을 향상시킬 수 있다. 이에 따라, 본 개시의 전자 장치에 의해 제공되는 통합 프레임워크는 UniCLIP(unified framework for contrastive language-image pretraining)으로 지칭될 수 있다. 전자 장치는, 대조 학습의 통합된 프레임워크를 위해, 아키텍처, 대조 로스, 유사성 스코어 등의 부분에서 새로운 문제를 해결하고 기존 대조 학습을 확장한다. 또한, CC3M, CC12M, YFCC15M 등의 이미지-텍스트 오픈 데이터 세트에서 대조 사전 훈련의 효과를 검증하여 기존 CLIP(contrastive language-image pretraining) 방법 대비 높은 성능을 이끌어낼 수 있다. 본 개시의 통합 프레임워크 제공 방법은 복수의 도메인 내 및 복수의 도메인 간 모든 쌍의 대조 학습을 하나의 통합된 임베딩 공간에서 정의할 수 있다.
실시예에 따른 프로세서는 증강 이미지 인코더 및 증강 인식 프로젝션 헤드를 기반으로 상기 사전 훈련 모듈을 통해 상기 데이터 세트 도메인에 대한 사전 훈련을 수행할 수 있다. 프로세서는 사전 훈련 모듈을 통해 텍스트 도메인, 이미지 도메인, 및 텍스트-이미지 복합 도메인에 대하여 데이터 증강이 적용된 사전 훈련을 수행할 수 있다. 이 때, 이미지 도메인은 기본 이미지 도메인, 제1 단계 증강 이미지 도메인(예: weak augmentation image domain), 제2 단계 증강 이미지 도메인(예: strong augmentation image domain)으로 구성될 수 있으며, 프로세서는 이미지 도메인 간, 이미지-텍스트 도메인 간, 텍스트-텍스트 도메인 간의 모든 도메인 쌍에 대하여 대조 학습(예: 사전 훈련)을 수행할 수 있다.
실시예에 따른 프로세서는 이미지 도메인에 대한 데이터 증강 여부를 확인하고, 증강 이미지 인코더를 통해 확인된 데이터 증강 여부에 대한 인코딩을 수행할 수 있다. 프로세서는 수행된 인코딩을 기반으로 상기 증강 인식 프로젝션 헤드를 통해 상기 데이터 증강에 의해 발생하는 불일치(misalignment)를 수정하는 사전 훈련을 수행하며, 불일치는 상기 이미지 도메인에 대한 데이터 증강으로 인해 텍스트 도메인과 발생하는 불일치일 수 있다.
실시예에 따른 프로세서는 증강 이미지 인코더를 통해 이미지 도메인에 어떤 종류의 데이터 증강이 적용되었는지에 대한 정보를 인코딩할 수 있다. 이러한 증강 정보가 증강 인식 프로젝션 헤드로 전달되고, 증강 인식 프로젝션 헤드는 데이터 증강으로 인해 발생하는 불일치를 수정하도록 사전 훈련될 수 있다. 이에 따라, 프로세서는 증강된 데이터를 충분히 활용하면서 불일치가 발생한 모델 훈련을 손상시키는 것을 방지할 수 있다.
단계 S220에서, 프로세서는 복수의 샘플에 대한 로스를 적용할 수 있다. 프로세서는 로스 적용 모듈(예: 도 1의 로스 적용 모듈(112))을 통해 사전 학습된 데이터 세트 중 복수의 파지티브(positive) 샘플에 대해 로스를 적용할 수 있다. 프로세서는 로스 적용 모듈을 통해 동일한 공간에 임베딩된 텍스트 도메인 및 이미지 도메인 간 로스의 밸런스를 조정할 수 있다. 이 때, 프로세서는 텍스트-이미지, 이미지-이미지, 텍스트-텍스트 도메인 등 모든 도메인 쌍에 대해서 밸런스 조정을 수행할 수 있다.
단계 S230에서, 프로세서는 유사성(similarity)을 측정할 수 있다. 프로세서는 스코어 적용 모듈(예: 도 1의 스코어 적용 모듈(113))을 통해 동일한 공간에 임베딩된 텍스트 도메인 및 이미지 도메인에 대한 상이한 특성에 기반하여 개별 도메인에 포함되어 있는 데이터 간 유사성을 측정할 수 있다. 이에 따라, 프로세서는 텍스트 도메인 및 이미지 도메인 별 파라미터를 기반으로 유사성 스코어를 적용할 수 있다. 단계 S240에서, 프로세서는 하나의 공간에 임베딩을 수행할 수 있다. 단계 S250에서, 프로세서는 통합 프레임워크를 제공할 수 있다.
실시예에 따르면, 대조 로스 함수(contrastive loss function)는 하나의 데이터 포인트에 대한 로스가 취하는 양수, 음수 쌍의 수에 따라 분류할 수 있다. 예를 들어, 삼중항 로스(triplet loss)는 단일 파지티브 쌍과 단일의 네거티브(negative) 쌍만 취하고, N쌍 로스 및 infoNCE 로스는 단일 파지티브 쌍과 복수의 네거티브 쌍을 취하며, MIL-NCE 로스와 SupCon 로스는 복수의 파지티브 쌍과 복수의 네거티브 쌍을 취할 수 있다. 본 개시의 통합 프레임워크는 복수의 파지티브 쌍이 있으므로, 먼저 MIL-NCE 로스 및 SupCon 로스 함수를 확인한다.
실시예에 따르면, 임베딩 배치 {zi}i에서 i번째 임베딩 zi의 경우, Pi를 i 자체를 제외한 i 번째 샘플의 모든 파지티브 샘플 인덱스의 집합으로, Ni를 i 번째 샘플의 모든 네거티브 샘플 인텍스의 집합으로 가정할 수 있다. 이는 아래의 수학식 (2)와 같이 나타낼 수 있다.
Figure PCTKR2023006577-appb-img-000002
실시예에 따르면, i 번째와 j 번째 임베딩 사이의 유사성 스코어는 si,j > 0으로 표현될 수 있다. 대조 로스 함수는 파지티브 쌍의 유사성 스코어를 최대화하는 동시에 네거티브 쌍의 유사성 스코어를 최소화할 수 있다. 배치의 각 샘플에 대해 하나의 파지티브 샘플만 있는 경우(예: Pi = {pi}), i 번째 샘플에 대한 infoNCE 로스 또는 NT-Xent 로스는 아래의 수학식 (3)으로 설명될 수 있다.
Figure PCTKR2023006577-appb-img-000003
실시예에 따르면, i 번째 임베딩에 대한 MIL-NCE 로스는 아래의 수학식 (4)와 같이 표현될 수 있다.
Figure PCTKR2023006577-appb-img-000004
상기 수학식 (4)의 MIL-NCE 로스 함수는 모든 파지티브 쌍의 유사성 스코어
Figure PCTKR2023006577-appb-img-000005
의 합을 최대화하고, 모든 네거티브 쌍의 유사성 스코어
Figure PCTKR2023006577-appb-img-000006
의 합을 최소화하도록 구성된다. 그러나, MIL-NCE 로스는 네거티브 쌍을 각 파지티브 쌍 si,p가 아닌 파지티브 스코어
Figure PCTKR2023006577-appb-img-000007
와 비교하기 때문에 유사성 스코어가 어려운 파지티브 쌍과 네거티브 쌍의 스코어를 지배할 만큼 충분히 큰 쉬운 파지티브 쌍이 있는 경우
Figure PCTKR2023006577-appb-img-000008
로부터 충분한 기울기(gradients)를 받을 수 없다. 일부
Figure PCTKR2023006577-appb-img-000009
인 경우,
Figure PCTKR2023006577-appb-img-000010
에서 si,q까지의 기울기는 아래의 수학식 (5)로 표현될 수 있다.
Figure PCTKR2023006577-appb-img-000011
상기 수학식 (5)에서, 파지티브 쌍의 스코어 si,q가 작더라도 쉬운 파지티브 쌍으로 인해
Figure PCTKR2023006577-appb-img-000012
가 크면 기울기가 0으로 소멸될 수 있다. 쉬운 파지티브 쌍은 MIL-NCE 로스에서 어려운(hard) 파지티브 쌍의 훈련을 방해하며, 도메인 내 및 도메인 간 슈퍼비전으로 인해 어려운 파지티브와 쉬운 파지티브가 자주 공존하기 때문에 이는 통합 프레임워크에서 더욱 두드러질 수 있다.
실시예에 따르면, i 번째 임베딩에 대한 SupCon 로스는 아래의 수학식 (6)과 같이 표현될 수 있다.
Figure PCTKR2023006577-appb-img-000013
상기 수학식 (6)에서, 각 파지티브 쌍 si,p는 네거티브 쌍과 비교되지만, 분모의 파지티브 스코어의 합은 여전히 바람직하지 않은 부작용을 야기할 수 있다. 유사성 스코어가 큰 쉬운 파지티브 쌍의 경우 스코어와 분모를 줄임으로써 그 로스를 줄일 수 있다.
Figure PCTKR2023006577-appb-img-000014
상기 수학식 (7)에서,
Figure PCTKR2023006577-appb-img-000015
의 경우, 분모의 si,q항에 의한 상대적으로 큰 업데이트로 인해 어려운 파지티브가 MIL-NCE 로스보다 더 잘 훈련될 수 있다. 그러나, 파지티브 스코어의 합이 네거티브 스코어의 합보다 훨씬 크다고 가정하게 되면 아래의 수학식 (8)처럼 표현될 수 있다.
Figure PCTKR2023006577-appb-img-000016
실시예에 따르면, 기울기가 항상 음수인 것은 아니기 때문에,
Figure PCTKR2023006577-appb-img-000017
은 si,q가 평균 파지티브 스코어보다 크면 파지티브 스코어 si,q를 늘리는 대신 줄이려고 할 수 있다. 즉, 어려운 파지티브 쌍은 SupCon 로스에서 쉬운 파지티브 스코어의 수렴을 방해할 수 있다.
실시예에 따르면, 분모의 파지티브 스코어의 합은 쉽고 어려운 파지티브 쌍이 서로 간섭하게 하므로, 하기 수학식 (9) 및 수학식 (10)과 같이 infoNCE 로스의 다중 파지티브 버전을 사용하여 개별 파지티브 쌍이 로스에 독립적으로 기여하도록 할 수 있다.
Figure PCTKR2023006577-appb-img-000018
Figure PCTKR2023006577-appb-img-000019
상기 수학식 (10)에서, 어려운 파지티브 샘플은 큰 업데이트로부터 충분히 훈련이 가능하고, 감소하는 파지티브 쌍 유사성 문제는 발생하지 않을 수 있다. 이러한 경우, 아래의 수학식 (11)을 로스 함수로 사용할 수 있다.
Figure PCTKR2023006577-appb-img-000020
상기 수학식 (11)에서, wi,p는 입력 쌍의 도메인 관계를 기반으로 동일한 기여도로 도메인 간 및 도메인 내 쌍이 로스에 반영되도록 하는 역할을 수행할 수 있다. 또한, 자신과의 유사성 스코어를 로스에 포함시킴으로써 온도(temperature) 및 오프셋(offset) 훈련에 대한 기준점을 생성하는 효과를 기대할 수 있다. 여기서 온도는 제1 파라미터일 수 있으며, 오프셋은 제2 파라미터에 대응할 수 있다. 프로세서는, UniCLIP을 제공함으로써, 수학식 (11)과 같이 복수의 파지티브 샘플이 존재하는 상황에서도 infoNCE 로스를 적용할 수 있도록 확장한 MP-NCE(multi-positive NCE)를 적용할 수 있다. MP-NCE는 현재 배치 내의 개별 파지티브 쌍에 대한 infoNCE 로스의 평균을 취한 것으로, 프로세서는 도메인 간 로스의 밸런스를 맞춰줄 수 있는 하이퍼 파라미터인 wi,p의 개념을 도입하여, 다른 대조 로스들(예: MIL-NCE 로스, SupCon 로스 등)보다 뛰어난 퍼포먼스를 낼 수 있다.
실시예에 따르면, 온도 척도 코사인 유사성(temperature scaled cosine similarity)이 대조 학습을 위해 적절하게 설계되는 경우, 온도가 어려운 네거티브 샘플에 대한 페널티 강도를 제어하는 역할을 수행할 수 있다. 그러나, 실시예에 따른 통합 프레임워크는 다양한 유형의 쌍을 한 번에 처리한다는 점에서 차이점이 존재한다. 따라서, 도메인의 차이를 고려할 수 있는 유사성 측정을 활용할 필요성이 있다.
실시예에 따르면, 대조 학습에서는 파지티브와 네거티브를 나누는 기준점이 존재할 수 있다. 이는 쉬운 샘플이 멀고 어려운 샘플이 기준점에 더 가깝기 때문에 어려움 측정(hardness measuring)에 활용될 수 있다. 그러나, 모든 쌍이 동일한 기준점을 갖기 때문에, 단일 유형의 데이터 쌍만을 사용하는 경우 기준점을 고려할 필요가 없을 수 있다. 예를 들어, 기준점을 고려하여 유사성 스코어에서 오프셋 값을 빼더라도 infoNCE 로스(예: 수학식 (3))에서 분수 감소로 인해 무시될 수 있게 된다.
반면에, 로스를 계산하기 위해 다양한 타입의 데이터 쌍을 사용할 때, 유사성 스코어는 오프셋을 다르게 포함해야 할 수 있다. 또한, 이러한 유형은 지정된 온도를 통해 제어 수준을 달리 해야할 수 있다. 그러므로, 유사성 함수가 입력 쌍의 도메인 관계에 따라 다양한 오프셋과 온도 항을 갖도록 설계할 필요가 있다. 또한, 모델이 스스로 적절한 값을 조정할 수 있도록 학습 가능한 파라미터를 설정할 수 있다. 이는 아래의 수학식 (12)와 같이 표현할 수 있다. 기존의 대조 학습의 두 임베딩 간 유사성 스코어는 수학식 (12)에서의 bD(i,j) 개념이 존재하지 않았다. 본 개시의 프로세서는, UniCLIP에서, 복수의 도메인으로부터 데이터가 동일한 공간에 임베딩되는 상황에서는 도메인마다 다른 특성을 가지고 있는 것을 활용하여 스코어의 적정 범위를 도메인마다 다르게 설정할 수 있다. 이는 도메인 종속 유사성 스코어(domain-dependent similarity score)로 지칭될 수 있으며, 프로세서는 UniCLIP을 통해 개별 도메인 D 마다 서로 다른 적정한 온도와 오프셋을 학습할 수 있다. 이에 따라, 이미지-이미지, 이미지-텍스트, 및 텍스트-텍스트 쌍이 프레임워크에 존재하기 때문에, 본 개시의 프로세서는 세가지 온도와 오프셋이 학습에 사용할 수 있다.
Figure PCTKR2023006577-appb-img-000021
도 3은 본 개시의 다양한 실시예에 따른 텍스트-이미지 간 대조를 기반으로 한 사전 훈련에 관한 예시도이다.
기존의 프레임워크들은 셀프 슈퍼비전(self supservision) 이미지 특성 학습 방법을 통해 같은 이미지 데이터를 증강시켜 파지티브 쌍으로 사용하였다(예: simCLR, SSL). 이는 대조 학습에서 사용되는 모델 중 하나이며, 이미지 데이터를 이용하여 학습된 표현을 활용하여 다양한 다운스트림 테스크(downstream task)를 수행할 수 있다. simCLR은 두 가지 주요 구성요소로 이루어질 수 있으며, 데이터 증강을 통해 입력 이미지를 증강하고, 이를 통해 모델이 다양한 환경에서 로버스트(robust)하게 동작할 수 있도록 한다. 또한, simCLR은 대조 로스를 활용하여 이미지 간 유사성을 최대화하고 다른 이미지와의 유사성을 최소화하는 방식으로 학습을 수행할 수 있다. 이는 상대적으로 강한 증강을 활용하는 방식 중 하나일 수 있다.
다른 예를 들어, CLIP은 이미지와 텍스트 간 상호작용을 학습하여 다양한 다운스트림 태스크를 수행할 수 있도록 하는 사전 훈련 방식이다. CLIP은 이미지와 텍스트를 하나의 공간에서 비교할 수 있도록 하며, 이를 통해 이미지와 텍스트 간의 유사성을 측정할 수 있다. CLIP은 대조 학습과 셀프 슈퍼비전 등의 방식을 통해 사전 훈련을 수행할 수 있다. 특히, 이미지-텍스트 간 특성을 학습하는데 중점을 두고 있으며, 이미지와 그에 대응하는 텍스트 쌍을 파지티브 쌍으로 할 수 있다. 다만, 이미지를 많이 증강시키게 되면 텍스트와의 도메인 관계가 많이 변하게 되어 상대적으로 약한 증강만이 가능하다.
또 다른 예를 들어, SLIP은 이미지 데이터를 이용하여 학습된 표현을 활용하여 이미지 간 유사성을 측정할 수 있다. 이는 simCLR과 CLIP을 함께 사용하는 방식이며, 두 방식을 단순히 결합한 것으로 텍스트-이미지, 이미지-이미지, 텍스트-텍스트 도메인, 즉 모든 도메인 쌍에 대한 것을 커버하지 못한다.
실시예에 따른 UniCLIP은 모든 도메인 간 모든 쌍을 효율적으로 학습할 수 있도록 하며, 이는 도 3의 예시와 같이 나타낼 수 있다. 예를 들어, 310과 320은 전자 장치(예: 도 1의 전자 장치(100))가 제공하고자 하는 통합 프레임워크에서의 도메인들을 의미할 수 있다. 여기서, 텍스트 도메인은 '개'에 대한 311과 '고양이'에 대한 321이 있으며, 이미지 도메인은 '개'와 관련된 312, 313, 314와 '고양이'와 관련된 322, 323, 324가 존재한다. 310에 포함되어 있는 텍스트 도메인(311)과 이미지 도메인(312, 313, 314)은 서로 파지티브 쌍으로 판별될 수 있으며, 이는 320에 포함되어 있는 텍스트 도메인(321)과 이미지 도메인(322, 323, 324)에 대해서도 동일할 수 있다.
실시예에 따르면, 도 3의 이미지 도메인 중 기본 이미지 도메인은 312와 322일 수 있다. 이 경우, 제1 단계 증강 이미지 도메인은 313과 323에 대응될 수 있으며, 제2 단계 증강 이미지 도메인은 314와 324에 대응될 수 있다. 제1 단계 증강은 약한 이미지 증강(예: 변형)일 수 있으며, 제2 단계 증강은 강한 이미지 증강일 수 있고, 그 단계는 증강의 정도에 따라 분류될 수 있다.
실시예에 따른 프로세서(예: 도 1의 프로세서(120))는 도 3과 같이, 모든 도메인 내 및 도메인 간의 복수의 파지티브 샘플에 대한 사전 훈련을 수행할 수 있다. 이를 통해, 프로세서는 기존의 방식들인 simCLR, CLIP, SLIP 등보다 정교하고 명확한 프레임워크를 제공할 수 있다.
도 4는 본 개시의 다양한 실시예에 따른 이미지 도메인의 데이터 증강에 관한 예시도이다.
도 4를 참고하면, 통합된 하나의 임베딩 공간에 복수의 도메인 간의 대조 학습을 설계하는 과정에서 발생하는 큰 문제인 증강으로 인한 이미지-텍스트 불일치를 확인할 수 있다.
도 4를 참고하면, 기본 이미지 도메인은 411에 대응할 수 있으며, 기본 텍스트 도메인은 412에 대응할 수 있다. 기본 이미지 도메인에 대하여 플립(flip), 그레이스케일(grayscale), 크롭(crop)한 각각의 이미지 도메인은 421, 431, 441에 대응할 수 있다. 기본 이미지 도메인에 대하여 데이터 증강을 수행하게 되면 기본 텍스트 도메인과의 관계가 완전히 바뀔 수 있다. 이는 기본 텍스트 도메인 412가 421에서는 422와 같이 볼드 처리된 부분(예: right)에서 불일치가 발생하거나, 431에서는 432와 같이 볼드 처리된 부분(예: red, green)에서 불일치가 발생하거나, 441에서는 442와 같이 볼드 처리된 부분(예: A red apple is on the right of)에서 불일치가 발생하는 것에서 확인할 수 있다.
실시예에 따르면, 프로세서(예: 도 1의 프로세서(120))는 통합 프레임워크에서 이미지 증강의 정보를 임베딩에 반영하여 이와 같은 불일치를 해결할 수 있다.
도 5는 본 개시의 다양한 실시예에 따른 텍스트-이미지 간 대조를 기반으로 한 사전 훈련에 관한 결과의 예시도이다.
도 5는 복수의 도메인에 대한 프로세서(예: 도 1의 프로세서(120))의 사전 훈련 예시도일 수 있다. 도 5를 참고하면, WA(weak augmentation)는 제1 단계 증강 이미지 도메인일 수 있으며, SA(strong augmentation)는 제2 단계 증강 이미지 도메인일 수 있고, Text는 텍스트 도메인일 수 있다. 또한 SA는 복수로 하여 기본 이미지 도메인을 다양한 방식으로 데이터 증강하여 존재할 수 있다.
실시예에 따르면, 프로세서는 510과 같이 이미지-텍스트 도메인 간 사전 훈련을 수행할 수 있다. 또한, 프로세서는 520과 같이 이미지-이미지 도메인 간 사전 훈련을 수행하고, 텍스트-텍스트 간 사전 훈련을 수행할 수 있다. 즉, 프로세서는 주어진 모든 도메인에서 사전 훈련을 수행하여 통합 프레임워크를 제공할 수 있게 된다. 도 5는 사전 훈련을 수행하여 하나의 임베딩 공간에서 빈틈없이 프레임워크를 구성하는 예시를 보여준다.
도 6은 본 개시의 다양한 실시예에 따른 통합 프레임워크 제공 방법의 프로세스 구조도이다.
실시예에 따른 전자 장치(예: 도 1의 전자 장치(100))는 증강 인식 프로젝션 헤드(augmentation-aware projection head)를 포함할 수 있다. 증강 인식 프로젝션 헤드는 증강 토큰 및 증강 불가지론 이미지 특성(augmentation agnostic image feature)이 잠재 공간에 포함되도록 할 수 있다. 증강 인식 프로젝션 헤드는 잠재 공간의 동일한 의미 체계 경계 내에서 잘못 정렬된 데이터를 반환하는 증강 효과를 무시하도록 훈련될 수 있다. 예를 들어, 널리 사용되는 MLP 대신 증강 인식 프로젝션 헤드 gI에 잔류 병목 블록(residual bottleneck block)을 사용할 수 있다. 그 이유는 증강 인식 프로젝션 헤드가 증강 정보와 이미지 정보를 한 번에 인코딩할 수 있는 충분한 인코딩 기능을 가져야 하기 때문일 수 있다. 잔류 병목 블록에는 GELU가 활성화된 두 개의 선형 레이어가 포함될 수 있다. 여기서, 레이어 정규화는 블록 앞에 적용되고 잔류 연결은 블록 뒤에 적용될 수 있다.
실시예에 따른 전자 장치는 텍스트 인코더를 포함할 수 있다. 전자 장치는 트랜스포머를 학습 가능한 포지셔널 임베딩이 있는 텍스트 백본(backbone) 네트워크로 활용할 수 있다. 이 때, 로우 텍스트(raw text)는 바이트 쌍 인코딩(byte pair encoding, BPE)으로 토큰화되고, 시작 토큰 및 마지막 토큰으로 래핑되어 토큰화된 텍스트 x가 생성될 수 있다. 이에 따라, 통합 잠재 공간에서의 텍스트 표현 h=fT(x)와 텍스트 임베딩 z=gT(fT(x))는 증강 임베딩 없이 획득될 수 있다. 학습 가능한 포지셔널 임베딩이 존재하는 텍스트 인코더 fT에는 트랜스포머를 사용하고, 텍스트 프로젝션 헤드 gT에는 선형 레이어를 사용할 수 있다. 이와 같이, 시작 토큰의 마지막 활성화 값은 텍스트 표현 h로 사용될 수 있다. 즉, 텍스트 인코더 fT는 어텐션 마스크 없이 출력을 계산하고, 시작 토큰의 마지막 활성화 값은 텍스트 표현 hT에 사용될 수 있다.
실시예에 따른 프로세서(예: 도 1의 프로세서(120))는 이미지 도메인에 어떤 종류의 증강이 적용되었는지에 대한 정보를 증강 이미지 인코더를 통해 인코딩하고, 이러한 증강의 정보와 이미지의 특성(feature)가 증강 인식 프로젝션 헤드를 통과하여 최종 임베딩이 되도록 임베딩을 수행한다. 도 6과 같은 구조에서, 프로세서는 증강 인식 프로젝션 헤드를 통해 이미지에 적용된 증강 정보를 알 수 있게 되며, 증강 인식 프로젝션 헤드가 증강으로 인한 이미지-텍스트 불일치 문제를 수정할 수 있다. 이는 도 6을 참고 시, 증강 이미지 인코더를 통해 인코딩된 정보들이 흐릿했으나, 증강 인식 프로젝션 헤드를 통과하여 텍스트와 진해지고, 텍스트 인코더 및 텍스트 프로젝션 헤드를 거친 결과들과 결합하여 하나의 공간에서 임베딩되는 것을 통해 알 수 있다. 여기서, 정보들이 흐릿한 것은 증강되기 이전의 상태를 의미할 수 있고, 정보들이 진한 것은 증강된 이후의 상태를 의미할 수 있다. 도 6은 텍스트 및 이미지를 증강 학습하여 하나의 공간에 임베딩한 것을 나타낸다. 도 6을 참고하면, 본 개시의 전자 장치는 각각의 이미지가 나타내는 텍스트와의 불일치를 하나의 공간에서 수정하여 보다 명확한 정보를 나타내는 프로세스를 수행할 수 있다. 즉, 전자 장치는 텍스트와 이미지의 데이터 증강을 통해 서로의 상관관계를 명확하게 하나의 공간에서 표현할 수 있도록 하는 프로세스를 수행할 수 있다.
한편, 개시된 실시예들은 컴퓨터에 의해 실행 가능한 명령어를 저장하는 기록매체의 형태로 구현될 수 있다. 명령어는 프로그램 코드의 형태로 저장될 수 있으며, 프로세서에 의해 실행되었을 때, 프로그램 모듈을 생성하여 개시된 실시예들의 동작을 수행할 수 있다. 기록매체는 컴퓨터로 읽을 수 있는 기록매체로 구현될 수 있다.
컴퓨터가 읽을 수 있는 기록매체로는 컴퓨터에 의하여 해독될 수 있는 명령어가 저장된 모든 종류의 기록 매체를 포함한다. 예를 들어, ROM(Read Only Memory), RAM(Random Access Memory), 자기 테이프, 자기 디스크, 플래쉬 메모리, 광 데이터 저장장치 등이 있을 수 있다.
이상에서와 같이 첨부된 도면을 참조하여 개시된 실시예들을 설명하였다. 본 개시가 속하는 기술분야에서 통상의 지식을 가진 자는 본 개시의 기술적 사상이나 필수적인 특징을 변경하지 않고도, 개시된 실시예들과 다른 형태로 본 개시가 실시될 수 있음을 이해할 것이다. 개시된 실시예들은 예시적인 것이며, 한정적으로 해석되어서는 안 된다.

Claims (15)

  1. 텍스트-이미지 간 대조를 기반으로 한 사전 훈련 통합 프레임워크를 제공하는 전자 장치에 있어서,
    사전 훈련 모듈;
    로스(loss) 적용 모듈;
    스코어 적용 모듈; 및
    상기 사전 훈련 모듈, 로스 적용 모듈, 및 스코어 적용 모듈의 동작을 제어하는 프로세서를 포함하고,
    상기 프로세서는,
    상기 사전 훈련 모듈을 통해 입력되는 데이터 세트 도메인에 대응하는 텍스트 및 이미지 중 적어도 하나를 포함하는 데이터 세트에 대한 사전 훈련을 수행하고,
    상기 로스 적용 모듈을 통해 사전 학습된 데이터 세트 중 복수의 파지티브(positive) 샘플에 대해 로스를 적용하고,
    상기 스코어 적용 모듈을 통해 유사성(similarity)을 기반으로 복수의 도메인으로부터 사전 훈련된 데이터 세트를 동일한 공간에 임베딩하기 위한 스코어를 적용하는 것으로 설정된, 전자 장치.
  2. 제1항에 있어서,
    상기 프로세서는,
    증강 이미지 인코더(augmentation-agnostic image encoder) 및 증강 인식 프로젝션 헤드(augmentation-aware projection head)를 기반으로 상기 사전 훈련 모듈을 통해 상기 데이터 세트 도메인에 대한 사전 훈련을 수행하도록 설정된, 전자 장치.
  3. 제2항에 있어서,
    상기 프로세서는,
    상기 사전 훈련 모듈을 통해 텍스트 도메인, 이미지 도메인, 및 텍스트-이미지 복합 도메인에 대하여 데이터 증강이 적용된 사전 훈련을 수행하고,
    상기 이미지 도메인은 기본 이미지 도메인, 제1 단계 증강 이미지 도메인, 및 제2 단계 증강 이미지 도메인으로 구성되어 상기 동일한 공간에 임베딩하는 것을 특징으로 하는, 전자 장치.
  4. 제3항에 있어서,
    상기 프로세서는,
    상기 이미지 도메인에 대한 데이터 증강 여부를 확인하고,
    상기 증강 이미지 인코더를 통해 확인된 데이터 증강 여부에 대한 인코딩을 수행하고,
    수행된 인코딩을 기반으로 상기 증강 인식 프로젝션 헤드를 통해 상기 데이터 증강에 의해 발생하는 불일치(misalignment)를 수정하는 사전 훈련을 수행하도록 설정되고,
    상기 불일치는 상기 이미지 도메인에 대한 데이터 증강으로 인해 텍스트 도메인과 발생하는 불일치인 것을 특징으로 하는, 전자 장치.
  5. 제4항에 있어서,
    상기 프로세서는,
    상기 로스 적용 모듈을 통해 상기 동일한 공간에 임베딩된 상기 텍스트 도메인 및 상기 이미지 도메인 간 로스의 밸런스를 조정하도록 설정된, 전자 장치.
  6. 제5항에 있어서,
    상기 프로세서는,
    상기 스코어 적용 모듈을 통해 상기 동일한 공간에 임베딩된 상기 텍스트 도메인 및 상기 이미지 도메인에 대한 상이한 특성에 기반하여 개별 도메인에 포함되어 있는 데이터 간 유사성을 측정하는 것을 특징으로 하는, 전자 장치.
  7. 제6항에 있어서,
    상기 프로세서는,
    상기 스코어 적용 모듈을 통해 상기 텍스트 도메인 및 상기 이미지 도메인 별 제1 파라미터 및 제2 파라미터를 기반으로 유사성 스코어를 적용하도록 설정된, 전자 장치.
  8. 텍스트-이미지 간 대조를 기반으로 한 사전 훈련 통합 프레임워크를 제공하는 방법에 있어서,
    사전 훈련 모듈을 통해 입력되는 데이터 세트 도메인에 대응하는 텍스트 및 이미지 중 적어도 하나를 포함하는 데이터 세트에 대한 사전 훈련을 수행하는 단계;
    로스 적용 모듈을 통해 사전 학습된 데이터 세트 중 복수의 파지티브(positive) 샘플에 대해 로스를 적용하는 단계; 및
    스코어 적용 모듈을 통해 유사성(similarity)을 기반으로 복수의 도메인으로부터 사전 훈련된 데이터 세트를 동일한 공간에 임베딩하기 위한 스코어를 적용하는 단계를 포함하는, 프레임워크 제공 방법.
  9. 제8항에 있어서,
    상기 사전 훈련을 수행하는 단계는,
    증강 이미지 인코더(augmentation-agnostic image encoder) 및 증강 인식 프로젝션 헤드(augmentation-aware projection head)를 기반으로 상기 사전 훈련 모듈을 통해 상기 데이터 세트 도메인에 대한 사전 훈련을 수행하는 단계를 포함하는, 프레임워크 제공 방법.
  10. 제9항에 있어서,
    상기 사전 훈련을 수행하는 단계는,
    상기 사전 훈련 모듈을 통해 텍스트 도메인, 이미지 도메인, 및 텍스트-이미지 복합 도메인에 대하여 데이터 증강이 적용된 사전 훈련을 수행하는 단계를 포함하고,
    상기 이미지 도메인은 기본 이미지 도메인, 제1 단계 증강 이미지 도메인, 및 제2 단계 증강 이미지 도메인으로 구성되어 상기 동일한 공간에 임베딩하는 것을 특징으로 하는, 프레임워크 제공 방법.
  11. 제10항에 있어서,
    상기 사전 훈련을 수행하는 단계는,
    상기 이미지 도메인에 대한 데이터 증강 여부를 확인하는 단계;
    상기 증강 이미지 인코더를 통해 확인된 데이터 증강 여부에 대한 인코딩을 수행하는 단계; 및
    수행된 인코딩을 기반으로 상기 증강 인식 프로젝션 헤드를 통해 상기 데이터 증강에 의해 발생하는 불일치(misalignment)를 수정하는 사전 훈련을 수행하는 단계를 포함하고,
    상기 불일치는 상기 이미지 도메인에 대한 데이터 증강으로 인해 텍스트 도메인과 발생하는 불일치인 것을 특징으로 하는, 프레임워크 제공 방법.
  12. 제11항에 있어서,
    상기 로스를 적용하는 단계는,
    상기 로스 적용 모듈을 통해 상기 동일한 공간에 임베딩된 상기 텍스트 도메인 및 상기 이미지 도메인 간 로스의 밸런스를 조정하는 단계를 포함하는, 프레임워크 제공 방법.
  13. 제12항에 있어서,
    상기 스코어를 적용하는 단계는,
    상기 스코어 적용 모듈을 통해 상기 동일한 공간에 임베딩된 상기 텍스트 도메인 및 상기 이미지 도메인에 대한 상이한 특성에 기반하여 개별 도메인에 포함되어 있는 데이터 간 유사성을 측정하는 단계를 포함하는, 프레임워크 제공 방법.
  14. 제13항에 있어서,
    상기 스코어를 적용하는 단계는,
    상기 스코어 적용 모듈을 통해 상기 텍스트 도메인 및 상기 이미지 도메인 별 제1 파라미터 및 제2 파라미터를 기반으로 유사성 스코어를 적용하는 단계를 포함하는, 프레임워크 제공 방법.
  15. 제8항의 방법을 수행하기 위한 컴퓨터 프로그램이 기록된 컴퓨터로 판독 가능한 저장 매체.
PCT/KR2023/006577 2022-05-17 2023-05-16 텍스트-이미지 간 대조를 기반으로 한 사전 훈련 통합 프레임워크를 제공하는 방법 및 이를 이용한 전자 장치 WO2023224344A1 (ko)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
KR10-2022-0059975 2022-05-17
KR20220059975 2022-05-17
KR10-2023-0061358 2023-05-11
KR1020230061358A KR20230160729A (ko) 2022-05-17 2023-05-11 텍스트-이미지 간 대조를 기반으로 한 사전 훈련 통합 프레임워크를 제공하는 방법 및 이를 이용한 전자 장치

Publications (1)

Publication Number Publication Date
WO2023224344A1 true WO2023224344A1 (ko) 2023-11-23

Family

ID=88835754

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2023/006577 WO2023224344A1 (ko) 2022-05-17 2023-05-16 텍스트-이미지 간 대조를 기반으로 한 사전 훈련 통합 프레임워크를 제공하는 방법 및 이를 이용한 전자 장치

Country Status (1)

Country Link
WO (1) WO2023224344A1 (ko)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10885111B2 (en) * 2018-04-16 2021-01-05 International Business Machines Corporation Generating cross-domain data using variational mapping between embedding spaces

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10885111B2 (en) * 2018-04-16 2021-01-05 International Business Machines Corporation Generating cross-domain data using variational mapping between embedding spaces

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
LEE JANGHYEON, KIM JONGSUK, SHON HYOUNGUK, KIM BUMSOO, KIM SEUNG HWAN, LEE HONGLAK, KIM JUNMO: "UniCLIP: Unified Framework for Contrastive Language-Image Pre-training", 36TH CONFERENCE ON NEURAL INFORMATION PROCESSING SYSTEMS (NEURIPS 2022), ITHACA, 1 January 2022 (2022-01-01), Ithaca, pages 1 - 12, XP093110539 *
LEWEI YAO; RUNHUI HUANG; LU HOU; GUANSONG LU; MINZHE NIU; HANG XU; XIAODAN LIANG; ZHENGUO LI; XIN JIANG; CHUNJING XU: "FILIP: Fine-grained Interactive Language-Image Pre-Training", ARXIV.ORG, 9 November 2021 (2021-11-09), XP091098985 *
YANGGUANG LI; FENG LIANG; LICHEN ZHAO; YUFENG CUI; WANLI OUYANG; JING SHAO; FENGWEI YU; JUNJIE YAN: "Supervision Exists Everywhere: A Data Efficient Contrastive Language-Image Pre-training Paradigm", ARXIV.ORG, 14 March 2022 (2022-03-14), XP091171303 *
YOSHIKAWA YUYA, IWATA TOMOHARU, SAWADA HIROSHI, YAMADA TAKESHI: "Cross-Domain Matching for Bag-of-Words Data via Kernel Embeddings of Latent Distributions", ADVANCES IN NEURAL INFORMATION PROCESSING SYSTEMS 28 (NIPS 2015), 1 January 2015 (2015-01-01), pages 1 - 9, XP093110530 *
YOU YUNING, CHEN TIANLONG, SHEN YANG, WANG ZHANGYANG: "Graph Contrastive Learning Automated", ARXIV.ORG, 28 June 2021 (2021-06-28), XP093110533, DOI: 10.48550/arxiv.2106.07594 *

Similar Documents

Publication Publication Date Title
WO2017213398A1 (en) Learning model for salient facial region detection
WO2020180170A1 (en) Effective user modeling with time-aware based binary hashing
WO2019156287A1 (en) Progressive compressed domain computer vision and deep learning systems
WO2019245186A1 (ko) 전자 장치 및 그의 제어 방법
WO2018135723A1 (ko) 복수 문단 텍스트의 추상적 요약문 생성 장치 및 방법, 그 방법을 수행하기 위한 기록 매체
WO2019216514A1 (en) Electronic apparatus for compression and decompression of data and compression method thereof
EP3744008A1 (en) Electronic apparatus for compression and decompression of data and compression method thereof
Shuang et al. Major–minor long short-term memory for word-level language model
WO2020159140A1 (ko) 전자 장치 및 이의 제어 방법
WO2023224344A1 (ko) 텍스트-이미지 간 대조를 기반으로 한 사전 훈련 통합 프레임워크를 제공하는 방법 및 이를 이용한 전자 장치
CN116610795B (zh) 文本检索方法及装置
CN113052025A (zh) 图像融合模型的训练方法、图像融合方法及电子设备
Rakesh et al. Sign language recognition using convolutional neural network
WO2023080509A1 (ko) 효율적인 전환 매트릭스 추정을 통한 노이즈 레이블을 학습하는 방법 및 장치
EP3707646A1 (en) Electronic apparatus and control method thereof
KR20230160729A (ko) 텍스트-이미지 간 대조를 기반으로 한 사전 훈련 통합 프레임워크를 제공하는 방법 및 이를 이용한 전자 장치
WO2022244997A1 (en) Method and apparatus for processing data
Shrivastava et al. Puzzling out emotions: a deep-learning approach to multimodal sentiment analysis
WO2021015403A1 (en) Electronic apparatus and controlling method thereof
WO2022145525A1 (ko) 학습된 조건 기반의 디자인 생성 방법 및 그 장치
Thapak et al. Transformer++
Gadge et al. Recognition of Indian Sign Language characters using convolutional neural network
WO2022050578A1 (ko) 질환 판단 방법
Dongfang et al. Traffic sign classification network using inception module
Lee et al. Combining voice and image recognition for smart home security system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23807863

Country of ref document: EP

Kind code of ref document: A1