Next-generation collider experiments will have to cope with extremely high collision rates, making it necessary to implement real-time event processing capabilities. Among the standard pattern recognition algorithms thought to be run on Look-Up Tables, Machine Learning methods, and in particular Deep Neural Networks, are spreading very fast and there is growing interest in executing such algorithms at trigger level to improve on-line selection performance. The main issue in running these algorithms in real-time is the amount of operation that needs to be computed. Low-latency hardware solutions exist, e.g. FPGAs, but the main constraint to the implementation is often related to the size of the model, that has to be finely tuned not to exceed the available memory. We present an approach to reduce in an optimized way the size of models based on Fully Connected Neural Networks, having under control the model performances. The number of features in input to the Deep Neural Network is reduced using a CancelOut layer, optimized through an original loss function. We compare the performances of this approach with other techniques. We use as baseline study the selection of proton-proton collision events in which the boosted Higgs boson decays to two $b$-quarks and both the decay products are contained in a large and massive jet. These events have to be selected against an overwhelming QCD background. Promising results are shown and the way for future developments is outlined.