  We introduce an efficient and accurate readout measurement scheme for single
and multi-qubit states. Our method uses Bayesian inference to build an
assignment probability distribution for each qubit state based on a reference
characterization of the detector response functions. This allows us to account
for system imperfections and thermal noise within the assignment of the
computational basis. We benchmark our protocol on a quantum device with five
superconducting qubits, testing initial state preparation for single and
two-qubit states and an application of the Bernstein-Vazirani algorithm
executed on five qubits. Our method shows a substantial reduction of the
readout error and promises advantages for near-term and future quantum devices.
