The encoding of classical data in a physical support can be done up to some level of accuracy due to errors and the imperfection of the writing process. Moreover, some degradation of the stored data can happen over time because of physical or chemical instability of the system. Any readout strategy should take into account this natural degree of uncertainty and minimize its effect. An example are optical digital memories, where the information is encoded in two values of reflectance of a collection of cells. Quantum reading using entanglement, has been shown to enhances the readout of an ideal optical memory, where the two level are perfectly characterized. In this work, we analyse the case of imperfect construction of the memory and propose an optimized quantum sensing protocol to maximize the readout accuracy in presence of imprecise writing. The proposed strategy is feasible with current technology and is relatively robust to detection and optical losses. Beside optical memories, this work have implications for identification of pattern in biological system, in spectrophotometry, and whenever the information can be extracted from a transmission/reflection optical measurement.