EValuate the generated images of GANS using FID and SSIM (MATLAB:2023a)
21 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MAHMOUD EID
am 3 Aug. 2023
Kommentiert: John
am 21 Feb. 2024
I have generated an images using CGANS ( conditional Gans) as in the matlab official example:
Howerver, I need to write a code to evaluate the smilarity between the orignial images and generated images using FID (Frechet Inception Distance (FID) or Image Quality Measures (SSIM)
1 Kommentar
Fatima Bibi
am 13 Feb. 2024
Bearbeitet: Fatima Bibi
am 13 Feb. 2024
i also want this question answer i want to load cgan pretrained model that matches model images with original images
my original images have one folder that contain 5 classes.i want it matches randomly 10 images per class for FID
Akzeptierte Antwort
Ayush Aniket
am 21 Aug. 2023
For calculating SSIM for the generated images you can use the MATLAB inbuilt ‘ssim’ function as follows:
% Load and preprocess the original and generated images
original_images = imread('path/to/original/image.jpg');
generated_images = imread('path/to/generated/image.jpg');
% Calculate Structural Similarity Index Measure (SSIM)
ssim_score = ssim(original_images, generated_images);
You can read more about the function in the documentation page: https://in.mathworks.com/help/images/ref/ssim.html
For calculating FID, you can use pre-trained Inception-v3 model from the Deep Learning Toolbox as follows:
net = inceptionv3;
% Calculate Frechet Inception Distance (FID)
original_features = activations(net, original_image, 'avg_pool');
generated_features = activations(net, generated_image, 'avg_pool');
fid_score = wassersteinDistance(original_features, generated_features);
You can read about the model here : https://in.mathworks.com/help/deeplearning/ref/inceptionv3.html
You may need the check for the size compatibility of your images and that required as input to the Inception-v3 model.
Hope this helps!
3 Kommentare
Shreeya
am 29 Aug. 2023
Bearbeitet: Shreeya
am 29 Aug. 2023
Hi @MAHMOUD EID
Find the implementation of the wassersteinDistance below
John
am 21 Feb. 2024
Is the 'original image' before the 'net'? For example, is it the 'noised image' before denoising? If that is the case, then "ssim(original_images, generated_images);" will not be much meaningful. I am not sure how about the Frechet Inception Distance (FID).
What kind of appropriate quantitative evaluation for, for example, unsupervised Cycle GAN generated denoised images? There are two group of images here: noisy-image and denoised-image; the training net is available.
Thank you.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Image Segmentation and Analysis finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!