Machine Learning Models for a Novel Optical Memory Approach Authors: Tal Raviv, Zeev Kalyuzhner, Zeev Zalevsky Published: 2024 ABSTRACT In recent years, there has been growing interest in optical data processing, driven by the demand for high-speed and high-bandwidth data handling in data centers. One of the key milestones for enabling effective all-optical data processing systems is the development of efficient optical memory. Previously, we introduced a novel approach for establishing nonvolatile optical memory, based on the classification of scattering fields generated by gold nanoparticles. In this ongoing research, we apply advanced machine learning techniques to enhance the performance of the proposed nonvolatile memory element. By utilizing Random Forest and t-SNE algorithms, we successfully classified and analyzed the scattered images obtained from the optical memory device. The classification model presented in this study achieved an accuracy and average F1-score of 0.81 across nine distinct classes. Introduction Over the years, numerous optical memory technologies have been developed.1 These technologies encompass optical RAM, including optical delay lines,2 slow-light optical buffers,3 all-optical flip-flops (AOFF),4 and coupled microring lasers.5,6 Implementations also frequently utilize semiconductor and InP photonic crystal lasers, as well as nanocavity technologies.7−10 Nonvolatile optical memories leverage phase-change materials due to their ability to transition between amorphous and crystalline states. This phase change can be induced through various mechanisms, including microring resonators, plasmonic nanogaps, and pulse-width modulation.11−15 Our method for an optical nonvolatile memory element is extensively detailed in our previous publication.16 It revolves around classifying the scattering patterns emitted by gold nanoparticles. Under far-field conditions, distinct scattering images were acquired due to spatial variations in the patterns of the gold nanoparticles. Utilizing these scattering images, we introduce a classification model that enables easy retrieval of stored data from each memory cell. Our optical memory approach demonstrated a 1.5-fold enhancement compared with electronic ROM technologies, based on the PBD (power bit density) criteria outlined in the paper. Figure 1 shows a postfabrication image that illustrates the particle configuration within each memory cell, along with the corresponding memory cell numbers. Understanding the particle configuration is essential for evaluating the classification performance. Top view of the memory element configuration. Postfabrication image showing the memory cells and their corresponding cell numbers. Reprinted in part with permission from ref (16). Copyright 2023 ACS Publications. In the previous paper, the classical classification approach relied on calculating a 2D correlation factor between the real-time scattering image and a reference image, which somewhat limited the efficiency of the method. To improve the effectiveness of the classification task, an advanced machine learning approach can be employed. In this article, we employ machine learning algorithms to classify and analyze the scattering patterns generated by gold nanoparticles (NPs) used in the creation of an optical memory device. To the best of our knowledge, this is the first application of such techniques for developing an optical memory device. For this study, we utilized t-SNE and Random Forest—two widely used algorithms in data visualization and classification tasks. t-distributed stochastic neighbor embedding (t-SNE) is a nonlinear dimensionality reduction algorithm introduced in 2008.17 It aids in understanding high-dimensional data by projecting it into lower-dimensional spaces, such as 2D or 3D. Random Forest, on the other hand, is an ensemble learning algorithm introduced in 2001.18 It works by combining multiple decision trees to generate a single output. Our optical memory approach comprises several key steps, detailed throughout this paper. First, a reliable data set for training and testing the classification model must be created. This process is discussed extensively in our previous publication16 and is briefly revisited here. Second, the selection of the machine learning model and its parameters requires careful consideration. While achieving optimal classification performance is essential, it is equally important to minimize the risk of overfitting. Finally, the classification performance must be robust enough to statistically distinguish between memory cells with similar particle configurations, such as cells 1, 2, and 3. Methods The memory element, illustrated in Figure 1, was replicated multiple times across the sample, with minor adjustments made to the exposure times of the photoresist. The nanoparticle radius was consistently maintained at 100 nm, with a tolerance of ±5 nm across all memory elements. Scattering measurements were conducted in two phases. Initially, an imaging system was used to determine the sample orientation, ensuring correct labeling of the illuminated memory cell. Subsequently, scattering measurements were carried out in the far-field regime using a green laser with a wavelength of 532 nm. To generate data for training and testing, three experiments were conducted. Each experiment involved scattering measurements of nine memory cells, each with a unique particle configuration, from three different memory elements. Additionally, a background measurement was taken for each set to eliminate scattering in the background. During the measurement process, nanoscale movements in the X–Y directions were performed. In the first experiment, we collected 225 scattering images from nine memory cells, capturing 25 scattering patterns for each particle configuration. In the second and third experiments, 122 scattering images were taken for each particle configuration, resulting in a total of 1089 samples for each experiment. For data analysis and classification, we employed two common algorithms: t-SNE for data analysis and visualization and Random Forest for the classification task. The t-SNE algorithm served three purposes. First, it provided a visualization tool to qualitatively examine the classification into the nine cells. Second, by projecting the data into a 2D space, it enabled us to select the data set for training and testing. Lastly, since the data sets were obtained from different memory elements with varying exposure times, projecting the data into 2D space allowed us to assess the effect of fabrication tolerance on the scattering patterns and consequently on the classification error. The Random Forest algorithm was employed to classify the data set into nine categories, each representing different data stored in the memory element. Random Forest is an ensemble algorithm that utilizes the Bagging technique, which is effective when dealing with models that are prone to overfitting. A comprehensive explanation of the key steps in the architecture of the Random Forest model is provided below:1.Bootstrapping: The algorithm initiates by randomly selecting subsets of data points and features. These subsets are formed with replacement, ensuring that the size of the data remains consistent with the entire data set.2.Training predictors: Multiple decision trees are constructed and trained, each tree is trained on a different subset of data points and features. This step involves creating several decision trees, each tailored to a distinct subset of the data.3.Decision tree prediction: Each decision tree within the Random Forest generates an output based on the input data.4.Aggregation: The final output of the Random Forest is determined through aggregation. Typically, this involves employing majority voting, where the prediction that receives the highest number of votes from the individual decision trees is considered the final output. 1.Bootstrapping: The algorithm initiates by randomly selecting subsets of data points and features. These subsets are formed with replacement, ensuring that the size of the data remains consistent with the entire data set. Bootstrapping: The algorithm initiates by randomly selecting subsets of data points and features. These subsets are formed with replacement, ensuring that the size of the data remains consistent with the entire data set. 2.Training predictors: Multiple decision trees are constructed and trained, each tree is trained on a different subset of data points and features. This step involves creating several decision trees, each tailored to a distinct subset of the data. Training predictors: Multiple decision trees are constructed and trained, each tree is trained on a different subset of data points and features. This step involves creating several decision trees, each tailored to a distinct subset of the data. 3.Decision tree prediction: Each decision tree within the Random Forest generates an output based on the input data. Decision tree prediction: Each decision tree within the Random Forest generates an output based on the input data. 4.Aggregation: The final output of the Random Forest is determined through aggregation. Typically, this involves employing majority voting, where the prediction that receives the highest number of votes from the individual decision trees is considered the final output. Aggregation: The final output of the Random Forest is determined through aggregation. Typically, this involves employing majority voting, where the prediction that receives the highest number of votes from the individual decision trees is considered the final output. For evaluating the classification performance, we utilized four statistical metrics:19 Accuracy, Precision, Recall, and F1-score. These metrics can be calculated using eqs 2–5, where TP (true positive), TN (true negative), FP (false positive), and FN (false negative) are defined in eq 1:12345Here TP, TN, FP, and FN are defined for a binary classifier but can be easily generalized. In eq 1, f(condition) is an indicator function that returns 1 if the condition is true and 0 otherwise. Additionally, ŷi represents the predicted output of the ith instance, and yi represents the actual output of the ith instance. In a classification task, achieving a precision score of 1.0 for class C indicates that all items predicted as belonging to class C do indeed belong to class C. However, this does not provide information about the number of items from class C that were not predicted correctly. Likewise, a recall of 1.0 means that every item from class C was predicted as belonging to class C, but it does not indicate how many items from other classes were incorrectly predicted as belonging to class C. This illustrates the necessity for another performance parameter that balances both metrics. The F1-score indeed serves as an example of such a predictive performance parameter derived from precision and recall. It represents the harmonic mean of precision and recall, offering a balanced assessment of these two metrics. Results and Discussion Figure 2 shows the scattering images after preprocessing, which were used for training and testing the model. In each scattering image, the class label (memory cell) is displayed below the image. The corresponding nanoparticle configuration for each class is shown in Figure 1 above. Scattering images after preprocessing. After completing the data collection task, we proceeded to the data analysis and classification phases. Initially, we will use the t-SNE algorithm to visualize all of the measured data, aiming to assess the separation between memory cells originating in three different memory elements. As illustrated in Figure 3, while the data are clearly separable, some classes are projected into two distinct groups. This observation suggests that we can employ a classifier based on decision tree architecture. However, the projection of the data into more than one group for some classes may indicate one of the following phenomena: either fabrication tolerance strongly influences the scattering pattern, or the optical measurements are inconsistent. t-SNE projection of all data sets. To delve deeper into this matter, we will employ the t-SNE projection algorithm on data sets 2 and 3, which were measured during experiments 2 and 3, respectively. These data sets were acquired consecutively using identical optical setups but on two different memory elements with varying exposure times, which may have affected the size of the gold nanoparticles. Figure 4 presents the t-SNE results for data sets 2 and 3. Results of the t-SNE algorithm for data sets 2 and 3. Figure 4 illustrates the projection of the scattering data into more than one group for each class. Based on these findings and the identical optical setup used in both measurement phases, we can infer that fabrication tolerances influenced the interference pattern obtained from the memory element. Consequently, when designing a classifier based on decision tree architecture, we must exclude two data sets and utilize only one for training and testing the model. Data set number 2 was selected for classifier training and testing. Data set number 1 is notably smaller than the other two, and although data set 3 exhibits similar classification results, it is not presented in this paper. Figure 5 displays the 2D mapping of data set 2 exclusively. In this figure, a clear distinction between the classes is evident, facilitating effective utilization as input to the machine learning model. 2D mapping of scattering images from data set 2. As previously mentioned, we will employ a Random Forest architecture for classification, utilizing scattering images from data set 2 as input. There are several key parameters which deserve attention. Initially, we activated the ‘bootstrap’ option, which entails generating subsets of the data. Subsequently, we opted for ‘gini’ as the criterion to evaluate the split quality in the tree. Additionally, we constrained the maximum depth of the tree to 5. Given that not all features are assessed for each tree in the Random Forest algorithm, we utilized the ‘max_features’ parameter and designated it as ‘sqrt’. Lastly, we employed the ‘n_estimators’ parameter to establish the forest’s tree count at 10. The tables presented below summarize the model’s performance, calculated using eqs 1–5. First, a table including statistical metrics, precision, recall, and F1-score is presented. Then, a confusion matrix is displayed, where each entry i, j denotes the number of observations in class i but predicted to be in class j. Additionally, the total number of observations for each class is shown alongside the confusion matrix. The model achieves an accuracy score of 0.81. Average precision and recall values of 0.86 and 0.83, respectively, are reported. Furthermore, the average F1-score is found to be 0.81. The results presented in Table 1 reveal that classes 5 and 8 demonstrate poor recall results but good precision. Furthermore, cell number 3 exhibits a relatively low precision value but a good recall value. These observations are further confirmed by the confusion matrix (Table 2), which clearly depicts the predictions for each class. It is important to note that in our study, we cannot definitively determine whether precision or recall is more crucial. Therefore, the F1-score parameter, representing the harmonic mean of precision and recall, holds greater significance in our context. By focusing solely on this metric, we observe an average value of 0.81 and a median value of 0.88, indicating strong classification performance across all memory cells. Table 1Random Forest Model Performance precisionrecallF1-scoretotal samplescell 10.940.970.9530cell 20.791.000.8823cell 30.550.840.6719cell 40.930.960.9426cell 51.000.350.5223cell 60.930.930.9329cell 70.731.000.8522cell 81.000.440.6227cell 90.831.000.9019accuracy 0.83218average0.860.830.81218 Random Forest Model Performance Table 2Confusion Matrix cell 1cell 2cell 3cell 4cell 5cell 6cell 7cell 8cell 9totalcell 1290010000030cell 2023000000023cell 3021600100019cell 4010250000026cell 502518150123cell 6000002700229cell 7000000220022cell 8218000312127cell 9000000001919 Confusion Matrix Conclusions In summary, this article introduces our approach to utilizing advanced machine learning techniques for classifying and analyzing readout data from scattering-based optical memory elements, as detailed in our prior publication. As an initial step, we employed the t-SNE model to project the high-dimensional data set into a 2D space. This algorithm facilitated gaining insights into the data sets and comprehending their structure. Furthermore, the data projection into 2D space enabled us to assess the sensitivity of our approach to tolerances in the fabrication process. Subsequently, we utilized the Random Forest model for data classification. Following model fitting, we assessed our model’s performance using statistical metrics. Accuracy, precision, recall, and F1-score are crucial metrics for evaluating machine learning classification models, all of which were employed in this study. The computed statistical metrics allowed us to quantitatively examine the classification error and the reliability of the model. The results from the machine learning classification model demonstrate strong performance across all memory cells. We calculated an accuracy and average F1-score of 0.81, as well as a median F1-score of 0.88. Through the application of the t-SNE projection algorithm, we observed the effect of fabrication tolerances on the scattering pattern. The projection of data sets 2 and 3 reveals that each memory cell has been projected into more than one group. Thus, fabrication tolerances significantly influence the scattering pattern, highlighting the necessity for a precise fabrication process to optimize memory device performance. The optical memory approach outlined in these two papers lays a groundwork for future research in the realm of optical RAM devices. Through the utilization of precise fabrication processes and advanced techniques, it becomes feasible to manipulate the spatial configurations of the gold nanoparticles. In this paper, we showcased promising classification performance by applying the Random Forest architecture to these scattering patterns, suggesting potential applicability for future optical RAM devices as well.