As a new optical machine learning framework, the diffractive deep neural network (D 2 NN) has attracted much attention due to its advantages such as low power consumption, parallel computing, and fast execution speed. Here, we demonstrate a new optical neural network design of a differential D 2 NN with structured illumination. In this scheme, the illumination patterns participate in the training process of the network and are optimized by an end-to-end technique. With the application of differential detection, the non-negativity constraint in a diffractive neural network can be alleviated. The test results show that this network architecture can achieve 97.63 and 88.10% classification accuracies on the MNIST and Fashion-MNIST data sets using only one diffractive layer, which exceeds the effect achieved by the five-layer traditional D 2 NN. Moreover, this network architecture can achieve a comprehensive improvement over a traditional D 2 NN in the challenging classification problems of tiny samples and samples blocked by occlusions. Compared with the traditional D 2 NN, this scheme innovatively uses the illumination patterns as new degrees of freedom in system design, which can effectively improve classification ability and reduce the space complexity of the optical neural network.