# Deep Neural Networks Classification via Binary Error-Detecting Output Codes
## 2 Methods and Materials
### Decision Method
To recognize the pattern of each sample, we evaluate (10), and the function (11)  
\[m\ =\ \underset{c^{N}\in C}{\text{argmax}}\Big{\{}t\Big{(}\widetilde{\boldsymbol{ y}}\ =\ \boldsymbol{c}^{N}\Big{)}\Big{\}} \tag{11}\]  
gives the index of the codeword with the highest fuzzy truth-value. The output \(\widetilde{\boldsymbol{y}}\) and, consequently, sample \(\boldsymbol{x}\), will be assigned to the codeword \(\boldsymbol{c}^{m}\). We use 10 codewords for training and 1024 codewords for testing to compare one-hot encoding with binary coding. If the codeword \(\boldsymbol{c}^{m}\) is outside of the set of the codewords assigned to the classes, we interpret the case as error detection, and the pattern is not classified (classifier abstains from classification). In this paper, we are using a zero syndrome for error detection of binary codes on \(GF(2)^{n}\)[15]. Zadeh fuzzy logic has a valuable property, defined in Theorem 1, for testing over the complete set of codewords. **Theorem 1. ** Let \(\Big{\{}\boldsymbol{c}^{j}\ =\ \Big{(}c^{j}_{0},\ldots,c^{j}_{n-1}\Big{)}\in \{0,1\}^{n}\Big{\}}\), \(j\in\{0,1,\ldots,2^{n}-1\}\) be the binary codespace, \(\widetilde{\boldsymbol{y}}\ =\ (\widetilde{y}_{0},\ldots,\widetilde{y}_{n-1})\in[0,1]^{n}\) be a normalized output of the neural network, \(t\Big{(}\widetilde{y}_{i}\ =\ c^{j}_{i}\Big{)}\) be defined according to (9), and the winning codeword \(\widetilde{\boldsymbol{c}}\) be taken according to Equation (11). 1. Then the truth-value that \(\widetilde{\boldsymbol{c}}\) is the winning codeword is more than one half. 2. There is only one codeword with truth-value higher than one half. 3. The winning codeword is obtained by rounding off \(\widetilde{\boldsymbol{y}}\) i.e., \(\widetilde{\boldsymbol{c}}\ =\ (\widetilde{y}_{0},\ldots,\widetilde{y}_{n-1})\), where \(\approx\widetilde{y}_{i}\ =\ [\widetilde{y}_{i}+\
icefrac{{1}}{{2}}]\). **Proof of Theorem 1. ** Assume \(\boldsymbol{c}^{i}\ =\ \underset{\boldsymbol{c}\in\{0,1\}^{n}}{\text{argmax}} \Big{(}\mu\Big{(}\widetilde{\boldsymbol{y}}\ =\ \boldsymbol{c}\Big{)}\Big{)}\) and \(t\Big{(}\widetilde{\boldsymbol{y}}\ =\ \boldsymbol{c}^{i}\Big{)}<\
icefrac{{1}}{{2}}\). Then, there exists in the codeword \(\boldsymbol{c}^{i}\) bits \(i\in I\subseteq\{0,\ldots,n-1\}\) with \(t\Big{(}\widetilde{y}_{i}\ =\ \boldsymbol{c}^{i}_{i}\Big{)}<\
icefrac{{1}}{{2}}\). Replacing these bits by their negations, we obtain the codeword \(\boldsymbol{c}^{k}\) with \(t\big{(}\widetilde{y}_{i}\ =\ \boldsymbol{c}^{k}_{i}\big{)}\ >\
icefrac{{1}}{{2}}\), \(i=\{0,\ldots,n-1\}\). Therefore, \(t\Big{(}\widetilde{\boldsymbol{y}}\ =\ \boldsymbol{c}^{k}\Big{)}>\
icefrac{{1}}{{2}}\), which is in contradiction with the assumption. 1. Assume \(\boldsymbol{c}^{i}\ =\ \underset{\boldsymbol{c}\in\{0,1\}^{n}}{\text{argmax}} \Big{(}t\Big{(}\widetilde{\boldsymbol{y}}\ =\ \boldsymbol{c}\Big{)}\Big{)}\), \(\boldsymbol{c}^{k}\ =\underset{\boldsymbol{c}\in\{0,1\}^{n}}{\text{argmax}} \Big{(}t\Big{(}\widetilde{\boldsymbol{y}}\ =\ \boldsymbol{c}\Big{)}\Big{)}\, \boldsymbol{j}\
eq\text{k}\,\text{and}\,t\Big{(}\widetilde{\boldsymbol{y}}\ =\ \boldsymbol{c}^{i}\Big{)}>\
icefrac{{1}}{{2}}\), \(t\Big{(}\widetilde{\boldsymbol{y}}\ =\ \boldsymbol{c}^{k}\Big{)}>\
icefrac{{1}}{{2}}\). Because \(\boldsymbol{c}^{j}\
eq\boldsymbol{c}^{k}\), there exists a bit \(i\in\{0,1,\ldots,n-1\}\) that \(\boldsymbol{c}^{j}_{i}\ =\ \overline{\boldsymbol{c}^{k}_{i}}\). \(t\Big{(}\widetilde{y}_{i}\ =\ \boldsymbol{c}^{i}_{i}\Big{)}\ =\ \boldsymbol{t}\Big{(} \widetilde{y}_{i}\ =\ \overline{\boldsymbol{c}^{k}_{i}}\Big{)}>\
icefrac{{1}}{{2}}\) implies \(t\big{(}\widetilde{y}_{i}\ =\ \boldsymbol{c}^{k}_{i}\big{)}<\
icefrac{{1}}{{2}}\), \(t\Big{(}\widetilde{\boldsymbol{y}}\ =\ \boldsymbol{c}^{k}\Big{)}<\
icefrac{{1}}{{2}}\), which is in contradiction with the assumption. 2. For the rounded output \(t\Big{(}\widetilde{\boldsymbol{y}}\ =\ \Big{(}\approx\widetilde{\boldsymbol{y}} \Big{)}\Big{)}>\
icefrac{{1}}{{2}}\). According to b), \(\approx\ \widetilde{\boldsymbol{y}}\) is the only winning codeword.