The energy-variance-based optimization procedures have proven to be useful tools to describe N-electron spectra. However, the resulting wave functions usually present spin-contaminant contributions. The goal of this work is to reduce the spin contamination of the results arising from the unrestricted doubly occupied configuration interaction method in its energy variance minimization version [Alcoba et al., J. Chem. Phys. 160, 164107 (2024)]. We propose to incorporate the half-projection technique, which allows removing the spin components with even or odd spin quantum number of an approximate N-electron wave function, into the framework of the unrestricted doubly occupied configuration interaction treatment. This implementation can be carried out following several possible ways, whose results are analyzed in detail, in order to show the behavior of each procedure. Numerical determinations performed on selected strongly correlated N-electron systems, in ground and excited states, allow us to assess the most suitable procedure.