A Feature Selection Layer Approach for Multi-Class Classification on Neural Networks
Organizations: Institute of Informatics, Federal University of Rio Grande do Sul, Porto Alegre, RS, Brazil · Center for Biotechnology, Federal University of Rio Grande do Sul, Porto Alegre, RS, Brazil · National Institute of Science and Technology - Forensic Science, Porto Alegre, RS, Brazil
Abstract
In the age of data-driven decision-making, deep learning models have become powerful tools for uncovering patterns and making predictions that influence many aspects of society. However, their broader adoption in scientific and business applications is often limited by a lack of interpretability. Feature weighting methods, which assess the relevance of individual features, are among the most widely studied approaches for improving interpretability. While post hoc techniques have advanced significantly, especially in modeling nuanced relationships between features and labels in multiclass problems, embedded methods typically fall short in this regard. Embedded techniques integrate feature relevance learning directly into the model training process, but they are often unable to capture label-specific relationships. To address the limitation, we propose multiple extensions to the Feature Selection Layer, an embedded feature weighting mechanism for neural networks. Through extensive experimentation, we identify the most effective extension and benchmark it against established feature weighting methods. Our results show that the proposed method matches existing techniques in identifying globally relevant features and outperforms them in capturing label-specific relevance. By leveraging the internal dynamics of the trained neural network, it reveals how individual features contribute to the prediction of specific labels, requiring no post-processing beyond the training process.
Figures & tables
| XOR | SynthA | Isolet | Breast | |
| 0.526 0.160 | 0.704 0.019 | 0.943 0.007 | 0.961 0.022 | |
| 0.588 0.194 | 0.732 0.053 | 0.947 0.004 | 0.981 0.026 | |
| 0.741 0.268 | 0.894 0.010 | 0.946 0.004 | 0.961 0.022 | |
| 1.000 0.000 | 0.918 0.008 | 0.940 0.005 | 0.942 0.021 | |
| 1.000 0.000 | 0.926 0.007 | 0.907 0.007 | 0.902 0.070 | |
| 1.000 0.000 | 0.746 0.032 | 0.800 0.017 | 0.971 0.026 |
| Dataset | Activation | Test F1 | Test Loss | 2D Silhouette |
| XOR | ReLU | 1.0000 0.0000 | 0.0004 0.0007 | 0.1931 0.0195 |
| Sigmoid | 0.4235 0.0746 | 0.7011 0.0083 | 0.0028 0.0024 | |
| Tanh | 0.9980 0.0045 | 0.0029 0.0061 | 0.1974 0.0177 | |
| SynthA | ReLU | 0.9168 0.0111 | 0.4945 0.0733 | 0.1656 0.0240 |
| Sigmoid | 0.7090 0.0119 | 0.7701 0.0168 | 0.1472 0.0178 | |
| Tanh | 0.9187 0.0097 | 0.5199 0.0428 | 0.1971 0.0693 |
| Features | Init. Weight | Test F1 | Test Loss | 2D Silhouette |
| 50 | 1.000 0.000 | 0.000 0.000 | 0.648 0.021 | |
| 0.667 0.456 | 0.440 0.602 | 0.682 0.027 | ||
| 500 | 1.000 0.000 | 0.000 0.000 | 0.725 0.008 | |
| 0.833 0.373 | 0.220 0.493 | 0.726 0.007 | ||
| 5000 | 0.998 0.001 | 0.003 0.002 | 0.600 0.038 | |
| 0.997 0.002 | 0.016 0.013 | 0.601 0.072 |
| Name | Feature Type | Labels | Features | Relevant | Per label | Samples |
| XOR | Binary | 2 | 50 | 2 | 2 | 500 |
| SynthA | Numerical | 3 | 100 | 30 | 30 | 3000 |
| SynthB | Numerical | 3 | 300 | 30 | 10 | 3000 |
| SynthC | Numerical | 3 | 300 | 30 | 15 | 3000 |
| Dataset | Features | Labels | Identifier | Samples |
| Liver 22405 | 22284 | normal | 0 | 24 |
| heptocarcinoma | 1 | 24 | ||
| Colorectal 41657 | 33468 | normal | 0 | 12 |
| high_grade_dysplasia | 1 | 28 | ||
| low_grade_dysplasia | 2 | 21 | ||
| adenocarcinoma | 3 | 25 |
| Algorithm | Stability metric | Features | Score |
| FSL | Pearson | 50 | .990 |
| Spearman | 50 | .098 | |
| Jaccard | 2 | 1 | |
| Listener | Pearson | 50 | .987 |
| Spearman | 50 | .150 | |
| Jaccard | 2 | 1 |
| Features | Labels | FSL | Listener | Output Aware | Residual | Multiple FSL |
| 50 | 2 | 15.90 1.50 | 21.32 1.09 | 19.95 1.43 | 16.54 1.29 | 16.44 1.47 |
| 5 | 14.60 0.42 | 19.37 0.80 | 17.60 0.51 | 15.88 0.38 | 15.64 0.44 | |
| 10 | 17.03 1.57 | 27.15 1.73 | 24.62 1.95 | 18.25 1.79 | 17.95 1.76 | |
| 20 | 15.30 1.20 | 26.43 2.71 | 24.37 2.84 | 17.08 1.60 | 16.62 1.44 | |
| 500 | 2 | 17.83 1.44 | 39.24 2.33 | 35.86 2.13 | 18.73 1.29 | 18.38 1.15 |
| 5 | 15.17 2.08 | 33.12 3.42 | 29.87 3.78 | 14.94 2.04 | 14.66 2.42 |
| Features | Labels | FSL | Listener | Output Aware | Residual | Multiple FSL |
| 50 | 2 | 18.1 | 18.1 | 18.1 | 18.1 | 18.4 |
| 5 | 18.1 | 18.2 | 18.2 | 18.1 | 19.0 | |
| 10 | 18.1 | 18.2 | 18.2 | 18.2 | 20.2 | |
| 20 | 18.1 | 18.2 | 18.2 | 18.2 | 22.4 | |
| 500 | 2 | 24.8 | 25.7 | 25.7 | 24.8 | 26.1 |
| 5 | 24.8 | 25.9 | 25.9 | 24.9 | 29.9 |
| Algorithm | Label | SynthA | SynthB | SynthC |
| FSL | 0 | .887 .015 | .934 .013 | .878 .012 |
| 1 | .885 .013 | .942 .011 | .863 .016 | |
| 2 | .888 .014 | .924 .013 | .865 .012 | |
| Listener | 0 | .888 .007 | .945 .011 | .890 .016 |
| 1 | .883 .009 | .946 .021 | .867 .018 | |
| 2 | .889 .009 | .934 .013 | .880 .016 |
| Algorithm | Pearson | Spearman | Jaccard |
| Decision Tree | 0.833 .044 | 0.607 .097 | 0.633 .079 |
| Random Forest | 0.987 .002 | 0.688 .042 | 0.935 .000 |
| Kruskal Wallis | 0.999 .000 | 0.999 .000 | 1.000 .000 |
| ReliefF | 0.997 .001 | 0.977 .007 | 0.748 .061 |
| Lasso | 0.992 .002 | 0.964 .012 | 0.925 .047 |
| LIME | 0.755 .043 | 0.475 .101 | 0.489 .067 |
| Weight source | HD silhouette | 2D silhouette |
| None | .038 | .049 |
| Decision Tree | .409 .073 | .498 .056 |
| Random Forest | .220 .019 | .517 .047 |
| Kruskal Wallis | .148 .013 | .305 .061 |
| ReliefF | .054 .003 | .066 .016 |
| Lasso | .382 .038 | .661 .033 |
| Model | XOR | SynthB | Breast | Isolet | Letter Recognition |
| Base Neural Network | 4.59 0.60 | 39.40 4.22 | 14.83 0.31 | 13.88 0.53 | 98.19 1.65 |
| Decision Tree | 0.00 0.00 | 0.76 0.21 | 1.24 0.11 | 2.13 0.05 | 0.04 0.00 |
| Random Forest | 0.06 0.00 | 1.94 0.07 | 0.66 0.01 | 5.73 0.05 | 0.85 0.01 |
| Kruskal Wallis | 0.02 0.00 | 0.16 0.03 | 18.09 0.56 | 0.83 0.00 | 0.02 0.00 |
| ReliefF | 0.02 0.01 | 0.23 0.04 | 0.47 0.01 | 1.84 0.02 | 4.06 0.06 |
| Lasso | 0.00 0.00 | 0.06 0.01 | 7.00 0.74 | 2.57 0.51 | 0.15 0.27 |
| Model | XOR | SynthB | Breast | Isolet | Letter Recognition |
| Base Neural Network | 19.8 | 23.3 | 83.1 | 35.8 | 23.7 |
| DeepSHAP | 21.7 | 39.7 | 97.0 | 35.8 | 34.3 |
| LassoNet | 20.2 | 29.3 | 102.6 | 47.9 | 62.1 |
| TabNet | 17.7 | 21.1 | 12063.8 | 26.2 | 28.7 |
| FSL | 19.8 | 24.0 | 83.7 | 38.2 | 23.8 |
| Multiple FSL | 21.0 | 27.1 | 127.7 | 114.3 | 144.8 |
| Label | Baseline | DeepSHAP | TabNet | Multiple FSL |
| A | -0.182 0.000 | -0.173 0.027 | -0.128 0.039 | -0.181 0.031 |
| B | -0.103 0.000 | -0.039 0.069 | -0.002 0.025 | -0.041 0.063 |
| C | 0.144 0.000 | 0.135 0.052 | 0.146 0.100 | 0.179 0.034 |
| D | -0.052 0.000 | -0.041 0.038 | -0.017 0.033 | 0.003 0.093 |
| E | -0.048 0.000 | -0.034 0.043 | 0.038 0.036 | -0.131 0.050 |
| F | 0.020 0.000 | 0.097 0.038 | 0.116 0.054 | 0.104 0.050 |
| Dataset | Baseline | LassoNet | TabNet | FSL | Multiple FSL |
| XOR | 0.078 0.051 | 0.003 0.001 | 0.067 0.028 | 0.003 0.007 | 0.003 0.006 |
| SynthA | 0.086 0.027 | 0.044 0.017 | 0.101 0.025 | 0.073 0.010 | 0.062 0.010 |
| SynthB | 0.090 0.038 | 0.087 0.067 | 0.067 0.018 | 0.037 0.011 | 0.029 0.005 |
| SynthC | 0.076 0.032 | 0.041 0.013 | 0.054 0.020 | 0.086 0.007 | 0.066 0.016 |
| Liver | 0.094 0.142 | 0.050 0.074 | 0.111 0.074 | 0.033 0.080 | 0.023 0.053 |
| Colorectal | 0.172 0.080 | 0.190 0.046 | 0.109 0.091 | 0.129 0.064 | 0.136 0.079 |
| Weight source | HD silhouette | 2D silhouette |
| None | .024 | .090 |
| Lasso | .024 .000 | .060 .032 |
| LIME | .024 .000 | .036 .030 |
| DeepSHAP | .048 .008 | .141 .042 |
| Multiple FSL | .143 .025 | .446 .027 |
| Algorithm | General | Label 0 | Label 1 | Label 2 |
| LassoNet | 0.948 .031 | 0.936 .067 | 1.0 .000 | 0.882 .098 |
| TabNet | 0.530 .071 | 0.518 .147 | 0.591 .130 | 0.509 .138 |
| SAGE | 0.951 .035 | - | - | - |
| Multiple FSL | 0.921 .040 | 0.982 .040 | 1.0 .000 | 1.0 .000 |
Appendix figures & tables20 assets
Supplementary material from the paper’s appendix.
Appendix
| Weight source | HD silhouette | 2D silhouette |
| None | .0030 | -.013 |
| FSL | .0105 .0005 | .1755 .0560 |
| Listener | .0109 .0003 | .1291 .0433 |
| Residual | .0109 .0004 | .1755 .0560 |
| Output Aware | .0128 .0005 | .1696 .0693 |
| Multiple FSL | .0123 .0004 | .1773 .0922 |
| Algorithm | Label 0 | Label 1 | Label 2 |
| Listener | .834 | .727 | .886 |
| Residual | .398 | .400 | .862 |
| Output Aware | .463 | .513 | .599 |
| Multiple FSL | .341 | .626 | .811 |
| Algorithm | Label | Precision | Recall | F1 score |
| FSL | 0 | .990 .032 | .977 .048 | .983 .029 |
| 1 | .951 .084 | .985 .048 | .965 .049 | |
| 2 | 1.0 .0 | 1.0 .0 | 1.0 .0 | |
| 3 | 1.0 .0 | 1.0 .0 | 1.0 .0 | |
| 4 | .974 .055 | 1.0 .0 | .986 .030 | |
| 5 | 1.0 .0 | .939 .080 | .967 .044 |
| Algorithm | Pearson | Spearman | Jaccard |
| Decision Tree | 0.728 .087 | 0.330 .040 | 0.536 .044 |
| Random Forest | 0.989 .003 | 0.342 .039 | 0.947 .026 |
| Kruskal Wallis | 0.999 .000 | 1.000 .000 | 1.000 .000 |
| ReliefF | 0.987 .001 | 0.924 .008 | 0.976 .033 |
| Lasso | 0.989 .001 | 0.840 .035 | 0.753 .061 |
| LIME | 0.874 .026 | 0.162 .052 | 0.388 .050 |
| Weight source | HD silhouette | 2D silhouette |
| None | .024 | .090 |
| Lasso | .187 .011 | .487 .047 |
| LIME | .072 .001 | .207 .026 |
| DeepSHAP | .096 .005 | .298 .030 |
| Multiple FSL | .159 .015 | .561 .021 |
| Label | Baseline | Multiple FSL | TabNet | LassoNet | Lasso |
| A | 0.989 0.005 | 0.993 0.003 | 0.941 0.019 | 0.988 0.005 | 0.603 0.004 |
| B | 0.945 0.006 | 0.940 0.012 | 0.859 0.025 | 0.928 0.009 | 0.546 0.011 |
| C | 0.970 0.010 | 0.976 0.005 | 0.908 0.019 | 0.946 0.010 | 0.492 0.003 |
| D | 0.959 0.011 | 0.957 0.010 | 0.855 0.027 | 0.935 0.005 | 0.555 0.007 |
| E | 0.953 0.015 | 0.950 0.009 | 0.885 0.022 | 0.951 0.006 | 0.085 0.023 |
| F | 0.956 0.008 | 0.952 0.010 | 0.858 0.024 | 0.920 0.019 | 0.475 0.015 |
| Label | Baseline | Multiple FSL | TabNet | LassoNet | Lasso |
| A | 0.953 0.017 | 0.964 0.017 | 0.974 0.017 | 0.972 0.012 | 0.752 0.014 |
| B | 0.764 0.046 | 0.869 0.027 | 0.899 0.030 | 0.865 0.022 | 0.791 0.017 |
| C | 0.982 0.010 | 0.996 0.006 | 0.982 0.014 | 0.975 0.008 | 0.882 0.009 |
| D | 0.836 0.056 | 0.905 0.025 | 0.908 0.023 | 0.899 0.018 | 0.767 0.012 |
| E | 0.871 0.048 | 0.893 0.033 | 0.918 0.022 | 0.913 0.020 | 0.862 0.014 |
| F | 0.900 0.037 | 0.916 0.021 | 0.957 0.035 | 0.969 0.016 | 0.720 0.020 |
Feature Selection
Feature selection identifies compact, informative variables or input dimensions to improve prediction, efficiency, interpretability, and statistical inference.
See all 194 papers