## 3 Proposed Work
### Recovering the Original Image and Hidden Information
#### 3.3.1 Training of the Machine-Learning Models  
The feature set to train and validate the different ensemble learning algorithms is selected from four different images that are randomly chosen from the USC-SIPI image database. The SVM model and the KNN model are trained on a set of five feature vectors. For this, we computed the feature vector on 240 different blocks of size \(8\times 8\) pixels. From the selected set of 240 blocks, 120 are original and the rest of the 120 are encrypted blocks. The third model, called CNN, is trained to act as a binary classifier by taking the original and encrypted blocks directly as input. The CNN model is trained with \(16,384\) blocks. A total of 75% of these blocks were used for training the model and the rest of the 25% blocks were used for validation. Figure 4: Illustration of the recovery of the hidden secret information. ```
Input: An image \(E^{\prime}\) of size \(M\times N\) pixels which are encrypted and embedded with the secret information \(I\), feature vector table, classification table, a folder with the original and encrypted blocks, and the decryption key \(K\). Output: The recovered original image \(IM\) and the recovered information stream \(I\). Let \(IM\) be the recovered image of size \(M\times N\) initialized to zero. Let \(SVMModel\) be the trained support vector machine model on input feature vectors and class. Let \(KNNModel\) be the trained K-nearest neighbor model on input feature vectors and class. Set the number of neighbors \(k=10\). Let \(CNNModel\) be the trained convolutional neural network model on the original and encrypted blocks. Divide the image \(E^{\prime}\) into non-overlapping blocks \(NB\) of fixed size \(A\times A\) pixels. Generate a pseudo-random matrix \(G\) of size \(M\times N\) pixels whose values are within [0-255] using the decryption key \(K\). \(r=1\); \(s=1\); while\((r\leq M-A+1)\)do while\((s\leq N-A+1)\)do  Get each block \(NB_{i}\) of size \(A\times A\) pixels from \(E^{\prime}\). /* \(i\) is the index of the block \(NB\) in \(E^{\prime}\). */  Get each block \(G_{i}\) of size \(A\times A\) pixels from the pseudo-random matrix \(G\). /* \(i\) is the index of that block in \(G\). */ \(t=1\); \(RB=B_{i}\) while\((t\leq A)\)do  Pass the block \(NB_{i}\) and \(t\) to the FibonacciTransform function. The /* FibonacciTransform function returns a block \(NB_{i}^{t}\) after embedding \(t\) in the block \(NB_{i}\). */  Decrypt the block \(NB_{i}^{t}\) by XORing with \(G_{i}\). /* Let the decrypted block be \(DB_{i}^{t}\). */  Compute the feature vector \(F\) of \(DB_{i}^{t}\). Predict the \(label1\) and \(confidence1\) by passing \(F\) to \(SVMModel\). Predict the \(label2\) and \(confidence2\) by passing the block \(BB_{i}^{t}\) to \(CNNModel\). Predict the \(label3\) and \(confidence3\) by passing \(F\) to \(KNNModel\). /* The confidence measure is a vector with two different values that correspond to the highest confidence value and lowest confidence value. */  If \(label1\), \(label2\), and \(label3\) gives positive votes for the block \(B_{i}^{t}\) then the recovered block \(RB=DB_{i}^{t}\). If the above condition fails, we check if any of the two labels give positive votes. If so, we preserve that recovered block as \(RB=DB_{i}^{t}\). In the worst case, when the above two conditions do not hold, we find the lowest confidence measure of each block via SVM prediction \(RB1\) and CNN prediction \(RB2\). We preserve the block which has the lowest confidence among the two predictions \(RB=RB1\) or \(RB=RB2\). [Here, the lowest confidence implies the lowest measure with which the model classifies a block as an encrypted block] \(t=t+1\);  Preserve the recovered block \(RB\) at the index \(i\) of the image \(IM\). Each embedded data value \(I_{i}\) is extracted by passing the encrypted form of the recovered block \(RB\) to the Fibonacci transform and comparing the resulting block with the corresponding block of \(E^{\prime}\). \(r=r+1\); \(s=s+1\);
```  
**Algorithm 3**Ensemble based recovery.