Abstract We train a model atom to recognize hand-written digits in the range 0-9, employing intense light--matter interaction as a computational resource. For training, the images of the digits are converted into shaped laser pulses (data input pulses). Simultaneously with an input pulse, another shaped pulse (program pulse), polarized in the orthogonal direction, is applied to the atom and the system evolves quantum mechanically according to the time-dependent Schr"odinger equation. The purpose of the optimal program pulse is to direct the system into specific atomic final states (classification states) that correspond to the input digits. 
A success rate of about 40\% is achieved when using a basic optimization scheme that might be limited by the computational resources for finding the optimal program pulse in a high-dimensional search space. Our key result is the capability of the laser-programmed atom to generalize, i.e.,~the classification of unseen images is improved by training. This atom-sized machine-learning image-recognition scheme operates on time scales down to tens of femtoseconds, is scalable towards larger (e.g. molecular) systems, and is readily reprogrammable towards other learning/classification tasks.