 summarised in the Appendix in Table \[CNN\_architecture\].

### Preprocessing and Input Corruption

All images have been scaled so that all values are between 0 and 1. Furthermore, In order to allow for the partial corruption of the input. A corruption layer has been implemented that is responsible for adding Gaussian noise with mean $0$ and variance $\sigma$ to the input of the system. Various $\sigma$ values between $0$ and $1$ have been attempted. Experimentally the best results were obtained for $\sigma = 0.1$.

### Loss functions and Class Imbalance

In this section we describe in detail how we balance the cost functions used to train our networks. For training the baseline CNN model, a single binary cross entropy loss function was used as it is an appropriate loss function for classification tasks. The ssDAAE on the other hand consists of several modules each with their own loss function, these loss functions need to be combined with care. The loss functions include: a classification loss at the output of the classifier, $E^y_{\theta_y}$, a reconstruction loss at the output of the decoder, $D_{\theta_D}$ and both discriminator and regularisation losses at the output of the discriminators, $T_{\theta_T}$ and $T^y_{\theta_{T_y}}$. The latent space discriminator loss is described in Equation (\[disCost\_z\]), this cost may be modified for the label discriminator, by replacing $p(z)$ with a binary distribution and $p_g(z)$ with the output of $E^y_{\theta_y}$. We now describe the encoder loss function, (designed to update the weights, $\{\theta_E, \theta_{E_y}, \theta_{E_z} \}$), which is defined as the weighted combination of the following losses:\

-   **Classification Loss $l_{class}$ :** The binary cross-entropy loss between the predicted class and the ground truth label.

-   **Reconstruction Loss $l_{rec}$ :** The mean squared-error between the decoded image and the input image.

-   **Latent Regularisation Loss $l_{reg_z}$ :** The binary-cross entropy loss between output of the latent discriminator, $T_{\theta_T}$ and a target label 1. (Where $1$ refers to the discriminator predicting that a samples is from the chosen
summarised in the Appendix in Table \[CNN\_architecture\ ]. 

 # # # Preprocessing and Input Corruption 

 All images have been scaled so that all values are between 0 and 1. Furthermore, In decree to leave for the partial corruption of the input. A putrescence layer has been implemented that is creditworthy for adding Gaussian noise with mean $ 0 $ and variance $ \sigma$ to the input signal of the system. Various $ \sigma$ value between $ 0 $ and $ 1 $ have been attempted. Experimentally the best solution were prevail for $ \sigma = 0.1$. 

 # # # Loss functions and Class Imbalance 

 In this section we describe in detail how we poise the cost functions used to prepare our networks. For training the service line CNN model, a unmarried binary cross entropy loss routine was used as it is an appropriate loss function for categorization tasks. The ssDAAE on the other hand consists of several modules each with their own personnel casualty function, these loss functions need to be combined with care. The loss functions include: a classification personnel casualty at the output of the classifier, $ E^y_{\theta_y}$, a reconstruction loss at the output signal of the decoder, $ D_{\theta_D}$ and both differentiator and regulation losses at the output of the differentiator, $ T_{\theta_T}$ and $ T^y_{\theta_{T_y}}$. The latent space differentiator loss is described in Equation (\[disCost\_z\ ]), this cost may be change for the label discriminator, by replacing $ p(z)$ with a binary distribution and $ p_g(z)$ with the output of $ E^y_{\theta_y}$. We now describe the encoder loss function, (designed to update the weights, $ \{\theta_E, \theta_{E_y }, \theta_{E_z } \}$), which is defined as the weighted combination of the following losses:\ 

 -    * * Classification Loss $ l_{class}$ :* * The binary crabbed - entropy loss between the bode course and the flat coat truth label. 

 -    * * Reconstruction Loss $ l_{rec}$ :* * The mean squared - mistake between the decoded image and the input prototype. 

 -    * * Latent Regularisation Loss $ l_{reg_z}$ :* * The binary - cross entropy loss between output of the latent differentiator, $ T_{\theta_T}$ and a target label 1. (Where $ 1 $ refers to the discriminator predicting that a samples is from the choose
 sulmarised in the Appendix in Table \[CNN\_areyitectnre\].

### Prelrocessivg and Input Corruption

All ilates hqve been scaled so thag all valles are bwtwetn 0 and 1. Furthermore, In ovber tk allmx for the partisl corrupthon of the inpgt. A corruption layer has been implemeneed thay ls responsible for wddihg Gaussian noise with mean $0$ and vzriance $\sigma$ to the input of the system. Varioks $\slgma$ values betweej $0$ and $1$ havg beqb attempted. Dxperimentally the besj results were obtained for $\sigmx = 0.1$.

### Lpss functiinw ajg Class Imbelance

Pn this section we devcribe on detail how ee ualabce the cost functionv used to train out networks. Fkr training the bqswline CNN moddo, a sihgke binarj ccoss entropg loss funcrion was used as it if an appropriafe losf sunction for classification tasks. The svDAZE on the other hand cobsists of several modoles each rith their own loss function, these loss functions need go yc zimhined with care. The loss functions include: a smaxspfication loss at the output ov yre classifier, $E^y_{\thecz_y}$, a reconstruction poss at the iutput of the decoder, $D_{\theta_D}$ and both duscriminator qnd regularisation losses at che oujput og the discriminators, $T_{\tketa_T}$ znd $T^y_{\theta_{H_y}}$. The lafdnt space discrioinstmr loss is described in Eqtation (\[diwCosc\_z\]), this zost may bq modified for bve label discriminwtor, yy re[lacing $p(z)$ with a binary distribution and $p_g(z)$ with the pudpun of $E^y_{\thzta_y}$. Wc now describe ehe encoder loxs funccion, (ddsigned to update the weightf, $\{\theta_E, \thetd_{G_y}, \theta_{E_z} \}$), wiich is dqfinwd aw the wdkghted combinayion of tkt followint losses:\

-   **Classiflcatiuh Loss $l_{class}$ :** Cke binary cross-enyrooy jods bqdween the pradicged vlass and tht gvouvd ttuth label.

-   **Reconstsuctjon Loss $l_{rec}$ :** The mcan squargd-error bqtween the devoded image and tht inpuv imagx.

-   **Layenj Regularisation Loss $l_{reg_z}$ :** Ths binary-cgosf entropy lofs bctwegn output oy the latent discriminator, $T_{\theta_T}$ and a target label 1. (Whgre $1$ refers to the dixgriminator pcedictyng that d samples is from thw chosen
summarised in the Appendix in Table \[CNN\_architecture\]. and Corruption All have been scaled between and 1. Furthermore, order to allow the partial corruption of the input. corruption layer has been implemented that is responsible for adding Gaussian noise with $0$ and variance $\sigma$ to the input of the system. Various $\sigma$ values $0$ $1$ been Experimentally the best results were obtained for $\sigma = 0.1$. ### Loss functions and Class Imbalance this section we describe in detail how we the cost functions used train our networks. For training baseline model, a binary entropy function was used it is an appropriate loss function for classification tasks. The ssDAAE on the other hand consists of modules each own loss these functions to be combined The loss functions include: a classification output of the classifier, $E^y_{\theta_y}$, a reconstruction loss the output the decoder, $D_{\theta_D}$ and both discriminator regularisation losses at the output of the discriminators, and $T^y_{\theta_{T_y}}$. The latent space discriminator loss is described in Equation (\[disCost\_z\]), this cost may for the label discriminator, replacing $p(z)$ with binary and with output of We now describe the encoder loss function, (designed to update the $\{\theta_E, \theta_{E_y}, \theta_{E_z} \}$), which is defined as the weighted the losses:\ - **Classification $l_{class}$ :** The binary loss the predicted class and truth - :** mean between the decoded image the input image. - **Latent Loss $l_{reg_z}$ :** The of the latent discriminator, $T_{\theta_T}$ and a target 1. (Where $1$ refers to the discriminator that a samples is from the chosen
 summarised in the Appendix in table \[CNN\_arChiteCtuRe\].

### PReProcEssiNg and Input CorrUPtioN

All images have been scalEd so tHaT All vALuEs are Between 0 ANd 1. fURthErMoRe, IN oRDeR to alLow For the pArtial corrUptIoN of the input. A COrRuption layEr hAs been implemEntEd that Is ResPOnsibLe fOr addIng GauSSian noIse with meAn $0$ ANd variANce $\sigmA$ TO tHe inPut of the system. VarIOuS $\Sigma$ values betWeen $0$ anD $1$ hAVe BEEn aTteMpted. ExperImEntalLY the besT ReSULTs wERe obtained for $\Sigma = 0.1$.

### Loss fuNCtiOns and clAss iMbalanCe

In tHiS SecTion we descrIbe iN detail hoW we balANce the cOSt functIons usEd tO trAin oUR nEtWorKs. fOr tRAiNinG The Baseline cNn mOdel, a SingLE BINary CroSs enTropy Loss function wAs uSed aS It iS an apProprIate LoSs funCtion fOr claSsIfication tasks. THe ssdAAE on the OthEr HanD cOnsisTS of sevEraL moDules eaCh with tHEir OwN LOSs Function, these loss fUnCTIoNs need to Be combINeD wITh care. ThE lOss FuncTIOns inCludE: A cLassificAtion lOSs At The outpUt Of the cLaSsiFieR, $E^y_{\thETa_y}$, a ReconsTruction Loss aT The output of the DEcoder, $D_{\theta_D}$ ANd BOTh DIscrImiNator and regUlarISatiOn loSSeS at THe outPut of ThE DiSCriminators, $T_{\theta_T}$ aNd $t^y_{\thetA_{T_y}}$. ThE latent space dIscriminatOR LOss is desCribED iN equation (\[disCosT\_z\]), thiS cost may be MOdified fOr the Label disCriminatoR, BY replaciNg $p(Z)$ wiTh a BinARY dIstribution anD $P_G(z)$ wiTh The outpUt oF $E^y_{\thetA_y}$. WE noW deScrIbE the encodEr loss fuNcTiOn, (DeSigNed to UPdate the WeIghTs, $\{\TheTa_E, \thETa_{E_y}, \thEta_{E_z} \}$), WhicH iS dEFinEd as the WEiGHTed cOmBiNatiOn oF tHe folLowiNG loSses:\

-   **ClaSsificatiOn LOSs $l_{cLaSs}$ :** the binaRy cross-entropY lOss between ThE prEdicteD CLass and tHe ground truth label.

-   **ReconSTructioN LoSs $l_{reC}$ :** The Mean squarEd-eRror beTweEN the deCoded iMage aNd The INPut imAGE.

-   **LAteNt regularisaTIOn LOss $l_{rEg_Z}$ :** The Binary-cRoss entropy loss betWEen Output of the laTenT disCRImInaTOr, $t_{\TheTa_t}$ And A TArget label 1. (Where $1$ Refers to thE dIScRiminator pREdiCtIng that A sampleS is frOM the choSen
 summarised in the Appendi x in Table  \[CN N\_ arc hi tect ure\ ].

### Prepro c essi ng and Input Corruptio n

Al li mage s  h ave b een sca l ed s o t ha tall  v a lu es ar e b etween0 and 1. F urt he rmore, In or d er  to allowfor  the partial  co rrupti on  of the i npu t. Acorrup t ion la yer has b ee n  imple m ented t h a tis r esponsible for ad d in g  Gaussian nois e with  m e an $ 0$and  variance$\ sigma $  to the in p u t  of the system. V arious $\si g ma$  value sbet w een $0 $ and  $ 1 $ h ave been at temp ted. Expe riment a lly the best re sultswer e o btai n ed  f or$\ s igm a  =  0. 1 $.
### Los sfu nctio ns a n d C lass  Im bala nce
In this secti onwe d e scr ibe i n det ailho w webalanc e the  c ost functions u sedto trainour  n etw or ks. F o r trai nin g t he base line CN N  mo de l , asingle binary cros se n tr opy loss  funct i on  w a s used a sitis a n appro pria t eloss fun ctionf or  c lassifi ca tion t as ks.  Th e ssD A AE o n theother ha nd co n sists of sever a l modules eac h  w i t ht heir  ow n loss func tion ,  the se l o ss  fu n ction s nee dt ob e combined with car e.  The l oss f unctions incl ude: a cla s s i fication  los s  a t  the output of  theclassifier ,  $E^y_{\ theta _y}$, areconstru c t ion loss  at  th e o utp u t  o f the decoder , $D_{ \t heta_D} $ a nd both  di scr imi nat or  and regu larisati on  l os se s a t the output o fthe  d isc rimin a tors,$T_{\ thet a_ T} $  an d $T^y_ { \t h e ta_{ T_ y} }$.The  l atent  spa c e d iscrimi nator los s i s  des cr ib ed in E quation (\[di sC ost\_z\]),  t his  costm a y be mod ified for the label dis c riminat or,  by r epla cing $p(z )$with a  bi n ary di stribu tionan d $ p _ g(z)$ w it h t he  output of $ E^y _{\th et a_y} $. We n ow describe the en c ode r loss functi on,  (de s i gn edt ou pda te the w eights, $\{\the ta_E, \the ta _ {E _y}, \thet a _{E _z } \}$),  whichis de f ined as  the weig hted comb in atio n ofthe follow ing loss es:\

- **Cla s si ficat ion  Loss$l _{c lass} $ :**T hebinar y cros s- entrop y los sbetweenthe predicted class and  the g round  tr uth label .
-   **Reconst ruct ion Loss $ l_{ rec }$ :* * T h e mea n sq u ar ed- e rrorbetw e en the de c od edi m ag e and the i n p u t i mage. 

-   **La tent  Regularisation L o ss $l_{reg_z}$  :** T hebin a ry-c ro ss entropy los s b et w e en outpu tof the late nt discr im i nator , $T_{ \theta _T}$ an d at argetlabe l 1 . (Where$1$  r e fers to  t he discri mina to r pred icting that a  samples is from  thec h osen
 summarised_in the_Appendix in Table \[CNN\_architecture\].

###_Preprocessing and_Input_Corruption

All images_have_been scaled so_that all values_are between 0 and_1. Furthermore, In_order_to allow for the partial corruption of the input. A corruption layer has been_implemented_that is_responsible_for_adding Gaussian noise with mean_$0$ and variance $\sigma$ to_the input_of the system. Various $\sigma$ values between $0$_and_$1$ have been_attempted. Experimentally the best results were obtained for $\sigma_= 0.1$.

### Loss functions and Class_Imbalance

In this section_we_describe_in detail how we_balance the cost functions used to_train our networks. For training the_baseline CNN model, a single binary cross_entropy loss function was used as_it is an appropriate loss_function for_classification tasks. The ssDAAE on_the other hand_consists of_several modules each_with their own loss function, these_loss functions need_to be combined with care. The_loss_functions include: a_classification_loss_at the_output of the_classifier,_$E^y_{\theta_y}$, a_reconstruction_loss at the output of the_decoder,_$D_{\theta_D}$ and both discriminator and regularisation losses_at the output of_the_discriminators, $T_{\theta_T}$ and $T^y_{\theta_{T_y}}$._The latent space discriminator loss_is described in Equation (\[disCost\_z\]), this_cost may_be modified_for the label discriminator, by replacing $p(z)$ with a binary distribution_and $p_g(z)$ with the output of_$E^y_{\theta_y}$. We now describe_the encoder_loss_function, (designed to_update_the weights,_$\{\theta_E, \theta_{E_y}, \theta_{E_z} \}$), which is defined_as the_weighted combination of the following losses:\

-_  **Classification Loss_$l_{class}$_:** The binary cross-entropy loss between_the predicted class and the ground_truth label.

-   **Reconstruction_Loss_$l_{rec}$_:** The mean squared-error between_the decoded image and the input_image.

-  _**Latent Regularisation Loss $l_{reg_z}$ :** The binary-cross_entropy_loss between output of the latent_discriminator,_$T_{\theta_T}$ and a target label 1._(Where_$1$_refers to the discriminator predicting_that a samples is from the_chosen