# Predicting the Impact of Data Poisoning Attacks in Blockchain-Enabled Supply Chain Networks
## 4 Experiment
### Experiment Analysis  
Data poisoning attacks are a type of attack that targets the vulnerability of machine learning models' training data. By injecting malicious samples into the training data, the attackers can manipulate the model's behaviour and compromise its integrity. Data poisoning attacks can devastate a real-world supply chain network, especially if the network relies on machine learning models for its operations. One example of such a scenario is the ordering system network within a company that operates a distribution centre. The ordering system network uses a machine learning model based on intrusion detection and prevention systems (IDPSs) to monitor network traffic and detect or prevent malicious activities. However, suppose an attacker can poison the IDPS model and gain access to the backend server. In that case, they can modify the ordering system and overload the distribution centre with excessive or fraudulent orders. This can cause serious losses for the company in terms of money, time, and reputation. Moreover, the attack can cascade effects throughout the overall supply chain network, disrupting the flow of goods and services from the suppliers to the customers. The attack can create bottlenecks, delays, shortages, or surpluses in the network, depending on the nature and magnitude of the order modifications. For example, suppose the attacker increases the orders for some products and decreases the orders for others. In that case, this can affect the company's and its suppliers' inventory levels and demand forecasts. This can lead to the overstocking or understocking of some products, resulting in waste or lost sales. Alternatively, if the attacker cancels or duplicates some orders, this can affect the delivery schedules and customer satisfaction of both the company and its customers. This can lead to missed deadlines or over-deliveries, resulting in penalties or refunds. The attack can also affect the trust and collaboration among the supply chain partners, as they may be unable to verify or communicate with each other about the order changes. This can increase the risk and uncertainty in the network, as they may not be able to coordinate their actions or respond to contingencies effectively. These effects can have long-term consequences for the competitiveness and sustainability of the network, as they may erode its reputation, efficiency, and resilience [29; 30]. Figure 11: (a) Loss vs. validation loss in poisoned neural network; (b) accuracy vs. val accuracy in poisoned neural network; and (c) poisoned model performance report. To evaluate the impact of data poisoning attacks on machine learning models based on IDPSs, we conducted experiments using five different models: logistic regression, random forest, support vector machine, XGBoost, and an artificial neural network. We trained and tested these models on two datasets: a non-poisoned dataset that does not contain any label changes and a poisoned dataset that is generated using two different attacks--random label flipping and distance-based label flipping. The random label flipping attack randomly changes the labels of some instances in the training data, with a probability of 0.1, to mislead the model. The distance-based label flipping attack changes the labels of some instances close to the model's decision boundary, with a distance threshold of 0.5, to confuse the model. The results of our experiments are shown in Tables 2-4 and Figures 7-11. Table 2 shows the performance metrics of all models on the non-poisoned dataset. The results show that all models have a reasonable accuracy and F1 Score on this dataset, with the logistic regression, Figure 7a, having the highest values (0.858 and 0.868, respectively) and the random forest, Figure 7b, having the lowest values (0.83 and 0.82, respectively). Table 3 shows the performance metrics of all models on the poisoned dataset generated using the random label flipping attack.