A Novel Computer Algorithm for Automating Nano-Scale Thickness Identification of 2D Materials

Atomically thin 2D materials such as graphene promise great innovation in the electronics industry. However, these promises have stayed unfulfilled due to the lack of commercial 2D material production. There is currently no scalable and no economical way to identify the thicknesses of 2D materials reliably. Traditionally, Raman spectroscopy or atomic force microscopy (AFM) is used to measure the nanoscale (1-10 atom) thicknesses of 2D materials. These processes have many limitations because they require expensive equipment, are highly time-consuming, and only provide data for a single point on the sample. This paper presents a cheap and scalable solution that uses optical microscopy images to identify thicknesses. Two significant challenges need to be overcome to make this method feasible. Firstly, color temperatures and lighting intensities vary between different cameras and microscope setups. Secondly, the atomic-scale thicknesses of 2D materials translate into a very low contrast ratio between the 2D material and the substrate. This paper addresses these two challenges with novel computer vision and color normalization techniques. The method’s accuracy was verified by comparing its results with measurements from Raman spectroscopy. It reliably calculates thicknesses with a single compressed jpg image, making it drastically faster and cheaper than traditional methods. The algorithm can be applied to any 2D material stack combination and adapt to any microscope setup, regardless of camera type and light color temperature. Furthermore, while the Raman spectrometer uses a laser to measure a single point’s thickness, the new method provides insight into the topography of the entire material surface. All these advancements pave the way for industrial-scale production of 2D materials.


Introduction
Imagine a future where your phone lasts a whole week on a single 10-minute charge, and your tablet rolls up like a newspaper. Recently, researchers have proved that these technologies are possible with atomically thin 2D materials. For example, researchers at Samsung have recently developed such a battery using graphene. Graphene has the highest conductivity of any known material. However, due to the nanoscale-thicknesses of 2D materials, even slight changes in these values can completely change their properties. For example, bilayer graphene is only ~0.35nm thicker than monolayer graphene, yet it is used for entirely different purposes since monolayer graphene's electron mobility is more than 10 times greater than that of bilayer graphene. Traditionally, the thickness (atomic layer count) of 2D materials is measured by Raman spectroscopy or atomic force microscopy (AFM). These methods only provide data on a small region while being laborious and time-consuming. Since there is no scalable thickness identification method, futuristic technologies made possible by 2D materials cannot come to the mass market. This paper presents a cheaper, more efficient method using microscope images to identify thickness, accelerating 2D material research and opening possibilities for industrial production.
The algorithm consists of three main parts. In Part I, the optics transfer-matrix method and colorimetry conversions are used to calculate RGB values for different 2D material stack combinations. In Part II, a separate computer vision process segments images to separate 2D samples from the substrate. Since traditional segmentation methods such as the Canny edge detector fail to work under the low contrast ratios presented by 2D materials, Part II develops a novel computer vision process to overcomes these issues. Part III brings the first two parts together to determine the thickness. It overcomes the challenge of inconsistent lighting and camera settings through a novel color normalization technique.
The accuracy of the algorithm was verified through a comparison process with the traditional Raman method. 2D material samples were micro-mechanically exfoliated in the lab using the Nobel Prize-winning "Scotch tape method" [10]. The thickness is measured by both the algorithm and the Raman spectrometer to create an accuracy benchmark.

Part I -Color Derivation of the 2D Material Stack
The color derivation algorithms calculate the sRGB' value given any defined stack of 2D materials by deriving a spectral curve from the transfer-matrix method for thin-films, then converting the spectral curve into the universal sRGB' color space. The calculated sRGB' values of 2D material stacks are later compared with sRGB' values from optical images to determine thickness. In addition, the substrate color is computed to provide a reference for color normalization in Part III.

Transfer-Matrix Method for Multilayer Systems
The transfer-matrix method is a mathematical model to analyze the propagation of electromagnetic waves in a multilayer structure, such as those in 2D materials or other thin films.
The structure consists of a stack of material layers, each with a thickness and refractive indices . Each layer is separated by interference planes. In this paper, the transfer-matrix method is used to produce the spectral curve (λ vs. reflectance) for stacks of 2D materials. The structure is regarded as an optical system with one input and one output.  The transfer matrix Τ for wave propagation through an interface between layers and can be calculated by: where and are the Fresnel coefficients describing reflection and transmission between mediums for TM-polarization. They are given by:  The transfer matrix Τ for wave propagation through layer is given by: where the phase change, Φ can be calculated by: where is the thickness of layer .
Finally, the reflectance is calculated with the final transfer matrix: The function of reflectance over 290-830nm light (approx. visible light range) creates a spectral curve (see Fig. 3 and Fig. 4) that determines the color of a material stack.

CIE XYZ Colorspace
To compare the spectral curves produced in section 2.1 with the colors captured in images, they must be translated into a digital representation. In this paper, it takes the form of a conversion to   The CIE XYZ color space encompasses all color sensations of an average human being.
Therefore, it is the standard device-invariant representation of color.
Tristimulus XYZ values are analogous to the human eye's LMS cone responses (see Fig. 5). Y is the luminance, Z is the s-cone response and is somewhat equal to blue, and the X value is a mix of cone response curves chosen to be non-negative for computational simplification.
Color-matching functions for XYZ (see Fig. 6) are the spectral sensitivity curves for X, Y, and Z.
The color-matching functions (CIE 1931 standard curves) are fitted using the Levenberg-Marquardt algorithm (non-linear least squares) [6]:  where ( ) is the spectral power distribution and ̅ ( ), ̅( ), ̅ ( ) are the CIE 1931 XYZ colormatching functions. This mathematically derives the device-independent color values from the spectral curve of the stack.

Device-Invariant XYZ to Device-Dependent sRGB'
The device-independent XYZ Tristimulus values are converted into device-dependent sRGB' to match the camera's color space. Through this conversion process, a spectral curve, such as the one shown in Fig. 3, is given an sRGB' value based on the reflectance at each wavelength (see Fig. 6 and Fig. 7).  Through Part I, the sRGB' value of any substrate or 2D material stack configuration is calculated.

Part II -Image Segmentation
For full automation of the thickness identification process, algorithms are applied to differentiate the 2D material sample from the substrate. This segmentation process is difficult because of the low contrast ratio between atom-thick 2D materials and the substrate. Furthermore, the images are compressed and noisy, so edge detectors such as the Canny method fail to work consistently.
Instead, Part II develops a novel process employing Otsu's method.

Gamma Expansion of Non-linear sRGB
Before any other calculations or adjustments to the image, its color space should be linearized.
Digital images are represented in the gamma-compressed (non-linear) sRGB color space.
Humans perceive light differently than cameras do. When twice the number of photons hit the camera sensor, cameras receive twice the signal; however, it is only a fraction brighter to the human eye. The human eye is much more sensitive to changes in dark tones than changes in lighter tones since it allows vision to operate over a broader range of luminance. (Fig. 8) Fig. 8: Human Eye vs Camera Luminance Sensitivity [7] By applying gamma correction, the usage of bits is optimized, and images match the non-linear perception of human eyes. (Fig. 9) Linearizing sRGB values greatly simplifies computer vision processes such as color normalization; scalars and transformation matrices can be directly multiplied onto linear values.
The non-linear sRGB values from the JPEG camera images are normalized to linear sRGB' using the following transformation:  12 5 ℎ where is , , or . (Fig. 10 shows linearization applied to an optical microscopy image of graphene used in this paper.)

De-vignetting
After the linearization of the image, vignetting towards the corners is apparent. This is caused by the optics of microscope lenses and the radial light source on the microscope. It is critical to The Gaussian kernel can be generated with: where is the column of a pixel, is the row of a pixel, and ≈ 2 .
The Gaussian kernel is then overlayed to produce the corrected image ( Fig. 12):

Conversion to Grayscale
At this state, pre-processing is finished, so the image is ready for color normalization and computer vision calculations. Otsu's thresholding method is used to separate the 2D sample from the substrate. The method is binary, so it assigns each pixel a white or black value to separate the sample from the substrate. Thus, the three RGB color channels are converted into one luminance-preserving grayscale value to simplify the binarization process. This is given by:

Noise Reduction
After converting the image to grayscale, any noise on the image needs to be cleaned up. Often, specks of noise can be perceived as pieces of material, causing errors in thresholding. The simplest way to remove image grain would be by averaging pixel values over a kernel (mean blur). However, a mean blur would soften edges, causing problems when thresholding samples.
Instead, this paper employs a Gaussian blur so that each pixel is assigned the weighted average value of the pixels around it. Thus, noise is eliminated while preserving edges. The Gaussian kernel is created using a technique similar to the one used in de-vignetting (3.2), but the scale of the distribution is much smaller: The Gaussian kernel produced is then applied via kernel convolution:

Otsu's Method for Image Binarization
Typically, arbitrary values are chosen to perform thresholding, but by applying Otsu's method [8], the threshold value can be determined automatically by minimizing the weighted intraclass variance in a bimodal image, which is defined by: where the class probabilities 1 ( ) and 2 ( ) are: and the variance 1 2 ( ) and 2 2 ( ) is: given that represent the bins of the image histogram (see Fig. 16). The threshold can be found by iterating through each possible value to find the minimum.
However, to increase the efficiency of the algorithm through a far faster recursive method, the minimizing of intra-class variance is computed by maximizing inter-class variance, which is given by: where the class means 1 ( ) and 2 ( ) are given by: After finding , a thresholded version of the image is created by assigning each pixel a black or white value through a simple inequality:

Morphological Operations
After applying Otsu's binarization, small traces of noise and holes may affect certain parts of the image. Thus, the morphological operation of opening is performed on the substrate.
Morphological opening consists of an erosion to fill in any white spots in the image, followed by dilation to remove noise and excess pixels created by erosion. This is performed with a simple structuring element , which is a 9x9 ellipse. The erosion is given by: ⊖ ≡ { ∈ ℤ 2 | ( + ) ∈ , for every ∈ } So, the new binary image resulting from opening is simplified to: This intricate procedure creates a clean separation between the substrate and the sample, even with low-quality images.

Contour Tracing
This paper uses a method based on Suzuki's Contour Tracing Method [9] to segment and find RGB values needed for the color normalization technique. The tracing method efficiently draws the boundaries of the substrate and the sample.
Contours drawn from the binary image using Suzuki's method are applied onto a mask, which is overlayed to the original de-vignetted image from 3.2 to partition the image regions:

Part III -Color Normalization and Thickness Identification
To identify thickness, colors calculated in Part I is compared with the sample's color in the image. However, the image's colors are inaccurate due to factors such as the white balance of the camera or the color temperature of the microscope's light. This paper develops a novel color normalization technique to correct the image and solve this problem.

Color Normalization
Since conditions such as bulb brightness and temperature, camera settings, and microscope setup change image colors, the image is normalized by applying the following transformation:

Measuring Thickness
2D material thickness is discrete since it is based on the atomic layer count. The thickness can be determined by minimizing the RGB difference between the normalized image RGB value (Fig.   23b) and the theoretical RGB values derived for each thickness in Part I (Fig. 23a). RGB difference is defined by:

Algorithm Accuracy Verification with Raman
To verify the accuracy of the algorithm, results are compared with the traditionally used Raman method. Samples of 2D materials were micro-mechanically exfoliated onto silicon wafers with the "Scotch tape method." After finding suitable samples with an optical microscope, images were captured at varying illuminant parameters. The same samples were also scanned with a Raman spectrometer to compare the thickness measurement.
A sample's thickness can be determined with Raman spectroscopy by analyzing the ratio between the intensities of the 2D (around 2700 cm -1 ) and G peak (around 1580 cm -1 ) in the Raman spectra (Fig. 24). For example, in one of the samples tested, the 2D peak intensity was ~150, and the G peak had an intensity of ~70. This verified the sample to be monolayer graphene (~0.35nm thick) since the ratio of the intensities for the 2D peak to the G peak was approximately two: The algorithm's results were consistent with Raman spectroscopy for all samples tested. The algorithm developed matches the accuracy of Raman spectroscopy while producing results much faster and more cost-effectively. By only requiring compressed jpg optical images, the algorithm provides an automatable and scalable method that eliminates the need for expensive equipment.

Conclusion
The fully automated 2D material thickness identification algorithm developed in this paper is scalable to large quantities. Compared to previous attempts, this algorithm is much more flexible and extendable. The method requires no prior calibration or setup, so it can be rapidly implemented on any microscope setup and any 2D material stack combination. And by using a novel computer vision process, the algorithm can segment images despite the low contrast ratios between the 2D material and the substrate. Furthermore, the algorithm gives insight into the sample's entire surface instead of the single point measured by a Raman's laser. Combined with its speed and low cost, the algorithm opens possibilities for the mass production of 2D materials.