We developed an AI-based diagnostic model that did well in detecting lymph node metastases, particularly micrometastases. The LNMDM showed substantial potential for clinical applications in improving the accuracy and efficiency of pathologists’ work.