Diagnostic imaging has become an integral part of the healthcare system. In recent years, scientists around the world have been working on artificial intelligence-based tools that help in achieving better and faster diagnoses. Their accuracy is crucial for successful treatment, especially for imaging diagnostics. This study used a deep convolutional neural network to detect four categories of objects on digital chest X-ray images. The data were obtained from the publicly available National Institutes of Health (NIH) Chest X-ray (CXR) Dataset. In total, 112,120 CXRs from 30,805 patients were manually checked for foreign objects: vascular port, shoulder endoprosthesis, necklace, and implantable cardioverter-defibrillator (ICD). Then, they were annotated with the use of a computer program, and the necessary image preprocessing was performed, such as resizing, normalization, and cropping. The object detection model was trained using the You Only Look Once v8 architecture and the Ultralytics framework. The results showed not only that the obtained average precision of foreign object detection on the CXR was 0.815 but also that the model can be useful in detecting foreign objects on the CXR images. Models of this type may be used as a tool for specialists, in particular, with the growing popularity of radiology comes an increasing workload. We are optimistic that it could accelerate and facilitate the work to provide a faster diagnosis.