In this thesis, we investigate the usage of the Neural Tangent Kernel (NTK) as a kernel for computing the Maximum Mean Discrepancy (MMD) statistic. We focus on the application of the NTK MMD statistic on image data, using NTKs derived from convolutional neural networks. In the first part of this work, we explore multiple variants of the MMD statistic computed with the NTK for performing two sample tests, and compare them with two baselines: the quadratic time MMD statistic computed with the Gaussian kernel, and its linear time approximation. We consider multiple classes of alternative hypotheses, and perform the experiments on the MNIST and CIFAR-10 dataset. While on the MNIST dataset we find that the Gaussian kernel MMD is the best choice for two sample tests, on the CIFAR-10 dataset it is outperformed by multiple variants of the NTK MMD statistic. We also investigate the impact of the network architecture on the NTK MMD testing performance. In the second part of this work, we apply the NTK MMD to the detection of adversarial examples. We focus on examples generated by the Projected Gradient Descent (PGD) attack, and we frame the problem in two different ways: distinguishing two samples, where one contains a fraction of adversarial images, and detecting which images in a sample are adversarial. On the MNIST dataset, we succeed in both the tasks with the Gaussian kernel MMD and multiple variants of the NTK MMD. On the CIFAR-10 dataset, we succeed on the first task only with three variants of the NTK MMD, and only for adversarial examples generated by an high number of iterations of the PGD attack. No method succeeds on the second task on CIFAR-10. In the end, we develop a variant of the PGD attack against the detection method on MNIST.

In questa tesi, exploriamo l'utilizzo del Neural Tangent Kernel (NTK) come kernel per il calcolo della statistica Maximum Mean Discrepancy (MMD). Applichiamo la statistica MMD a campioni di immagini, utilizzando NTK derivati da reti neurali convoluzionali. Nella prima parte di questo lavoro, analizziamo l'uso di diverse variantk della statistica MMD calcolata con il NTK per test a due campioni, e le compariamo con due metodi di riferimento: la MMD quadratica calcolata usando il kernel Gaussiano, e la sua approssimazione lineare. Consideriamo diverse classi di ipotesi alternative, ed eseguiamo gli esperimenti sui dataset MNIST e CIFAR-10. Mentre per MNIST la MMD calcolata con il kernel Gaussiano si rivela essere la scelta migliore per effettuare un test a due campioni, essa viene superata da diverse varianti della NTK MMD per CIFAR-10. Inoltre, analizziamo l'impatto dell'architettura della rete neurale utilizzata sulla performance del test. Nella seconda parte di questo lavoro, applichiamo la NTK MMD all'individuazione di immagini avversarie. Consideriamo immagini generate dall'attacco Projected Gradient Descent (PGD), e impostiamo il problema in due modi differenti: distinguere due campioni, uno dei quali contenente una frazione di immagini avversarie, e identificare quali immagini sono avversarie in un campione. Per MNIST, la MMD calcolata con il Gaussian kernel e diverse varianti della NTK MMD succedono in entrambi i compiti. Per CIFAR-10, solamente tre varianti della NTK MMD succedono nel primo compito, e solamente per immagini avversarie generate da un numero elevato di iterazioni dell'attacco PGD. Nessun metodo ha successo per il secondo compito su CIFAR-10. Infine, sviluppiamo una variante dell'attacco PGD per fronteggiare l'individuazione di singole immagini avversarie per MNIST.

Neural tangent Kernels for maximum mean discrepancy: a comprehensive analysis

Magri, Chiara
2022/2023

Abstract

In this thesis, we investigate the usage of the Neural Tangent Kernel (NTK) as a kernel for computing the Maximum Mean Discrepancy (MMD) statistic. We focus on the application of the NTK MMD statistic on image data, using NTKs derived from convolutional neural networks. In the first part of this work, we explore multiple variants of the MMD statistic computed with the NTK for performing two sample tests, and compare them with two baselines: the quadratic time MMD statistic computed with the Gaussian kernel, and its linear time approximation. We consider multiple classes of alternative hypotheses, and perform the experiments on the MNIST and CIFAR-10 dataset. While on the MNIST dataset we find that the Gaussian kernel MMD is the best choice for two sample tests, on the CIFAR-10 dataset it is outperformed by multiple variants of the NTK MMD statistic. We also investigate the impact of the network architecture on the NTK MMD testing performance. In the second part of this work, we apply the NTK MMD to the detection of adversarial examples. We focus on examples generated by the Projected Gradient Descent (PGD) attack, and we frame the problem in two different ways: distinguishing two samples, where one contains a fraction of adversarial images, and detecting which images in a sample are adversarial. On the MNIST dataset, we succeed in both the tasks with the Gaussian kernel MMD and multiple variants of the NTK MMD. On the CIFAR-10 dataset, we succeed on the first task only with three variants of the NTK MMD, and only for adversarial examples generated by an high number of iterations of the PGD attack. No method succeeds on the second task on CIFAR-10. In the end, we develop a variant of the PGD attack against the detection method on MNIST.
CUDRANO, PAOLO
SAMELE, STEFANO
ING - Scuola di Ingegneria Industriale e dell'Informazione
9-apr-2024
2022/2023
In questa tesi, exploriamo l'utilizzo del Neural Tangent Kernel (NTK) come kernel per il calcolo della statistica Maximum Mean Discrepancy (MMD). Applichiamo la statistica MMD a campioni di immagini, utilizzando NTK derivati da reti neurali convoluzionali. Nella prima parte di questo lavoro, analizziamo l'uso di diverse variantk della statistica MMD calcolata con il NTK per test a due campioni, e le compariamo con due metodi di riferimento: la MMD quadratica calcolata usando il kernel Gaussiano, e la sua approssimazione lineare. Consideriamo diverse classi di ipotesi alternative, ed eseguiamo gli esperimenti sui dataset MNIST e CIFAR-10. Mentre per MNIST la MMD calcolata con il kernel Gaussiano si rivela essere la scelta migliore per effettuare un test a due campioni, essa viene superata da diverse varianti della NTK MMD per CIFAR-10. Inoltre, analizziamo l'impatto dell'architettura della rete neurale utilizzata sulla performance del test. Nella seconda parte di questo lavoro, applichiamo la NTK MMD all'individuazione di immagini avversarie. Consideriamo immagini generate dall'attacco Projected Gradient Descent (PGD), e impostiamo il problema in due modi differenti: distinguere due campioni, uno dei quali contenente una frazione di immagini avversarie, e identificare quali immagini sono avversarie in un campione. Per MNIST, la MMD calcolata con il Gaussian kernel e diverse varianti della NTK MMD succedono in entrambi i compiti. Per CIFAR-10, solamente tre varianti della NTK MMD succedono nel primo compito, e solamente per immagini avversarie generate da un numero elevato di iterazioni dell'attacco PGD. Nessun metodo ha successo per il secondo compito su CIFAR-10. Infine, sviluppiamo una variante dell'attacco PGD per fronteggiare l'individuazione di singole immagini avversarie per MNIST.
File allegati
File Dimensione Formato  
Thesis.pdf

accessibile in internet per tutti

Descrizione: Thesis
Dimensione 2.65 MB
Formato Adobe PDF
2.65 MB Adobe PDF Visualizza/Apri
Executive Summary.pdf

accessibile in internet per tutti

Descrizione: Executive Summary
Dimensione 511.14 kB
Formato Adobe PDF
511.14 kB Adobe PDF Visualizza/Apri

I documenti in POLITesi sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/10589/219521