This program implements an automatic and efficient measure for detecting thyroid nodules, which may reduce the workload of doctors in the future. This technique applies a Swin Transformer to a nodule detection network. Swin Transformers are effective in capturing long-range content information, which is very helpful in improving the sensitivity of nodule detention.
To begin, open a terminal on the machine and install Python 3.8 by typing sudo apt-get install python3.8 in the command line. To install PyTorch 1.7, go to the official website of Miniconda and install it. Then create a Conda environment by typing the command shown on the screen in the command line, and activate it by typing conda activate SwinFasterRCNN.
Install PyTorch by writing the shown command in the command line. For the MM detection installation, clone from the official GitHub repository, and then install MM Detection by writing the command pip install v e in the command line. Open the schedule_1x.
py file in the Vim text editor and edit the file to set the default training-related parameters, including the optimizer, learning rate, and epic. Begin the training by typing the command shown on the screen. Wait for the network to begin the training for 48 epics, and for the resulting trained weights of the SwinFasterRCNN network to be generated in the output folder.
Save the model weights with the highest accuracy on the validation set. After training, select the model with the best performance on the validation set for thyroid nodule detection in the new images. Run the test script to resize the image to 512 pixels by 512 pixels and normalize it.
Wait for the script to automatically load the pre-trained model parameters to the SwinFasterRCNN, and feed the pre-processed image into the SwinFasterRCNN for inference. Wait for the SwinFasterRCNN to output the prediction box for each image. Finally, allow the script to automatically perform NMS post-processing on each image to remove the duplicate detection boxes.
The detection results for the same image are shown in a given row. The columns are the detection results for SwinFasterRCNN, FasterRCNN, YOLOv3, SSD, RetinaNet, and DETR. The ground truths of the regions are marked with green rectangular boxes.
The detection results are framed by the red rectangular boxes. It is very important to select the appropriate hyper parameter to ensure those converges which needs to be determined by many experiments.