An image forming apparatus includes scanning targets, an optical scanning section, a cassette, a cassette insertion section, and a cassette guide. Receiving portion for positioning the brush holder unit is formed in the accommodating portion. A two-tiered analysis scheme is used, where the first tier is more sensitive and less specific than the second tier.