## 5 Experiments and Results
### Drone Path Planning for PFBs Inspection
#### 5.1.1 Object Detection via Haar-Cascade Object Detection  
To allow a greater level of detail in the inspection images, the fans were stripped of their protective metal cages to expose the PFBs. Training a new boosted cascade of weak classifiers to detect the updated look required sets of positive and negative images. For the best accuracy in the specific scope of work, all photos were taken with the drone in the experiment environment. The drone was programmed to fly autonomously and extract frames from the camera. Python multi-threading was utilized to make the drone perform a snake path flight pattern while extracting pictures in real time. The flight path shown in Figure 9 was performed multiple times with the turbines arranged in varied patterns. Each flight extracted hundreds of photos, many with fans and many without. The collected dataset was manually analyzed to find and eradicate unfit images due to blurriness or subpar quality. The remaining images were separated into positive and negative sets, where the negative set did not include any turbine PFBs, whole or partial. Then, leveraging OpenCV's annotation tool, each PFB was annotated. At first, objects were given a bounding box as long as most of the object was in frame with the box tightly encompassing the fans, as shown in Figure 10.  
Figure 9: Snake path flight pattern used for collecting images of fans in a 1000 \(\times\) 600 (cm) area to train a cascade classifier. In performing this, the goal was to achieve accurate bounding boxes for precise distance calculations. Once the annotation process was completed, training began, where the machine learning (ML) model tested itself with positive and negative samples and adjusted the chosen Haar features to minimize the loss. The best way to test the model is to perform real-time detection in experimental flights. The results of initial training with a low number of stages are illustrated in Figure 11, signaling that the model was under-fitted and unable to generalize the PFB features. After adding several stages of Haar features, the model became over-fitted, and no objects were detected where objects existed. Stages were eliminated until the object-detection model had good detection results, as shown in Figure 12a. In an investigation of the detection model's performance, the detection of partial PFBs was consistent with the annotation method utilized. Here, images were annotated even if significant portions of the PFBs were cut off from the frame's boundaries. Another issue present in the training of the detection model exists in the translucency of the PFBs, allowing them to have similar pixel densities as non-PFB backgrounds. In the experiments that followed, it was found that the partial detections and inconsistent sizes of the bounding box led to inaccuracies in the path-planning algorithms, mainly the distance computation  
Figure 11: Under-fitted object-detection model: The red boxes indicate model predictions showing the Haar-based cascade classifier is inadequate since many undesired objects are detected. Figure 10: Cursor-drawn annotations, shown with the green boxes, from OpenCV used for positive images in training a cascade classifier. leveraging the real-world size of the turbine and the size in pixels. The equation leveraged for distance calculations is defined as:  
\[d=l_{f}(w_{r}/w_{p}), \tag{11}\]  
where \(d\) is the approximate distance of the detected object to the drone's camera (cm), \(l_{f}\) is the calculated focal length of the camera for a 720 \(\times\) 420-resolution image, \(w_{r}\) is the real-world width of the object (cm), and \(w_{p}\) is the width of the object in a frame (pixels). To solve these issues, a new Haar-cascade model was trained, this time with a stricter standard for annotations. Here, only images where the entire PFB is present would be annotated, allowing for the generalization of the entirety of the PFB features over partials. Images that did not meet this requirement were removed from the dataset entirely.