# Detection and Monitoring of Fitting Progression on Gear Tooth Flank Using Deep Learning
## 3 Data Collection  
In this paper, a spur gear (Figure 2) is used with the following characteristics: normal module m = 4, number of teeth z = 15, pressure angle at normal section \(\alpha\) = 20\({}^{\circ}\), reference diameter d = 60 mm, tip diameter d\({}_{\rm a}\) = 68 mm, root diameter d\({}_{\rm f}\) = 50 mm, profile shift coefficient x = 0, and width b = 40 mm. For the experiment, one ring was printed with the outer shape of the gear that was positioned next to the gearing so that the whole gear width was increased to 50 mm. On this gear ring, every tooth had its own number. For the creation of the dataset, four identical gears were used, and pitting damage was seeded on them. The smallest defect that was seeded on the gear teeth had the size of 4 mm and the biggest was approximately 12 mm. Figure 1: Architecture of the faster R-CNN deep learning network for defect detection. Figure 2: Output image of the gear with smaller pitting damage. The spatial resolution of the camera that was used in photographing gear teeth was 2048 \(\times\) 1536 pixels. Bounding boxes around the teeth and pitting damage were generated with a Hasty annotator [28]. A total of 823 images were used for the whole training and testing process. Out of these images, 349 were images with defects, while all the images had two or sometimes three recognized teeth--the size and the angle from which these teeth were photographed was relevant for further processing. For the recognition of teeth, a total of 1392 teeth were labeled. The dataset was created using a regular Nikon COOLPIX L320 camera from the distance of approx. half a meter in room lighting conditions without the use of a flash. Since the monitoring of gear pitting development is new, the authors chose to take images that had an almost perpendicular view to a single tooth, since then the images would show one tooth with potential damage. The intention was that the whole tooth with potential damage was in just one plane, which would simplify the process of labeling and detection with a bounding box, and finally lead to the possibility of calculating the size of pitting. The dataset was created by constant rotation of the gear and burst mode shooting. The Faster-RCNN model was built using Facebook's Detectron2 python library [26]. In training the network, 16 foreground classes were considered, from which 15 were for each gear tooth and the sixteenth was for pitting damage. We used a learning rate of 0.005 and trained the network for 12,000 iterations. The selection of crucial parameters of the neural network is very important for effective training in terms of convergence speed and avoidance of local minima. The selection of these parameters is a quite complex task given the differences in modeling problems and available datasets, and, moreover, there are no rules that would systematically \"fine\" adjust these parameters. Therefore, some time-consuming empirical experimental trials are often needed, in the form of the trial-and-error method [29], in order to determine the most adequate set of neural network weights and biases, values which would ultimately ensure model of the high generalization capability of the model. [PERSON] and [PERSON] [30] also stated that: \"The hyper-parameters for the training process affect results of the training, that is, the weight factors. Unfortunately, since a set of parameters for optimization depends on the network model and the dataset, it is generally chosen arbitrarily or based on prior experiences and is adjusted by trial and error\". In our case, there are two different class types for the neural network: (1) pitting as damage and (2) single tooth. In the training process of the neural network, was much easier to detect pitting damage than a single tooth. For pitting, satisfying results (prediction confidence higher than 95%) start to occur with 5000 iterations. The detection of a single tooth was harder, and the final parameters were connected to the recognition of teeth.