Riassunto analitico
In questa sezione viene proposto un sunto, in lingua italiana, degli esperimenti ed analisi svolti nel corso del progetto di tesi. Tuttavia, questo non è da considerarsi come la completa ed esaustiva esposizione delle tecniche ed algoritmi implementati: per quest'ultimi si rimanda al testo integrale in inglese. Una tendenza diffusa nella letteratura è quella di pre-addestrare i modelli con dataset molto grandi e successivamente andare ad effettuare operazioni di fine-tuning sui dati di dominio di interesse. Tale operazione permette al modello addestrato di generalizzare meglio i contenuti. Questo procedimento non è solo tipico del campo dell'Intelligenza Artificiale: essa ha preso spunto dal comportamento degli esseri umani che non devono apprendere nuovi compiti completamente da zero. Infatti la nostra conoscenza base viene trasferita e riutilizzata nel corso dell'apprendimento di nuove attività. Con la pubblicazione di Vision Transformer (ViT), per raggiungere prestazioni migliori rispetto ai modelli convoluzionali, i modelli proposti sono stati pre-addestrati utilizzando il dataset JFT-300M con circa 300 milioni di immagini etichettate. Dataset supervisionati così voluminosi richiedono grandi risorse, sia economiche per l'etichettatura sia computazionali per effettuare training di modelli. Inoltre spesso, come nel caso di JFT-300M, queste collezioni di dati non sono rilasciate al pubblico dalle società che lo finanziano. Invece di focalizzarci sull'incremento del numero di dati o parametri del modello, nel corso della tesi abbiamo deciso di concentrarci sullo stream di input del ViT. Il funzionamento delle architetture basate su Vision Transformer consiste nella suddivisione dell'immagine di input in patch; quest'ultime vengono poi processate da un layer lineare, andando a formare una sequenza di vettori. Successivamente, l'architettura, basandosi sul meccanismo di attenzione, apprende dall'input le informazioni necessarie per il conseguimento del task. Nel corso della tesi, abbiamo esplorato una tecnica innovativa di pre-processing delle immagini per architetture basate su Vision Transformer. Questa prevede l'utilizzo del modello CLIP per l'estrazione di features. L'architettura CLIP (Contrastive Language–Image Pre-training) ha dimostrato di essere una delle migliori per quanto concerne l'estrazione di features. Invece di utilizzare dataset supervisionati, che sono costosi da costruire e forniscono un numero limitato di concetti visivi predeterminati (classi), CLIP viene addestrato utilizzando coppie di testo e immagini facilmente reperibili online. Questo permette di scalare facilmente la dimensionalità del dataset e pone le basi per un apprendimento multimodale capace di collegare la semantica del linguaggio a concetti visivi. L'architettura da noi proposta elimina la classica suddivisone in patch, ideata nel Vision Transformer, in favore di una sequenza di features ottenuta discretizzando i canali degli output intermedi di CLIP. Nel corso della sperimentazione abbiamo inoltre adattato la tecnica di pre-training XLNet (originariamente proposta con ottimi risultati nell'ambito del Natural Language Processing) al campo della Computer Vision. Questo algoritmo non-supervisionato si focalizza sul massimizzare la likelihood logaritmica di una sequenza, rispetto a tutte le possibili permutazioni dell'ordine di fattorizzazione. Per quanto concerne i campi di applicazione, abbiamo testato la nostra pipeline nell'ambito della classificazione di immagini ottenendo un incremento di top-1 accuracy del 6% sul dataset ImageNet, nei confronti della stessa architettura (Vit-Tiny) standard con training da zero su ImageNet. Ulteriori test riguardanti task di segmentazione di immagini presuppongono gli stessi vantaggi anche in questo ambito.
|
Abstract
This section offers a summary, in English, of the experiments and analysis carried out during the thesis project. However, this is not to be considered the complete and exhaustive exposition of the techniques and algorithms implemented: for the latter, please refer to the full text.
A widespread trend in the literature is to pre-train models with very large datasets and then fine-tune parameters on the data of the domain of interest. This allows the trained model to better generalize the content. This procedure is not only typical of the field of Artificial Intelligence: it took its cue from the behaviour of human beings who do not have to learn new tasks completely from scratch. In fact, our basic knowledge is transferred and reused in the course of learning new activities.
With the publication of Vision Transformer (ViT), to achieve better performance than convolutional models, the proposed models were pre-trained using the JFT-300M dataset with approximately 300 million labelled images. Such large supervised datasets require huge resources, both economic for labelling and computational for training models. Also often, as in the case of the JFT-300M, these data collections are not released to the public by the companies that finance it.
Instead of focusing on increasing the number of data or model parameters, during the thesis we decided to focus on the ViT input stream.
The operation of the architectures based on Vision Transformer consists in the subdivision of the input image in patches; the latter are then processed by a linear layer, forming a sequence of vectors. Subsequently, the architecture, based on the attention mechanism, learns from the input the information necessary for the achievement of the task.
During the thesis, we explored an innovative image pre-processing technique for Vision Transformer-based architectures. This involves the use of the CLIP model for the extraction of features.
The CLIP architecture (Contrastive Language – Image Pre-training) has proven to be one of the best in terms of feature extraction. Instead of using supervised datasets, which are expensive to build and provide a limited number of predetermined visual concepts (classes), CLIP is trained using pairs of text and images that are readily available online.
This allows to easily scale the dimensionality of the dataset and lays the foundations for multimodal learning capable of linking the semantics of the language to visual concepts.
The architecture proposed by us eliminates the classic subdivision into patches, conceived in the Vision Transformer, in favour of a sequence of features obtained by discretizing the intermediate output channels of CLIP.
During the experimentation, we also adapted the XLNet pre-training technique (originally proposed with excellent results in the field of Natural Language Processing) to the field of Computer Vision. This unsupervised algorithm focuses on maximizing the logarithmic likelihood of a sequence, with respect to all possible permutations of the factorization order.
As regards the fields of application, we tested our pipeline in the field of image classification, obtaining a top-1 accuracy increase of 6% on the ImageNet dataset, compared to the same standard architecture (Vit-Tiny) with training from scratch on ImageNet. Further tests regarding image segmentation tasks assume the same benefits in this area as well.
|