High-fidelity detection of large-scale atom arrays in an optical lattice