4. In the Cartesian coordinate system, color the point set
$$
\{(m, n) \mid m, n \in \mathbf{N}, 1 \leqslant m, n \leqslant 6\}
$$

with red or blue. Then, the number of different coloring schemes where each unit square has exactly two red vertices is
4.126.

First, color the first row (points with a y-coordinate of 6), which has $2^{6}$ ways of coloring. We can divide these into two cases:
(1) No two adjacent points are the same color (i.e., red and blue alternate), which gives 2 ways of coloring. In this case, there are only 2 ways to color the second row. Similarly, each row has 2 ways of coloring, resulting in a total of $2^{6}$ ways.
(2) At least two adjacent points are the same color, which gives $\left(2^{6}-2\right)$ ways of coloring. In this case, when coloring the second row, it can be observed that the valid coloring is unique. Similarly, each row has a unique way of coloring. Therefore, there are $\left(2^{6}-2\right)$ ways of coloring.
Combining (1) and (2), the total number of valid coloring methods is
$$
2^{6}+\left(2^{6}-2\right)=2^{7}-2=126 \text { ways. }
$$