kpsarakis / image-forgery-detection-cnn Goto Github PK
View Code? Open in Web Editor NEWImage forgery detection using convolutional neural networks. Group 10's final project for TU Delft's course CS4180 Deep Learning 2019.
Image forgery detection using convolutional neural networks. Group 10's final project for TU Delft's course CS4180 Deep Learning 2019.
Hi,
cool project :)
Would it be possible to provide a demo example of how to run your application with a single tampered image that is neither in CASIA2 nor NC2016 with your pretrained weights?
Best
Karol
I'm trying to find the mask used in patch extractor but I'm not able to. Can you please let me know where can I find the same. Thanks in advance!
mask = io.imread(self.input_path + '/masks/' + im_name + '_gt.png')
When running feature_extraction.py script, I am encountering the following error :
Traceback (most recent call last):
File "C:/Users/chinm/Desktop/Image-Forgery-Detection-CNN-master/Image-Forgery-Detection-CNN-master/src/feature_extraction.py", line 16, in
create_feature_vectors(model, tampered_path, authentic_path, output_filename)
File "C:\Users\chinm\Desktop\Image-Forgery-Detection-CNN-master\Image-Forgery-Detection-CNN-master\src\feature_fusion\feature_vector_generation.py", line 31, in create_feature_vectors
pd.DataFrame(get_patch_yi(model, image))])], axis=1, sort=False)
File "C:\Users\chinm\Desktop\Image-Forgery-Detection-CNN-master\Image-Forgery-Detection-CNN-master\src\feature_fusion\feature_vector_generation.py", line 77, in get_patch_yi
patches = get_patches(image, stride=128)
File "C:\Users\chinm\Desktop\Image-Forgery-Detection-CNN-master\Image-Forgery-Detection-CNN-master\src\feature_fusion\patch_extraction.py", line 17, in get_patches
windows = view_as_windows(image_mat, window_shape, step=stride)
File "C:\Users\chinm\Desktop\Image-Forgery-Detection-CNN-master\Image-Forgery-Detection-CNN-master\venv\lib\site-packages\skimage\util\shape.py", line 209, in view_as_windows
raise TypeError("arr_in
must be a numpy ndarray")
TypeError: arr_in
must be a numpy ndarray
I am not able to find any solution to this error. Hope you can help me with this.
Hi Sir. I am not understanding the first step of your pipeline:
Can you kindly elaborate here what you want me to do by extracting?
Hi, did you try the model on any test set? For example, the Casia1 dataset.
@kPsarakis @achilleasvlogiaris @arkajitb @psoilis
"Extract SVM patches: same as step 1 but with different arguments."
I ran the script with the CASIA2 dataset and it went well, but with the NC2016 dataset and the pretrained model it shows this kind of error.
After changing the code for the NC2016 dataset:
input_path = '../data/NC2016/'
output_filename = 'NC2016_WithRot_LR001_b128_nodrop.csv'
create_feature_vectors_nc(model, input_path, output_filename)
I keep encountering this kind of errors:
DtypeWarning: Columns (3,6,10,15,16,18,19) have mixed types.Specify dtype option on import or set low_memory=False.
create_feature_vectors_nc(model, input_path, output_filename)
ValueError: At least one stride in the given numpy array is negative, and tensors with negative strides are not currently supported. (You can probably work around this by making a copy of your array with array.copy().)
Image Forgery Detection with CNNs
Hi , I'm trying to reproduce the single image test but I would like to see where the image has been tampered. How can I do that ?
thanks!
Hi - awesome project - thanks!
I'd like to test the pretrained model/s on a single image file.
What is the best route to doing this?
Any chance of a v short demo script?
Thanks again!
This is a snippet of patch_extractor_casia.py from line number-93.
os.listdir(tp_dir)
gives only filenames and not absolute paths.
" f " contains just the file name, so the .split(os.sep)[-1]
is not required in - im_name = f.split(os.sep)[-1].split('.')[0]
Getting errors running this application on my local machine. Some of the errors:
Traceback (most recent call last):
File ".\extract_patches.py", line 9, in
pe.extract_patches()
File "C:\Users\toddy\OneDrive\Documents\Project\Tendai NUST\Tendai\Image-Forgery-Detection-CNN-master_2\Image-Forgery-Detection-CNN-master\src\patch_extraction\patch_extractor_casia.py", line 89, in extract_patches
for f in os.listdir(tp_dir):
FileNotFoundError: [WinError 3] The system cannot find the path specified: '../data/CASIA2/Tp/'
Can the Readme be more clear and have a step-wise process on how we can use this model?
Engineers around can write API's for the same.
I have tried the models, works well with Photoshop, however, any image modified or edited in Paint cannot be detected.
"C:\Program Files\Python39\python.exe" C:\Users\ikhwa\PycharmProjects\IFDCNN\src\extract_patches.py
Traceback (most recent call last):
File "C:\Users\ikhwa\PycharmProjects\IFDCNN\src\extract_patches.py", line 9, in
pe.extract_patches()
File "C:\Users\ikhwa\PycharmProjects\IFDCNN\src\patch_extraction\patch_extractor_casia.py", line 92, in extract_patches
image = io.imread(tp_dir + f)
File "C:\Program Files\Python39\lib\site-packages\skimage\io_io.py", line 48, in imread
img = call_plugin('imread', fname, plugin=plugin, **plugin_args)
File "C:\Program Files\Python39\lib\site-packages\skimage\io\manage_plugins.py", line 207, in call_plugin
return func(*args, **kwargs)
File "C:\Program Files\Python39\lib\site-packages\skimage\io_plugins\imageio_plugin.py", line 10, in imread
return np.asarray(imageio_imread(*args, **kwargs))
File "C:\Program Files\Python39\lib\site-packages\imageio_init_.py", line 97, in imread
return imread_v2(uri, format=format, **kwargs)
File "C:\Program Files\Python39\lib\site-packages\imageio\v2.py", line 226, in imread
with imopen(uri, "ri", **imopen_args) as file:
File "C:\Program Files\Python39\lib\site-packages\imageio\core\imopen.py", line 298, in imopen
raise err_type(err_msg)
ValueError: Could not find a backend to open C:/Users/ikhwa/PycharmProjects/IFDCNN/data/CASIA2/Tp/Thumbs.db`` with iomode
ri`.
Process finished with exit code 1
Im not sure about this since im still learning python
Hi,
After 150 epochs. train_net converged at 87.60% accuracy. after that I run feature fusion and then apply SVM classification.
I got 89.96%
May I know where I could be wrong.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.