Monitoring Energy Consumption for Cyberattack Detection in Additive Manufacturing Systems

preprint OA: closed
Full text JSON View at publisher

Abstract

Abstract Additive manufacturing (AM) combined with the innovation of the Internet of Things (IoT) has made manufacturing faster and more convenient than ever. However, increased connectivity has exposed systems to potential security breaches. To address this vulnerability, this study presents a novel methodology to monitor AM systems using a side-channel monitoring framework based on a power meter. The power meter measures the energy consumption of every G/M-code command. Concurrently, a machine learning (ML) model is trained to predict energy consumption for each G/M-code command in the absence of cyberattacks. Consequently, when attacks occur in the system, the energy consumption prediction errors increase, indicating the presence of malicious activity. Our method is validated with three different print models to ensure robustness and generalizability. For all models, the prediction error increased by a factor of seven during attacks that altered the operating temperatures by 1 or 2 degrees. The results demonstrate the effectiveness of the proposed method in detecting attacks and anomalies in a timely manner.
Full text 127,191 characters · extracted from preprint-html · click to expand
Monitoring Energy Consumption for Cyberattack Detection in Additive Manufacturing Systems | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Research Article Monitoring Energy Consumption for Cyberattack Detection in Additive Manufacturing Systems Xuan-Phat Truong, Haemin Jeon, Yi Wang, Seong Hyeon Hong This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-6346058/v1 This work is licensed under a CC BY 4.0 License Status: Published Journal Publication published 26 Sep, 2025 Read the published version in The International Journal of Advanced Manufacturing Technology → Version 1 posted 5 You are reading this latest preprint version Abstract Additive manufacturing (AM) combined with the innovation of the Internet of Things (IoT) has made manufacturing faster and more convenient than ever. However, increased connectivity has exposed systems to potential security breaches. To address this vulnerability, this study presents a novel methodology to monitor AM systems using a side-channel monitoring framework based on a power meter. The power meter measures the energy consumption of every G/M-code command. Concurrently, a machine learning (ML) model is trained to predict energy consumption for each G/M-code command in the absence of cyberattacks. Consequently, when attacks occur in the system, the energy consumption prediction errors increase, indicating the presence of malicious activity. Our method is validated with three different print models to ensure robustness and generalizability. For all models, the prediction error increased by a factor of seven during attacks that altered the operating temperatures by 1 or 2 degrees. The results demonstrate the effectiveness of the proposed method in detecting attacks and anomalies in a timely manner. additive manufacturing side channel monitoring cyber physical system neural network attack detection Figures Figure 1 Figure 2 Figure 3 Figure 4 Figure 5 Figure 6 Figure 7 Figure 8 Figure 9 Figure 10 1. Introduction The rapid development of additive manufacturing (AM), commonly known as 3D printing, has made a significant impact on industries by enabling instant prototyping, customization, and on-demand production of complex parts. From aerospace [ 1 ] to healthcare [ 2 ], AM's ability to produce complex geometries with a variety of materials has not only supported manufacturing capabilities but also empowered innovation and efficiency. However, this transformative technology has also revealed a unique set of vulnerabilities, particularly to cyber-physical attacks, that pose significant risks to the security of the manufacturing process. A cyber-physical attack is defined as an action that sabotages both digital and physical systems, utilizing the connection between components within their network. Such attacks aim to compromise intellectual property, interrupt processes or production chains, destroy products and facilities, and even threaten human health and safety. Several high-profile incidents that highlight the damage caused by cyber-physical attacks include the German Steel Mill cyber-attack [ 3 ], the Maroochy water services incident [ 4 ], and the Stuxnet malware [ 5 ]. Particularly in AM, cyber-physical attacks refer to malicious activities that exploit remote connections to physical systems, aiming to compromise the quality, functionality, or safety of printed parts. These attacks can be executed through various routes, including: (1) modifying computer-aided design (CAD) models, often in the stereolithography (STL) file format; (2) altering machine command lines, i.e., G/M-code; and (3) changing machine parameters and planned tool paths through machine firmware [ 6 ]. For instance, FLAW3D, a trojan-based cyberattack, can manipulate G-code to reduce filament extrusion and shift material deposition [ 7 ]. Additionally, man-in-the-middle (MitM) attacks can infiltrate communication protocols to swap 3D models of printed parts and alter infill materials [ 8 ]. These aforementioned interventions can have severe consequences, including product failures, financial losses, and even threats to human life in critical sectors such as aerospace, automotive, and medical devices. It is important to note that the present study focuses only on cyber-physical attacks that directly sabotage the printing process or printed objects. Other forms of cyberattacks that do not impact the outputs of AM systems are not considered in this research. To prevent malicious attacks, various research groups have been exploring a range of strategies and technologies to safeguard AM systems. These include the development of robust encryption methods, the establishment of secure communication protocols, and the construction of real-time advanced monitoring systems [ 9 ]. Shi et al. used a blockchain-based approach to safeguard the tool path file from unauthorized access. Along with an asymmetric encryption technique, the authors were able to prevent two kinds of cyber-physical attacks: design modifications and intellectual theft [ 10 ]. Saraeian et al. proposed a behavior control component using event logs. They developed a unique detection method based on process mining and game theory techniques [ 11 ]. Even though these methods are effective, they are limited to the attacks without access to the main hub. In other words, attacks that modify the logs and/or sensor values can be dodged since the information acquired from the main communication channel is no longer reliable. Consequently, a side-channel monitoring system is an ideal option to prevent such attacks. A side-channel refers to an indirect pathway of data stream for a protocol, or communication service that is not a part of the main network of the system. Nonetheless, side channel monitoring systems can still provide insightful information regarding internal states, health, and other statuses of the system. Furthermore, a side-channel monitoring system can be retrofitted into most AM systems while being non-invasive and low-cost. The advantages of using sensors as a side-channel include isolation from the main channel/network, and yet still able to provide information to predict the health status of the system. Straub proposed an imaging-based methodology to prevent changes of printing orientation [ 12 ]. Nonetheless, the vision-based approach has limitations due to the camera’s field of view and angle on complex objects. Chhetri et al. introduced the Kinetic Cyber-attack Detection (KCAD) method, which identifies cyberattacks in AM systems using acoustic analog emissions [ 13 ]. Here, they built a regression model to convert acoustic signals into control parameters and compared them with the actual control parameters defined by G-code commands. Any changes in G-code commands reflect changes in acoustic signals, thus increasing the control parameter prediction error. Nonetheless, their approach was limited to attacks that modify the path of nozzle in horizontal directions. Belikovetsky et al. also presented a side-channel monitoring method using acoustic sensors [ 14 ]. They generated digital audio fingerprints from smartphone recordings for attack-free cases, then compared them with online fingerprints to detect malicious activities. Unfortunately, this method is not generalizable, and thus fingerprints must be generated for each print model. Moreover, it fails to detect temperature changes or extrusion alterations. To embrace a greater variety of cyber-physical attacks and enhance detection accuracy, energy/power meters were deployed. Hong et al. used energy consumption data to detect anomalies in robot manipulators mimicking the AM production line [ 15 ]. Since processing data needs power, the correlation between power usage and system activities can help detect any suspicious activity [ 16 ]. Although this study was not designed for AM systems, it demonstrated that a side-channel approach using power meters to monitor and detect anomalies provides a robust, real-time, and cost-effective means of enhancing security in additive manufacturing. It supports existing security measures by adding a layer of physical parameter monitoring, making it harder for cyber-physical attacks to go undetected. Gatlin et al. developed a method to compare power signatures to detect cyberattacks designed for G-code alterations with 100% precision, except for G1 and G0 swap intrusions [ 17 ]. They extended their work to reconstruct the printed parts solely by observing the power measurements of stepper motors in Fused Deposition Modeling (FDM) 3D printers [ 18 ]. Their approach clearly showed that the information collected from the 3D printer by power meters is richer than that from acoustic sensors. However, their approach cannot be applied to unknown print models since a nominal power signature must be generated beforehand. Furthermore, they did not consider attacks that do not modify the tool paths. Inspired by the KCAD framework and the salient capabilities of energy meters, we propose a secure and effective attack/anomaly detection approach. The primary component of the current methodology involves designing and implementing a detection system that utilizes power meters to measure and analyze energy consumption patterns, identifying anomalies potentially caused by malicious activities applied to the system. A data collection process is introduced, which captures both G/M-code commands and energy consumption for each command line, aiming to enrich the quality of data by relating machine operations to their corresponding energy consumption. Unlike many existing methods that measure and estimate the total energy consumption of each printed output, this approach predicts the energy consumption for each G/M-code command line, enabling more time-sensitive detection and analysis. Moreover, by predicting the energy consumption for each command line, the method can easily be generalized to various printing parts, without the need to measure and collect data beforehand. Our proposed work differs from [ 17 ] and [ 18 ] in that the energy consumption of the entire AM system is measured instead of individual actuators. Additionally, we bypass the power consumption signature generation step by integrating a machine learning (ML) model to directly predict power consumption, replacing the signature database with a simple model to detect attacks. The proposed methodology can potentially offer real-time monitoring capabilities as well as timely intervention, even for printing jobs that have not been pre-trained. This also simplifies the data collection process, since data collected during abnormal operations are no longer needed for training. The ML technique deployed in this work predicts energy consumption instead of directly detecting attacks by classification. ML and artificial intelligence (AI) techniques are increasingly being integrated into cyber-physical attack (or anomaly, which may or may not be caused by a cyber-physical attack) detection systems, showing great promise in predicting potential cyber-physical threats by analyzing vast amounts of data for suspicious patterns. Shi et al. adopted an autoencoder to detect attacks by extracting vibration features using sensors [ 19 ]. The study was conducted using both supervised and unsupervised learning for attack detection. Scime et al. introduced ML approaches to detect anomalies by observing printed parts using images [ 20 ]. Yu et al. benchmarked multiple ML-based anomaly detection algorithms for AM and showed that the neural network (NN) approach achieved the best performance [ 21 ]. Tan et al. implemented an encoder-decoder architecture to detect anomalies in an unsupervised fashion [ 22 ]. By using images of printed products and simulated images, Wu et al. developed an ML approach to detect anomalies in AM systems and achieved 96.1% accuracy [ 23 ]. As these studies were carried out, the use of ML approaches was emphasized as effective, convenient, and highly reliable. The contribution of the current study is summarized in threefold: (1) A framework to map energy consumption of the AM system with G/M-code command lines using an NN model is developed, which can be applied to other AM systems; (2) A side-channel monitoring system is proposed and verified to detect cyberattacks that change system parameters; and (3) Collected data used in this work are shared in the public domain ( https://github.com/fit-ipcl/CPS_C2EN_data ) to further support the AM community. The remainder of the paper is organized as follows. Section 2 elucidates the side-channel monitoring system and the ML model for predicting energy consumption. In Section 3, the experimental setup to implement and validate the side-channel monitoring system for cyberattack detection is explained in detail. Section 4 presents and discusses the prediction and detection results, followed by the conclusion in Section 5. 2. Methodology 2.1. Side channel monitoring system As depicted in Fig. 1 , a typical AM process begins with a desired CAD model, usually in the form of an STL file. The model is then transferred to secondary software for slicing. “Slicing” in AM refers to a computational action that turns 3D design into 2D geometric layers, resulting in corresponding G/M-code commands. At this stage, key parameters such as layer height, printing temperature, printing speed, and infill percentage are defined to determine the quality of the printed parts. These parameters significantly affect the contents of the G/M-code commands and consequently the actual printing process. The main computing device feeds the 3D printer with G/M-code commands line by line and receives a process signal from the printer indicating the successful completion of each command. Since the entire printing process can be conducted remotely in smart manufacturing with limited human supervision, the system faces significant risks of cyberattacks. An infiltrator can modify the CAD model, printing parameters through machine firmware, or G/M-code command lines generated by the slicer to cause product defects, operation errors, system destruction, and/or resource waste. Another loophole exists between the main computer and the 3D printer, where both the commands and the progress logs can be altered. The side channel monitoring system demonstrated in Fig. 1 is proposed to prevent such cyberattacks. The same slicer software is utilized to generate the same set of G/M-code commands. Then, the interpreter transforms the commands into numerical arrays to train the ML model. The details of the interpreter are elucidated in Section 2.2 . The essential piece of the current side channel monitoring approach is the ML model, which predicts the energy consumption of the 3D printer for each input command. In other words, the ML model is trained to map the relationship between the G/M-code commands, expressed as numerical arrays by the interpreter, and the energy consumption of commands measured by the power meter. For each command line, the predicted energy consumption is compared with the actual energy consumption measured in real-time, and an anomaly is flagged when a significant deviation is detected between the two. Any changes made by cyberattacks cause a difference in energy consumption, since the modifications will alter motor movements and system parameters. It is worth mentioning that we are not comparing the extracted command lines from the side channel with the actual command lines applied to the system to detect possible attacks because we assume that attackers hide their changes to evade detection. The main purpose of the research is to secure the AM process and enable rapid detection of cyberattacks using the side channel monitoring system. To achieve this, the monitoring system must remain isolated from the main AM system. The original CAD model is transferred to both the AM and side channel monitoring systems directly, ensuring a highly secure transmission to the side channel. The CAD model can still be modified within the AM system, but the CAD model received by the side channel is protected. The second data stream comes from the energy meter, which is connected to the main power source of the 3D printer, providing a secure and isolated data stream. The third data stream comes from the 3D printer, delivering information about command execution status and current system temperatures. Since this data is delivered directly from the 3D printer, it cannot be tampered with. 2.2. Data Interpreter As for the proof of concept, we implemented the side channel monitoring system on a fused deposition modeling (FDM) 3D printer. In most FDM processes, the print job procedure is determined as follows: (1) print bed heating, (2) nozzle heating, (3) homing, (4) nozzle cleaning, (5) model printing, and (6) finishing. Steps 1 through 4 are preparatory steps and do not constitute a large portion of the total printing time. However, these steps are crucial for the final product, as all the axes and thermal-related tools are properly prepared. The first two steps do not have an estimated completion time because the time required to reach the nozzle and print bed target temperatures depends on the current temperature. Homing, which is the action of moving all actuators back to their initial positions, also cannot be estimated, as the nozzle may end up at a different location after each print. Furthermore, Step 6 is primarily for cooling the system, which is irrelevant to the actual printing process. Therefore, the data we need to acquire are during Step 5, where the majority of valuable information is generated. To model the relationship between the command (input) and the energy consumption (output), the data set must be expressed numerically. Therefore, G/M-code commands must be converted to an array of numerical values using the data interpreter. Figure 2 illustrates the data interpreter we developed for this research. Two consecutive G/M-code command lines are converted to an array of seven columns, indicating seven unique features affecting energy consumption. In G-code, the letters “X”, “Y”, and “Z” followed by numerical values represent the target nozzle position in the X, Y, and Z directions, respectively. To be specific, “X90 Y50 Z0.5” indicates a nozzle position of (90, 50, 0.5) expressed in the Cartesian coordinate system with the basis along the X, Y, and Z directions. Therefore, any two consecutive G-code commands (i.e., n th and n + 1th ) provide the movement of the nozzle by specifying start and end positions. ΔX, ΔY, and ΔZ denote changes in nozzle position resulting from executing the (n + 1) th command. Similarly, the letter “E” from the G-code represents the extruder length, and ΔE denotes the change in extruder length, indicating how much the motor within the nozzle actuates to extrude the material. The letter “F” from the G-code represents the feed rate, which defines the rate of feeding the material for printing. In addition, temperature information is included as features since temperature regulation has a huge impact on the energy consumption of the AM system. M-code commands are sent initially to set the nozzle and print bed temperatures. For instance, “M140 S200” and “M104 S50” imply “set the nozzle temperature to 200°C” and “set the print bed temperature to 50°C,” respectively. Periodically, the current nozzle and print bed temperatures are retrieved, and the temperature differences between the set and current temperatures are added as extra features (i.e., nozzle and print bed temperature errors). In order to train the model, the power meter data must be collected to measure the energy consumption of the system for each G/M-code command. A signal is sent from the 3D printer whenever a command line is executed successfully. This signal is crucial for measuring energy consumption since the start and end times must be identified to incorporate the power meter readings. Consequently, the execution flag signal is labeled with a computer clock time. Once the command execution signal is timestamped, as a post-processing step, power meter readings are integrated using the trapezoid rule within the execution period to measure energy consumption. These energy consumption values are paired with the interpreted data to train the data-driven model. 2.3. Command to energy consumption network (C2EN) To effectively develop a cyberattack detection framework, energy consumption must be estimated precisely. There are other existing methods to predict energy consumption for FDM 3D printers. Yi et al. predicted the energy consumption for an FDM 3D printer given printing parameters such as layer thickness, support structure, build speed (feed rate), part size (scale in %), and number of parts [ 22 ]. They built a regression model to predict energy consumption, and they found that part size had the largest impact on energy consumption, followed by the number of parts and layer thickness. Lunetto et al. introduced a more sophisticated model by dividing the printing process into multiple stages [ 23 ]. Their rationale was that the heating, preparation, and cooling stages consume a similar amount of energy. The only stage that varies in energy consumption is the printing stage, so they predicted the specific energy consumption based on part size. For the rest of the stages, they simply used a statistical approach to estimate energy consumption. On the other hand, Hopkins et al. built a regression model to predict total energy consumption, as a function of time, as well as nozzle and print bed temperatures [ 24 ]. Yan et al. introduced a novel method that predicts the total energy consumption for different print models [ 25 ]. Their idea was to divide the manufacturing process into multiple stages and obtain the working state matrix that holds information about how much the subsystems are activated during each stage. For example, during the heating stage, the extruder and platform-moving motors are not activated. However, during the material deposition stage, these motors are activated, and the heaters are partially activated. As a consequence, they empirically determined the energy consumption of subsystems and the execution time of different print stages to estimate total energy consumption. All these existing methods can only predict total energy consumption, i.e., the energy required to print the entire prototype. Moreover, two of these methods are not general approaches and require retraining of the prediction models for new printed parts. For the current study, we propose a Command to Energy Consumption Network (C2EN) that uses an NN as a backbone to predict the energy consumption for each G/M-code command. Predicting the total energy consumption to detect anomalous events will be less efficient since it requires the printing process to be completed before a decision can be made. By predicting the energy consumption for each command, anomalies can be detected sooner, thereby wasting fewer resources. Additionally, the C2EN model is easier to generalize since the range of features used for training largely overlaps with many print models. The C2EN model is trained in a supervised manner to predict the energy consumption given the seven features, which are change in extruder position (ΔX, ΔY, ΔZ), change in extruder length (ΔE), feed rate (F), nozzle temperature error, and print bed temperature error, as described in Section 2.2 . To the best of our knowledge, such a model has not been trained and deployed as part of the side channel monitoring system. For the proof of concept, a shallow fully connected NN with two hidden layers containing 28 and 14 neurons is selected. The hyperbolic tangent activation function is applied to all hidden neurons, and a mean squared error loss function is used for training. It is important to mention that optimizing the NN structure or applying various NN structures is not the focus of this work. 3. Experiment For the authenticity of the proposed method, a simple AM system was constructed, as depicted in Fig. 3 . We selected an FDM 3D printer as the AM system. In particular, the Creality Ender-5 Pro was chosen for this work due to its external plug-in port that allows for data communication. To transmit G/M-code and receive feedback, a serial protocol was established between the main computer and the 3D printer. To ensure efficient communication speed, stable data acquisition, and fast data interpretation, a relatively powerful computing device was required. Consequently, the NVIDIA Jetson Orin (2.2 GHz CPU, 2048 NVIDIA GPU cores with maximum GPU frequency of 1.3 GHz) was selected, which is known for its capability to send, receive, and interpret log data concurrently and seamlessly. Additionally, the power meter (Walfront PZEM-004T) was employed for side channel monitoring, using a current transformer to measure the power line without penetrating or interfering with the actual current values. As mentioned in the previous section, the AM and monitoring systems must be controlled by two independent microcontrollers. However, for experimental purposes, we used a single Jetson Orin to manage both systems to reduce costs. Although the two systems share the same computational unit, they are operated individually without sharing any resources. Most slicer software estimates the printing path of 3D objects by dividing it into small, straight printing lines. For instance, when slicing a circle, the slicer may generate a polygon with multiple sides, depending on the resolution of the slicing parameters. For this reason, several different 3D printed parts (model shapes) were utilized in the experiments to observe various printing patterns. The three print models are a stack, a cube, and a dome, as illustrated in Fig. 4. Printing different models enhances the diversity of the data and ensures that the methodology is adaptable to a wide range of models, even when applied to previously untrained 3D models. For each of the models in Fig. 4, five prints were made: four under normal conditions, and one with attacks present. Due to variations in size and shape across each model, the G/M-code generated by the slicer differs in both pattern and length. Specifically, the stack, dome, and cube models contain 1880, 6290, and 2502 lines of G/M-code commands, respectively. Consequently, print times for these models are approximately 335 s, 975 s, and 566 s, in the same order. Three out of the four normal datasets were used for training and validation of the C2EN model. The C2EN model was trained using the Levenberg-Marquardt optimization algorithm. The model was trained for 500 epochs, with 80% of the data used for training and 20% for validation. The remaining normal dataset and the dataset with attacks were used to evaluate the attack/anomaly detection capability of the proposed side channel monitoring system. In order to mimic an actual cyberattack to validate our approach, we embedded additional G/M-code commands that were not created during the slicing procedure. This way, the 3D printer behaves differently, causing anomalies or defects during the manufacturing process. As previously mentioned, the embedded G/M-code commands are not visible in the log files since cyberattacks are often hidden by the infiltrator to dodge detection. In other words, even if the attacks are present, the G/M-code file will be equivalent to that of the command file when no attacks are present. Adding or modifying G-code to alter the printing scheme causes immediate defects, which are noticeable in the printed parts or as runtime errors. Since these can be easily detected, M-code commands were implemented to slightly alter the temperature settings of the thermal system, making them difficult to recognize by visual inspection of the printed parts. For normal operations, M-code commands were generated to set the nozzle and print bed temperatures to 200°C and 50°C, respectively. To represent cyberattacks, the M-code commands were randomly generated throughout the run to change the set temperatures by 1 or 2°C. One may argue that these attacks can be detected simply by observing the current temperatures. Nevertheless, these changes were made within a range to ensure that the print process still appears normal. Additionally, any temperature values that exceed normal operating conditions were modified to hide the attacks. 4. Results and discussion 4.1. C2EN model The prediction accuracy of the C2EN model was evaluated using normal datasets that were excluded from training. The predicted and measured energy consumption values are manifested in Fig. 5 for the stack, dome, and cube print models. For demonstration purposes, a certain range of command lines was selected for each print model. In general, the predicted energy consumption values closely follow the actual measurements for all three printed parts, indicating precise modeling of the relationship between energy consumption and AM parameters. Small discrepancies between the two curves can be attributed to noise in the power meter measurements. A larger error magnitude is visible for the dome model compared to the stack and cube models. Figure 5a and Fig. 5c exhibit small discrepancies between predicted and measured energy consumption values for the stack and cube models, respectively. This is because both models have a relatively simple structure, consisting primarily of straight linear paths. Figure 5b depicts the results for the dome model, which shows larger errors compared to the other two models. The complexity of the dome model’s profile requires more approximation steps for the slicer, resulting in extremely short tool paths. The limited sampling frequency of the energy meter results in an increase in aliasing, contributing to larger prediction errors. In addition, having more printing segments exposes the printer to increased electromagnetic noise from the motors, thus amplifying the error magnitude. For numerical comparison, the mean absolute error (MAE), root mean squared error (RMSE), and maximum error were computed and presented in Table 1 . For all three models, the MAE and RMSE were found to be less than 1.5 J and 3 J, respectively. However, the maximum errors indicate the presence of some outliers, possibly caused by random heating events related to the temperature regulation of the nozzle and print bed. The standard deviations of absolute errors (STDEs) for all three models were found to be between 1.7 J and 2.6 J. Overall, based on its prediction performance, the C2EN model is valid, indicating that it can be utilized for anomaly/attack detection. Table 1 C2EN prediction error Stack Dome Cube MAE 1.11 J 1.45 J 1.28 J RMSE 2.10 J 2.97 J 2.28 J Maximum Error 26.39 J 63.01 J 23.78 J STDE 1.78 J 2.59 J 1.89 J To show that our framework can be extended to other AM systems, we trained the C2EN model for a different 3D printer, the PRUSA Research Original Prusa MK4. Since every 3D printer uses different actuators and thermal systems, energy consumption varies. Consequently, energy consumption needs to be measured for various printed objects to retrain the C2EN model. Although the magnitude of energy consumed per command line may differ, the consumption profile must look similar among various 3D printers. As a consequence, we scaled the predicted energy consumption values as an alternative approach to match the actual energy consumed by the new AM system, as demonstrated in Fig. 6 . Compared to the Ender-5 Pro, the Original Prusa MK4 consumes less energy throughout the process, and by scaling the C2EN output, the predicted energy consumption generally follows the actual energy consumption, yielding an MAE of 1.89 J. Although accuracy is slightly sacrificed, in this way, there is no need to collect the entire dataset for a different system. Instead, only a small portion of the dataset is required. In other words, the C2EN model can be easily extended to other 3D printers, without intensive data collection and NN retraining. 4.2. Attack detection The trained C2EN model was adopted to detect cyberattacks in the AM system. Recall that the C2EN model was trained only on data collected during normal operation. As a consequence, the energy consumption predicted by the C2EN model is expected to deviate from the measured energy consumption in the presence of cyberattacks, since such attacks change the energy profile of the system. That is, the prediction error becomes larger than that observed during the C2EN model validation. Figure 6 shows the predicted and actual (or measured) energy consumption in the presence of cyberattacks that alter the operational temperatures. It is apparent from the figure that the measured and predicted energy profiles do not align well throughout the manufacturing process when compared to the normal operation shown in Fig. 5. The measured values are often either smaller or larger than the predicted values, implying that the magnitude of the prediction error corresponds to the changes made by undesirable infiltrations. For an in-depth analysis, numerical errors are computed and presented in Table 2 in the same manner as in Table 1 . The numerical values clearly indicate that the magnitude of errors increased significantly for all three printed models. For all models, the MAE increased by a factor of 7, and the RSME increased by 6 to 8 times. The stack model exhibits greater deviation compared to the other two models. This is because the stack model has the highest attack-to-normal ratio in terms of duration. The print time of the stack model is significantly shorter than that of the dome and cube models. However, all three models experienced a similar number of temperature modifications. For the same reason, the STDE of the stack model is approximately 4 J higher than the other two models. The magnitudes of maximum errors for all models indicate that the cyberattacks significantly impact the energy consumption in AM systems. Table 2 C2EN prediction error in presence of cyberattacks Stack Dome Cube MAE 7.86 J 7.07 J 7.51 J RMSE 16.12 J 12.66 J 12.89 J Maximum Error 92.51 J 191.84 J 61.57 J STDE 14.07 J 10.50 J 10.48 J Without a doubt, the C2EN prediction accuracy can indicate the presence of cyberattacks. However, simply using a threshold value may result in many false positives due to the presence of outliers even during normal operation, as illustrated in Fig. 5 and Table 1 . To avoid false positives, an ideal approach is to compute the moving average error for a certain window size so that the peak errors blend, resulting in an error curve that only reflects a trend. It is essential to mention that various window sizes and weighting methods were tested and compared. A larger window size filters the noise and makes the curve smoother, but it can cause some errors to disappear. By applying exponential or linear weighting to compute the moving average, unwanted effects of smoothing can be reduced. Nevertheless, we selected uniform weights since we observed negligible differences and chose a window size of 20 because it balanced the trade-off between smoothing and losing information. Once the raw error is filtered by taking the moving average over a specified window, the threshold is selected based on the MAE and STDE. The threshold can be determined for each model using the following equation: $$\:\tau\:=\text{M}\text{A}\text{E}+k\left(\text{S}\text{T}\text{D}\text{E}\right)$$ 1 where, \(\:\tau\:\) denotes threshold and \(\:k\) denotes a constant multiplier. It is common to select k to be between 2 and 3 to detect outliers [ 26 ]. For this work, we empirically selected k to be equal to 2, which rejected most false positives while being sensitive to malicious events. The anomaly detection results for the stack, dome, and cube print models are respectively presented in Fig. 7, Fig. 8, and Fig. 9. In these figures, the first row presents predicted errors. The second row shows filtered errors and a predefined threshold for anomaly detection. The third and fourth rows illustrate the variations in print bed and nozzle set temperatures due to cyberattacks. Within these plots, magenta markers indicate detected attacks, and cyan markers indicate false detections during the manufacturing process. In Fig. 7, around the 120th command index, both the print bed and nozzle temperatures increase, causing noticeable peak errors. Nonetheless, the filtered error begins to exceed the threshold around 190th command index. This demonstrates that error filtering reduces false positives but causes a delay in attack detection. Between the 500th and 600th command index, both temperatures return to normal, and no errors are detected during this period due to filtering. One noteworthy observation is that shortly after the 600th command index, both temperatures drop to lower values, yet no attacks are detected. A straightforward explanation is that the heaters remained off during this period, so the energy consumption predictions remained accurate. However, when the temperature increased back to normal around the 900th command index, the error rose significantly because the subsystems needed to be heated again to maintain normal operational temperatures. As a result, even when the temperatures returned to normal, the error remained significantly high. From then on, the set temperatures increase again causing a large deviation until the 1400th command index. During this period, large errors are observed because the system experiences substantial increase in both nozzle and print bed temperatures. The error begins to decrease afterwards as the temperatures drop back to the normal status. Based on these observations, there are delays in attack detection, especially when the set temperatures are reduced. Moreover, the attacks cannot be detected throughout the entire attack period, but they are flagged multiple times during the manufacturing process. Additionally, there are two false positive detections around the 1087th command index, where the normal energy consumption experienced a small peak. In Fig. 8, the result for the dome model is presented, which illustrates a smaller mean prediction error but a larger maximum error compared to the stack model shown in Fig. 7. Due to the large peak errors that appear in several locations during for the normal run, even with the current filtering process, false detections are observed throughout the run. These can be removed by increasing the threshold slightly because they mostly cross the threshold value for a very short period of time. For instance, at roughly the 600th index, there is a peak from normal data that crosses the threshold, but these false detections only last for about 20 indices. In particular, at the 660th and 780th index, there are small peaks during the normal run that cross the threshold, but these false detections only last for 20 and 9 indices, respectively. Other false detections detected at the 930th, 1200th, and 1730th indices only last for short periods. A possible reason for the large number of false positives for the dome model is that the model consists of many G-code commands for extremely short print distances, causing difficulties in precise power measurements. Nonetheless, for consistency, we used the same k value in Eq. ( 1 ) to detect the attacks. In general, the threshold performed well across the whole process. From the beginning of the printing process, cyberattacks are consistently applied to alter the nozzle and print bed set temperatures, and they are detected. From the 3200th index to the 3600th index, both nozzle and print bed temperatures were set back to normal. Therefore, no attacks are detected during this period to raise alarms. Shortly after, attacks are applied again until the end of the printing process. At this stage, attacks are detected but not for the entire attack period. Although the detections are not made throughout the attack period, cyberattacks are frequently detected and triggered as events, validating the proposed method. Figure 9 shows the result for the cube model. Attacks are observable almost from the beginning of the printing process, and they are detected after the 50th index. However, from the actual error plot, spikes are observed soon after the attacks. Around the 500th index, both temperatures are set back to normal, but detection stops earlier, at around 390th index. Nonetheless, compared to the normal case, the filtered predicted error seems to be larger throughout the run, indicating abnormal events. After the 900th index, attacks are almost continuously detected since either one of the temperatures is in an abnormal state. In contrast to the dome and cube models, no false detections are visible, as all the filtered prediction errors are strictly below the threshold, implying fewer outliers due to having more moderate tool paths. In general, for all three models, cyberattacks are successfully detected using the proposed method. The magnitude of prediction error distinctly increases in the presence of attacks throughout the manufacturing process. Furthermore, by using the C2EN model to predict energy consumption for each G/M-code command, attacks are detected soon after they are applied. In this way, users can decide to halt and terminate the printing process in a timely manner to avoid further losses. 5. Conclusion Cyberattack detection for AM systems is a challenging problem in modern industrial chains. To enhance the security of the AM system, a reliable side-channel monitoring system is necessary. In this work, we developed a non-invasive, affordable, and low-maintenance side-channel monitoring solution using a power meter. By employing the power meter, the energy consumption of each G/M-code command was measured. Based on the collected data, the C2EN model was trained to predict the energy consumption for each command line applied to the AM system. Since most cyberattacks change the energy profile of the system, the C2EN prediction error increased in the presence of attacks because the model was trained using the data collected during normal operation (i.e., without attacks). Moreover, our method was able to detect the attacks at an early stage since we compared the energy consumption prediction for each command line, providing users with an opportunity to intervene in the printing process whenever necessary to reduce material and time losses and prevent further defects if failed products are to be used. To mimic the cyberattacks, we modified the operational temperatures of the print bed and nozzle by 1 or 2 degrees. With these attacks, the prediction errors increased approximately seven times compared to attack-free cases. A small number of false positives were observed, but in general, attacks were precisely detected, validating the performance of the proposed approach. Despite the salient performance of the proposed framework, a couple of limitations were identified. First, since it takes time for the cyberattack to change the energy profile, attacks cannot be detected in real-time. Second, the attacks cannot be detected for the entire attack period because the heaters are not always active to regulate the set temperatures. In other words, predictions are typically accurate when the heaters are off, even during the attacks. To enhance the performance of the proposed framework, we plan to explore different detection algorithms rather than relying on a simple threshold method. Furthermore, we plan to implement different types of cyberattacks to modify other parameters of the AM process and further evaluate the proposed method. Statements and Declarations Funding : The authors declare that no funds, grants, or other support were received during the preparation of this manuscript. Competing Interests : The authors have no relevant financial or non-financial interests to disclose. Data Availability : The data collected and used for training the machine learning model is publicly available at https://github.com/fit-ipcl/CPS_C2EN_data. Any additional data that supports the findings of the current study is available upon request. References Karkun, M.S. and Dharmalingam, S., 2022. 3D printing technology in aerospace industry–a review. International Journal of Aviation, Aeronautics, and Aerospace , 9 (2), p.4. Trenfield, S.J., Awad, A., Madla, C.M., Hatton, G.B., Firth, J., Goyanes, A., Gaisford, S. and Basit, A.W., 2019. Shaping the future: recent advances of 3D printing in drug delivery and healthcare. Expert opinion on drug delivery , 16 (10), pp.1081-1094. Lee, R.M., Assante, M.J. and Conway, T., 2014. German steel mill cyber attack. Industrial Control Systems , 30 (62), pp.1-15. Slay, J. and Miller, M., 2007, March. Lessons learned from the maroochy water breach. In International conference on critical infrastructure protection (pp. 73-82). Boston, MA: Springer US. Bencsáth, B., Pék, G., Buttyán, L. and Félegyházi, M., 2011. Duqu: A Stuxnet-like malware found in the wild. CrySyS Lab Technical Report , 14 , pp.1-60. Gao, Y., Li, B., Wang, W., Xu, W., Zhou, C. and Jin, Z., 2018. Watching and safeguarding your 3D printer: Online process monitoring against cyber-physical attacks. Proceedings of the ACM on Interactive, Mobile, Wearable and Ubiquitous Technologies, 2(3), pp.1-27. Pearce, H., Yanamandra, K., Gupta, N., & Karri, R. (2022). Flaw3d: A trojan-based cyber attack on the physical outcomes of additive manufacturing. IEEE/ASME Transactions on Mechatronics , 27 (6), 5361-5370. Alkofahi, H., Alawneh, H., & Skjellum, A. (2024). MitM attacks on intellectual property and integrity of additive manufacturing systems: A security analysis. Computers & Security , 140 , 103810. Yan, H., Grasso, M., Paynabar, K. and Colosimo, B.M., 2022. Real-time detection of clustered events in video-imaging data with applications to additive manufacturing. IISE Transactions, 54(5), pp.464-480. Shi, Z., Kan, C., Tian, W. and Liu, C., 2021. A Blockchain-based G-code protection approach for cyber-physical security in additive manufacturing. Journal of Computing and Information Science in Engineering, 21(4), p.041007. Saraeian, S. and Shirazi, B., 2020. Process mining-based anomaly detection of additive manufacturing process activities using a game theory modeling approach. Computers & Industrial Engineering , 146 , p.106584. Straub, J., 2017, June. Identifying positioning-based attacks against 3D printed objects and the 3D printing process. In Pattern Recognition and Tracking XXVIII (Vol. 10203, pp. 22-34). SPIE. Chhetri, S.R., Canedo, A. and Al Faruque, M.A., 2016, November. Kcad: kinetic cyber-attack detection method for cyber-physical additive manufacturing systems. In 2016 IEEE/ACM International Conference on Computer-Aided Design (ICCAD) (pp. 1-8). IEEE. Belikovetsky, S., Solewicz, Y.A., Yampolskiy, M., Toh, J. and Elovici, Y., 2018. Digital audio signature for 3D printing integrity. ieee transactions on information forensics and security , 14 (5), pp.1127-1141. Hong, S.H., Kyzer, T., Cornelius, J., Zahiri, F. and Wang, Y., 2022, March. Intelligent anomaly detection of robot manipulator based on energy consumption auditing. In 2022 IEEE aerospace conference (AERO) (pp. 1-11). IEEE. Randolph, M. and Diehl, W., 2020. Power side-channel attack analysis: A review of 20 years of study for the layman. Cryptography, 4(2), p.15. Gatlin, J., Belikovetsky, S., Moore, S.B., Solewicz, Y., Elovici, Y. and Yampolskiy, M., 2019. Detecting sabotage attacks in additive manufacturing using actuator power signatures. IEEE Access , 7 , pp.133421-133432. Gatlin, J., Belikovetsky, S., Elovici, Y., Skjellum, A., Lubell, J., Witherell, P. and Yampolskiy, M., 2021, October. Encryption is futile: Reconstructing 3d-printed models using the power side-channel. In Proceedings of the 24th International Symposium on Research in Attacks, Intrusions and Defenses (pp. 135-147). Shi, Z., Mamun, A.A., Kan, C., Tian, W. and Liu, C., 2023. An LSTM-autoencoder based online side channel monitoring approach for cyber-physical attack detection in additive manufacturing. Journal of Intelligent Manufacturing, pp.1-17. Scime, L. and Beuth, J., 2018. Anomaly detection and classification in a laser powder bed additive manufacturing process using a trained computer vision algorithm. Additive Manufacturing, 19, pp.114-126. Yu, S.Y., Malawade, A.V., Chhetri, S.R. and Al Faruque, M.A., 2020. Sabotage attack detection for additive manufacturing systems. IEEE Access, 8, pp.27218-27231. Tan, Y., Jin, B., Nettekoven, A., Chen, Y., Yue, Y., Topcu, U. and Sangiovanni-Vincentelli, A., 2019, December. An encoder-decoder based approach for anomaly detection with application in additive manufacturing. In 2019 18th IEEE international conference on machine learning and applications (ICMLA) (pp. 1008-1015). IEEE. Wu, M., Song, Z. and Moon, Y.B., 2019. Detecting cyber-physical attacks in CyberManufacturing systems with machine learning methods. Journal of intelligent manufacturing , 30 (3), pp.1111-1123. Yi, L., Chen, T., Ehmsen, S., Gläßner, C., & Aurich, J. C. (2020). A study on impact factors of the energy consumption of the fused deposition modeling process using two-level full factorial experiments. Procedia CIRP , 93 , 79-84. Lunetto, V., Priarone, P. C., Galati, M., & Minetola, P. (2020). On the correlation between process parameters and specific energy consumption in fused deposition modelling. Journal of Manufacturing Processes , 56 , 1039-1049. Hopkins, N., Jiang, L. and Brooks, H., 2021. Energy consumption of common desktop additive manufacturing technologies. Cleaner Engineering and Technology , 2 , p.100068. Yan, Z., Huang, J., Lv, J., Hui, J., Liu, Y., Zhang, H., Yin, E. and Liu, Q., 2022. A new method of predicting the energy consumption of additive manufacturing considering the component working state. Sustainability , 14 (7), p.3757. Leys, C., Ley, C., Klein, O., Bernard, P. and Licata, L., 2013. Detecting outliers: Do not use standard deviation around the mean, use absolute deviation around the median. Journal of experimental social psychology , 49 (4), pp.764-766. Cite Share Download PDF Status: Published Journal Publication published 26 Sep, 2025 Read the published version in The International Journal of Advanced Manufacturing Technology → Version 1 posted Editorial decision: Major Revisions Needed 21 Aug, 2025 Reviewers agreed at journal 03 Apr, 2025 Reviewers invited by journal 02 Apr, 2025 Editor assigned by journal 01 Apr, 2025 First submitted to journal 31 Mar, 2025 You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-6346058","acceptedTermsAndConditions":true,"allowDirectSubmit":false,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":437429539,"identity":"4c5e5780-b11a-4a43-af3f-c575f897a897","order_by":0,"name":"Xuan-Phat Truong","email":"","orcid":"","institution":"","correspondingAuthor":false,"prefix":"","firstName":"Xuan-Phat","middleName":"","lastName":"Truong","suffix":""},{"id":437429540,"identity":"ee39ab4e-9b5e-457f-b6d9-9943e0d7afa3","order_by":1,"name":"Haemin Jeon","email":"","orcid":"","institution":"","correspondingAuthor":false,"prefix":"","firstName":"Haemin","middleName":"","lastName":"Jeon","suffix":""},{"id":437429541,"identity":"c0db8ca0-3c0f-4fef-aff9-949dcdbbd879","order_by":2,"name":"Yi Wang","email":"","orcid":"","institution":"","correspondingAuthor":false,"prefix":"","firstName":"Yi","middleName":"","lastName":"Wang","suffix":""},{"id":437429542,"identity":"053a244d-be40-426b-b351-bda8c4a2bbc1","order_by":3,"name":"Seong Hyeon Hong","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAArklEQVRIiWNgGAWjYDACCR4QacPPBqJ4SNCSJtnGRqKWw5INRGuRn9178HHBr/MSfPINjA/ethGhxeDOuWTjmX23JdjYGJgN5xKlRSLHTJq353YdUAubNC8xWuRngLWcA9nC/psoLQw3gFp4fhwAaWFjJkqLwY0cY2PehmSglsRmyTnniHOY4WOeP3YS8s2HD354U0aMw0CAEewexgZi1YPAH1IUj4JRMApGwYgDAH5GLUPb3WN+AAAAAElFTkSuQmCC","orcid":"https://orcid.org/0000-0003-4747-7669","institution":"Florida Institute of Technology","correspondingAuthor":true,"prefix":"","firstName":"Seong","middleName":"Hyeon","lastName":"Hong","suffix":""}],"badges":[],"createdAt":"2025-03-31 15:08:47","currentVersionCode":1,"declarations":"","doi":"10.21203/rs.3.rs-6346058/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-6346058/v1","draftVersion":[],"editorialEvents":[{"content":"https://doi.org/10.1007/s00170-025-16551-2","type":"published","date":"2025-09-26T15:57:05+00:00"}],"editorialNote":"","failedWorkflow":false,"files":[{"id":81226592,"identity":"02a2f37c-73fd-481d-8394-6a9eb1b84153","added_by":"auto","created_at":"2025-04-23 16:22:41","extension":"png","order_by":1,"title":"Figure 1","display":"","copyAsset":false,"role":"figure","size":114065,"visible":true,"origin":"","legend":"\u003cp\u003eFlow chart of the side channel monitoring system\u003c/p\u003e","description":"","filename":"1.png","url":"https://assets-eu.researchsquare.com/files/rs-6346058/v1/a7132a9c7d743ca62a029d40.png"},{"id":81226599,"identity":"0a5a25dd-228b-4672-aed3-875aed0a346a","added_by":"auto","created_at":"2025-04-23 16:22:41","extension":"png","order_by":2,"title":"Figure 2","display":"","copyAsset":false,"role":"figure","size":66948,"visible":true,"origin":"","legend":"\u003cp\u003eDemonstration of the data interpretation\u003c/p\u003e","description":"","filename":"2.png","url":"https://assets-eu.researchsquare.com/files/rs-6346058/v1/ea696388c08afe69c0d8d863.png"},{"id":81226662,"identity":"4ab14909-53a7-422d-9367-977859b50618","added_by":"auto","created_at":"2025-04-23 16:22:45","extension":"png","order_by":3,"title":"Figure 3","display":"","copyAsset":false,"role":"figure","size":226561,"visible":true,"origin":"","legend":"\u003cp\u003eSchematic of the experiment setup\u003c/p\u003e","description":"","filename":"3.png","url":"https://assets-eu.researchsquare.com/files/rs-6346058/v1/f32b6347a43c4e99ea843f97.png"},{"id":81226590,"identity":"e5d16cde-8e98-4646-aa7b-a0574ded20c2","added_by":"auto","created_at":"2025-04-23 16:22:41","extension":"png","order_by":4,"title":"Figure 4","display":"","copyAsset":false,"role":"figure","size":286389,"visible":true,"origin":"","legend":"\u003cp\u003ePrint models for the experiment: sliced CAD models (row 1), and actual printed parts (row 2).\u003c/p\u003e","description":"","filename":"4.png","url":"https://assets-eu.researchsquare.com/files/rs-6346058/v1/ec482d3d688aadccc56414c7.png"},{"id":81226605,"identity":"0490a99c-aee9-4975-8b16-d04d095a2f46","added_by":"auto","created_at":"2025-04-23 16:22:42","extension":"png","order_by":5,"title":"Figure 5","display":"","copyAsset":false,"role":"figure","size":567139,"visible":true,"origin":"","legend":"\u003cp\u003ePredicted and measured energy consumption of the AM system for different print models: (a) stack, (b) dome, and (c) cube\u003c/p\u003e","description":"","filename":"5.png","url":"https://assets-eu.researchsquare.com/files/rs-6346058/v1/c494680ab0b984a122cef889.png"},{"id":81227280,"identity":"8c1fe177-753b-42dc-b7f5-78625d586637","added_by":"auto","created_at":"2025-04-23 16:30:41","extension":"png","order_by":6,"title":"Figure 6","display":"","copyAsset":false,"role":"figure","size":271592,"visible":true,"origin":"","legend":"\u003cp\u003ePredicted and measured energy consumption of the Original Prusa MK4\u003c/p\u003e","description":"","filename":"6.png","url":"https://assets-eu.researchsquare.com/files/rs-6346058/v1/ddc2717f71f2440cfa84924a.png"},{"id":81226625,"identity":"66ef7cf0-5daf-494b-ae0c-ef40ac624b4c","added_by":"auto","created_at":"2025-04-23 16:22:42","extension":"png","order_by":7,"title":"Figure 7","display":"","copyAsset":false,"role":"figure","size":432098,"visible":true,"origin":"","legend":"\u003cp\u003ePredicted and measured energy consumption of the AM system in presence of cyberattacks for different print models: (a) stack, (b) dome, and (c) cube\u003c/p\u003e","description":"","filename":"7.png","url":"https://assets-eu.researchsquare.com/files/rs-6346058/v1/99f0d23451f9978a3a539263.png"},{"id":81227279,"identity":"72a4fc16-d8f5-4ce1-a3ac-1a17d4c3c428","added_by":"auto","created_at":"2025-04-23 16:30:41","extension":"png","order_by":8,"title":"Figure 8","display":"","copyAsset":false,"role":"figure","size":261791,"visible":true,"origin":"","legend":"\u003cp\u003eAnomaly detection result for the stack model: (a) raw error, (b) filtered error, (c) print bed temperature, and (d) nozzle temperature\u003c/p\u003e","description":"","filename":"8.png","url":"https://assets-eu.researchsquare.com/files/rs-6346058/v1/e27752d6c707986f9a9918d9.png"},{"id":81226608,"identity":"64168c0c-1a86-408f-8bd7-dcbf125c5610","added_by":"auto","created_at":"2025-04-23 16:22:42","extension":"png","order_by":9,"title":"Figure 9","display":"","copyAsset":false,"role":"figure","size":286350,"visible":true,"origin":"","legend":"\u003cp\u003eAnomaly detection result for the dome model: (a) raw error, (b) filtered error, (c) print bed temperature, and (d) nozzle temperature\u003c/p\u003e","description":"","filename":"9.png","url":"https://assets-eu.researchsquare.com/files/rs-6346058/v1/9fad4a44d6ed9eb49a408ca0.png"},{"id":81226598,"identity":"3200ddd2-e9d4-4af7-83d9-4ec4b3022fb8","added_by":"auto","created_at":"2025-04-23 16:22:41","extension":"png","order_by":10,"title":"Figure 10","display":"","copyAsset":false,"role":"figure","size":276324,"visible":true,"origin":"","legend":"\u003cp\u003eAnomaly detection result for the cube model: (a) raw error, (b) filtered error, (c) print bed temperature, and (d) nozzle temperature\u003c/p\u003e","description":"","filename":"10.png","url":"https://assets-eu.researchsquare.com/files/rs-6346058/v1/972840b748fb7086562608d7.png"},{"id":92430722,"identity":"1fe861c7-cadd-48ad-ab53-20d6bb0efbf4","added_by":"auto","created_at":"2025-09-29 16:07:37","extension":"pdf","order_by":0,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":3158657,"visible":true,"origin":"","legend":"","description":"","filename":"manuscript.pdf","url":"https://assets-eu.researchsquare.com/files/rs-6346058/v1/72691196-0d66-4dc8-9efb-4d344e08fadd.pdf"}],"financialInterests":"","formattedTitle":"Monitoring Energy Consumption for Cyberattack Detection in Additive Manufacturing Systems","fulltext":[{"header":"1. Introduction","content":"\u003cp\u003eThe rapid development of additive manufacturing (AM), commonly known as 3D printing, has made a significant impact on industries by enabling instant prototyping, customization, and on-demand production of complex parts. From aerospace [\u003cspan citationid=\"CR1\" class=\"CitationRef\"\u003e1\u003c/span\u003e] to healthcare [\u003cspan citationid=\"CR2\" class=\"CitationRef\"\u003e2\u003c/span\u003e], AM's ability to produce complex geometries with a variety of materials has not only supported manufacturing capabilities but also empowered innovation and efficiency. However, this transformative technology has also revealed a unique set of vulnerabilities, particularly to cyber-physical attacks, that pose significant risks to the security of the manufacturing process. A cyber-physical attack is defined as an action that sabotages both digital and physical systems, utilizing the connection between components within their network. Such attacks aim to compromise intellectual property, interrupt processes or production chains, destroy products and facilities, and even threaten human health and safety. Several high-profile incidents that highlight the damage caused by cyber-physical attacks include the German Steel Mill cyber-attack [\u003cspan citationid=\"CR3\" class=\"CitationRef\"\u003e3\u003c/span\u003e], the Maroochy water services incident [\u003cspan citationid=\"CR4\" class=\"CitationRef\"\u003e4\u003c/span\u003e], and the Stuxnet malware [\u003cspan citationid=\"CR5\" class=\"CitationRef\"\u003e5\u003c/span\u003e].\u003c/p\u003e \u003cp\u003eParticularly in AM, cyber-physical attacks refer to malicious activities that exploit remote connections to physical systems, aiming to compromise the quality, functionality, or safety of printed parts. These attacks can be executed through various routes, including: (1) modifying computer-aided design (CAD) models, often in the stereolithography (STL) file format; (2) altering machine command lines, i.e., G/M-code; and (3) changing machine parameters and planned tool paths through machine firmware [\u003cspan citationid=\"CR6\" class=\"CitationRef\"\u003e6\u003c/span\u003e]. For instance, FLAW3D, a trojan-based cyberattack, can manipulate G-code to reduce filament extrusion and shift material deposition [\u003cspan citationid=\"CR7\" class=\"CitationRef\"\u003e7\u003c/span\u003e]. Additionally, man-in-the-middle (MitM) attacks can infiltrate communication protocols to swap 3D models of printed parts and alter infill materials [\u003cspan citationid=\"CR8\" class=\"CitationRef\"\u003e8\u003c/span\u003e]. These aforementioned interventions can have severe consequences, including product failures, financial losses, and even threats to human life in critical sectors such as aerospace, automotive, and medical devices. It is important to note that the present study focuses only on cyber-physical attacks that directly sabotage the printing process or printed objects. Other forms of cyberattacks that do not impact the outputs of AM systems are not considered in this research.\u003c/p\u003e \u003cp\u003eTo prevent malicious attacks, various research groups have been exploring a range of strategies and technologies to safeguard AM systems. These include the development of robust encryption methods, the establishment of secure communication protocols, and the construction of real-time advanced monitoring systems [\u003cspan citationid=\"CR9\" class=\"CitationRef\"\u003e9\u003c/span\u003e]. Shi et al. used a blockchain-based approach to safeguard the tool path file from unauthorized access. Along with an asymmetric encryption technique, the authors were able to prevent two kinds of cyber-physical attacks: design modifications and intellectual theft [\u003cspan citationid=\"CR10\" class=\"CitationRef\"\u003e10\u003c/span\u003e]. Saraeian et al. proposed a behavior control component using event logs. They developed a unique detection method based on process mining and game theory techniques [\u003cspan citationid=\"CR11\" class=\"CitationRef\"\u003e11\u003c/span\u003e]. Even though these methods are effective, they are limited to the attacks without access to the main hub. In other words, attacks that modify the logs and/or sensor values can be dodged since the information acquired from the main communication channel is no longer reliable. Consequently, a side-channel monitoring system is an ideal option to prevent such attacks.\u003c/p\u003e \u003cp\u003eA side-channel refers to an indirect pathway of data stream for a protocol, or communication service that is not a part of the main network of the system. Nonetheless, side channel monitoring systems can still provide insightful information regarding internal states, health, and other statuses of the system. Furthermore, a side-channel monitoring system can be retrofitted into most AM systems while being non-invasive and low-cost. The advantages of using sensors as a side-channel include isolation from the main channel/network, and yet still able to provide information to predict the health status of the system. Straub proposed an imaging-based methodology to prevent changes of printing orientation [\u003cspan citationid=\"CR12\" class=\"CitationRef\"\u003e12\u003c/span\u003e]. Nonetheless, the vision-based approach has limitations due to the camera\u0026rsquo;s field of view and angle on complex objects.\u003c/p\u003e \u003cp\u003eChhetri et al. introduced the Kinetic Cyber-attack Detection (KCAD) method, which identifies cyberattacks in AM systems using acoustic analog emissions [\u003cspan citationid=\"CR13\" class=\"CitationRef\"\u003e13\u003c/span\u003e]. Here, they built a regression model to convert acoustic signals into control parameters and compared them with the actual control parameters defined by G-code commands. Any changes in G-code commands reflect changes in acoustic signals, thus increasing the control parameter prediction error. Nonetheless, their approach was limited to attacks that modify the path of nozzle in horizontal directions. Belikovetsky et al. also presented a side-channel monitoring method using acoustic sensors [\u003cspan citationid=\"CR14\" class=\"CitationRef\"\u003e14\u003c/span\u003e]. They generated digital audio fingerprints from smartphone recordings for attack-free cases, then compared them with online fingerprints to detect malicious activities. Unfortunately, this method is not generalizable, and thus fingerprints must be generated for each print model. Moreover, it fails to detect temperature changes or extrusion alterations.\u003c/p\u003e \u003cp\u003eTo embrace a greater variety of cyber-physical attacks and enhance detection accuracy, energy/power meters were deployed. Hong et al. used energy consumption data to detect anomalies in robot manipulators mimicking the AM production line [\u003cspan citationid=\"CR15\" class=\"CitationRef\"\u003e15\u003c/span\u003e]. Since processing data needs power, the correlation between power usage and system activities can help detect any suspicious activity [\u003cspan citationid=\"CR16\" class=\"CitationRef\"\u003e16\u003c/span\u003e]. Although this study was not designed for AM systems, it demonstrated that a side-channel approach using power meters to monitor and detect anomalies provides a robust, real-time, and cost-effective means of enhancing security in additive manufacturing. It supports existing security measures by adding a layer of physical parameter monitoring, making it harder for cyber-physical attacks to go undetected. Gatlin et al. developed a method to compare power signatures to detect cyberattacks designed for G-code alterations with 100% precision, except for G1 and G0 swap intrusions [\u003cspan citationid=\"CR17\" class=\"CitationRef\"\u003e17\u003c/span\u003e]. They extended their work to reconstruct the printed parts solely by observing the power measurements of stepper motors in Fused Deposition Modeling (FDM) 3D printers [\u003cspan citationid=\"CR18\" class=\"CitationRef\"\u003e18\u003c/span\u003e]. Their approach clearly showed that the information collected from the 3D printer by power meters is richer than that from acoustic sensors. However, their approach cannot be applied to unknown print models since a nominal power signature must be generated beforehand. Furthermore, they did not consider attacks that do not modify the tool paths.\u003c/p\u003e \u003cp\u003eInspired by the KCAD framework and the salient capabilities of energy meters, we propose a secure and effective attack/anomaly detection approach. The primary component of the current methodology involves designing and implementing a detection system that utilizes power meters to measure and analyze energy consumption patterns, identifying anomalies potentially caused by malicious activities applied to the system. A data collection process is introduced, which captures both G/M-code commands and energy consumption for each command line, aiming to enrich the quality of data by relating machine operations to their corresponding energy consumption. Unlike many existing methods that measure and estimate the total energy consumption of each printed output, this approach predicts the energy consumption for each G/M-code command line, enabling more time-sensitive detection and analysis. Moreover, by predicting the energy consumption for each command line, the method can easily be generalized to various printing parts, without the need to measure and collect data beforehand. Our proposed work differs from [\u003cspan citationid=\"CR17\" class=\"CitationRef\"\u003e17\u003c/span\u003e] and [\u003cspan citationid=\"CR18\" class=\"CitationRef\"\u003e18\u003c/span\u003e] in that the energy consumption of the entire AM system is measured instead of individual actuators. Additionally, we bypass the power consumption signature generation step by integrating a machine learning (ML) model to directly predict power consumption, replacing the signature database with a simple model to detect attacks. The proposed methodology can potentially offer real-time monitoring capabilities as well as timely intervention, even for printing jobs that have not been pre-trained. This also simplifies the data collection process, since data collected during abnormal operations are no longer needed for training.\u003c/p\u003e \u003cp\u003eThe ML technique deployed in this work predicts energy consumption instead of directly detecting attacks by classification. ML and artificial intelligence (AI) techniques are increasingly being integrated into cyber-physical attack (or anomaly, which may or may not be caused by a cyber-physical attack) detection systems, showing great promise in predicting potential cyber-physical threats by analyzing vast amounts of data for suspicious patterns. Shi et al. adopted an autoencoder to detect attacks by extracting vibration features using sensors [\u003cspan citationid=\"CR19\" class=\"CitationRef\"\u003e19\u003c/span\u003e]. The study was conducted using both supervised and unsupervised learning for attack detection. Scime et al. introduced ML approaches to detect anomalies by observing printed parts using images [\u003cspan citationid=\"CR20\" class=\"CitationRef\"\u003e20\u003c/span\u003e]. Yu et al. benchmarked multiple ML-based anomaly detection algorithms for AM and showed that the neural network (NN) approach achieved the best performance [\u003cspan citationid=\"CR21\" class=\"CitationRef\"\u003e21\u003c/span\u003e]. Tan et al. implemented an encoder-decoder architecture to detect anomalies in an unsupervised fashion [\u003cspan citationid=\"CR22\" class=\"CitationRef\"\u003e22\u003c/span\u003e]. By using images of printed products and simulated images, Wu et al. developed an ML approach to detect anomalies in AM systems and achieved 96.1% accuracy [\u003cspan citationid=\"CR23\" class=\"CitationRef\"\u003e23\u003c/span\u003e]. As these studies were carried out, the use of ML approaches was emphasized as effective, convenient, and highly reliable.\u003c/p\u003e \u003cp\u003eThe contribution of the current study is summarized in threefold: (1) A framework to map energy consumption of the AM system with G/M-code command lines using an NN model is developed, which can be applied to other AM systems; (2) A side-channel monitoring system is proposed and verified to detect cyberattacks that change system parameters; and (3) Collected data used in this work are shared in the public domain (\u003cspan class=\"ExternalRef\"\u003e\u003cspan class=\"RefSource\"\u003ehttps://github.com/fit-ipcl/CPS_C2EN_data\u003c/span\u003e\u003cspan address=\"https://github.com/fit-ipcl/CPS_C2EN_data\" targettype=\"URL\" class=\"RefTarget\"\u003e\u003c/span\u003e\u003c/span\u003e) to further support the AM community.\u003c/p\u003e \u003cp\u003eThe remainder of the paper is organized as follows. Section 2 elucidates the side-channel monitoring system and the ML model for predicting energy consumption. In Section 3, the experimental setup to implement and validate the side-channel monitoring system for cyberattack detection is explained in detail. Section 4 presents and discusses the prediction and detection results, followed by the conclusion in Section 5.\u003c/p\u003e"},{"header":"2. Methodology","content":"\u003cdiv id=\"Sec3\" class=\"Section2\"\u003e \u003ch2\u003e2.1. Side channel monitoring system\u003c/h2\u003e \u003cp\u003eAs depicted in Fig.\u0026nbsp;\u003cspan refid=\"Fig1\" class=\"InternalRef\"\u003e1\u003c/span\u003e, a typical AM process begins with a desired CAD model, usually in the form of an STL file. The model is then transferred to secondary software for slicing. \u0026ldquo;Slicing\u0026rdquo; in AM refers to a computational action that turns 3D design into 2D geometric layers, resulting in corresponding G/M-code commands. At this stage, key parameters such as layer height, printing temperature, printing speed, and infill percentage are defined to determine the quality of the printed parts. These parameters significantly affect the contents of the G/M-code commands and consequently the actual printing process. The main computing device feeds the 3D printer with G/M-code commands line by line and receives a process signal from the printer indicating the successful completion of each command. Since the entire printing process can be conducted remotely in smart manufacturing with limited human supervision, the system faces significant risks of cyberattacks. An infiltrator can modify the CAD model, printing parameters through machine firmware, or G/M-code command lines generated by the slicer to cause product defects, operation errors, system destruction, and/or resource waste. Another loophole exists between the main computer and the 3D printer, where both the commands and the progress logs can be altered.\u003c/p\u003e \u003cp\u003e \u003c/p\u003e \u003cp\u003eThe side channel monitoring system demonstrated in Fig.\u0026nbsp;\u003cspan refid=\"Fig1\" class=\"InternalRef\"\u003e1\u003c/span\u003e is proposed to prevent such cyberattacks. The same slicer software is utilized to generate the same set of G/M-code commands. Then, the interpreter transforms the commands into numerical arrays to train the ML model. The details of the interpreter are elucidated in Section \u003cspan refid=\"Sec4\" class=\"InternalRef\"\u003e2.2\u003c/span\u003e. The essential piece of the current side channel monitoring approach is the ML model, which predicts the energy consumption of the 3D printer for each input command. In other words, the ML model is trained to map the relationship between the G/M-code commands, expressed as numerical arrays by the interpreter, and the energy consumption of commands measured by the power meter. For each command line, the predicted energy consumption is compared with the actual energy consumption measured in real-time, and an anomaly is flagged when a significant deviation is detected between the two. Any changes made by cyberattacks cause a difference in energy consumption, since the modifications will alter motor movements and system parameters. It is worth mentioning that we are not comparing the extracted command lines from the side channel with the actual command lines applied to the system to detect possible attacks because we assume that attackers hide their changes to evade detection.\u003c/p\u003e \u003cp\u003eThe main purpose of the research is to secure the AM process and enable rapid detection of cyberattacks using the side channel monitoring system. To achieve this, the monitoring system must remain isolated from the main AM system. The original CAD model is transferred to both the AM and side channel monitoring systems directly, ensuring a highly secure transmission to the side channel. The CAD model can still be modified within the AM system, but the CAD model received by the side channel is protected. The second data stream comes from the energy meter, which is connected to the main power source of the 3D printer, providing a secure and isolated data stream. The third data stream comes from the 3D printer, delivering information about command execution status and current system temperatures. Since this data is delivered directly from the 3D printer, it cannot be tampered with.\u003c/p\u003e \u003c/div\u003e \u003cdiv id=\"Sec4\" class=\"Section2\"\u003e \u003ch2\u003e2.2. Data Interpreter\u003c/h2\u003e \u003cp\u003eAs for the proof of concept, we implemented the side channel monitoring system on a fused deposition modeling (FDM) 3D printer. In most FDM processes, the print job procedure is determined as follows: (1) print bed heating, (2) nozzle heating, (3) homing, (4) nozzle cleaning, (5) model printing, and (6) finishing. Steps 1 through 4 are preparatory steps and do not constitute a large portion of the total printing time. However, these steps are crucial for the final product, as all the axes and thermal-related tools are properly prepared. The first two steps do not have an estimated completion time because the time required to reach the nozzle and print bed target temperatures depends on the current temperature. Homing, which is the action of moving all actuators back to their initial positions, also cannot be estimated, as the nozzle may end up at a different location after each print. Furthermore, Step 6 is primarily for cooling the system, which is irrelevant to the actual printing process. Therefore, the data we need to acquire are during Step 5, where the majority of valuable information is generated.\u003c/p\u003e \u003cp\u003eTo model the relationship between the command (input) and the energy consumption (output), the data set must be expressed numerically. Therefore, G/M-code commands must be converted to an array of numerical values using the data interpreter. Figure\u0026nbsp;\u003cspan refid=\"Fig2\" class=\"InternalRef\"\u003e2\u003c/span\u003e illustrates the data interpreter we developed for this research. Two consecutive G/M-code command lines are converted to an array of seven columns, indicating seven unique features affecting energy consumption. In G-code, the letters \u0026ldquo;X\u0026rdquo;, \u0026ldquo;Y\u0026rdquo;, and \u0026ldquo;Z\u0026rdquo; followed by numerical values represent the target nozzle position in the X, Y, and Z directions, respectively. To be specific, \u0026ldquo;X90 Y50 Z0.5\u0026rdquo; indicates a nozzle position of (90, 50, 0.5) expressed in the Cartesian coordinate system with the basis along the X, Y, and Z directions. Therefore, any two consecutive G-code commands (i.e., n\u003csup\u003eth\u003c/sup\u003e and n\u0026thinsp;+\u0026thinsp;1th ) provide the movement of the nozzle by specifying start and end positions. ΔX, ΔY, and ΔZ denote changes in nozzle position resulting from executing the (n\u0026thinsp;+\u0026thinsp;1)\u003csup\u003eth\u003c/sup\u003e command. Similarly, the letter \u0026ldquo;E\u0026rdquo; from the G-code represents the extruder length, and ΔE denotes the change in extruder length, indicating how much the motor within the nozzle actuates to extrude the material. The letter \u0026ldquo;F\u0026rdquo; from the G-code represents the feed rate, which defines the rate of feeding the material for printing. In addition, temperature information is included as features since temperature regulation has a huge impact on the energy consumption of the AM system. M-code commands are sent initially to set the nozzle and print bed temperatures. For instance, \u0026ldquo;M140 S200\u0026rdquo; and \u0026ldquo;M104 S50\u0026rdquo; imply \u0026ldquo;set the nozzle temperature to 200\u0026deg;C\u0026rdquo; and \u0026ldquo;set the print bed temperature to 50\u0026deg;C,\u0026rdquo; respectively. Periodically, the current nozzle and print bed temperatures are retrieved, and the temperature differences between the set and current temperatures are added as extra features (i.e., nozzle and print bed temperature errors).\u003c/p\u003e \u003cp\u003e \u003c/p\u003e \u003cp\u003eIn order to train the model, the power meter data must be collected to measure the energy consumption of the system for each G/M-code command. A signal is sent from the 3D printer whenever a command line is executed successfully. This signal is crucial for measuring energy consumption since the start and end times must be identified to incorporate the power meter readings. Consequently, the execution flag signal is labeled with a computer clock time. Once the command execution signal is timestamped, as a post-processing step, power meter readings are integrated using the trapezoid rule within the execution period to measure energy consumption. These energy consumption values are paired with the interpreted data to train the data-driven model.\u003c/p\u003e \u003c/div\u003e \u003cdiv id=\"Sec5\" class=\"Section2\"\u003e \u003ch2\u003e2.3. Command to energy consumption network (C2EN)\u003c/h2\u003e \u003cp\u003eTo effectively develop a cyberattack detection framework, energy consumption must be estimated precisely. There are other existing methods to predict energy consumption for FDM 3D printers. Yi et al. predicted the energy consumption for an FDM 3D printer given printing parameters such as layer thickness, support structure, build speed (feed rate), part size (scale in %), and number of parts [\u003cspan citationid=\"CR22\" class=\"CitationRef\"\u003e22\u003c/span\u003e]. They built a regression model to predict energy consumption, and they found that part size had the largest impact on energy consumption, followed by the number of parts and layer thickness. Lunetto et al. introduced a more sophisticated model by dividing the printing process into multiple stages [\u003cspan citationid=\"CR23\" class=\"CitationRef\"\u003e23\u003c/span\u003e]. Their rationale was that the heating, preparation, and cooling stages consume a similar amount of energy. The only stage that varies in energy consumption is the printing stage, so they predicted the specific energy consumption based on part size. For the rest of the stages, they simply used a statistical approach to estimate energy consumption. On the other hand, Hopkins et al. built a regression model to predict total energy consumption, as a function of time, as well as nozzle and print bed temperatures [\u003cspan citationid=\"CR24\" class=\"CitationRef\"\u003e24\u003c/span\u003e]. Yan et al. introduced a novel method that predicts the total energy consumption for different print models [\u003cspan citationid=\"CR25\" class=\"CitationRef\"\u003e25\u003c/span\u003e]. Their idea was to divide the manufacturing process into multiple stages and obtain the working state matrix that holds information about how much the subsystems are activated during each stage. For example, during the heating stage, the extruder and platform-moving motors are not activated. However, during the material deposition stage, these motors are activated, and the heaters are partially activated. As a consequence, they empirically determined the energy consumption of subsystems and the execution time of different print stages to estimate total energy consumption. All these existing methods can only predict total energy consumption, i.e., the energy required to print the entire prototype. Moreover, two of these methods are not general approaches and require retraining of the prediction models for new printed parts.\u003c/p\u003e \u003cp\u003eFor the current study, we propose a Command to Energy Consumption Network (C2EN) that uses an NN as a backbone to predict the energy consumption for each G/M-code command. Predicting the total energy consumption to detect anomalous events will be less efficient since it requires the printing process to be completed before a decision can be made. By predicting the energy consumption for each command, anomalies can be detected sooner, thereby wasting fewer resources. Additionally, the C2EN model is easier to generalize since the range of features used for training largely overlaps with many print models. The C2EN model is trained in a supervised manner to predict the energy consumption given the seven features, which are change in extruder position (ΔX, ΔY, ΔZ), change in extruder length (ΔE), feed rate (F), nozzle temperature error, and print bed temperature error, as described in Section \u003cspan refid=\"Sec4\" class=\"InternalRef\"\u003e2.2\u003c/span\u003e. To the best of our knowledge, such a model has not been trained and deployed as part of the side channel monitoring system. For the proof of concept, a shallow fully connected NN with two hidden layers containing 28 and 14 neurons is selected. The hyperbolic tangent activation function is applied to all hidden neurons, and a mean squared error loss function is used for training. It is important to mention that optimizing the NN structure or applying various NN structures is not the focus of this work.\u003c/p\u003e \u003c/div\u003e"},{"header":"3. Experiment","content":"\u003cdiv class=\"BlockQuote\"\u003e\n \u003cp\u003eFor the authenticity of the proposed method, a simple AM system was constructed, as depicted in Fig. \u003cspan class=\"InternalRef\"\u003e3\u003c/span\u003e. We selected an FDM 3D printer as the AM system. In particular, the Creality Ender-5 Pro was chosen for this work due to its external plug-in port that allows for data communication. To transmit G/M-code and receive feedback, a serial protocol was established between the main computer and the 3D printer. To ensure efficient communication speed, stable data acquisition, and fast data interpretation, a relatively powerful computing device was required. Consequently, the NVIDIA Jetson Orin (2.2 GHz CPU, 2048 NVIDIA GPU cores with maximum GPU frequency of 1.3 GHz) was selected, which is known for its capability to send, receive, and interpret log data concurrently and seamlessly. Additionally, the power meter (Walfront PZEM-004T) was employed for side channel monitoring, using a current transformer to measure the power line without penetrating or interfering with the actual current values. As mentioned in the previous section, the AM and monitoring systems must be controlled by two independent microcontrollers. However, for experimental purposes, we used a single Jetson Orin to manage both systems to reduce costs. Although the two systems share the same computational unit, they are operated individually without sharing any resources.\u003c/p\u003e\n\u003c/div\u003e\n\u003cp\u003eMost slicer software estimates the printing path of 3D objects by dividing it into small, straight printing lines. For instance, when slicing a circle, the slicer may generate a polygon with multiple sides, depending on the resolution of the slicing parameters. For this reason, several different 3D printed parts (model shapes) were utilized in the experiments to observe various printing patterns. The three print models are a stack, a cube, and a dome, as illustrated in Fig. 4. Printing different models enhances the diversity of the data and ensures that the methodology is adaptable to a wide range of models, even when applied to previously untrained 3D models.\u003c/p\u003e\n\u003cp\u003eFor each of the models in Fig.\u0026nbsp;4, five prints were made: four under normal conditions, and one with attacks present. Due to variations in size and shape across each model, the G/M-code generated by the slicer differs in both pattern and length. Specifically, the stack, dome, and cube models contain 1880, 6290, and 2502 lines of G/M-code commands, respectively. Consequently, print times for these models are approximately 335 s, 975 s, and 566 s, in the same order. Three out of the four normal datasets were used for training and validation of the C2EN model. The C2EN model was trained using the Levenberg-Marquardt optimization algorithm. The model was trained for 500 epochs, with 80% of the data used for training and 20% for validation. The remaining normal dataset and the dataset with attacks were used to evaluate the attack/anomaly detection capability of the proposed side channel monitoring system.\u003c/p\u003e\n\u003cp\u003eIn order to mimic an actual cyberattack to validate our approach, we embedded additional G/M-code commands that were not created during the slicing procedure. This way, the 3D printer behaves differently, causing anomalies or defects during the manufacturing process. As previously mentioned, the embedded G/M-code commands are not visible in the log files since cyberattacks are often hidden by the infiltrator to dodge detection. In other words, even if the attacks are present, the G/M-code file will be equivalent to that of the command file when no attacks are present. Adding or modifying G-code to alter the printing scheme causes immediate defects, which are noticeable in the printed parts or as runtime errors. Since these can be easily detected, M-code commands were implemented to slightly alter the temperature settings of the thermal system, making them difficult to recognize by visual inspection of the printed parts. For normal operations, M-code commands were generated to set the nozzle and print bed temperatures to 200\u0026deg;C and 50\u0026deg;C, respectively. To represent cyberattacks, the M-code commands were randomly generated throughout the run to change the set temperatures by 1 or 2\u0026deg;C. One may argue that these attacks can be detected simply by observing the current temperatures. Nevertheless, these changes were made within a range to ensure that the print process still appears normal. Additionally, any temperature values that exceed normal operating conditions were modified to hide the attacks.\u003c/p\u003e"},{"header":"4. Results and discussion","content":"\u003cdiv id=\"Sec8\" class=\"Section2\"\u003e\n \u003ch2\u003e4.1. C2EN model\u003c/h2\u003e\n \u003cp\u003eThe prediction accuracy of the C2EN model was evaluated using normal datasets that were excluded from training. The predicted and measured energy consumption values are manifested in Fig.\u0026nbsp;5 for the stack, dome, and cube print models. For demonstration purposes, a certain range of command lines was selected for each print model. In general, the predicted energy consumption values closely follow the actual measurements for all three printed parts, indicating precise modeling of the relationship between energy consumption and AM parameters. Small discrepancies between the two curves can be attributed to noise in the power meter measurements. A larger error magnitude is visible for the dome model compared to the stack and cube models.\u003c/p\u003e\n \u003cp\u003eFigure 5a and Fig.\u0026nbsp;5c exhibit small discrepancies between predicted and measured energy consumption values for the stack and cube models, respectively. This is because both models have a relatively simple structure, consisting primarily of straight linear paths. Figure\u0026nbsp;5b depicts the results for the dome model, which shows larger errors compared to the other two models. The complexity of the dome model\u0026rsquo;s profile requires more approximation steps for the slicer, resulting in extremely short tool paths. The limited sampling frequency of the energy meter results in an increase in aliasing, contributing to larger prediction errors. In addition, having more printing segments exposes the printer to increased electromagnetic noise from the motors, thus amplifying the error magnitude.\u003c/p\u003e\n \u003cp\u003eFor numerical comparison, the mean absolute error (MAE), root mean squared error (RMSE), and maximum error were computed and presented in Table \u003cspan class=\"InternalRef\"\u003e1\u003c/span\u003e. For all three models, the MAE and RMSE were found to be less than 1.5 J and 3 J, respectively. However, the maximum errors indicate the presence of some outliers, possibly caused by random heating events related to the temperature regulation of the nozzle and print bed. The standard deviations of absolute errors (STDEs) for all three models were found to be between 1.7 J and 2.6 J. Overall, based on its prediction performance, the C2EN model is valid, indicating that it can be utilized for anomaly/attack detection.\u003c/p\u003e\n \u003cdiv class=\"gridtable\"\u003e\u0026nbsp;\u003ctable id=\"Tab1\" border=\"1\"\u003e\n \u003ccaption language=\"En\"\u003e\n \u003cdiv class=\"CaptionNumber\"\u003eTable 1\u003c/div\u003e\n \u003cdiv class=\"CaptionContent\"\u003e\n \u003cp\u003eC2EN prediction error\u003c/p\u003e\n \u003c/div\u003e\n \u003c/caption\u003e\n \u003ccolgroup cols=\"4\"\u003e\u003c/colgroup\u003e\n \u003cthead\u003e\n \u003ctr\u003e\n \u003cth align=\"left\"\u003e\u0026nbsp;\u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eStack\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eDome\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eCube\u003c/p\u003e\n \u003c/th\u003e\n \u003c/tr\u003e\n \u003c/thead\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e\u003cstrong\u003eMAE\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e1.11 J\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e1.45 J\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e1.28 J\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e\u003cstrong\u003eRMSE\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e2.10 J\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e2.97 J\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e2.28 J\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e\u003cstrong\u003eMaximum Error\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e26.39 J\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e63.01 J\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e23.78 J\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e\u003cstrong\u003eSTDE\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e1.78 J\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e2.59 J\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e1.89 J\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003c/tbody\u003e\n \u003c/table\u003e\n \u003c/div\u003e\n \u003cdiv class=\"BlockQuote\"\u003e\n \u003cp\u003eTo show that our framework can be extended to other AM systems, we trained the C2EN model for a different 3D printer, the PRUSA Research Original Prusa MK4. Since every 3D printer uses different actuators and thermal systems, energy consumption varies. Consequently, energy consumption needs to be measured for various printed objects to retrain the C2EN model. Although the magnitude of energy consumed per command line may differ, the consumption profile must look similar among various 3D printers. As a consequence, we scaled the predicted energy consumption values as an alternative approach to match the actual energy consumed by the new AM system, as demonstrated in Fig. \u003cspan class=\"InternalRef\"\u003e6\u003c/span\u003e. Compared to the Ender-5 Pro, the Original Prusa MK4 consumes less energy throughout the process, and by scaling the C2EN output, the predicted energy consumption generally follows the actual energy consumption, yielding an MAE of 1.89 J. Although accuracy is slightly sacrificed, in this way, there is no need to collect the entire dataset for a different system. Instead, only a small portion of the dataset is required. In other words, the C2EN model can be easily extended to other 3D printers, without intensive data collection and NN retraining.\u003c/p\u003e\n \u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"Sec9\" class=\"Section2\"\u003e\n \u003ch2\u003e4.2. Attack detection\u003c/h2\u003e\n \u003cdiv class=\"BlockQuote\"\u003e\n \u003cp\u003eThe trained C2EN model was adopted to detect cyberattacks in the AM system. Recall that the C2EN model was trained only on data collected during normal operation. As a consequence, the energy consumption predicted by the C2EN model is expected to deviate from the measured energy consumption in the presence of cyberattacks, since such attacks change the energy profile of the system. That is, the prediction error becomes larger than that observed during the C2EN model validation. Figure \u003cspan class=\"InternalRef\"\u003e6\u003c/span\u003e shows the predicted and actual (or measured) energy consumption in the presence of cyberattacks that alter the operational temperatures. It is apparent from the figure that the measured and predicted energy profiles do not align well throughout the manufacturing process when compared to the normal operation shown in Fig. 5. The measured values are often either smaller or larger than the predicted values, implying that the magnitude of the prediction error corresponds to the changes made by undesirable infiltrations.\u003c/p\u003e\n \u003cp\u003eFor an in-depth analysis, numerical errors are computed and presented in Table \u003cspan class=\"InternalRef\"\u003e2\u003c/span\u003e in the same manner as in Table \u003cspan class=\"InternalRef\"\u003e1\u003c/span\u003e. The numerical values clearly indicate that the magnitude of errors increased significantly for all three printed models. For all models, the MAE increased by a factor of 7, and the RSME increased by 6 to 8 times. The stack model exhibits greater deviation compared to the other two models. This is because the stack model has the highest attack-to-normal ratio in terms of duration. The print time of the stack model is significantly shorter than that of the dome and cube models. However, all three models experienced a similar number of temperature modifications. For the same reason, the STDE of the stack model is approximately 4 J higher than the other two models. The magnitudes of maximum errors for all models indicate that the cyberattacks significantly impact the energy consumption in AM systems.\u003c/p\u003e\n \u003c/div\u003e\n \u003cdiv class=\"gridtable\"\u003e\u0026nbsp;\u003ctable id=\"Tab2\" border=\"1\"\u003e\n \u003ccaption language=\"En\"\u003e\n \u003cdiv class=\"CaptionNumber\"\u003eTable 2\u003c/div\u003e\n \u003cdiv class=\"CaptionContent\"\u003e\n \u003cp\u003eC2EN prediction error in presence of cyberattacks\u003c/p\u003e\n \u003c/div\u003e\n \u003c/caption\u003e\n \u003ccolgroup cols=\"4\"\u003e\u003c/colgroup\u003e\n \u003cthead\u003e\n \u003ctr\u003e\n \u003cth align=\"left\"\u003e\u0026nbsp;\u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eStack\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eDome\u003c/p\u003e\n \u003c/th\u003e\n \u003cth align=\"left\"\u003e\n \u003cp\u003eCube\u003c/p\u003e\n \u003c/th\u003e\n \u003c/tr\u003e\n \u003c/thead\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e\u003cstrong\u003eMAE\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e7.86 J\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e7.07 J\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e7.51 J\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e\u003cstrong\u003eRMSE\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e16.12 J\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e12.66 J\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e12.89 J\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e\u003cstrong\u003eMaximum Error\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e92.51 J\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e191.84 J\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e61.57 J\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e\u003cstrong\u003eSTDE\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e14.07 J\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e10.50 J\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd align=\"left\"\u003e\n \u003cp\u003e10.48 J\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003c/tbody\u003e\n \u003c/table\u003e\n \u003c/div\u003e\n \u003cdiv class=\"BlockQuote\"\u003e\n \u003cp\u003eWithout a doubt, the C2EN prediction accuracy can indicate the presence of cyberattacks. However, simply using a threshold value may result in many false positives due to the presence of outliers even during normal operation, as illustrated in Fig. 5 and Table \u003cspan class=\"InternalRef\"\u003e1\u003c/span\u003e. To avoid false positives, an ideal approach is to compute the moving average error for a certain window size so that the peak errors blend, resulting in an error curve that only reflects a trend. It is essential to mention that various window sizes and weighting methods were tested and compared. A larger window size filters the noise and makes the curve smoother, but it can cause some errors to disappear. By applying exponential or linear weighting to compute the moving average, unwanted effects of smoothing can be reduced. Nevertheless, we selected uniform weights since we observed negligible differences and chose a window size of 20 because it balanced the trade-off between smoothing and losing information. Once the raw error is filtered by taking the moving average over a specified window, the threshold is selected based on the MAE and STDE. The threshold can be determined for each model using the following equation:\u003c/p\u003e\n \u003c/div\u003e\n \u003cdiv id=\"Equ1\" class=\"Equation\"\u003e\n \u003cdiv class=\"mathdisplay\" id=\"FileID_Equ1\" name=\"EquationSource\"\u003e$$\\:\\tau\\:=\\text{M}\\text{A}\\text{E}+k\\left(\\text{S}\\text{T}\\text{D}\\text{E}\\right)$$\u003c/div\u003e\n \u003cdiv class=\"EquationNumber\"\u003e1\u003c/div\u003e\n \u003c/div\u003e\n \u003cp\u003ewhere, \u003cspan class=\"InlineEquation\"\u003e\u003cspan class=\"mathinline\"\u003e\\(\\:\\tau\\:\\)\u003c/span\u003e\u003c/span\u003e denotes threshold and \u003cspan class=\"InlineEquation\"\u003e\u003cspan class=\"mathinline\"\u003e\\(\\:k\\)\u003c/span\u003e\u003c/span\u003e denotes a constant multiplier. It is common to select \u003cem\u003ek\u003c/em\u003e to be between 2 and 3 to detect outliers [\u003cspan class=\"CitationRef\"\u003e26\u003c/span\u003e]. For this work, we empirically selected \u003cem\u003ek\u003c/em\u003e to be equal to 2, which rejected most false positives while being sensitive to malicious events.\u003c/p\u003e\n \u003cdiv class=\"BlockQuote\"\u003e\n \u003cp\u003eThe anomaly detection results for the stack, dome, and cube print models are respectively presented in Fig.\u0026nbsp;7, Fig.\u0026nbsp;8, and Fig.\u0026nbsp;9. In these figures, the first row presents predicted errors. The second row shows filtered errors and a predefined threshold for anomaly detection. The third and fourth rows illustrate the variations in print bed and nozzle set temperatures due to cyberattacks. Within these plots, magenta markers indicate detected attacks, and cyan markers indicate false detections during the manufacturing process.\u003c/p\u003e\n \u003c/div\u003e\n \u003cdiv class=\"BlockQuote\"\u003e\n \u003cp\u003eIn Fig. 7, around the 120th command index, both the print bed and nozzle temperatures increase, causing noticeable peak errors. Nonetheless, the filtered error begins to exceed the threshold around 190th command index. This demonstrates that error filtering reduces false positives but causes a delay in attack detection. Between the 500th and 600th command index, both temperatures return to normal, and no errors are detected during this period due to filtering. One noteworthy observation is that shortly after the 600th command index, both temperatures drop to lower values, yet no attacks are detected. A straightforward explanation is that the heaters remained off during this period, so the energy consumption predictions remained accurate. However, when the temperature increased back to normal around the 900th command index, the error rose significantly because the subsystems needed to be heated again to maintain normal operational temperatures. As a result, even when the temperatures returned to normal, the error remained significantly high. From then on, the set temperatures increase again causing a large deviation until the 1400th command index. During this period, large errors are observed because the system experiences substantial increase in both nozzle and print bed temperatures. The error begins to decrease afterwards as the temperatures drop back to the normal status. Based on these observations, there are delays in attack detection, especially when the set temperatures are reduced. Moreover, the attacks cannot be detected throughout the entire attack period, but they are flagged multiple times during the manufacturing process. Additionally, there are two false positive detections around the 1087th command index, where the normal energy consumption experienced a small peak.\u003c/p\u003e\n \u003c/div\u003e\n \u003cp\u003eIn Fig. 8, the result for the dome model is presented, which illustrates a smaller mean prediction error but a larger maximum error compared to the stack model shown in Fig. 7. Due to the large peak errors that appear in several locations during for the normal run, even with the current filtering process, false detections are observed throughout the run. These can be removed by increasing the threshold slightly because they mostly cross the threshold value for a very short period of time. For instance, at roughly the 600th index, there is a peak from normal data that crosses the threshold, but these false detections only last for about 20 indices. In particular, at the 660th and 780th index, there are small peaks during the normal run that cross the threshold, but these false detections only last for 20 and 9 indices, respectively. Other false detections detected at the 930th, 1200th, and 1730th indices only last for short periods. A possible reason for the large number of false positives for the dome model is that the model consists of many G-code commands for extremely short print distances, causing difficulties in precise power measurements. Nonetheless, for consistency, we used the same \u003cem\u003ek\u003c/em\u003e value in Eq.\u0026nbsp;(\u003cspan class=\"InternalRef\"\u003e1\u003c/span\u003e) to detect the attacks. In general, the threshold performed well across the whole process. From the beginning of the printing process, cyberattacks are consistently applied to alter the nozzle and print bed set temperatures, and they are detected. From the 3200th index to the 3600th index, both nozzle and print bed temperatures were set back to normal. Therefore, no attacks are detected during this period to raise alarms. Shortly after, attacks are applied again until the end of the printing process. At this stage, attacks are detected but not for the entire attack period. Although the detections are not made throughout the attack period, cyberattacks are frequently detected and triggered as events, validating the proposed method.\u003c/p\u003e\n \u003cdiv class=\"BlockQuote\"\u003e\n \u003cp\u003eFigure 9 shows the result for the cube model. Attacks are observable almost from the beginning of the printing process, and they are detected after the 50th index. However, from the actual error plot, spikes are observed soon after the attacks. Around the 500th index, both temperatures are set back to normal, but detection stops earlier, at around 390th index. Nonetheless, compared to the normal case, the filtered predicted error seems to be larger throughout the run, indicating abnormal events. After the 900th index, attacks are almost continuously detected since either one of the temperatures is in an abnormal state. In contrast to the dome and cube models, no false detections are visible, as all the filtered prediction errors are strictly below the threshold, implying fewer outliers due to having more moderate tool paths.\u003c/p\u003e\n \u003cp\u003eIn general, for all three models, cyberattacks are successfully detected using the proposed method. The magnitude of prediction error distinctly increases in the presence of attacks throughout the manufacturing process. Furthermore, by using the C2EN model to predict energy consumption for each G/M-code command, attacks are detected soon after they are applied. In this way, users can decide to halt and terminate the printing process in a timely manner to avoid further losses.\u003c/p\u003e\n \u003c/div\u003e\n\u003c/div\u003e"},{"header":"5. Conclusion","content":"\u003cp\u003eCyberattack detection for AM systems is a challenging problem in modern industrial chains. To enhance the security of the AM system, a reliable side-channel monitoring system is necessary. In this work, we developed a non-invasive, affordable, and low-maintenance side-channel monitoring solution using a power meter. By employing the power meter, the energy consumption of each G/M-code command was measured. Based on the collected data, the C2EN model was trained to predict the energy consumption for each command line applied to the AM system. Since most cyberattacks change the energy profile of the system, the C2EN prediction error increased in the presence of attacks because the model was trained using the data collected during normal operation (i.e., without attacks). Moreover, our method was able to detect the attacks at an early stage since we compared the energy consumption prediction for each command line, providing users with an opportunity to intervene in the printing process whenever necessary to reduce material and time losses and prevent further defects if failed products are to be used. To mimic the cyberattacks, we modified the operational temperatures of the print bed and nozzle by 1 or 2 degrees. With these attacks, the prediction errors increased approximately seven times compared to attack-free cases. A small number of false positives were observed, but in general, attacks were precisely detected, validating the performance of the proposed approach.\u003c/p\u003e \u003cp\u003eDespite the salient performance of the proposed framework, a couple of limitations were identified. First, since it takes time for the cyberattack to change the energy profile, attacks cannot be detected in real-time. Second, the attacks cannot be detected for the entire attack period because the heaters are not always active to regulate the set temperatures. In other words, predictions are typically accurate when the heaters are off, even during the attacks. To enhance the performance of the proposed framework, we plan to explore different detection algorithms rather than relying on a simple threshold method. Furthermore, we plan to implement different types of cyberattacks to modify other parameters of the AM process and further evaluate the proposed method.\u003c/p\u003e"},{"header":"Statements and Declarations","content":"\u003cp\u003e\u003cem\u003eFunding\u003c/em\u003e: The authors declare that no funds, grants, or other support were received during the preparation of this manuscript.\u003c/p\u003e\n\u003cp\u003e\u003cem\u003eCompeting Interests\u003c/em\u003e: The authors have no relevant financial or non-financial interests to disclose. \u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u003cem\u003eData Availability\u003c/em\u003e: The data collected and used for training the machine learning model is publicly available at https://github.com/fit-ipcl/CPS_C2EN_data. Any additional data that supports the findings of the current study is available upon request.\u003c/p\u003e"},{"header":"References","content":"\u003col\u003e\n \u003cli\u003eKarkun, M.S. and Dharmalingam, S., 2022. 3D printing technology in aerospace industry\u0026ndash;a review. \u003cem\u003eInternational Journal of Aviation, Aeronautics, and Aerospace\u003c/em\u003e, \u003cem\u003e9\u003c/em\u003e(2), p.4.\u003c/li\u003e\n \u003cli\u003eTrenfield, S.J., Awad, A., Madla, C.M., Hatton, G.B., Firth, J., Goyanes, A., Gaisford, S. and Basit, A.W., 2019. Shaping the future: recent advances of 3D printing in drug delivery and healthcare. \u003cem\u003eExpert opinion on drug delivery\u003c/em\u003e, \u003cem\u003e16\u003c/em\u003e(10), pp.1081-1094.\u003c/li\u003e\n \u003cli\u003eLee, R.M., Assante, M.J. and Conway, T., 2014. German steel mill cyber attack. \u003cem\u003eIndustrial Control Systems\u003c/em\u003e, \u003cem\u003e30\u003c/em\u003e(62), pp.1-15.\u003c/li\u003e\n \u003cli\u003eSlay, J. and Miller, M., 2007, March. Lessons learned from the maroochy water breach. In \u003cem\u003eInternational conference on critical infrastructure protection\u003c/em\u003e (pp. 73-82). Boston, MA: Springer US.\u003c/li\u003e\n \u003cli\u003eBencs\u0026aacute;th, B., P\u0026eacute;k, G., Butty\u0026aacute;n, L. and F\u0026eacute;legyh\u0026aacute;zi, M., 2011. Duqu: A Stuxnet-like malware found in the wild. \u003cem\u003eCrySyS Lab Technical Report\u003c/em\u003e, \u003cem\u003e14\u003c/em\u003e, pp.1-60.\u003c/li\u003e\n \u003cli\u003eGao, Y., Li, B., Wang, W., Xu, W., Zhou, C. and Jin, Z., 2018. Watching and safeguarding your 3D printer: Online process monitoring against cyber-physical attacks. Proceedings of the ACM on Interactive, Mobile, Wearable and Ubiquitous Technologies, 2(3), pp.1-27.\u003c/li\u003e\n \u003cli\u003ePearce, H., Yanamandra, K., Gupta, N., \u0026amp; Karri, R. (2022). Flaw3d: A trojan-based cyber attack on the physical outcomes of additive manufacturing. \u003cem\u003eIEEE/ASME Transactions on Mechatronics\u003c/em\u003e, \u003cem\u003e27\u003c/em\u003e(6), 5361-5370.\u003c/li\u003e\n \u003cli\u003eAlkofahi, H., Alawneh, H., \u0026amp; Skjellum, A. (2024). MitM attacks on intellectual property and integrity of additive manufacturing systems: A security analysis. \u003cem\u003eComputers \u0026amp; Security\u003c/em\u003e, \u003cem\u003e140\u003c/em\u003e, 103810.\u003c/li\u003e\n \u003cli\u003eYan, H., Grasso, M., Paynabar, K. and Colosimo, B.M., 2022. Real-time detection of clustered events in video-imaging data with applications to additive manufacturing. IISE Transactions, 54(5), pp.464-480.\u003c/li\u003e\n \u003cli\u003eShi, Z., Kan, C., Tian, W. and Liu, C., 2021. A Blockchain-based G-code protection approach for cyber-physical security in additive manufacturing. Journal of Computing and Information Science in Engineering, 21(4), p.041007.\u003c/li\u003e\n \u003cli\u003eSaraeian, S. and Shirazi, B., 2020. Process mining-based anomaly detection of additive manufacturing process activities using a game theory modeling approach. \u003cem\u003eComputers \u0026amp; Industrial Engineering\u003c/em\u003e, \u003cem\u003e146\u003c/em\u003e, p.106584.\u003c/li\u003e\n \u003cli\u003eStraub, J., 2017, June. Identifying positioning-based attacks against 3D printed objects and the 3D printing process. In \u003cem\u003ePattern Recognition and Tracking XXVIII\u003c/em\u003e (Vol. 10203, pp. 22-34). SPIE.\u003c/li\u003e\n \u003cli\u003eChhetri, S.R., Canedo, A. and Al Faruque, M.A., 2016, November. Kcad: kinetic cyber-attack detection method for cyber-physical additive manufacturing systems. In 2016 IEEE/ACM International Conference on Computer-Aided Design (ICCAD) (pp. 1-8). IEEE.\u003c/li\u003e\n \u003cli\u003eBelikovetsky, S., Solewicz, Y.A., Yampolskiy, M., Toh, J. and Elovici, Y., 2018. Digital audio signature for 3D printing integrity. \u003cem\u003eieee transactions on information forensics and security\u003c/em\u003e, \u003cem\u003e14\u003c/em\u003e(5), pp.1127-1141.\u003c/li\u003e\n \u003cli\u003eHong, S.H., Kyzer, T., Cornelius, J., Zahiri, F. and Wang, Y., 2022, March. Intelligent anomaly detection of robot manipulator based on energy consumption auditing. In \u003cem\u003e2022 IEEE aerospace conference (AERO)\u003c/em\u003e (pp. 1-11). IEEE.\u003c/li\u003e\n \u003cli\u003eRandolph, M. and Diehl, W., 2020. Power side-channel attack analysis: A review of 20 years of study for the layman. Cryptography, 4(2), p.15.\u003c/li\u003e\n \u003cli\u003eGatlin, J., Belikovetsky, S., Moore, S.B., Solewicz, Y., Elovici, Y. and Yampolskiy, M., 2019. Detecting sabotage attacks in additive manufacturing using actuator power signatures. \u003cem\u003eIEEE Access\u003c/em\u003e, \u003cem\u003e7\u003c/em\u003e, pp.133421-133432.\u003c/li\u003e\n \u003cli\u003eGatlin, J., Belikovetsky, S., Elovici, Y., Skjellum, A., Lubell, J., Witherell, P. and Yampolskiy, M., 2021, October. Encryption is futile: Reconstructing 3d-printed models using the power side-channel. In Proceedings of the 24th International Symposium on Research in Attacks, Intrusions and Defenses (pp. 135-147).\u003c/li\u003e\n \u003cli\u003eShi, Z., Mamun, A.A., Kan, C., Tian, W. and Liu, C., 2023. An LSTM-autoencoder based online side channel monitoring approach for cyber-physical attack detection in additive manufacturing. Journal of Intelligent Manufacturing, pp.1-17.\u003c/li\u003e\n \u003cli\u003eScime, L. and Beuth, J., 2018. Anomaly detection and classification in a laser powder bed additive manufacturing process using a trained computer vision algorithm. Additive Manufacturing, 19, pp.114-126.\u003c/li\u003e\n \u003cli\u003eYu, S.Y., Malawade, A.V., Chhetri, S.R. and Al Faruque, M.A., 2020. Sabotage attack detection for additive manufacturing systems. IEEE Access, 8, pp.27218-27231.\u003c/li\u003e\n \u003cli\u003eTan, Y., Jin, B., Nettekoven, A., Chen, Y., Yue, Y., Topcu, U. and Sangiovanni-Vincentelli, A., 2019, December. An encoder-decoder based approach for anomaly detection with application in additive manufacturing. In 2019 18th IEEE international conference on machine learning and applications (ICMLA) (pp. 1008-1015). IEEE.\u003c/li\u003e\n \u003cli\u003eWu, M., Song, Z. and Moon, Y.B., 2019. Detecting cyber-physical attacks in CyberManufacturing systems with machine learning methods. \u003cem\u003eJournal of intelligent manufacturing\u003c/em\u003e, \u003cem\u003e30\u003c/em\u003e(3), pp.1111-1123.\u003c/li\u003e\n \u003cli\u003eYi, L., Chen, T., Ehmsen, S., Gl\u0026auml;\u0026szlig;ner, C., \u0026amp; Aurich, J. C. (2020). A study on impact factors of the energy consumption of the fused deposition modeling process using two-level full factorial experiments. \u003cem\u003eProcedia CIRP\u003c/em\u003e, \u003cem\u003e93\u003c/em\u003e, 79-84.\u003c/li\u003e\n \u003cli\u003eLunetto, V., Priarone, P. C., Galati, M., \u0026amp; Minetola, P. (2020). On the correlation between process parameters and specific energy consumption in fused deposition modelling. \u003cem\u003eJournal of Manufacturing Processes\u003c/em\u003e, \u003cem\u003e56\u003c/em\u003e, 1039-1049.\u003c/li\u003e\n \u003cli\u003eHopkins, N., Jiang, L. and Brooks, H., 2021. Energy consumption of common desktop additive manufacturing technologies. \u003cem\u003eCleaner Engineering and Technology\u003c/em\u003e, \u003cem\u003e2\u003c/em\u003e, p.100068.\u003c/li\u003e\n \u003cli\u003eYan, Z., Huang, J., Lv, J., Hui, J., Liu, Y., Zhang, H., Yin, E. and Liu, Q., 2022. A new method of predicting the energy consumption of additive manufacturing considering the component working state. \u003cem\u003eSustainability\u003c/em\u003e, \u003cem\u003e14\u003c/em\u003e(7), p.3757.\u003c/li\u003e\n \u003cli\u003eLeys, C., Ley, C., Klein, O., Bernard, P. and Licata, L., 2013. Detecting outliers: Do not use standard deviation around the mean, use absolute deviation around the median. \u003cem\u003eJournal of experimental social psychology\u003c/em\u003e, \u003cem\u003e49\u003c/em\u003e(4), pp.764-766.\u003c/li\u003e\n\u003c/ol\u003e"}],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":true,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":false,"hideJournal":false,"highlight":"","institution":"","isAcceptedByJournal":true,"isAuthorSuppliedPdf":false,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":false,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"[email protected]","identity":"the-international-journal-of-advanced-manufacturing-technology","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":false,"externalIdentity":"jamt","sideBox":"Learn more about [The International Journal of Advanced Manufacturing Technology](https://www.springer.com/journal/170)","snPcode":"170","submissionUrl":"https://submission.nature.com/new-submission/170/3","title":"The International Journal of Advanced Manufacturing Technology","twitterHandle":"","acdcEnabled":true,"dfaEnabled":true,"editorialSystem":"em","reportingPortfolio":"Springer Hybrid","inReviewEnabled":true,"inReviewRevisionsEnabled":false},"keywords":"additive manufacturing, side channel monitoring, cyber physical system, neural network, attack detection","lastPublishedDoi":"10.21203/rs.3.rs-6346058/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-6346058/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"\u003cp\u003eAdditive manufacturing (AM) combined with the innovation of the Internet of Things (IoT) has made manufacturing faster and more convenient than ever. However, increased connectivity has exposed systems to potential security breaches. To address this vulnerability, this study presents a novel methodology to monitor AM systems using a side-channel monitoring framework based on a power meter. The power meter measures the energy consumption of every G/M-code command. Concurrently, a machine learning (ML) model is trained to predict energy consumption for each G/M-code command in the absence of cyberattacks. Consequently, when attacks occur in the system, the energy consumption prediction errors increase, indicating the presence of malicious activity. Our method is validated with three different print models to ensure robustness and generalizability. For all models, the prediction error increased by a factor of seven during attacks that altered the operating temperatures by 1 or 2 degrees. The results demonstrate the effectiveness of the proposed method in detecting attacks and anomalies in a timely manner.\u003c/p\u003e","manuscriptTitle":"Monitoring Energy Consumption for Cyberattack Detection in Additive Manufacturing Systems","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2025-04-23 16:22:36","doi":"10.21203/rs.3.rs-6346058/v1","editorialEvents":[{"type":"communityComments","content":0},{"type":"decision","content":"Major Revisions Needed","date":"2025-08-21T08:42:09+00:00","index":"","fulltext":""},{"type":"reviewerAgreed","content":"","date":"2025-04-03T07:22:16+00:00","index":0,"fulltext":""},{"type":"reviewersInvited","content":"","date":"2025-04-02T12:35:21+00:00","index":"","fulltext":""},{"type":"editorAssigned","content":"","date":"2025-04-02T03:41:40+00:00","index":"","fulltext":""},{"type":"submitted","content":"The International Journal of Advanced Manufacturing Technology","date":"2025-03-31T11:06:29+00:00","index":"","fulltext":""}],"status":"published","journal":{"display":true,"email":"[email protected]","identity":"the-international-journal-of-advanced-manufacturing-technology","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":false,"externalIdentity":"jamt","sideBox":"Learn more about [The International Journal of Advanced Manufacturing Technology](https://www.springer.com/journal/170)","snPcode":"170","submissionUrl":"https://submission.nature.com/new-submission/170/3","title":"The International Journal of Advanced Manufacturing Technology","twitterHandle":"","acdcEnabled":true,"dfaEnabled":true,"editorialSystem":"em","reportingPortfolio":"Springer Hybrid","inReviewEnabled":true,"inReviewRevisionsEnabled":false}}],"origin":"","ownerIdentity":"a2646a79-334f-41da-9cb3-2aa16003f775","owner":[],"postedDate":"April 23rd, 2025","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"published-in-journal","subjectAreas":[],"tags":[],"updatedAt":"2025-09-29T16:05:06+00:00","versionOfRecord":{"articleIdentity":"rs-6346058","link":"https://doi.org/10.1007/s00170-025-16551-2","journal":{"identity":"the-international-journal-of-advanced-manufacturing-technology","isVorOnly":false,"title":"The International Journal of Advanced Manufacturing Technology"},"publishedOn":"2025-09-26 15:57:05","publishedOnDateReadable":"September 26th, 2025"},"versionCreatedAt":"2025-04-23 16:22:36","video":"","vorDoi":"10.1007/s00170-025-16551-2","vorDoiUrl":"https://doi.org/10.1007/s00170-025-16551-2","workflowStages":[]},"version":"v1","identity":"rs-6346058","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-6346058","identity":"rs-6346058","version":["v1"]},"buildId":"8U1c8b4HqxoKbykW_rLl7","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}

Text is read by the "Ask this paper" AI Q&A widget below. Extraction quality varies by source — PMC NXML preserves structure cleanly, OA-HTML may include some navigation residue, and OA-PDF can have broken hyphenation. The publisher copy (via DOI) is the canonical version.

My notes (saved in your browser only)

Ask this paper AI returns verbatim quotes from the full text · source: preprint-html

Answers must be backed by verbatim quotes from this paper's full text. Hallucinated quotes are dropped automatically; if no verbatim passage answers the question, we say so. How this works

Citation neighborhood (no data yet)

We don't have any in-corpus citations linked to this paper yet. This is a recent paper (2025) — citers typically take a year or two to land, and the OpenAlex reference graph may still be filling in.

Source provenance

europepmc
last seen: 2026-05-20T01:45:00.602351+00:00