The presence of microparticle viruses seriously affects the quality of silkworm seed for domestic sericulture, so it is important to exclude them from detection in silkworm seed production. The traditional methods for detecting microparticle viruses in silkworms are manual microscopic observation, molecular biology, immunological approach, etc., which are cumbersome steps and cannot achieve intelligent detection and batch real-time detection. The YOLOv8 algorithm is used in this paper to address this problem. Firstly, NAM attention is introduced in the original algorithm's Backbone part. Therefore, the model can extract more generic information about features. Secondly, ODConv is used to replace Conv in the Head part of the original algorithm to enhance the model's ability to identify microparticle viruses. Finally, NWD-LOSS is used to modify the CIOU loss of the original algorithm to obtain a more accurate prediction box. The experiments indicate that the NN-YOLOv8 model is more accurate in detecting silkworm microparticle disease than mainstream detection algorithms. For a single image, the average detection time is 22.6 milliseconds, it has better prospects for future applications.