# Vision Transformer in Industrial Visual Inspection
## 1 Introduction  
Industrial visual inspection (VI) in production and maintenance is under constant pressure from increasing quality requirements due to rising product demands, changing material, and cost specifications. In addition, there are changing external factors, such as new and constantly changing legal requirements, standards, and norms. Further, the risk of reputational damage from substandard products is steadily increasing due to the growing information availability and distribution through digital channels, such as social media, video sharing platforms, and review websites. Visual quality assurance is still predominantly performed or supported by human inspectors, which has several drawbacks, that have been studied by [PERSON] et al. [1] and [PERSON] et al. [2]. These include, but are not limited to, high labor cost, low efficiency, and low real-time performance on fast moving inspection objects or large surface areas. According to [PERSON] and [PERSON] [3], minimal error rates of 0.1% are reachable for very simple accept/reject tasks, which do account for negative influences of typical human inconsistency features, such as temporal fatigue. Though highly dependent on the inspection task, the findings of [PERSON] and [PERSON] [4] state that in more complex tasks error rates of 20% to 30% are observable. This can be seen as a rough general estimate for human error rates in visual inspection. In order to improve efficiency and performance, as well as reduce cost, several contributions from the domain of computer vision (CV) have been proposed to automate VI. Recently, deep learning-based models, such as convolutional neural networks (CNN) [5] superseded traditional feature-based methods. In 2017, transformers, the newest type of model in deep learning, started breaking performance records in the field of naturallanguage processing (NLP) [6; 7; 8; 9], but also made its way into CV and claimed benchmarks there in the last two years [10; 11; 12]. Recently, there have already been first applications of vision transformers in VI [13; 14]. While both publications demonstrate the capability of vision transformers in VI, they only cover one specific task, respectively. The work of [PERSON] et al. [13] features a relatively simple task with small training datasets and low intra-class variation, whereas [PERSON] et al. [14] address a more complex task, regarding number of classes, as well as detection targets per image, with a dataset of approximately twice the size. As we will discuss later, it is not possible to make a general statement about the capability of vision transformer for maintenance VI applications from their results. To address this we selected a scenario that is a good representation of the area of maintenance VI, as it covers a wide variety of inspection use cases, to investigate the applicability of vision transformers. Our scenario comes from the context of rail freight transport, specifically, we investigate the inspection of returning freight cars after train decomposition at railroad yards to ensure operational, as well as traffic, safety. Out of the wide variety of possible use cases, we consider three learning tasks, characterized by different challenges such as high intra-class variation, large number of classes, or detection targets per image and small target objects. The first use case is damage detection in wagon sheet metal flooring with one distinct damage class that is very small in size and has similar features, as well as complexity to the one addressed by [PERSON] et al. [13]. The second use case covers damage detection in wooden load spaces with three damage classes containing strong intra-class variation, due to different wood textures, as well as deterioration states. This one shows parallels to the work of [PERSON] et al. [14] regarding its properties and complexity. The third use case, the localization and recognition of wagon caption characters as a foundation for matching wagons with an internal database, is characterized by a high number of classes and targets per image.