Prediction of Coating Adhesion on Laser-Cleaned Metal Surfaces of Battery Cells Using Hyperspectral Imaging and Machine Learning

: Electric vehicles are shaping the future of the automotive industry. The traction battery is one of the most important components of electric cars. To ensure that the battery operates safely, it is essential to physically and electrically separate the cells facing each other. Coating a cell with varnish helps achieve this goal. Current studies use a destructive method on a sampling basis, the cross-cut test, to investigate the coating quality. In this paper, we present a fast, nondestructive and inline alternative based on hyperspectral imaging and artiﬁcial intelligence. Therefore, battery cells are measured with hyperspectral cameras in the visible and near-infrared (VNIR and NIR) parts of the electromagnetic spectrum before and after cleaning then coated and ﬁnally subjected to cross-cut test to estimate coating adhesion. During the cross-cut test, the cell coating is destroyed. This work aims to replace cross-cut tests with hyperspectral imaging (HSI) and machine learning to achieve continuous quality control, protect the environment, and save costs. Therefore, machine learning models (logistic regression, random forest, and support vector machines) are used to predict cross-cut test results based on hyperspectral data. We show that it is possible to predict with an accuracy of ~75% whether problems with coating adhesion will occur. Hyperspectral measurements in the near-infrared part of the spectrum yielded the best results. The results show that the method is suitable for automated quality control and process control in battery cell coating, but still needs to be improved to achieve higher accuracies.


Introduction
Recently, the automotive industry has been shifting away from internal combustion engines to electric vehicles. There is limited know-how regarding the manufacturing technologies required to produce new hybrid and electric vehicles [1]. In particular, the low level of expertise hinders the detection of deviations in quality. Increased and active process assurance based on test systems is needed to identify defects [2]. Undetected defects could end up in the customer's hands, resulting in breakdown, and in the worst case, harming people and the environment.
The production of electric drive trains therefore requires inspection processes integrated into the process to detect quality deviations. Artificial intelligence algorithms have the advantage that they independently learn dependencies and characteristics from existing data. In comparison, traditional data processing algorithms require manual programming, which is a disadvantage in the production of electric drive systems [3].
In addition, in electric motors, the lithium-ion traction battery is an equally important component. However, the use of lithium-ion cells in electric vehicles poses new challenges.
Cells facing each other need to be physically and electrically separated to ensure safe battery operation [4]. Isolation coating helps meet this challenge. A varnish physically and electrically separates two adjacent cells. The traditional production process inspects coating adhesion cyclically using a cross-cut test according to DIN EN ISO 2409 [5]. However, the cell coating is destroyed in this process, which increases production costs and squanders rare raw material resources. Moreover, the test is performed by a person, which makes the result highly subjective. In addition, the test is time-consuming and can only be performed on a sampling basis, which means that bad cells that were not tested can potentially be integrated into vehicles. To circumvent these problems, this paper presents a method that allows fast, objective, and non-destructing testing of coating adhesion. The cell surface is scanned by hyperspectral imaging (HSI). The high-dimensional HSI raw data are then evaluated by machine learning. Coating adhesion is assumed to be affected by the battery surface properties, and differences in surface properties are reflected in the spectral properties of the surface, which can be measured by HSI. Based on these approaches, it is impossible to assess how other factors affect coating adhesion, e.g., during the coating process itself. Therefore, reliably predicting the cross-cut classes seems unlikely.
HSI makes it possible to simultaneously measure the spectrally and laterally resolved reflectance properties of the samples under study. In a hyperspectral measurement, a complete spectrum in the wavelength range under investigation is obtained for each point on the surface of the sample examined. The resulting dataset is usually referred to as a hypercube. The wavelength range is not limited to the visible part of the spectrum, but can be extended into the ultraviolet, the near-infrared, and even into the mid-infrared parts. Originally developed for remote sensing [6], the HSI has now found use in many other applications, such as in agriculture, recycling, medicine, and pharmaceuticals [7][8][9][10].

State of the Art
As already explained in Section 1, quality evaluation can be supported by machine learning. The field offers enormous benefits, especially in the production of the electric powertrain, where access to expert knowledge is very limited. Due to this fact, in the following sections, we will summarize the literature that deals with the detection of quality deviations using optical sensors and failure classification using machine learning algorithms. The focus is placed on the production of electric drive systems. At the end of this section, a scientific gap is then derived for the present publication.
In the context of electric drive production, Weigelt et al. presented a method for checking the ultrasonic crimp connection of a stator. In addition to the winding assembly, the process of contacting the wire ends with cable lugs offers a greater potential for optimization. However, multiple factors make it difficult to control the contacting process of ultrasonic crimping. The authors presented an image-based convolutional neural network (CNN), which makes it possible to visually inspect and predict the connection quality. CNN helped achieve inspection accuracy of 91% [11].
Mayr et al. dealt with welding defect detection of hairpin pairs. At first, they sought to predict the weld quality based on machine parameters. Then, they compared different algorithms such as support vector machine [12], random forest [13], k-nearest-neighbor [14] and artificial neural networks [15]. In addition to predicting the weld seam quality based on machine parameters, the authors detected weld defects using a camera and a CNN technique. Depending on the failure class, an accuracy between 61% and 91% could be achieved [16].
In the field of hairpin welding, Vater et al. investigated how to detect welding defects using an optical system. The authors used both grayscale images and 3D scans. However, a significant added value for production is only created if, in addition to the detection of the quality deviation, automatic reworking can be implemented. To this end, an additional rework concept is defined, which is selected based on prescriptive analysis. With the 3D scans serving as input variables and the self-developed CNN, the authors achieved detection accuracy of 99.58% [17]. Huber presented a nondestructive optical method for detecting quality deviations on battery separators. He used a decision tree to classify the quality deviation. The test method was implemented in a test bench [4].
Since there is already a good summary of machine detection of quality deviations in the production of the electric drive, we will not go into further detail [18]. In summary, optically detecting production defects and classifying them machine learning has great potential. However, since there are no studies regarding coating adhesion detection and cross-cut prediction to date, this method will be described below.

Materials and Methods
This section presents the relevant methodology for predicting the cross-cut test results, and therefore the coating adhesion on a laser-structured metal surface. Relevant points are illustrated in Figure 1, which is based on the CRISP-DM (CRoss Industry Standard Process for Data Mining) [19]. With the 3D scans serving as input variables and the self-developed CNN, the authors achieved detection accuracy of 99.58% [17]. Huber presented a nondestructive optical method for detecting quality deviations on battery separators. He used a decision tree to classify the quality deviation. The test method was implemented in a test bench [4].
Since there is already a good summary of machine detection of quality deviations in the production of the electric drive, we will not go into further detail [18]. In summary, optically detecting production defects and classifying them machine learning has great potential. However, since there are no studies regarding coating adhesion detection and cross-cut prediction to date, this method will be described below.

Materials and Methods
This section presents the relevant methodology for predicting the cross-cut test results, and therefore the coating adhesion on a laser-structured metal surface. Relevant points are illustrated in Figure 1, which is based on the CRISP-DM (CRoss Industry Standard Process for Data Mining) [19]. The components of this process model are presented and explained in detail in the following sections, starting with business understanding in clockwise order. In the first stage, objectives and requirements are concretized. The data understanding phase then provides an initial overview of the generated data and assesses its quality. In the third step, the data is preprocessed to achieve higher algorithm accuracies. During the modeling phase, an algorithm suitable for predicting the cross-cut test results is developed and then evaluated. In the last phase, the obtained findings are processed. In the following sections, these steps will be presented in more detail with respect to the use case considered in this paper.

Business Understanding
This section first introduces the current and the desired production process. The procedure of the cross-cut test is then explained.

Actual and Target Production Process
As already described in Section 1, the lithium-ion cells are coated with a varnish to isolate the opposing cells both physically and electrically. The production process used for this consists of four steps, whereby the first two production steps involve cleaning the cell surface. In the first step, the cells are structured and cleaned using a laser. This process removes electrolyte residues, which remain on the cell surface. Due to the filling process, the battery cells are partially contaminated with electrolyte, which results in low adhesion of the applied varnish. Subsequently, small particles still present on the cell surface are removed using plasma cleaning. Afterwards, the isolating varnish is coated on the cell and the cell coating is cured by UV radiation. A cross-cut test according to DIN EN ISO The components of this process model are presented and explained in detail in the following sections, starting with business understanding in clockwise order. In the first stage, objectives and requirements are concretized. The data understanding phase then provides an initial overview of the generated data and assesses its quality. In the third step, the data is preprocessed to achieve higher algorithm accuracies. During the modeling phase, an algorithm suitable for predicting the cross-cut test results is developed and then evaluated. In the last phase, the obtained findings are processed. In the following sections, these steps will be presented in more detail with respect to the use case considered in this paper.

Business Understanding
This section first introduces the current and the desired production process. The procedure of the cross-cut test is then explained.
As already described in Section 1, the lithium-ion cells are coated with a varnish to isolate the opposing cells both physically and electrically. The production process used for this consists of four steps, whereby the first two production steps involve cleaning the cell surface. In the first step, the cells are structured and cleaned using a laser. This process removes electrolyte residues, which remain on the cell surface. Due to the filling process, the battery cells are partially contaminated with electrolyte, which results in low adhesion of the applied varnish. Subsequently, small particles still present on the cell surface are removed using plasma cleaning. Afterwards, the isolating varnish is coated on the cell and the cell coating is cured by UV radiation. A cross-cut test according to DIN EN ISO 2409 [5] is currently used to check the coating adhesion. However, the disadvantage of this method include the destruction of the cell coating. As described in Section 1, this incurs high costs and squanders resources. For this reason, nondestructive test methods should be developed for predicting the cross-cut test results of coating adhesion. The production process aimed at is explained in the following passage: The first production step involves examining the cell surface using HSI, which enables the detection and localization of electrolyte residues. Laser cleaning and structuring and a higher laser power could be used in areas of increased electrolyte contamination to remove the electrolyte. In the subsequent step, as already explained, the surface is fine cleaned by plasma cleaning. Following this, the cell surface is examined again for electrolyte residues using HSI. Since, as described above, the adhesion of the coating depends on the electrolyte contamination, the data of the HSI measurement shall be used to predict the cross-cut test results, and therefore an estimation of the coating adhesion. Finally, the cell is coated as explained above and the coating is cured. The advantage of the intended method is the possible integration of a nondestructive testing method into the manufacturing process, and therefore, a good automation capability through the use of the corresponding camera technology, whereby 100% inspection can be performed during production.

Cross-Cut Test
The cross-cut test can be used to estimate the adhesion of a single-or multi-layer coating to the respective substrate. This method involves assessing how the tested coating behaves under injury and shear stress. As shown in Figure 2, a set of parallel cuts are made down to the substrate using a cutter knife. These are then crossed by six cuts arranged in a perpendicular orientation. After the surface has been scored, it is cleaned using a soft brush. An adhesive tape is then applied to the cuts under slight pressure and removed in a uniform peeling motion. This grid cut is assessed by visual inspection against reference images. A distinction is made between cross-cut class 0 (good adhesion) and 4 (poor adhesion). A detailed overview and description of the classes can be found in ISO 2409: 2013 [5]. 2409 [5] is currently used to check the coating adhesion. However, the disadvantage of this method include the destruction of the cell coating. As described in Section 1, this incurs high costs and squanders resources. For this reason, nondestructive test methods should be developed for predicting the cross-cut test results of coating adhesion. The production process aimed at is explained in the following passage: The first production step involves examining the cell surface using HSI, which enables the detection and localization of electrolyte residues. Laser cleaning and structuring and a higher laser power could be used in areas of increased electrolyte contamination to remove the electrolyte. In the subsequent step, as already explained, the surface is fine cleaned by plasma cleaning. Following this, the cell surface is examined again for electrolyte residues using HSI. Since, as described above, the adhesion of the coating depends on the electrolyte contamination, the data of the HSI measurement shall be used to predict the cross-cut test results, and therefore an estimation of the coating adhesion. Finally, the cell is coated as explained above and the coating is cured. The advantage of the intended method is the possible integration of a nondestructive testing method into the manufacturing process, and therefore, a good automation capability through the use of the corresponding camera technology, whereby 100% inspection can be performed during production.

Cross-Cut Test
The cross-cut test can be used to estimate the adhesion of a single-or multi-layer coating to the respective substrate. This method involves assessing how the tested coating behaves under injury and shear stress. As shown in Figure 2, a set of parallel cuts are made down to the substrate using a cutter knife. These are then crossed by six cuts arranged in a perpendicular orientation. After the surface has been scored, it is cleaned using a soft brush. An adhesive tape is then applied to the cuts under slight pressure and removed in a uniform peeling motion. This grid cut is assessed by visual inspection against reference images. A distinction is made between cross-cut class 0 (good adhesion) and 4 (poor adhesion). A detailed overview and description of the classes can be found in ISO 2409: 2013 [5].

Hyperspectral Measurement of the Battery Cells
Hyperspectral measurements of the battery cells is performed using an HSI measurement system with two different pushbroom cameras and diffuse halogen illumination. Figure 3 shows a schematic representation of the system. The system is equipped either with an NIR-HSI (Xenics NIR, Xenics nv, Leuven, Belgium) camera with wavelength varying between 900 and 2300 nm or with a VNIR-HSI camera (Hyperspec-

Hyperspectral Measurement of the Battery Cells
Hyperspectral measurements of the battery cells is performed using an HSI measurement system with two different pushbroom cameras and diffuse halogen illumination. Figure 3 shows a schematic representation of the system. The system is equipped either with an NIR-HSI (Xenics NIR, Xenics nv, Leuven, Belgium) camera with wavelength varying between 900 and 2300 nm or with a VNIR-HSI camera (Hyperspec-VNIR, Headwall Photonics Inc., Bolton, MA, USA) with wavelength varying between 400 and 1000 nm, and the corresponding optics (NIR: SWIR-25 f/1. 4  Andor Technology Ltd., Belfast, UK), and the NIR camera is equipped with an InGaAs detector (Xenics nv, Leuven, Belgium) with 320 × 280 px. The lighting is provided by six halogen lamps with a power of 25 W each. The diffuse illumination of the samples is conducted by an integration tube made of Spectralon (Labsphere Inc., North Sutton, NH, USA). Sample movement is controlled by a linear stage (VT 80, PI Micos, Eschbach, Germany). The integration and control of the system components, as well as data acquisition, is performed by the dedicated HSI software suite imanto ® pro (Fraunhofer IWS, Dresden, Germany).
To avoid lighting irregularities and to eliminate dark current influences, white and dark corrections for each wavelength were performed according to Equation (1): I c is the corrected image and I o is the original image for the wavelength λ. I d is the dark signal recorded with the light source switched off and the lens covered. For the white reference (I w ), a Spectralon plate was recorded under the same measurement conditions as the original image. . The integration and control of the system components, as well as data acquisition, is performed by the dedicated HSI software suite imanto ® pro (Fraunhofer IWS, Dresden, Germany).
To avoid lighting irregularities and to eliminate dark current influences, white and dark corrections for each wavelength were performed according to Equation (1): Ic is the corrected image and Io is the original image for the wavelength λ. Id is the dark signal recorded with the light source switched off and the lens covered. For the white reference (Iw), a Spectralon plate was recorded under the same measurement conditions as the original image. Thirty battery cells were examined from the front side and back side by the HSI system. The measurement was performed once before and once after laser cleaning and structuring of the cells. VNIR camera measurements were performed with a working distance of 300 mm, exposure time of 8 ms, recording frequency of 40 Hz, and 4× binning in the spectral dimensions. This results in a field of view (FOV) of ~90 mm, lateral resolution of ~150 μm, and spectral resolution of 3 nm. NIR camera measurements were performed with a working distance of 300 mm, exposure time of 4.5 ms, and recording frequency of 50 Hz. This results in a FOV of ~145 mm, lateral resolution of 450 μm, and spectral resolution of 7 nm. For both cameras, the advance speed of the sample was set to obtain square pixels and, therefore, the same spatial resolution was observed in both directions. The result of each measurement was a hypercube containing 191 spectral bands between 400 and 1000 nm for the VNIR measurement and 189 spectral bands between 900 and 2300 nm for the NIR measurement. Figure 4 shows an example of battery cell measurements before laser cleaning taken by the NIR-HSI camera. Figure 4a shows the color-coded reflectivity at a wavelength of 1500 nm. Figure 4b shows some example spectra, the positions of which are marked by colored crosses in the Figure 4a. The blue spectra are from areas of the sample that appear clean, and the green spectra are from areas that appear contaminated. The blue spectra show higher reflectivity and few characteristic bands, while the green spectra show lower reflectivity and more Thirty battery cells were examined from the front side and back side by the HSI system. The measurement was performed once before and once after laser cleaning and structuring of the cells. VNIR camera measurements were performed with a working distance of 300 mm, exposure time of 8 ms, recording frequency of 40 Hz, and 4× binning in the spectral dimensions. This results in a field of view (FOV) of~90 mm, lateral resolution of 150 µm, and spectral resolution of 3 nm. NIR camera measurements were performed with a working distance of 300 mm, exposure time of 4.5 ms, and recording frequency of 50 Hz. This results in a FOV of~145 mm, lateral resolution of 450 µm, and spectral resolution of 7 nm. For both cameras, the advance speed of the sample was set to obtain square pixels and, therefore, the same spatial resolution was observed in both directions. The result of each measurement was a hypercube containing 191 spectral bands between 400 and 1000 nm for the VNIR measurement and 189 spectral bands between 900 and 2300 nm for the NIR measurement. Figure 4 shows an example of battery cell measurements before laser cleaning taken by the NIR-HSI camera. Figure 4a shows the color-coded reflectivity at a wavelength of 1500 nm. Figure 4b shows some example spectra, the positions of which are marked by colored crosses in the Figure 4a. The blue spectra are from areas of the sample that appear clean, and the green spectra are from areas that appear contaminated. The blue spectra show higher reflectivity and few characteristic bands, while the green spectra show lower reflectivity and more characteristic bands (for example at 1950 nm). Thus, it seems possible to detect contaminated sample areas by NIR-HSI.  The positions of the displayed sample spectra are marked by the colored crosses. The blue spectra represent areas that appear clean, and the green spectra represent areas that appear contaminated; (b) Example spectra of the cell. The positions of the displayed sample spectra are marked by the colored crosses. The blue spectra represent areas that appear clean, and the green spectra represent areas that appear contaminated.

Data Preparation
After coating and curing the battery cells, 10 cross-cut tests were performed according to DIN EN ISO 2409 [5] on each side of the cells to achieve coating adhesion. Figure 2 shows an example of a battery cell subject to cross-cut tests. The cross-cut test assessment was subjective, and provided cross-cut classes between 0 and 3. The worst cross-cut class, 4, did not occur. No cross-cut tests were performed for four sides of the battery cells; therefore, a total of 560 cross-cut classes were obtained. Table 2 shows the distribution of the measured cross-cut classes. A cross-cut class of 3 was obtained for only seven samples, as samples were taken from real production. Since for series production it is essential that as few defective products as possible are produced, only a few defectively painted cells could be collected. Since there is not enough data to successfully execute machine learning, these samples were also assigned to cross-cut class 2. In the next step, the corresponding areas in the hyperspectral measurements were assigned to the cross-section ranges. Each area corresponds to an area of approximately 1.5 cm × 1.5 cm. The training data for machine learning were derived from these areas. Two different approaches were considered: on the one hand, a mean spectrum was formed for each cross-cut area (100 × 100 spectra, approach a); on the other hand, the crosscut areas were divided into smaller sub-areas with a size of 10 × 10 spectra (~1.5 × 1.5 mm) and 4 × 4 spectra (~2 mm × 2 mm) for the VNIR and NIR measurements, respectively. The mean spectra of these sub-areas were calculated (approach b). Hence, the number of training data points can be increased from 560 to 100,000 for the VNIR measurements and 50,000 for the NIR measurements. In addition, this increases the spatial resolution for the prediction of the cross-cut values. Furthermore, VNIR and NIR measurements before laser cleaning (bc) and after laser cleaning (ac) were considered and used for the evaluation.
In total, eight data sets were generated: The positions of the displayed sample spectra are marked by the colored crosses. The blue spectra represent areas that appear clean, and the green spectra represent areas that appear contaminated; (b) Example spectra of the cell. The positions of the displayed sample spectra are marked by the colored crosses. The blue spectra represent areas that appear clean, and the green spectra represent areas that appear contaminated.

Data Preparation
After coating and curing the battery cells, 10 cross-cut tests were performed according to DIN EN ISO 2409 [5] on each side of the cells to achieve coating adhesion. Figure 2 shows an example of a battery cell subject to cross-cut tests. The cross-cut test assessment was subjective, and provided cross-cut classes between 0 and 3. The worst cross-cut class, 4, did not occur. No cross-cut tests were performed for four sides of the battery cells; therefore, a total of 560 cross-cut classes were obtained. Table 1 shows the distribution of the measured cross-cut classes. A cross-cut class of 3 was obtained for only seven samples, as samples were taken from real production. Since for series production it is essential that as few defective products as possible are produced, only a few defectively painted cells could be collected. Since there is not enough data to successfully execute machine learning, these samples were also assigned to cross-cut class 2. In the next step, the corresponding areas in the hyperspectral measurements were assigned to the cross-section ranges. Each area corresponds to an area of approximately 1.5 cm × 1.5 cm. The training data for machine learning were derived from these areas. Two different approaches were considered: on the one hand, a mean spectrum was formed for each cross-cut area (100 × 100 spectra, approach a); on the other hand, the cross-cut areas were divided into smaller sub-areas with a size of 10 × 10 spectra (~1.5 × 1.5 mm) and 4 × 4 spectra (~2 mm × 2 mm) for the VNIR and NIR measurements, respectively. The mean spectra of these sub-areas were calculated (approach b). Hence, the number of training data points can be increased from 560 to 100,000 for the VNIR measurements and 50,000 for the NIR measurements. In addition, this increases the spatial resolution for the prediction of the cross-cut values. Furthermore, VNIR and NIR measurements before laser cleaning (bc) and after laser cleaning (ac) were considered and used for the evaluation.
In total, eight data sets were generated: • VNIR-a-bc: VNIR measurement before cleaning, approach a; 560 data points • NIR-a-bc: NIR measurement before cleaning, approach a; 560 data points • VNIR-b-bc:VNIR measurement before cleaning, approach b;~100,000 data points • NIR-b-bc: NIR measurement before cleaning, approach b;~50,000 data points • VNIR-a-ac: VNIR measurement after cleaning, approach a; 560 data points • NIR-a-ac: NIR measurement after cleaning, approach a; 560 data points • VNIR-b-ac: VNIR measurement after cleaning, approach b;~100,000 data points • NIR-b-bac: NIR measurement after cleaning, approach b;~50,000 data points For the data sets created using approach b, only 5000 randomly chosen data points were used for training to reduce the necessary training time. The target values for the training of the prediction models are the cross-cut classes. In approach b, the same value was assigned to each subsection. In addition to trying to predict the exact cross-cut value, an attempt was made to predict whether coating adhesion issues would arise. For this purpose, all samples with a cross-cut value of 0 and all samples with a value greater than zero were combined into one class.

Machine Learning Methods
The goal is to train machine learning models to predict the cross-cut class and, thus, measure the quality of coating adhesion of the cells based on spectral information of the battery cell surfaces before and after cleaning. To achieve this, three different classification algorithms were trained and compared: logistic regression (LR, [20]), random forest classification (RF [13]), and support vector machines (SVM [12]), using a radial basis and a linear kernel. For a detailed algorithm description, please refer to the corresponding literature. Before the model training, an optional principal component analysis (PCA) and optional standardization to a standard deviation of one and a mean value of zero were performed.
Hyperparameter optimization was conducted for all algorithms, and also for the preprocessing of the spectral data. Hyperparameters are the parameters of the classification algorithms used to control the algorithms themselves. These parameters are set before the actual model training and are not learned during the training. They can greatly affect the overall classification accuracy of the trained algorithms; therefore, optimization of the hyperparameters is highly useful. Often, this optimization is guided by trial-and-error approaches and user experience. This process is often time-consuming, and does not guarantee that it will find an optimal result. Automatic hyperparameter optimization methods are increasingly being used to address these issues, especially for classification algorithms that require high computational efforts and a large number of hyperparameters. These algorithms attempt an iterative approach for the optimal hyperparameters of the classification algorithm using various mathematical methods. An example of such an algorithm is the Bayesian optimization algorithm (BOA, [21]). A disadvantage of these algorithms is that their calculation is time-consuming and computationally intensive. The random search algorithm (RS) is a simple and fast alternative, which randomly selects the next hyperparameter. It has been shown by Bergstra and Bengio that the differences between RS and other hyperparameter optimization algorithms are often small [22]. Therefore, the RS algorithm is used here for hyperparameter optimization. The optimized hyperparameters and the ranges in which these parameters were optimized are summarized in Table A1. All other parameters have been left at their default settings. Hyperparameter optimization using RS was performed on 50 epochs, which means that 50 models with different random hyperparameters were trained to find a good set of hyperparameters.
All trained classification models were assessed by 10-fold cross-validation. This technique involved dividing each data set into 10 parts and then training 10 classification models, whereby one part of the data is always not taken into account for training. The derived model is then applied to the neglected part of the data, and the overall balanced classification accuracy is determined. The mean value of all 10 tests yields the cross-validated overall balanced accuracy. Classification models are compared using the calculated overall balanced classification accuracies of the cross-validation. The balanced accuracy is used to avoid inflated accuracy because of the imbalanced dataset [23]. All calculations were performed with scikit-learn (version 0.23.2., [24]), a Windows 10 TM computer with an Intel ® Core TM i5-4590 with 3.3 GHz, 16 GB RAM, a Nvidia ® GTX 1080 Ti graphics card with 11 GB GDDR5X memory, and a processor clock of 1632 MHz. Figure 5 shows the average spectra of all regions with one of the three cross-cut classes before and after laser cleaning for NIR-and VNIR-HSI measurements. derived model is then applied to the neglected part of the data, and the overall balanced classification accuracy is determined. The mean value of all 10 tests yields the crossvalidated overall balanced accuracy. Classification models are compared using the calculated overall balanced classification accuracies of the cross-validation. The balanced accuracy is used to avoid inflated accuracy because of the imbalanced dataset [23]. All calculations were performed with scikit-learn (version 0.23.2., [24]), a Windows 10 TM computer with an Intel ® Core TM i5-4590 with 3.3 GHz, 16 GB RAM, a Nvidia ® GTX 1080 Ti graphics card with 11 GB GDDR5X memory, and a processor clock of 1632 MHz. Figure 5 shows the average spectra of all regions with one of the three cross-cut classes before and after laser cleaning for NIR-and VNIR-HSI measurements. The mean spectra were calculated from the mean spectra of all hypercubes of one cross-cut value. The mean spectra of the cross-cut classes between the NIR and VNIR measurements, as well as before and after laser cleaning, differ. The mean spectra differences of the NIR measurements are larger than those of the VNIR measurements. Cross-cut classes 1 and 2 hardly show any difference in the VNIR measurements. The mean spectra differences are mainly visible in the shape and intensity of the reflection spectra. The spectra are reminiscent of the interference spectrum of a thin layer and could, therefore, indicate such a layer on the sample surface (e.g., an oxide layer). The ripple of the spectra, which is mainly visible between 500 and 800 nm, is caused by the detector's quantum efficiency. Slight differences in the absorption bands between 1200 and 1400 nm are visible in the NIR spectra. These bands could be caused by organic substances, but the exact origin is unknown.

Data Understanding
Based on these results, it should be possible to differentiate between the cross-cut classes based on the spectral properties of the sample surface. However, a different picture emerges if one looks at the mean spectra of each cross-cut area rather than at the mean spectra of each cross-cut class. Figure 6 demonstrates 10 randomly selected spectra for each cross-cut class for VNIR and NIR measurements before cleaning. The figure shows small differences between the spectra of the individual cross-cut classes and a significant overlap in certain cases. However, NIR measurements show weak bands between 1300 and 1400 and ~1900 nm in the spectra of the areas with cross-cut values 2 and 3, which indicate the presence of organic substances on the surface. Those contaminations are assumed to cause weak coating adhesion, leading to higher cross-cut classes. The mean spectra were calculated from the mean spectra of all hypercubes of one cross-cut value. The mean spectra of the cross-cut classes between the NIR and VNIR measurements, as well as before and after laser cleaning, differ. The mean spectra differences of the NIR measurements are larger than those of the VNIR measurements. Cross-cut classes 1 and 2 hardly show any difference in the VNIR measurements. The mean spectra differences are mainly visible in the shape and intensity of the reflection spectra. The spectra are reminiscent of the interference spectrum of a thin layer and could, therefore, indicate such a layer on the sample surface (e.g., an oxide layer). The ripple of the spectra, which is mainly visible between 500 and 800 nm, is caused by the detector's quantum efficiency. Slight differences in the absorption bands between 1200 and 1400 nm are visible in the NIR spectra. These bands could be caused by organic substances, but the exact origin is unknown.
Based on these results, it should be possible to differentiate between the cross-cut classes based on the spectral properties of the sample surface. However, a different picture emerges if one looks at the mean spectra of each cross-cut area rather than at the mean spectra of each cross-cut class. Figure 6 demonstrates 10 randomly selected spectra for each cross-cut class for VNIR and NIR measurements before cleaning. The figure shows small differences between the spectra of the individual cross-cut classes and a significant overlap in certain cases. However, NIR measurements show weak bands between 1300 and 1400 and~1900 nm in the spectra of the areas with cross-cut values 2 and 3, which indicate the presence of organic substances on the surface. Those contaminations are assumed to cause weak coating adhesion, leading to higher cross-cut classes.
A possible explanation for the small spectral differences between the cross-cut classes is that there is only partial correlation between the surface spectral properties and the cross-cut test result. Another possible reason is the inaccuracy of the "ground truth" values. Since these were only determined integrally for a relatively large area of the cells, it is possible that the coating adhesion differs over one cross-cut area. The mean spectrum of this area can, therefore, be a combination from areas with different levels of coating adhesion. This could make it difficult to predict the coating adhesion or the cross-cut class from the spectral properties of the sample surface.
A possible explanation for the small spectral differences between the cross-cut classes is that there is only partial correlation between the surface spectral properties and the cross-cut test result. Another possible reason is the inaccuracy of the "ground truth" values. Since these were only determined integrally for a relatively large area of the cells, it is possible that the coating adhesion differs over one cross-cut area. The mean spectrum of this area can, therefore, be a combination from areas with different levels of coating adhesion. This could make it difficult to predict the coating adhesion or the cross-cut class from the spectral properties of the sample surface.

Results of Modeling Using Machine Learning Algorithms
Classification models are trained, optimized, and validated based on the eight data sets described in Section 3.4. The training is performed as described in Section 3.5, with the support vector machine, random forest, and logistic regression algorithms. For the data sets generated with approach b, only 5000 data points are used for the training to reduce the necessary training time. In addition, the training was performed twice: the first approach sought to predict the three cross-cut classes (0, 1 and 2 + 3; 3-class models), while the second one tried to distinguish between a zero cross-cut value and greater than 0 values (i.e., 1, 2, and 3; 2-class models). Greater-than-zero cross-cut values predict whether coating adhesion will be successful or not. Table 3 lists the results of the 10-fold cross-validation. It is clear that the balanced classification accuracies for the 3-class models reach a maximum of 65.4% for the NIR-bac data set using the SVM algorithm. If the number of classes is reduced to two (2-class models), the balanced classification accuracy increases to a maximum of 75.1% for the NIR-b-bc data set and the random forest algorithm. The SVM and random forest algorithms show similar classification accuracies on average, while logistic regression algorithms yield less accurate results. The balanced classification accuracies are also better on average for the 2-class models, demonstrating better balanced classification accuracies than the 3-class models. This shows that it is much easier to identify whether coating adhesion problems in an area will arise or not than to identify the exact cross-cut class of coating adhesion. Other reasons for this are that the differences between a cross-cut class of 1 and 2 are relatively small, and that the cross-cut class was determined manually, which could lead to errors in the ground truth data.
It also states that NIR measurements demonstrate better balanced classification accuracy than VNIR measurements. This indicates that surface contamination of the battery cells that weaken coating adhesion can be more clearly detected in the NIR spectral range. The assumption is that reduced coating adhesion is caused by electrolyte fluid contamination. Since the contaminations show a characteristic absorption in the NIR Figure 6. (a) The figure shows 10 randomly selected spectra for each of the VNIR-HSI measurement for each of the three cross-cut classes of the samples before cleaning (bc); (b) The figure shows 10 randomly selected spectra for each of the NIR-HSI measurement for each of the three cross-cut classes of the samples before cleaning (bc).

Results of Modeling Using Machine Learning Algorithms
Classification models are trained, optimized, and validated based on the eight data sets described in Section 3.4. The training is performed as described in Section 3.5, with the support vector machine, random forest, and logistic regression algorithms. For the data sets generated with approach b, only 5000 data points are used for the training to reduce the necessary training time. In addition, the training was performed twice: the first approach sought to predict the three cross-cut classes (0, 1 and 2 + 3; 3-class models), while the second one tried to distinguish between a zero cross-cut value and greater than 0 values (i.e., 1, 2, and 3; 2-class models). Greater-than-zero cross-cut values predict whether coating adhesion will be successful or not. Table 2 lists the results of the 10-fold cross-validation. It is clear that the balanced classification accuracies for the 3-class models reach a maximum of 65.4% for the NIR-b-ac data set using the SVM algorithm. If the number of classes is reduced to two (2-class models), the balanced classification accuracy increases to a maximum of 75.1% for the NIR-b-bc data set and the random forest algorithm. The SVM and random forest algorithms show similar classification accuracies on average, while logistic regression algorithms yield less accurate results. The balanced classification accuracies are also better on average for the 2-class models, demonstrating better balanced classification accuracies than the 3-class models. This shows that it is much easier to identify whether coating adhesion problems in an area will arise or not than to identify the exact cross-cut class of coating adhesion. Other reasons for this are that the differences between a cross-cut class of 1 and 2 are relatively small, and that the cross-cut class was determined manually, which could lead to errors in the ground truth data.
It also states that NIR measurements demonstrate better balanced classification accuracy than VNIR measurements. This indicates that surface contamination of the battery cells that weaken coating adhesion can be more clearly detected in the NIR spectral range.
The assumption is that reduced coating adhesion is caused by electrolyte fluid contamination. Since the contaminations show a characteristic absorption in the NIR spectral range, it is conclusive that they can be better detected by the NIR-HSI method. Even if this absorption is only slightly pronounced (see Section 3.1), it may be sufficient for a classification. Differences in the balanced classification accuracy between the cleaned (ac) and uncleaned samples (bc) are small, and it is unclear whether either measurement provides a better accuracy. This indicates that the developed approach can be used before, as well as after the laser cleaning process, to predict the cross-cut class and, hence, assess the coating adhesion.
Another result is that approach b leads to a slight improvement in the balanced classification accuracy compared to approach a. This effect can be explained by the fact that when considering the entire cross-cut areas (approach a), potentially contaminated and non-contaminated areas are combined, whereby spectral differences are reduced, making classification less accurate.
Overall, the prediction does not yet reach the quality required for later use and needs further improvement. Section 5 analyses the reasons for this and discusses ways to improve the prediction accuracies. Table 2. 10-fold cross-validated overall balanced classification accuracies for the prediction of the cross-section classes from the spectra of the HSI measurements in percent. The calculation was performed for three or two cross-cut classes. The best accuracy is marked in bold. VNIR: visible and near-infrared spectral data. NIR: near-infrared spectral data. a: approach a, mean spectra of cross-cut areas, 560 data points used for training and validation. b: approach b, sub-areas for each cross-cut area, 5000 data points used for training and validation. bc: measured before cleaning. ac: measured after cleaning.

Evaluation of the Prediction Algorithms
Ultimately, the best classification model found in Section 4.2 was applied to all HSI measurements to obtain a spatially resolved prediction of the coating adhesion for the complete surface of the battery cells. This experiment only intended to illustrate the results and demonstrate the possible application of the developed method, as the predictions obtained cannot be verified by reference measurements in this work.
For the prediction, the data set NIR-b-bc was selected, for which a balanced classification accuracy of 75.1% was achieved with the random forest algorithm and in the 2-class case. Figure 7 shows the result of the prediction for two of the examined battery cells. The prediction obtained from the algorithm agrees with the results of the cross-cut test for most areas. However, it can also be seen that for some cross-cut areas, there are differences between the measured and the predicted cross-cut classes.
Results show that the method is, in principle, suitable for quality control of the laser cleaning of the battery cells. For example, it would be possible to perform more intensive cleaning to increase coating adhesion in areas where adhesion is predicted to be poor.

Discussion
The best prediction of balanced accuracy found for the cross-cut value was 75.1%. This means that it can be predicted whether coating adhesion problems will arise for 75.1% of all sample areas (each corresponding to ~2 mm × 2 mm or 4 × 4 spectra). Unfortunately, the prediction accuracy of the model, whether the considered area has a cross-cut value of 1, 2 or 3, is not acceptable.
Since a large number of algorithms for predicting the cross-cut value have been investigated, it can be assumed that no (significantly) better accuracy can be achieved with the available data. There could be several reasons for this. One reason is inaccuracies in the ground truth of the cross-cut classes. One aspect is that the cross-cut classes are a subjective estimation for the coating adhesion and are, therefore, themselves subject to error. Another aspect is that the cross-cut classes are only determined for a relatively large area with the cross-cut test, and it is possible that in this area, there are points with good and bad coating adhesion. When training the machine learning models, these areas are mixed, thereby diminishing the quality of the prediction models. This makes prediction model training more difficult. This is supported by the fact that slightly better classification accuracies were achieved with data pre-processing approach b.
Furthermore, there might be no complete correlation between the HSI measurement data and the cross-cut classes of the coating adhesion. This means that there are causes for poor coating adhesion that cannot be detected by the hyperspectral measurements and, thus, cannot be taken into account in the prediction. These may include, for example, problems with the coating process itself, which were not considered in the present study.
The attempt to predict the exact cross-cut classes (0, 1, and 2 or 3) led to lower overall prediction accuracies. Differentiating the exact cross-cut classes seems to be more difficult than predicting whether coating adhesion will be impaired at all. The spectral differences between the sample areas with a cross-cut class are probably very small. In addition, the problem of inaccurate ground truth values increases in this case.

Conclusions
In summary, we conclude that an estimate prediction of the coating adhesion of battery cells after laser cleaning is possible using hyperspectral measurements and subsequent data evaluation based on machine learning. The best prediction accuracy was achieved with the NIR hyperspectral data of the battery cells before cleaning using the RF

Discussion
The best prediction of balanced accuracy found for the cross-cut value was 75.1%. This means that it can be predicted whether coating adhesion problems will arise for 75.1% of all sample areas (each corresponding to~2 mm × 2 mm or 4 × 4 spectra). Unfortunately, the prediction accuracy of the model, whether the considered area has a cross-cut value of 1, 2 or 3, is not acceptable.
Since a large number of algorithms for predicting the cross-cut value have been investigated, it can be assumed that no (significantly) better accuracy can be achieved with the available data. There could be several reasons for this. One reason is inaccuracies in the ground truth of the cross-cut classes. One aspect is that the cross-cut classes are a subjective estimation for the coating adhesion and are, therefore, themselves subject to error. Another aspect is that the cross-cut classes are only determined for a relatively large area with the cross-cut test, and it is possible that in this area, there are points with good and bad coating adhesion. When training the machine learning models, these areas are mixed, thereby diminishing the quality of the prediction models. This makes prediction model training more difficult. This is supported by the fact that slightly better classification accuracies were achieved with data pre-processing approach b.
Furthermore, there might be no complete correlation between the HSI measurement data and the cross-cut classes of the coating adhesion. This means that there are causes for poor coating adhesion that cannot be detected by the hyperspectral measurements and, thus, cannot be taken into account in the prediction. These may include, for example, problems with the coating process itself, which were not considered in the present study.
The attempt to predict the exact cross-cut classes (0, 1, and 2 or 3) led to lower overall prediction accuracies. Differentiating the exact cross-cut classes seems to be more difficult than predicting whether coating adhesion will be impaired at all. The spectral differences between the sample areas with a cross-cut class are probably very small. In addition, the problem of inaccurate ground truth values increases in this case.

Conclusions
In summary, we conclude that an estimate prediction of the coating adhesion of battery cells after laser cleaning is possible using hyperspectral measurements and subsequent data evaluation based on machine learning. The best prediction accuracy was achieved with the NIR hyperspectral data of the battery cells before cleaning using the RF algorithm. It was possible to predict whether there was a problem with the coating adhesion (cross-cut classes 1, 2, or 3) or not (cross-cut class 0) with an accuracy of 75.1%. To improve the prediction accuracy, it would be useful to perform further experiments, especially with a more accurate ground truth method. For example, it would make sense to obtain the ground truth values for smaller sample areas and automate and objectify the evaluation of the cross-section characteristics, which could be achieved by image evaluation and/or machine learning.
Furthermore, it would make sense to obtain more data to train more accurate models and possibly apply deep learning methods. Ideally, these additional experiments should be performed under industrial conditions to better estimate the effect of external influences on the results. Data acquisition could for example take place during the ongoing production of battery cells. Predictive models could be continuously improved by the results of the ongoing quality control and eventually replace them.
The results show that hyperspectral imaging is a promising method for fast, noncontact and nondestructive prediction of surface properties and the parameters derived from them. Further investigations in this direction will be conducted in the future.

Conflicts of Interest:
The authors declare no conflict of interest. A   Table A1. Overview of the optimized hyperparameters and the optimization ranges of machine learning models. For a description of the hyperparameters, please refer to the literature references.