# Enhancing Data Integrity in Blockchain Oracles Through Multi-Label Analysis
## 3 Methods
### Characteristics Are Defined as Precision, Completeness, Consistency, and Reliability in the Data  
In the third phase of data preparation, the collected data were thoroughly cleaned and transformed to be utilized in machine learning models, particularly an Oracle test. This Oracle primarily aims to assess data integrity, considering the context of future coffee contracts. The dataset was labeled using various functions that assign binary values (0 and 1) to evaluate different integrity characteristics to achieve this. For example, in the evaluate precision function, a value of 1 is assigned to the column's precision altitude and precision temperature, as well as other variables, if their values fall within the specific ranges described in Table 2. It indicates that the data are accurate; \begin{table}
\begin{tabular}{l l l} \hline
**Parameter** & **Description** & **Value/Configuration** \\ \hline Algorithm & Type of neural network used for simulation & GANs + LSTM \\ Phosphorus (P) & Simulated fertilizer usage (kg/ha) & 30, 40, 50 \\ Potassium (K) & Simulated fertilizer usage (kg/ha) & 200, 220, 240 \\ Calcium (Ca) & Simulated fertilizer usage (kg/ha) & 2, 3, 35 \\ Magnesium (Mg) & Simulated fertilizer usage within an appropriate range & To define \\ GAN Loss Function & Measures the difference between real and generated data & Binary Cross-Entropy \\ GAN Optimizer & Optimizes the loss function & Adam (lr = 0.0002, \(\beta\)1 = 0.5) \\ Latent Space (GAN) & The dimensionality of the latent space for the generator input & 100 \\ LSTM Units & Number of neurons per LSTM layer & 50–100 \\ LSTM Regularization & Prevents overfitting in LSTM & Dropout 0.2–0.3 \\ Epochs & Number of iterations over the training data & 1000 (adjustable based on model performance) \\ \hline \end{tabular}
\end{table} 
Table 3: Data integrity labeling for coffee cultivation variables. Figure 2: LSTM vs GANs predictions. otherwise, if the data are not reliable, a value of 0 is assigned. The evaluate coherence function ensures that the relationships between the variables are logical; for instance, if drip irrigation is \"No\" and humidity exceeds 80%, 0 indicates a possible inconsistency in the data. Additional functions, such as completeness and reliability evaluation, help identify complete and reliable records by assigning 1 or 0 according to predefined criteria [35]. These labeling and evaluation processes are essential for identifying data that do not meet the required standards, allowing for their subsequent exclusion or marking as anomalies [35]. They are crucial for ensuring the quality and integrity of the data used in the test oracle and, consequently, for the effective operation of coffee futures contracts, as exemplified in Table 4.  
Once the integrity of all variables was evaluated, it was observed that, among the four characteristics of integrity, precision had a greater weight in positive labels compared to the others (as shown in Figure 3). This is reflected in the characteristics of the labels, with 4000 labels for precision, while each of the categories of consistency, completeness, and reliability accounted for 2000 labels. The dataset consists of 20,000 records, labeled this way to detect primarily non-integral data. Despite its size, this small number of positive or accurate labels suggests that the majority percentage in the dataset is due to many outliers, negatively impacting data quality. In percentage terms, this implies that 20% of the labels correspond to precision, while each category of coherence, completeness, and reliability represents 10% of the total labels.