# Constrained Deep Networks: Lagrangian Optimization via Log-Barrier Extensions

arXiv: https://arxiv.org/abs/1904.04205 · HTML: https://mlsanity.com/paper/1904.04205/

## Key facts

- Cited by 30 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 8 Apr 2019.

## Built on by (most cited first, 30 of 30)

- [Neural Networks with Physics-Informed Architectures and Constraints for Dynamical Systems Modeling](https://mlsanity.com/paper/2109.06407/) (2021)
- [F-CAM: Full Resolution Class Activation Maps via Guided Parametric Upscaling](https://mlsanity.com/paper/2109.07069/) (2021)
- [Constrained unsupervised anomaly segmentation](https://mlsanity.com/paper/2203.01671/) (2022)
- [Constrained Reinforcement Learning with Smoothed Log Barrier Function](https://mlsanity.com/paper/2403.14508/) (2024)
- [Multi-Objective Preference Optimization: Improving Human Alignment of Generative Models](https://mlsanity.com/paper/2505.10892/) (2025)
- [TCAM: Temporal Class Activation Maps for Object Localization in Weakly-Labeled Unconstrained Videos](https://mlsanity.com/paper/2208.14542/) (2022)
- [Learning via Wasserstein-Based High Probability Generalisation Bounds](https://mlsanity.com/paper/2306.04375/) (2023)
- [Greedy-layer Pruning: Speeding up Transformer Models for Natural Language Processing](https://mlsanity.com/paper/2105.14839/) (2021)
- [Self-Bounding Majority Vote Learning Algorithms by the Direct Minimization of a Tight PAC-Bayesian C-Bound](https://mlsanity.com/paper/2104.13626/) (2021)
- [Negative Evidence Matters in Interpretable Histology Image Classification](https://mlsanity.com/paper/2201.02445/) (2022)
- [Learning to Optimize for Mixed-Integer Non-linear Programming with Feasibility Guarantees](https://mlsanity.com/paper/2410.11061/) (2024)
- [CoLo-CAM: Class Activation Mapping for Object Co-Localization in Weakly-Labeled Unconstrained Videos](https://mlsanity.com/paper/2303.09044/) (2023)
- [Neighbor-Aware Calibration of Segmentation Networks with Penalty-Based Constraints](https://mlsanity.com/paper/2401.14487/) (2024)
- [Guaranteed Conformance of Neurosymbolic Models to Natural Constraints](https://mlsanity.com/paper/2212.01346/) (2022)
- [Beyond pixel-wise supervision for segmentation: A few global shape descriptors might be surprisingly good!](https://mlsanity.com/paper/2105.00859/) (2021)
- [Looking at the whole picture: constrained unsupervised anomaly segmentation](https://mlsanity.com/paper/2109.00482/) (2021)
- [GM-TOuNN: Graded Multiscale Topology Optimization using Neural Networks](https://mlsanity.com/paper/2204.06682/) (2022)
- [Ordinal-Aware Calibration for Ordinal Classification](https://mlsanity.com/paper/2410.15658/) (2024)
- [L3Ms -- Lagrange Large Language Models](https://mlsanity.com/paper/2410.21533/) (2024)
- [Leveraging Transformers for Weakly Supervised Object Localization in Unconstrained Videos](https://mlsanity.com/paper/2407.06018/) (2024)
- [Prompt learning with bounding box constraints for medical image segmentation](https://mlsanity.com/paper/2507.02743/) (2025)
- [Proactive Constrained Policy Optimization with Preemptive Penalty](https://mlsanity.com/paper/2508.01883/) (2025)
- [SnareNet: Flexible Repair Layers for Neural Networks with Hard Constraints](https://mlsanity.com/paper/2602.09317/) (2026)
- [Integrating Material Selection with Design Optimization via Neural Networks](https://mlsanity.com/paper/2112.12566/) (2021)
- [Towards Positive Jacobian: Learn to Postprocess Diffeomorphic Image Registration with Matrix Exponential](https://mlsanity.com/paper/2202.00749/) (2022)
- [Constrained Reinforcement Learning for Safe Heat Pump Control](https://mlsanity.com/paper/2409.19716/) (2024)
- [Effect of Prior-based Losses on Segmentation Performance: A Benchmark](https://mlsanity.com/paper/2201.02428/) (2022)
- [Neuro-physical dynamic load modeling using differentiable parametric optimization](https://mlsanity.com/paper/2203.10582/) (2022)
- [Barrier-enforced multi-objective optimization for direct point and sharp interval forecasting](https://mlsanity.com/paper/2604.18492/) (2026)
- [Learning to Price Electricity for Optimal Demand Response](https://mlsanity.com/paper/2610.00755/) (2026)

## Abstract (arXiv)

This study investigates imposing hard inequality constraints on the outputs of convolutional neural networks (CNN) during training. Several recent works showed that the theoretical and practical advantages of Lagrangian optimization over simple penalties do not materialize in practice when dealing with modern CNNs involving millions of parameters. Therefore, constrained CNNs are typically handled with penalties. We propose *log-barrier extensions*, which approximate Lagrangian optimization of constrained-CNN problems with a sequence of unconstrained losses. Unlike standard interior-point and log-barrier methods, our formulation does not need an initial feasible solution. The proposed extension yields an upper bound on the duality gap -- generalizing the result of standard log-barriers -- and yielding sub-optimality certificates for feasible solutions. While sub-optimality is not guaranteed for non-convex problems, this result shows that log-barrier extensions are a principled way to approximate Lagrangian optimization for constrained CNNs via implicit dual variables. We report weakly supervised image segmentation experiments, with various constraints, showing that our formulation outperforms substantially the existing constrained-CNN methods, in terms of accuracy, constraint satisfaction and training stability, more so when dealing with a large number of constraints.
