A customs declaration is a document containing detailed information about goods entering or leaving a country, which is lengthy, complex, and difficult to recognize with high manual costs. To address these problems, using an OCR recognition algorithm based on the SwinTransformer backbone network for customs declaration recognition tasks can achieve advantages such as easy dataization, storage, and high efficiency. Compared with traditional Tesseract-OCR engine-based recognition methods, the OCR recognition algorithm based on the SwinTransformer backbone network significantly improves the accuracy of customs declaration recognition, reduces manual costs, and also provides extended information for subsequent information processing.