This paper by P. C. Fishburn and N. J. A. Sloane seems quite related:
Fishburn, Peter C., and N. J. A. Sloane. "The Solutionsolution to Berlekamp’s Switching GameBerlekamp's switching game." Discrete Mathematics 74.3 (1989): 263-290. (PDF download)
Abstract. Berlekamp’s game consists of a $10 \times 10$ array of light-bulbs, with $100$ switches at the back, one for each bulb, and $20$ switches at the front that can complement any row or column of bulbs. For any initial set $S$ of bulbs turned on using the back switches, let $f(S)$ be the minimal number of lights that can be achieved by throwing any combination of row and column switches. The problem is to find the maximum of $f(S)$ over all choices of $S$. We show that the answer is $34$. We also determine the solution for $n \times n$ arrays with $1 \le n \le 9$.
Berlekamps http://cs.smith.edu/~orourke/MathOverflow/Berlekamps_Switch_game.jpg
(Image from [this link][2].)