## 1 Introduction  
Defects, such as porosity, frequently occur in metal additively manufactured (AM) prints, adding additional costs to reprint or improve the parts. Such defects are typically only identified after the part is completed, leading to scrapped material and wasted production time at best or product failure in service if not detected. Identifying defect formation early in AM printing processes and taking preventative measures to stop them could be hugely beneficial in reducing costs and increasing quality in AM. This study focuses on a specific application in this area, applying machine learning (ML) to process data to identify regions of porosity in parts produced by laser powder bed fusion (L-PBF) metal AM parts. Porosity is one of the most prevalent and damaging defects for AM processes, with pores acting as initiation sites for crack formation and growth and contributing to drastically reduced fatigue life, among other issues [1, 2, 3]. There has therefore been significant research aimed at measuring and classifying porosity and other defects in AM parts and determining the raw materials properties and process parameters relating to porosity formation. Various approaches using machine learning with data from in-process sensors, cameras, process settings, or post-process analysis have been investigated for their potential to detect or predict problematic porosity [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]. Much of the focus has been on camera-based systems [16] and some studies have combined several different sensors; for example, [PERSON] et al. [17]combined signals from several different sensor types in one neural network and achieved an overall prediction accuracy of 98%, albeit from only a single part. Relatively few studies have focused on photodiode signals [18; 19; 20; 21], like the present study. Photodiodes have some advantages in that they are relatively cheap and their data are relatively easy to process compared to cameras, for example. They are also included in some commercial printers, such as the Renishaw RenAM 500M (Wotton-under-Edge, UK) used here. Distinct classes of pores have been identified based on their morphology and process of formation. Three important classes are lack of fusion (LOF), keyhole (KH), and gas porosity; each has different characteristics that allow them to be identified and result predominately from different material or process-related factors [22; 23; 24; 25; 26; 27; 28; 29; 30]. Example 3D renderings of KH and LOF pores from [31] are shown in Figure 1. [PERSON] and [PERSON] compared the characteristics of KH and LOF pores by looking at pore formation in cuboid parts printed with various energy densities. KH pores were found to have a near-spherical shape, while LOF pores were found to be elongated and to vary in size more [26; 31]. [PERSON] et al. concluded that LOF porosity is caused by a lack of input energy to the powder bed during the melting process [27]. This lower energy input then fails to fully melt the powder, which in turn leaves voids in the resultant structure. They attempted two different pore classification methods: an unsupervised ML model and a defined limits method for 2D and 3D pore models. A K-clustering ML method was found to be most effective for 3D pore data, while the defined limits method was found to be more suitable for 2D data. KH porosity is caused by an excess of input energy, causing excessive penetration into the metal powder and leaving a pore near the bottom of the melt pool [27]. [PERSON] et al. [24] worked on a combined numerical and experimental investigation to study the formation of KH-induced porosities in L-PBF processes. Their study found that the cause of these pores came from a chain of multiple physical phenomena due to the occurrence of local cold zones with higher surface tension and insignificant recoil pressure [24]. While LOF and KH pores are mainly described as process-induced, the same cannot be said for gas porosity [27].