In recent years, Artificial intelligence (AI) has been spreading more and more, permeating every area, from industries to healthcare. It has achieved incredible performance, solving increasingly complex problems, such as image classification or anomaly detection. However, the improvement of performance corresponds to the use of increasingly complex models. A drawback of such models is the lack of transparency in the model’s prediction, in the sense that it is not known what determines the model’s choices. To overcome this problem, eXplainable AI (XAI) has been devised. The idea is to endow existing AI models with algorithms that allow explaining their output. These algorithms are called explanation methods because their target is to provide an insightful understanding of the model choices to users. The XAI application to the anomaly detection task is a relatively new research topic and it has great potential. The goal of this thesis is to study the explanation methods of autoencoder neural networks. Autoencoders are deep learning models used to detect anomalies, namely data samples that significantly differ from the distribution of the majority of the data. They are composed of an encoder and a decoder: the first projects the data in a low dimensional space, while the second reconstructs the input as faithfully as possible. To detect anomalies, the reconstruction error is used. It evaluates the model’s ability to reconstruct the original sample, by employing a suitable loss function. The reconstruction error of the normal training data allows setting a threshold between normal or anomaly samples. A sample is classified as anomalous if its reconstruction error is higher than this threshold. In this work, an explanation algorithm called KernelSHAP is used to provide information about anomaly detection models. The algorithm is based on the computation of the Shapley values, derived from coalitional game theory. KernelSHAP estimates the average contribution given by each input feature to the final prediction. Several types of dataset, tabular data, images, and time series, are analyzed with the most suitable type of autoencoder. Afterwards, depending on the dataset, an explanation of the outcome of the model or of the reconstruction error is calculated using KernelSHAP. This allows us to better understand the behavior of the explanation method in different case studies. Furthermore, an explanation of the latent layer has also been studied, based on the hypothesis that the latent representation obtained from the autoencoder incorporates important information about the presence or absence of anomalies. The results indicate that explanation methods are useful to make complex models, such as those for anomaly detection, more understandable, highlighting in particular why an anomaly has been identified. In addition, they try to facilitate its identification. Thus, they are fundamental in supporting specialists in their work, for example in locating an anomaly in the event of a cyber attack or in identifying the anomalous part in a medical test to facilitate diagnosis.

Recentemente l’intelligenza artificiale (AI) si è diffusa in molti settori, dall’industria all’ healthcare, raggiungendo prestazioni sorprendenti, risolvendo problemi sempre più complessi, come la classificazione di immagini o l’individuazione di anomalie. A questo miglioramento corrisponde però l’utilizzo di modelli via via più complessi, che comportano, quindi, una minor trasparenza nelle loro predizioni, ossia non si sa da cosa sia determinata la scelta del modello. Al fine di ovviare a questo problema, è stata ideata l’eXplainable AI (XAI). L’idea è di associare ai modelli di intelligenza artificiale degli algoritmi che ne spieghino l’output. Questi algoritmi prendono il nome di metodi di spiegazione, in quanto sono creati per fornire, a chi li utilizza, delle indicazioni utili circa gli elementi che determinano le decisioni prese dai modelli. L’applicazione dell’ XAI al problema dell’ identificazione delle anomalie è un ambito di ricerca relativamente nuovo e particolarmente promettente. L’obiettivo di questa tesi è infatti studiare i metodi di spiegazione applicati a un particolare tipo di rete neurale, gli autoencoder. Questi sono dei modelli di deep learning usati anche per identificare le anomalie, ossia quei dati che si discostano in maniera statisticamente significativa dalla distribuzione seguita dalla maggioranza dei dati. L’autoencoder è composto da un encoder e un decoder: il primo proietta i dati in uno spazio di dimensione inferiore, mentre il secondo tenta di ricostruire l’input in modo che sia il più simile possibile all’originale. La presenza di un’anomalia viene determinata tramite l'errore di ricostruzione, il quale stima la capacità del modello di ricostruire il dato originale, grazie ad un’adeguata funzione di perdita (loss function). Calcolando l’errore di ricostruzione sui dati di training si ottiene una soglia che permette di distinguere i dati normali da quelli anomali: un campione viene quindi classificato come anomalo se il suo errore di ricostruzione è maggiore di questa soglia. Per svolgere questo lavoro è stato utilizzato come metodo di spiegazione un algoritmo che prende il nome di KernelSHAP, usato per fornire informazioni riguardanti i modelli di anomaly detection. Si basa sul calcolo dei valori di Shapley, basato sulla teoria dei giochi di coalizione. KernelSHAP stima il contributo medio dato da ogni feature in input alla predizione finale. Sono stati studiati diverse tipologie di dati, tabulari, immagini e serie temporali, ognuna associata alla tipologia più adatta di autoencoder. Successivamente, in base al data set, è stata calcolata una spiegazione per ogni predizione, sfruttando il suddetto algoritmo, KernelSHAP, e l’errore di ricostruzione. Questo ha permesso di comprendere meglio il comportamento del metodo di spiegazione nei diversi contesti studiati. Inoltre è stata anche approfondita la spiegazione del layer latente, basandosi sull’ipotesi per cui la rappresentazione latente ottenuta dall’autoencoder abbia anch’essa interiorizzato informazioni importanti riguardo la presenza o l’assenza di anomalie. I risultati indicano che i metodi di spiegazione usati sono effettivamente utili al fine di rendere più comprensibili e accessibili modelli complessi come quelli usati per l’anomaly detection, evidenziando in particolare perchè le anomalie vengono classificate come tali. Oltre a ciò questi permottono di facilitare l’identificazione delle anomalie, supportando quindi gli specialisti.

Spiegazione delle predizioni degli autoencoders applicati al rilevamento delle anomalie ​

DELPIANO, ALESSIA
2020/2021

Abstract

Recentemente l’intelligenza artificiale (AI) si è diffusa in molti settori, dall’industria all’ healthcare, raggiungendo prestazioni sorprendenti, risolvendo problemi sempre più complessi, come la classificazione di immagini o l’individuazione di anomalie. A questo miglioramento corrisponde però l’utilizzo di modelli via via più complessi, che comportano, quindi, una minor trasparenza nelle loro predizioni, ossia non si sa da cosa sia determinata la scelta del modello. Al fine di ovviare a questo problema, è stata ideata l’eXplainable AI (XAI). L’idea è di associare ai modelli di intelligenza artificiale degli algoritmi che ne spieghino l’output. Questi algoritmi prendono il nome di metodi di spiegazione, in quanto sono creati per fornire, a chi li utilizza, delle indicazioni utili circa gli elementi che determinano le decisioni prese dai modelli. L’applicazione dell’ XAI al problema dell’ identificazione delle anomalie è un ambito di ricerca relativamente nuovo e particolarmente promettente. L’obiettivo di questa tesi è infatti studiare i metodi di spiegazione applicati a un particolare tipo di rete neurale, gli autoencoder. Questi sono dei modelli di deep learning usati anche per identificare le anomalie, ossia quei dati che si discostano in maniera statisticamente significativa dalla distribuzione seguita dalla maggioranza dei dati. L’autoencoder è composto da un encoder e un decoder: il primo proietta i dati in uno spazio di dimensione inferiore, mentre il secondo tenta di ricostruire l’input in modo che sia il più simile possibile all’originale. La presenza di un’anomalia viene determinata tramite l'errore di ricostruzione, il quale stima la capacità del modello di ricostruire il dato originale, grazie ad un’adeguata funzione di perdita (loss function). Calcolando l’errore di ricostruzione sui dati di training si ottiene una soglia che permette di distinguere i dati normali da quelli anomali: un campione viene quindi classificato come anomalo se il suo errore di ricostruzione è maggiore di questa soglia. Per svolgere questo lavoro è stato utilizzato come metodo di spiegazione un algoritmo che prende il nome di KernelSHAP, usato per fornire informazioni riguardanti i modelli di anomaly detection. Si basa sul calcolo dei valori di Shapley, basato sulla teoria dei giochi di coalizione. KernelSHAP stima il contributo medio dato da ogni feature in input alla predizione finale. Sono stati studiati diverse tipologie di dati, tabulari, immagini e serie temporali, ognuna associata alla tipologia più adatta di autoencoder. Successivamente, in base al data set, è stata calcolata una spiegazione per ogni predizione, sfruttando il suddetto algoritmo, KernelSHAP, e l’errore di ricostruzione. Questo ha permesso di comprendere meglio il comportamento del metodo di spiegazione nei diversi contesti studiati. Inoltre è stata anche approfondita la spiegazione del layer latente, basandosi sull’ipotesi per cui la rappresentazione latente ottenuta dall’autoencoder abbia anch’essa interiorizzato informazioni importanti riguardo la presenza o l’assenza di anomalie. I risultati indicano che i metodi di spiegazione usati sono effettivamente utili al fine di rendere più comprensibili e accessibili modelli complessi come quelli usati per l’anomaly detection, evidenziando in particolare perchè le anomalie vengono classificate come tali. Oltre a ciò questi permottono di facilitare l’identificazione delle anomalie, supportando quindi gli specialisti.
ENG
ITA
In recent years, Artificial intelligence (AI) has been spreading more and more, permeating every area, from industries to healthcare. It has achieved incredible performance, solving increasingly complex problems, such as image classification or anomaly detection. However, the improvement of performance corresponds to the use of increasingly complex models. A drawback of such models is the lack of transparency in the model’s prediction, in the sense that it is not known what determines the model’s choices. To overcome this problem, eXplainable AI (XAI) has been devised. The idea is to endow existing AI models with algorithms that allow explaining their output. These algorithms are called explanation methods because their target is to provide an insightful understanding of the model choices to users. The XAI application to the anomaly detection task is a relatively new research topic and it has great potential. The goal of this thesis is to study the explanation methods of autoencoder neural networks. Autoencoders are deep learning models used to detect anomalies, namely data samples that significantly differ from the distribution of the majority of the data. They are composed of an encoder and a decoder: the first projects the data in a low dimensional space, while the second reconstructs the input as faithfully as possible. To detect anomalies, the reconstruction error is used. It evaluates the model’s ability to reconstruct the original sample, by employing a suitable loss function. The reconstruction error of the normal training data allows setting a threshold between normal or anomaly samples. A sample is classified as anomalous if its reconstruction error is higher than this threshold. In this work, an explanation algorithm called KernelSHAP is used to provide information about anomaly detection models. The algorithm is based on the computation of the Shapley values, derived from coalitional game theory. KernelSHAP estimates the average contribution given by each input feature to the final prediction. Several types of dataset, tabular data, images, and time series, are analyzed with the most suitable type of autoencoder. Afterwards, depending on the dataset, an explanation of the outcome of the model or of the reconstruction error is calculated using KernelSHAP. This allows us to better understand the behavior of the explanation method in different case studies. Furthermore, an explanation of the latent layer has also been studied, based on the hypothesis that the latent representation obtained from the autoencoder incorporates important information about the presence or absence of anomalies. The results indicate that explanation methods are useful to make complex models, such as those for anomaly detection, more understandable, highlighting in particular why an anomaly has been identified. In addition, they try to facilitate its identification. Thus, they are fundamental in supporting specialists in their work, for example in locating an anomaly in the event of a cyber attack or in identifying the anomalous part in a medical test to facilitate diagnosis.
IMPORT DA TESIONLINE
File in questo prodotto:
File Dimensione Formato  
833624_delpiano_explanation_of_autoencoders_predictions_for_anomaly_detection.pdf

non disponibili

Tipologia: Altro materiale allegato
Dimensione 5.36 MB
Formato Adobe PDF
5.36 MB Adobe PDF

I documenti in UNITESI 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/20.500.14240/156378