1 Ex. No : 01 Aim: To Write a Simple OpenAI Program. Procedure: Step 1: Initialize Groq Client Import the necessary libraries such as os for file operations and Groq from the Groq library. Initialize the Groq client by providing the appropriate API key. Step 2: Specify File Path Define the path of the audio file (YOUR_AUDIO_PATH.mp3) that needs transcription and assign it to the filename variable. Step 3: Verify File Existence Use the os.path.exists() function to check if the file specified in the filename exists in the system. Step 4: Read the File in Binary Mode If the file exists, open it using the open() function in binary read mode ("rb"). Step 5: Submit Audio File for Transcription Use the Groq client to create a transcription request via client.audio.transcriptions.create(). Pass the file, transcription model ("whisper-large-v3"), and other optional parameters such as: Prompt: To specify the context or spelling. Response Format: Typically JSON for structured output. Language: Specify the transcription language (e.g., English). Temperature: Control the randomness in transcription (set to 0 for deterministic results). Step 6: Process and Print Transcription Access the transcribed text using the appropriate attribute (e.g., transcription.text). Print the transcribed text. Step 7: Handle Missing File If the file does not exist, output an error message stating that the file was not found. This modern algorithmic approach keeps each step modular and clear for ease of implementation. 2 Coding: import os from groq import Groq # Initialize Groq client client = Groq(api_key='your_groq_api_key') # Replace with your actual Groq API key # Set the file path directly filename = "YOUR_AUDIO_PATH.mp3" # Check if the file exists and perform transcription if os.path.exists(filename): with open(filename, "rb") as file: transcription = client.audio.transcriptions.create( file=(filename, file.read()), model="whisper-large-v3", prompt="Specify context or spelling", # Optional response_format="json", # Optional language="en", # Optional temperature=0.0 # Optional ) # Print the transcribed text correctly by accessing the attribute print(transcription.text) # Assuming 'text' is the correct attribute else: print("File not found:", filename) OUTPUT: Your hands lie open in the long fresh grass. The finger points look through like rosy blooms. Your eyes smile peace. The pasture gleams and glooms neath billowing skies that scatter and amass. All round our nest, far as the eye can pass, are golden king cup fields with silver edge, where the cow partially skirts the hawthorn hedge. Tis visible silence, still is the hourglass. Your hands lie open in the long fresh grass The finger points look through like rosy blooms Your eyes smile peace The pasture gleams and glooms Neath billowing skies that scatter and amass All round our nest, far as the eye can pass Are golden king cup fields with silver edge Where the cow parsley skirts the hawthorn hedge Tis visible silence, still as the hourglass you 3 Ex. No : 02 Aim: To Write a Program for Training An Autoencoder . Procedure: A)Training A Simple Autoencoder Model On A Dataset. Step 1: Import Required Libraries Import numpy for numerical operations. Import matplotlib.pyplot for data visualization. Import necessary modules from tensorflow.keras, including datasets, layers, models, and callbacks. Step 2: Load and Preprocess the Dataset Load the MNIST dataset using mnist.load_data(): Split into x_train and x_test for training and testing data respectively. Normalize the pixel values to be between 0 and 1 by dividing by 255. Reshape the dataset to fit the input shape of the model: (28, 28, 1) to handle grayscale images. Step 3: Define the Autoencoder Architecture Input Layer: Define an input layer with shape (28, 28, 1) to handle MNIST images. Encoder: Add a Conv2D layer with 16 filters, kernel size (3, 3), relu activation, and same padding. Add a MaxPooling2D layer with pool size (2, 2) and same padding. Add another Conv2D layer with 8 filters, kernel size (3, 3), relu activation, and same padding. Add a second MaxPooling2D layer with pool size (2, 2) and same padding to reduce dimensionality. Decoder: Add a Conv2D layer with 8 filters, kernel size (3, 3), relu activation, and same padding to start decoding. Add an UpSampling2D layer to upsample and reverse the pooling operation. Add another Conv2D layer with 16 filters, kernel size (3, 3), relu activation, and same padding. Add another UpSampling2D layer. Add a final Conv2D layer with 1 filter, kernel size (3, 3), sigmoid activation, and same padding for output reconstruction. Step 4: Compile the Autoencoder Model Compile the autoencoder model: 4 Use the adam optimizer for efficient optimization. Set the loss function to binary_crossentropy as the output is binary. Step 5: Train the Autoencoder Model Fit the autoencoder model using the training data x_train and train against itself (autoencoder learns to reconstruct the input). Use the following parameters for training: Epochs: Set to 10 for quicker training. Batch Size: Set to 512 for processing larger batches. Shuffle: Enable shuffling for better generalization. Validation Data: Use x_test for validation during training. Add a TensorBoard callback to log training data. Step 6: Evaluate the Model Generate predictions using autoencoder.predict() on the x_test data to get reconstructed images (decoded_imgs). Step 7: Visualize Original and Reconstructed Images Set up a matplotlib plot to display both original and reconstructed images side by side. Display n = 10 images from the x_test dataset and their corresponding reconstructed versions from decoded_imgs. Use plt.imshow() to visualize each image and set axis visibility to False for a cleaner display. Step 8: Show the Plot Call plt.show() to display the comparison of original and reconstructed images. This algorithm is structured to provide a step-by-step guide to training an autoencoder on the MNIST dataset and visualizing the results. CODING: import numpy as np import matplotlib.pyplot as plt from tensorflow.keras.datasets import mnist from tensorflow.keras.layers import Input, Dense, Conv2D, MaxPooling2D, UpSampling2D from tensorflow.keras.models import Model from tensorflow.keras.callbacks import TensorBoard # Load and preprocess the dataset (x_train, _), (x_test, _) = mnist.load_data() x_train = x_train.astype('float32') / 255. x_test = x_test.astype('float32') / 255. x_train = np.reshape(x_train, (len(x_train), 28, 28, 1)) x_test = np.reshape(x_test, (len(x_test), 28, 28, 1)) # Define the autoencoder architecture 5 input_img = Input(shape=(28, 28, 1)) # Encoder x = Conv2D(16, (3, 3), activation='relu', padding='same')(input_img) x = MaxPooling2D((2, 2), padding='same')(x) x = Conv2D(8, (3, 3), activation='relu', padding='same')(x) encoded = MaxPooling2D((2, 2), padding='same')(x) # Decoder x = Conv2D(8, (3, 3), activation='relu', padding='same')(encoded) x = UpSampling2D((2, 2))(x) x = Conv2D(16, (3, 3), activation='relu', padding='same')(x) decoded = UpSampling2D((2, 2))(x) decoded = Conv2D(1, (3, 3), activation='sigmoid', padding='same')(decoded) autoencoder = Model(input_img, decoded) autoencoder.compile(optimizer='adam', loss='binary_crossentropy') # Train the autoencoder with fewer epochs and larger batch size autoencoder.fit(x_train, x_train, epochs=10, # reduced epochs batch_size=512, # increased batch size shuffle=True, validation_data=(x_test, x_test), callbacks=[TensorBoard(log_dir='/tmp/autoencoder')]) # Evaluate the model decoded_imgs = autoencoder.predict(x_test) # Display original and reconstructed images n = 10 # How many digits to display plt.figure(figsize=(20, 4)) for i in range(n): # Original ax = plt.subplot(2, n, i + 1) plt.imshow(x_test[i].reshape(28, 28)) plt.gray() ax.get_xaxis().set_visible(False) ax.get_yaxis().set_visible(False) # Reconstruction ax = plt.subplot(2, n, i + 1 + n) plt.imshow(decoded_imgs[i].reshape(28, 28)) plt.gray() 6 ax.get_xaxis().set_visible(False) ax.get_yaxis().set_visible(False) plt.show() OUTPUT: B) Text Autoencoder Using Tokenization: Step 1: Install Required Library Use the !pip install tiktoken command to install the tiktoken library, which will be used for text tokenization. Step 2: Import Tokenizer Import the tiktoken library using import tiktoken. Initialize the tokenizer using tiktoken.get_encoding('cl100k_base') for tokenizing text. Step 3: Define the Encoding Function Define a function encode_text(text): Input: Takes a string text. Process: Use the tokenizer's encode() method to convert the input text into a sequence of tokens. Output: Returns the list of tokens. Step 4: Define the Decoding Function Define a function decode_tokens(tokens): Input: Takes a list of tokens. Process: Use the tokenizer's decode() method to convert the list of tokens back into the original text. 7 Output: Returns the decoded string (reconstructed text). Step 5: Main Function Execution Inside the if __name__ == "__main__": block: Define a sample text string (e.g., "Hello, World!"). Call the encode_text() function to encode the sample text and store the resulting tokens in encoded. Call the decode_tokens() function to decode the tokens back into text and store it in decoded. Step 6: Display Results Print the original text, encoded tokens, and decoded text: Original Text: Displays the initial text. Encoded Tokens: Displays the list of tokens representing the original text. Decoded Text: Displays the reconstructed text after decoding. This algorithm outlines the steps to implement a simple text autoencoder using tokenization and decoding techniques. CODING !pip install tiktoken import tiktoken tokenizer = tiktoken.get_encoding('cl100k_base' def encode_text(text): tokens = tokenizer.encode(text) return tokens def decode_tokens(tokens): text = tokenizer.decode(tokens) return text if __name__ == "__main__": sample = "Hello, World!" encoded = encode_text(sample) decoded = decode_tokens(encoded) print(f"Original Text: {sample}") print(f"Encoded Tokens: {encoded}") print(f"Decoded Text: {decoded}") 8 OUTPUT: Original Text: Hello, this is a test sentence to encode and decode. Encoded Tokens: [9906, 11, 420, 374, 264, 1296, 11914, 311, 16559, 323, 17322, 13] Decoded Text: Hello, this is a test sentence to encode and decode. 9 Ex. No : 03 Aim: To Write a Program for implementing a basic GAN Architecture for Generating Synthetic Images using a Pre-trained Model. Procedure: Coding: import tensorflow as tf import matplotlib.pyplot as plt BATCH_SIZE = 32 # Models make_gen = lambda: tf.keras.Sequential([ tf.keras.layers.Dense(7*7*32, input_shape=(100,), use_bias=False), tf.keras.layers.BatchNormalization(), tf.keras.layers.LeakyReLU(), tf.keras.layers.Reshape((7, 7, 32)), tf.keras.layers.Conv2DTranspose(1, (5, 5), strides=(4, 4), padding='same', activation='tanh') ]) make_disc = lambda: tf.keras.Sequential([ tf.keras.layers.Conv2D(32, (5, 5), strides=(2, 2), padding='same', input_shape=[28, 28, 1]), tf.keras.layers.LeakyReLU(), tf.keras.layers.Flatten(), tf.keras.layers.Dense(1) ]) loss = tf.keras.losses.BinaryCrossentropy(from_logits=True) gen_loss = lambda fake: loss(tf.ones_like(fake), fake) disc_loss = lambda real, fake: loss(tf.ones_like(real), real) + loss(tf.zeros_like(fake), fake) @tf.function def train_step(images, gen, disc, gen_opt, disc_opt): noise = tf.random.normal([BATCH_SIZE, 100]) with tf.GradientTape() as gen_tape, tf.GradientTape() as disc_tape: 10 g_imgs = gen(noise, training=True) real_out, fake_out = disc(images, training=True), disc(g_imgs, training=True) g_loss, d_loss = gen_loss(fake_out), disc_loss(real_out, fake_out) gen_opt.apply_gradients(zip(gen_tape.gradient(g_loss, gen.trainable_variables), gen.trainable_variables)) disc_opt.apply_gradients(zip(disc_tape.gradient(d_loss, disc.trainable_variables), disc.trainable_variables)) def train(dataset, epochs): gen, disc = make_gen(), make_disc() g_opt, d_opt = tf.keras.optimizers.Adam(1e-3), tf.keras.optimizers.Adam(1e-3) for _ in range(epochs): for img_batch in dataset: train_step(img_batch, gen, disc, g_opt, d_opt) return gen # Data (train_images, _), _ = tf.keras.datasets.mnist.load_data() train_images = (train_images.reshape(-1, 28, 28, 1) - 127.5) / 127.5 train_dataset = tf.data.Dataset.from_tensor_slices(train_images).shuffle(60000).batch(BATCH_SIZE) # Train and visualize gen = train(train_dataset, 10) preds = gen(tf.random.normal([16, 100]), training=False) plt.figure(figsize=(4, 4)) for i in range(16): plt.subplot(4, 4, i+1), plt.imshow(preds[i, :, :, 0] * 0.5 + 0.5, cmap='gray'), plt.axis('off') plt.show() 11 OUTPUT: 12 Ex. No : 04 Aim: To Write a Python Program for Autoencoder for Denoising Procedure: A) Auto Encoder for Denoising Step 1: Import Required Libraries Import libraries such as numpy, matplotlib.pyplot, pandas, tensorflow, and modules for splitting data and evaluating performance metrics. Step 2: Load the MNIST Dataset Load the MNIST dataset using mnist.load_data() and split the dataset into training (x_train), validation (x_val), and test sets (x_test). Normalize the pixel values of the images by dividing them by 255 to bring them in the range [0, 1]. Step 3: Display Some Original Images Use matplotlib to display a sample of original test images before training, to visualize the clean input data. Step 4: Define the Autoencoder Model Create a custom autoencoder class inheriting from tf.keras.Model. Define the encoder using a Flatten layer followed by a Dense layer that reduces the dimensionality (latent space). Define the decoder using a Dense layer that projects the latent space back to the original image size followed by a Reshape layer to revert to the image shape (28, 28). Step 5: Compile the Model Instantiate the autoencoder with the latent dimension (e.g., latent_dim = 64). Compile the model using the Adam optimizer and the mean squared error loss function to minimize the reconstruction error. Step 6: Train the Autoencoder 13 Train the model using the fit() method with the training data as both the input and target, validating on the validation data. Set parameters such as epochs=10 and enable shuffle=True. Step 7: Summarize the Encoder and Decoder Print the model summaries of the encoder and decoder to understand the architecture. Step 8: Encode and Decode Test Data Pass test images through the encoder to get latent representations, then decode them using the decoder to reconstruct the images. Step 9: Display Original and Reconstructed Images Display side-by-side comparisons of the original and reconstructed test images using matplotlib. CODING: import matplotlib.pyplot as plt import numpy as np import pandas as pd import tensorflow as tf from sklearn.metrics import accuracy_score, precision_score, recall_score from sklearn.model_selection import train_test_split from tensorflow.keras import layers, losses from tensorflow.keras.datasets import mnist from tensorflow.keras.models import Model # Load MNIST dataset (x_train, _), (x_test, _) = mnist.load_data() x_train, x_val = x_train[:-10000], x_train[-10000:] x_train = x_train.astype('float32') / 255. x_test = x_test.astype('float32') / 255. x_val = x_val.astype('float32') / 255. print(x_train.shape) print(x_test.shape) print(x_val.shape) # Display some of the original test images n = 10 14 plt.figure(figsize=(20, 4)) for i in range(n): ax = plt.subplot(2, n, i + 1) plt.imshow(x_test[i]) plt.title('Original') plt.gray() ax.get_xaxis().set_visible(False) ax.get_yaxis().set_visible(False) plt.show() # Define Autoencoder Model latent_dim = 64 class Autoencoder(Model): def __init__(self, latent_dim): super(Autoencoder, self).__init__() self.latent_dim = latent_dim self.encoder = tf.keras.Sequential([ layers.Flatten(), layers.Dense(latent_dim, activation='relu'), ]) self.decoder = tf.keras.Sequential([ layers.Dense(784, activation='sigmoid'), layers.Reshape((28, 28)) ]) def call(self, x): encoded = self.encoder(x) decoded = self.decoder(encoded) return decoded # Instantiate and compile the autoencoder autoencoder = Autoencoder(latent_dim) autoencoder.compile(optimizer='adam', loss=losses.MeanSquaredError()) # Train the autoencoder autoencoder.fit(x_train, x_train, epochs=10, shuffle=True, validation_data=(x_val, x_val)) # Print model summaries print(autoencoder.encoder.summary()) print(autoencoder.decoder.summary()) 15 # Encode and decode some images encoded_imgs = autoencoder.encoder(x_test).numpy() decoded_imgs = autoencoder.decoder(encoded_imgs).numpy() # Display original and reconstructed images plt.figure(figsize=(20, 4)) for i in range(n): # Display original ax = plt.subplot(2, n, i + 1) plt.imshow(x_test[i]) plt.title("Original") plt.gray() ax.get_xaxis().set_visible(False) ax.get_yaxis().set_visible(False) # Display reconstruction ax = plt.subplot(2, n, i + 1 + n) plt.imshow(decoded_imgs[i]) plt.title("Reconstruct") plt.gray() ax.get_xaxis().set_visible(False) ax.get_yaxis().set_visible(False) plt.show() OUTPUT: Epoch 2/10 1563/1563 ━━━━━━━━━━━━━━━━━━━━ 12s 6ms/step - loss: 0.0094 - val_loss: 0.0062 Epoch 3/10 1563/1563 ━━━━━━━━━━━━━━━━━━━━ 6s 4ms/step - loss: 0.0058 - val_loss: 0.0050 Epoch 4/10 1563/1563 ━━━━━━━━━━━━━━━━━━━━ 10s 4ms/step - loss: 0.0049 - val_loss: 0.0047 Epoch 5/10 1563/1563 ━━━━━━━━━━━━━━━━━━━━ 10s 4ms/step - loss: 0.0045 - val_loss: 0.0045 Epoch 6/10 1563/1563 ━━━━━━━━━━━━━━━━━━━━ 11s 4ms/step - loss: 0.0044 - val_loss: 0.0044 Epoch 7/10 1563/1563 ━━━━━━━━━━━━━━━━━━━━ 11s 5ms/step - loss: 0.0043 - val_loss: 0.0043 Epoch 8/10 1563/1563 ━━━━━━━━━━━━━━━━━━━━ 9s 4ms/step - loss: 0.0042 - val_loss: 0.0042 Epoch 9/10 1563/1563 ━━━━━━━━━━━━━━━━━━━━ 8s 5ms/step - loss: 0.0041 - val_loss: 0.0041 Epoch 10/10 1563/1563 ━━━━━━━━━━━━━━━━━━━━ 10s 5ms/step - loss: 0.0041 - val_loss: 0.0041 Model: "sequential_5" ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━ ━┓ ┃ Layer (type) ┃ Output Shape ┃ Param # ┃ ┡━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩ │ flatten_1 ( Flatten) │ ( None, 784) │ 0 │ ├──────────────────────────────────────┼─────────────────────────────┼─────────────────┤ │ dense_16 ( Dense) │ ( None, 64) │ 50,240 │ └──────────────────────────────────────┴─────────────────────────────┴─────────────────┘ Total params: 50,240 (196.25 KB) Trainable params: 50,240 (196.25 KB) Non-trainable params: 0 (0.00 B) None Model: "sequential_6" ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━ ━┓ 16 ┃ Layer (type) ┃ Output Shape ┃ Param # ┃ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩ │ dense_17 ( Dense) │ ( None, 784) │ 50,960 │ ├──────────────────────────────────────┼─────────────────────────────┼─────────────────┤ │ reshape_1 ( Reshape) │ ( None, 28, 28) │ 0 │ └──────────────────────────────────────┴─────────────────────────────┴─────────────────┘ Total params: 50,960 (199.06 KB) Trainable params: 50,960 (199.06 KB) Non-trainable params: 0 (0.00 B) None B)Autoencoder For Denoising Procedure: Step 1: Import Required Libraries Import necessary libraries including numpy, matplotlib.pyplot, keras.models.Sequential, and keras.layers.Dense. Step 2: Load and Visualize the Dataset Load the MNIST dataset using mnist.load_data() into training (X_train) and testing data (X_test). Display a few sample images from the X_train set using matplotlib to visualize the original, clean images. Step 3: Reshape and Normalize Data Reshape the images into 1D arrays (flattened) to feed into a fully connected model. Normalize the pixel values by dividing by 255 to scale them between [0, 1]. Step 4: Add Noise to the Data Add Gaussian noise to the training and testing datasets by adding random noise from a normal distribution. Clip the values between [0, 1] to keep them valid. Create noisy datasets: x_train_noisy and x_test_noisy. 17 Step 5: Define the Denoising Autoencoder Model Use Sequential() to build a fully connected feedforward neural network with several layers: Multiple Dense layers with varying sizes (500, 300, 100 neurons) for encoding and decoding the image. Use relu activation for the hidden layers and sigmoid activation for the output to ensure values are in the [0, 1] range. Step 6: Compile and Train the Model Compile the model using the Adam optimizer and the mean squared error loss function, which penalizes reconstruction errors. Train the model with noisy inputs (x_train_noisy) and clean outputs (X_train) to learn how to denoise the images. Use validation data during training. Step 7: Predict and Evaluate on Test Data Predict the reconstructed images using the trained model by passing noisy test images (x_test_noisy). Step 8: Visualize Results Use matplotlib to display: The original clean images. The noisy images generated during testing. The reconstructed (denoised) images predicted by the autoencoder. This algorithm outlines the steps to build and train autoencoders for image noising and denoising tasks using the MNIST dataset. CODING: import numpy import matplotlib.pyplot as plt from keras.models import Sequential from keras.layers import Dense from keras.datasets import mnist # Load data (X_train, y_train), (X_test, y_test) = mnist.load_data() 18 # Display initial data samples plt.subplot(221) plt.imshow(X_train[0], cmap=plt.get_cmap('gray')) plt.subplot(222) plt.imshow(X_train[1], cmap=plt.get_cmap('gray')) plt.subplot(223) plt.imshow(X_train[2], cmap=plt.get_cmap('gray')) plt.subplot(224) plt.imshow(X_train[3], cmap=plt.get_cmap('gray')) plt.show() # Reshape and normalize num_pixels = X_train.shape[1] * X_train.shape[2] X_train = X_train.reshape(X_train.shape[0], num_pixels).astype('float32') / 255 X_test = X_test.reshape(X_test.shape[0], num_pixels).astype('float32') / 255 # Add noise noise_factor = 0.2 x_train_noisy = numpy.clip(X_train + noise_factor * numpy.random.normal(loc=0.0, scale=1.0, size=X_train.shape), 0., 1.) x_test_noisy = numpy.clip(X_test + noise_factor * numpy.random.normal(loc=0.0, scale=1.0, size=X_test.shape), 0., 1.) # Define model model = Sequential([ Dense(500, input_dim=num_pixels, activation='relu'), Dense(300, activation='relu'), Dense(100, activation='relu'), Dense(300, activation='relu'), Dense(500, activation='relu'), Dense(num_pixels, activation='sigmoid') ]) # Compile and train model.compile(loss='mean_squared_error', optimizer='adam') model.fit(x_train_noisy, X_train, validation_data=(x_test_noisy, X_test), epochs=2, batch_size=200) # Predict pred = model.predict(x_test_noisy) # Display original, noisy, and reconstructed images plt.figure(figsize=(20, 4)) print("Test Images") 19 for i in range(10, 20): plt.subplot(2, 10, i - 9) plt.imshow(X_test[i].reshape(28, 28), cmap='gray') plt.title("(Label: " + str(y_test[i]) + ")") plt.show() plt.figure(figsize=(20, 4)) print("Test Images with Noise") for i in range(10, 20): plt.subplot(2, 10, i - 9) plt.imshow(x_test_noisy[i].reshape(28, 28), cmap='gray') plt.show() plt.figure(figsize=(20, 4)) print("Reconstruction of Noisy Test Images") for i in range(10, 20): plt.subplot(2, 10, i - 9) plt.imshow(pred[i].reshape(28, 28), cmap='gray') plt.show() 20 OUTPUT: Epoch 1/2 300/300 ━━━━━━━━━━━━━━━━━━━━ 15s 45ms/step - loss: 0.0694 - val_loss: 0.0196 Epoch 2/2 300/300 ━━━━━━━━━━━━━━━━━━━━ 20s 45ms/step - loss: 0.0180 - val_loss: 0.0137 313/313 ━━━━━━━━━━━━━━━━━━━━ 2s 5ms/step Test Images Test Images with Noise Reconstruction of Noisy Test Images