異常檢測在資料分析領域中起著基石般的作用,對於金融欺詐檢測、醫療診斷、工業缺陷偵測,以及網絡安全等眾多領域具有至關重要的影響。隨著資料規模與複雜性的增加,能有效偵測異常資料的方法變得越來越重要且具有挑戰性。在本研究中,我們提出了利用生成對抗網路(GAN)與編碼器(encoder)的架構來進行異常圖片的偵測,並僅以正常資料作為訓練資料,利用重建誤差(reconstuction error)來進行異常偵測。結果中顯示,我們提出的方法在使用生成對抗網路架構進行異常偵測的偵測能力上,相較於目前領域中最先進的模型仍有更佳的表現。;Anomaly detection is one of the fundamental elements in data analysis, which is crucially influencing various industrial sectors. With the increasing volumes and complexity of the data, finding efficient anomaly detection methods has become increasingly important and challenging. However, the scarcity of anomaly data makes the training of anomaly detection models extremely difficult. To address this issue, this study proposes a method to identify anomalous images utilizing a generative adversarial network (GAN) combined with an encoder structure, leveraging only normal data for training and employing reconstruction error for anomaly detection. The experimental results indicate that our proposed method outperforms the state-of-the-art in anomaly detection using the GAN architecture. Furthermore, we identify an interesting relationship between the problems of anomaly detection and one-class novelty detection.