From bacteria following simple chemical gradients to the brain distinguishing complex odour information, the ability to recognize molecular patterns is essential for biological organisms. This type of information-processing function has been implemented using DNA-based neural networks, but has been limited to the recognition of a set of no more than four patterns, each composed of four distinct DNA molecules. Winner-take-all computation has been suggested as a potential strategy for enhancing the capability of DNA-based neural networks. Compared to the linear-threshold circuits and Hopfield networks used previously, winner-take-all circuits are computationally more powerful, allow simpler molecular implementation and are not constrained by the number of patterns and their complexity, so both a large number of simple patterns and a small number of complex patterns can be recognized. Here we report a systematic implementation of winner-take-all neural networks based on DNA-strand-displacement reactions. We use a previously developed seesaw DNA gate motif, extended to include a simple and robust component that facilitates the cooperative hybridization that is involved in the process of selecting a 'winner'. We show that with this extended seesaw motif DNA-based neural networks can classify patterns into up to nine categories. Each of these patterns consists of 20 distinct DNA molecules chosen from the set of 100 that represents the 100 bits in 10 × 10 patterns, with the 20 DNA molecules selected tracing one of the handwritten digits '1' to '9'. The network successfully classified test patterns with up to 30 of the 100 bits flipped relative to the digit patterns 'remembered' during training, suggesting that molecular circuits can robustly accomplish the sophisticated task of classifying highly complex and noisy information on the basis of similarity to a memory.