Preoperative diagnosis of bile duct tumor thrombus (BDTT) is clinically important as the surgical prognosis of hepatocellular carcinoma (HCC) patients with BDTT is significantly different from that of patients without BDTT. The current diagnosis of BDTT is usually based on identifying dilated bile ducts (DBDs) on medical images (eg., CT and MRI images). However, it is easy for doctors to ignore DBDs when reporting imaging scan results, leading to a high misdiagnosis rate in practice. The aim of the present study was to develop an artificial intelligence (AI) pipeline for diagnosing HCC patients with BDTT using medical images. The proposed AI pipeline includes two stages. First, the object detection neural network Faster R-CNN is adopted to identify DBDs; then, an HCC patient is diagnosed to have BDTT if the proportion of images with at least one identified DBD exceeds some threshold value. The proposed AI pipeline was applied to a real dataset consisting of 2,611 CT images collected from 34 HCC patients (16 with BDTT and 18 without BDTT). The average true positive rate for identifying DBDs per patient was 0.92, while the patient-level true positive rate for diagnosing BDTT was 0.94. The area under ROC curve for patient-level diagnosis of BDTT was 0.92 (95% CI: 0.83, 1.00), compared with 0.71 (95% CI: 0.52, 0.89) by random forest based on preoperative clinical variables. These results demonstrated that the proposed AI pipeline is successful in the diagnosis of BDTT. The automatic detection of DBDs is a key step in early diagnosis of HCC patients with BDTT, and is helpful in the treatment and prognosis of these patients.