Looking inside the ANN "black box": classifying individual neurons as outlier detectors Carlos López, Centro de Cálculo, Facultad de Ingeniería, Montevideo, URUGUAY
Purpose: The main body of the literature states that Artificial Neural Networks must be regarded as a "black box" without further interpretation due to the inherent difficulties for analyze the weights and bias terms. Some authors claim that ANN trained as a regression device tend to organize itself by specializing some neurons to learn the main relationships embedded in the training set, while other neurons are more concerned with the noise also existing. Such statement is on principle speculative, and left the researcher with the problem of identifying the "noise-related" neurons from the others. We proposed here a rule to identify them, and to use it to detect outliers in a large dataset of 30 years of daily precipitation records from 10 weather stations (WS) from Uruguay. The Monte Carlo experiment compared state-of-the-art statistical methods for outlier detection against our proposed method, producing very promising conclusions.
Method: The original motivation was to eliminate missing values of the dataset. Thus, for each WS, we trained an ANN to predict its daily precipitation values using as input records those available from other stations for the same date. Then available for further applications, we applied our suggested rule for identifying the "noise related" neurons, and we assume that those neurons are activated only when some unusual values (or combination of values) are present. If any of the 10 ANN (using each 9 out of 10 WS values as inputs) activates its noisy neurons, we consider such date as candidate to hold an outlier.In the experiment, we seed the dataset with outliers, and applied a detection-correction-and further detection process for each method until the finishing criteria is satisfied. In the process, it is assumed that once a date is selected as candidate, it can be corrected without error, which in the statistical literature is known as the "perfect inspector" hypothesis. Such date cannot be chosen as a candidate again. Under such hipothesis and given a measure of success, both a best and worst method can be defined; López (1997) suggested that any other method can be ranked in between according to a numerical index. The value 0.0 corresponds to the worst method, and the value 1.0 to the best one; larger values are associated with better methods, and the results will be presented according to this index. Success can be measured as the number of outliers still in the dataset, the RMS of the differences between them and the correct values, etc.
The proposed procedure was compared within a Monte Carlo framework with state-of-the-art methods for outlier detection. In order to analyze a new method for outlier location usually two aspects should be considered and reported: a) its ability to detect known errors in a given dataset and b) its requirements in computer resources. For the first aspect there exist a number of widely available and well studied datasets. They are usually very small (few dozens of events) so the methods are expected to discover all the known outliers in a single step. For a large dataset application like this, we found more realistic to discover the errors through a process instead of a single step operation; this will enable an optimization of the human and computational resources involved as well. In an industrial size application it might be more important to find quickly the most significant errors rather than all of the errors, opening room to different measures of success.
Results: After more than 850 realizations, we concluded that our method outperformed the others in more than X per cent of the cases, being X in the range 28 to 99 depending on the measure of success used. This clearly confirms that the noisy neurons have been identified, and that the ANN-based method for outlier detection should be seriously considered.
New or breakthrough aspect of work: We found indirect support for the hypothesis about the specialization of the neurons in the ANN. In addition, we proposed and tested a very crude rule for identify them, which successfully compared with state-of-the-art methods widely known in statistics. The use of the ANN as outlier detector does not require further training, and can be easily applied. If the dataset is believed to have errors, further refinements in the training process might include removing dubious values detected by the method, thus improving the quality of the ANN.
Conclusions: Given an ANN trained for other purposes, we were able to classify its neurons as related with noise. If the inputs hold outliers, we assume that its effect are that the noisy neurons produce a substantially higher-than-usual output. After a Monte Carlo experiment designed to test and compare the method, the results show that: a) some evidence confirms the abovementioned assumption about the different roles of the neurons b) our rule for classifying neurons as related with noise seems reliable c) ANN-based outlier detection methods based upon our rule outperformed other well established procedures. ANN are, however, harder to train and this has to be taken into account when comparing with standard outlier detection methods.