Model-Based Feature Selection for Neural Networks: A Mixed-Integer Programming Approach

Shudian Zhao, Calvin Tsay, Jan Kronqvist

Abstract

Deep Neural Networks (DNNs) often suffer from over-parameterization, leading to excessive computational demands and vulnerability to adversarial attacks. This paper presents a novel framework, Optimal Sparse Input Features (OSIF), which utilizes Mixed-Integer Linear Programming (MILP) to identify the most critical input features for pre-trained networks. By treating feature selection as an inverse optimization problem, the method identifies a sparse subset of inputs—reducing data size by up to 85%—while maintaining high classification accuracy and significantly enhancing model robustness. Experiments on MNIST and FashionMNIST demonstrate that this model-based approach effectively captures structural data properties, offering a path toward more efficient and secure "Green AI."

Introduction

Modern Deep Neural Networks are notoriously resource-intensive. While internal sparsification techniques like weight pruning and dropout have become standard for reducing model size, the challenge of selecting the most salient input features remains largely unaddressed. Traditional feature selection methods often analyze data in isolation, ignoring the specific logic of the trained model that will process it.

This research addresses this gap by asking: Can we use the trained model itself to identify the inputs it relies on most? By formulating feature selection as a mathematical optimization problem, the authors introduce a method to prune the input layer, creating leaner models that are not only faster to process but also more resilient to malicious adversarial perturbations.

The OSIF Framework: Feature Selection as an Inverse Problem

The core of the proposed approach is the Optimal Sparse Input Features (OSIF) method. Unlike standard forward-pass inference, OSIF treats feature selection as an "inverse problem."

MILP Encoding

The researchers translate the behavior of a ReLU-based neural network into a Mixed-Integer Linear Programming (MILP) model. This encoding allows the use of exact solvers, such as Gurobi, to find the mathematically optimal subset of features. The optimization objective is to find the smallest set of non-zero input pixels that maximizes the network's confidence for a specific target category.

Spatial Distribution Constraints

A significant challenge in model-based selection is the risk of the optimizer identifying a tiny, non-representative cluster of pixels that "tricks" the model through overfitting. To prevent this, the authors introduced spatial distribution constraints. By partitioning the input image into a $k \times k$ grid and requiring the selection to be distributed across these boxes, the algorithm is forced to identify generalizable, structural features rather than localized noise. This "spread" ensures that the selected features represent the global structure of the object (e.g., the silhouette of a shoe or the loops of a digit).

Experimental Evaluation

The OSIF method was evaluated using two benchmark computer vision datasets: MNIST (handwritten digits) and FashionMNIST (clothing items). Both datasets consist of $28 \times 28$ pixel images, representing 784 potential input features.

Accuracy and Data Reduction

The results demonstrate that the vast majority of input data is redundant for classification tasks. The OSIF method successfully reduced input features from 784 pixels to just 50–100 pixels (a reduction of approximately 87% to 94%).

  • MNIST: With only 100 pixels, the model achieved 93.4% accuracy, compared to the baseline of ~97% with the full 784-pixel input.
  • FashionMNIST: On the more complex clothing dataset, the model maintained 84% accuracy with 100 pixels, compared to an 87% baseline.

Adversarial Robustness

One of the most significant findings of this research is the relationship between sparsity and security. By drastically reducing the input space, the "search space" available to an adversarial attacker is similarly constrained. In tests on FashionMNIST using a $2 \times 40$ hidden layer network, reducing the input to 50 pixels increased the "minimal adversarial distance" (the amount of change required to fool the model) by 89.1%. This suggests that sparse input models are inherently more difficult to manipulate.

Discussion and Future Work

The OSIF framework demonstrates that model-based feature selection is a viable path for creating efficient and robust AI. Notably, the features identified by the MILP solver appear to be model-agnostic; salient features identified for one architecture often performed well when transferred to different classifiers, suggesting the method captures fundamental properties of the underlying data.

However, several avenues for future research remain:

  1. Scalability: While MILP solvers are highly effective for moderate-sized networks, they are computationally expensive. Scaling OSIF to massive architectures like ResNets or Transformers will require advanced decomposition techniques.
  2. Activation Functions: The current MILP formulation is optimized for ReLU activations. Extending this to smooth activations like Sigmoid or Tanh remains a theoretical challenge.
  3. Dynamic Masking: While the current study focuses on a static "global" mask for all samples, future iterations could explore instance-specific feature selection, where the network dynamically focuses on different features for every unique input.

Conclusion

By leveraging Mixed-Integer Programming, the OSIF method provides a rigorous mathematical framework for input sparsification. This approach not only reduces the computational footprint of neural networks but also provides a significant defensive advantage against adversarial attacks, marking a step forward in the development of sustainable and reliable machine learning systems.

Summary updated

BibTeX
@inproceedings{zhao2023model,
  author = {Shudian Zhao and Calvin Tsay and Jan Kronqvist},
  title = {{Model-Based Feature Selection for Neural Networks: A Mixed-Integer Programming Approach}},
  booktitle = {LION},
  year = {2023},
  doi = {10.1007/978-3-031-44505-7\_16},
}
Figure