We study a bilevel optimization framework for hyperparameter tuning of variational models, with a focus on sparse regression and classification tasks. In particular, we consider a weighted elastic-net regularizer, where feature-wise regularization parameters are learned through a bilevel formulation. A key novelty of our approach is the use of the Forward-Backward Envelope (FBE) to smooth the nonsmooth lower-level problem while preserving its set of minimizers. This reformulation yields a bilevel objective composed with a locally Lipschitz solution map, allowing the application of generalized subdifferential calculus to derive basic subgradients and enable efficient subgradient-based optimization. Empirical results on synthetic datasets demonstrate that our approach significantly outperforms scalar regularization methods in terms of prediction accuracy and support recovery. These findings highlight the benefits of feature-wise regularization and the effectiveness of bilevel optimization as a principled framework for learning interpretable and high-performing models.