Official implementation of TFN: "Twin Fuzzy Networks with Interpolation Consistency Regularization for Weakly-supervised Anomaly Detection" on IEEE Transactions on Fuzzy Systems
MATLAB R2022b
- Get datasets mentioned in the paper:
- Download ".zip" file in this share link, and unzip it to the folder "./Datasets"
- Generate your anomaly detection datasets:
- All datasets mentioned in the paper are generated using the python code of DevNet proposed in the SIGKDD paper Deep Anomaly Detection with Deviation Networks
- To run your own datasets with weakly supervision, name your generated train/test datasets in the following format:
- Train dataset: "{}_weakly_train_{}_{}.mat".format(origin_name, contamination_rate, num_known_anomalies)
- Test dataset: "{}_weakly_test_{}_{}.mat".format(origin_name, contamination_rate, num_known_anomalies)
- To fetch the results in the paper:
- Run "main.m".
- Results:
- The "log_{n}.txt" files that keep the display output for experiments are stored in "./Logs" directory.
- The corresponding tables "log_Result_{n}.csv" that store results for that experiments are stored in "./Logs" directory.
- Parameter Settings (in "main.m" file):
-
EXP: Set the random seed, and the number of runs for each dataset -
datasets: List all the origin names of the datasets under weak supervision -
WSAD: Set the hyperparameters for the weak supervision scenarios.known_outlieris the number of known anoamlies.contaminationis the contamination rate. -
PCA:pcadetermine whether PCA is used.min_dimis the minimum dimension for the usage of PCA.thresholdis the explained variation ratio. -
PTRAIN: Inmethod,fixeduses the pre-set number of rulesfix_rulefor these datasets, andsearchwill search for ideal number of rules resulting non-empty clusters betweenmin_fuleandmax_rule. -
AUG:-
num_trainis the number of data pairs (hyperparameter$M$ in the paper). -
c_valuesis the list of$[C_{a,a}, C_{u,a}, C_{u,u}]$ . -
E_testis the number of train data sampled in the test phase (hyperparameter$E$ in the paper).
-
-
MIXUP:-
typedetermine whether ICR is used, chosen between "No" and "ICR". -
Mis the number of virtual training pairs in the ICR process. -
gammais the weight of the ICR loss.
-
-
REGU:lambdais the weight of the$l_2$ regularization term. -
TRAIN:clusterchoose the cluster method used in TFN, choosen between "p_fcm" and "k-means".
-
The full paper can be found at this link.
@ARTICLE{cao2024twin,
author={Cao, Zhi and Shi, Ye and Chang, Yu-Cheng and Yao, Xin and Lin, Chin-Teng},
journal={IEEE Transactions on Fuzzy Systems},
title={Twin Fuzzy Networks With Interpolation Consistency Regularization for Weakly-Supervised Anomaly Detection},
year={2024},
volume={32},
number={9},
pages={5086-5097},
keywords={Anomaly detection;Training;Prototypes;Uncertainty;Interpolation;Optimization;Knowledge engineering;Data uncertainty;fuzzy c-means clustering;interpolation consistency regularization;twin fuzzy networks;weakly-supervised anomaly detection},
doi={10.1109/TFUZZ.2024.3412435}}