The incidence of thyroid nodules is increasing year by year. Accurate determination of benign and malignant nodules is an important basis for formulating treatment plans. Ultrasonography is the most widely used methodology in the diagnosis of benign and malignant nodules, but diagnosis by doctors is highly subjective, and the rates of missed diagnosis and misdiagnosis are high. To improve the accuracy of clinical diagnosis, this paper proposes a new diagnostic model based on deep learning. The diagnostic model adopts the diagnostic strategy of localization-classification. First, the distribution laws of the nodule size and nodule aspect ratio are obtained through data statistics, a multiscale localization network structure is a priori designed, and the nodule aspect ratio is obtained from the positioning results. Then, uncropped ultrasound images and nodule area image are correspondingly input into a two-way classification network, and an improved attention mechanism is used to enhance the feature extraction performance. Finally, the deep features, the shallow features, and the nodule aspect ratio are fused, and a fully connected layer is used to complete the classification of benign and malignant nodules. The experimental dataset consists of 4021 ultrasound images, where each image has been labeled under the guidance of doctors, and the ratio of the training set, validation set, and test set sizes is close to 3:1:1. The experimental results show that the accuracy of the multiscale localization network reaches 93.74%, and that the accuracy, specificity, and sensitivity of the classification network reach 86.34%, 81.29%, and 90.48%, respectively. Compared with the champion model of the TNSCUI 2020 classification competition, the accuracy rate is 1.52 points higher. Therefore, the network model proposed in this paper can effectively diagnose benign and malignant thyroid nodules.