## 3 Proposed Model  
The proposed model uses an unsupervised adversarial training scheme. It has two major components:  
* The generator (\(G\)) learns the dataset distribution from the input image, encodes it into a latent vector, and reconstructs the image by upsampling. The uniqueness of the generator is that the encoder uses a parallel model that is comprised of a convolutional pipeline (CNN) and a dilated convolutional end network (DCN) that is 8 layers deep,  
Figure 2: The architecture of the proposed model. The encoder part of the generator \(G\) is built on a unique parallel model that is capable of extracting local features from an input image \(x\) through the convolutional neural network (CNN), and global features through the DCN. Concatenation of these features \(z\) is used as the input for the generator which in turn reconstructs the original input image as \(\hat{x}\). The discriminator \(D\) is an encoder that inputs both the original and the reconstructed image and outputs a class label if the image is real or fake. Its fully connected layer \(\hat{z}\) is also used as a part of the main loss function during training. each layer uses \(3\times 3\) convolutional filters, a Rectified linear unit (ReLU) activation function, and a batch normalization operation. After two identical layers, a max-pooling operation is used for spatial dimension reduction and doubling the depth of the tensor. A latent vector of the input image is then generated. The DCN is eight layers deep, each layer uses \(3\times 3\) convolutional filters with a dilation factor of 2, a ReLU (Rectified linear units) activation function, and a batch normalization operation. After 2 identical layers, a max-pooling operation is used for spatial dimension reduction and increasing the depth of the tensor. A latent vector of the input image is then generated. Concatenation of these features gives the optimal feature vector of the input image [58]. The class activation map for the given input image is shown in Figure 3.
* The discriminator (\(D\)) predicts the class of the input (whether it is fake or not) based on learned features. The discriminator generally uses an encoder-type architecture. The mathematical definition and the formulation of the problem are the following:  
The dataset is split into a training set \(D\) that is comprised of \(N\) normal images where \(D=\{x_{1},\dots,x_{N}\}\), and a testing set \(\hat{D}\) of \(A\) normal and abnormal images combined \(\hat{D}=\{\hat{X}_{1},y_{1}),(\hat{X}_{2},y_{2}),\dots,(\hat{X}_{A},y_{A})\}\) where \(y_{A}\in[0,1]\) denotes normal and abnormal class labels, respectively. The task is training the proposed model \(f\) on \(D\) and perform inference on \(A\). Ideally, the training set should be larger than the training set, \(D\gg A\). Training helps to map the distribution of the dataset \(D\) in all vector spaces. This enables the network to learn both higher and lower-level features that are different from abnormal samples. As shown in Figure 2, the proposed model consists of a generator \(G\) and a discriminator \(D\). The generator uses an autoencoder-type structure to generate an image \(\hat{x}\) through extracted latent vector \(z\) from the input image \(x\) such that \(G:x\to z\) where \(x\in\mathbb{R}^{(w\times h\times c)}\) and \(z\in\mathbb{R}^{d}\). The input image \(x\) is fed to both pipelines where the conventional CNN extracts local features and the DCN extracts global features. Concatenation of these features creates the latent vector \(z\). The convolutional network pipeline consists of eight convolutional layers, each layer is created using \(3\times 3\) convolutional filters, a ReLU activation, and a batch normalization operation. The DCN consists of 8 dilated convolutional layers with each layer being comprised of a \(3\times 3\) convolutional filters with a dilation factor of 2, a ReLU activation, and a batch normalization operation. At the end of each pipeline, extracted image features are concatenated to the create the latent vector to \(z\).