# Deep Neural Networks Classification via Binary Error-Detecting Output Codes
## 2 Methods and Materials
### Decision Method
In [11], a method which combines ECOC with softmax was proposed. This method does not use error detection. We implement this method using CRC coding instead of ECOC to compare it with the proposed Zadeh decision method. To explain how general binary codes are used, let us start with two-valued logic. In a Boolean case, let the output \(\widetilde{\boldsymbol{y}}\) be mapped into the codeword \(\widetilde{\boldsymbol{c}}~{}=~{}(\widetilde{c}_{0},\ldots,\widetilde{c}_{n-1 })\in\{0,1\}^{n}\), and each class \(N\) be associated with a given codeword \(\boldsymbol{c}^{\boldsymbol{N}}=\big{(}\widetilde{c}_{0}^{N},\ldots,\widetilde {c}_{n-1}^{N}\big{)}\), \(N\in\{0,1,\ldots,n-1\}\). The training pattern will be classified in the class \(N\), if \(\widetilde{\boldsymbol{c}}~{}=~{}\boldsymbol{c}^{\boldsymbol{N}}\), i.e., \(\Lambda_{i=~{}0}^{n-1}\big{(}\widetilde{c}_{i}~{}=~{}c_{i}^{N}\big{)}\). In the Boolean logic, the codeword is equal to the class \(N\) codeword, if the truth-values of equality in all codeword's bits are equal to \(\Lambda\)one, i.e.,  
\[S^{N}~{}=~{}\Lambda_{i~{}=~{}0}^{n-1}\Big{(}\widetilde{c}_{i}~{}=~{}c_{i}^{N} \Big{)}\Rightarrow t\Big{(}S^{N}\Big{)}~{}=~{}\prod_{i~{}=~{}0}^{n-1}t\Big{(} \widetilde{c}_{i}~{}=~{}c_{i}^{N}\Big{)}~{}=~{}1,N\in\{0,1,\ldots,2^{n}-1\} \tag{7}\]where \(S^{N}\ =\ \big{(}\tilde{\epsilon}\ =\ \mathbf{c}^{N}\big{)},\tilde{\epsilon},\mathbf{c}^{N} \in\{0,1\}^{n},t(true)\ =\ 1,\ t(false)\ =\ 0\). To keep this holistic approach to the codeword decision, we replace the Boolean logic with Zadeh (standard) fuzzy logic and \(t\in[0,1]\) as a truth-value. The true values of the Zadeh fuzzy logic conjunction, disjunction, and negation of the A, B statements are  
\[ \begin{array}{l}t(A\Lambda B)\ =\ \min(t(A),t(B)),\\ t(A\lor B)\ =\ \max(t(A),t(B)),\\ t\big{(}\overline{A}\ =\ 1-t(A).\end{array}  \tag{8}\]  
The \(i\)-th output value \(\widetilde{y}_{i}\in[0,1]\) can be interpreted as a truth-value. To identify whether the bit is correct independent of its bit value, we introduce the degree of compliance as a truth-value [33] of the statement \(\widetilde{y}_{i}\ =\ a,\ a\in\{0,1\}\). To avoid indeterminate cases (if \(\widetilde{y}_{i}\ =\ 1/2\)), we add or subtract a negligible number \(\varepsilon>0\) to the truth-value, and therefore, \(t(\widetilde{y}_{i}\ =\ a)\
eq 1/2\)  
\[t(\widetilde{y}_{i}\ =\ a)\ =\ \left\{ \begin{array}{ll}\widetilde{y}_{i},&a\ =\ 1, \widetilde{y}_{i}\in[0,\
icefrac{{1}}{{2}})\Lambda(\
icefrac{{1}}{{2}},1]\\ 1-\widetilde{y}_{i},&a\ =\ 0,\widetilde{y}_{i}\in[0,\
icefrac{{1}}{{2}}) \Lambda(\
icefrac{{1}}{{2}},1]\\ \
icefrac{{1}}{{2}}+\varepsilon,&a\ =\ 1,\widetilde{y}_{i}\ =\
icefrac{{1}}{{2}},\ 0< \varepsilon\ \ll 1\\ \
icefrac{{1}}{{2}}-\varepsilon,&a\ =\ 0,\widetilde{y}_{i}\ =\ \
icefrac{{1}}{{2}},\ 0< \varepsilon\ \ll 1\end{array} \right.. \tag{9}\]  
We exclude this value in the implementation because the probability of \(\widetilde{y}_{i}\ =\ \
icefrac{{1}}{{2}}\) on the unit interval is equal to zero. Then,  
\[t\Big{(}S^{N}\Big{)}\ =\ t\Big{(}\widetilde{\epsilon}\ =\ \mathbf{c}^{N}\Big{)}\ =\ \min_{i\ =\ 0, \ldots,n-1}t\Big{(}\widetilde{c}_{i}\ =\ c_{i}^{N}\Big{)},\ N\in\{0,1,\ldots,2^{n}-1\}. \tag{10}\]  
The notation (10) is valid also for Boolean logic because  
\[\min_{i\ =\ 0,\ldots,n-1}t\Big{(}\widetilde{c}_{i}\ =\ c_{i}^{N}\Big{)}\ =\ \prod_{i\ =\ 0}^{n-1}t\Big{(}\widetilde{c}_{i}\ =\ c_{i}^{N}\Big{)},\ \text{for}\ t\Big{(} \widetilde{c}_{i}\ =\ c_{i}^{N}\Big{)}\in\{0,1\}.\]  
Therefore, in Figure 1, the minimum function is used instead of multiplication, even in the Boolean case. The demand for processing analog channel outputs by digital coding is not new [34]. Our approach is based on fuzzy linear coding [35; 36]. In general, a fuzzy codeword is a  
Figure 1: Proposed classification scheme based on the Zadeh fuzzy logic. subset of the codespace with assigned membership functions.