All Projects → deruhat → NIvsCG-keras

deruhat / NIvsCG-keras

Licence: other
Distinguishing Between Natural and Computer-Generated Images Using Convolutional Neural Networks in Keras.

Programming Languages

python
139335 projects - #7 most used programming language
matlab
3953 projects

Projects that are alternatives of or similar to NIvsCG-keras

CGvsPhoto
Computer Graphics vs Real Photographic Images : A Deep-learning approach
Stars: ✭ 24 (+20%)
Mutual labels:  computer-graphics, image-forensics
Teapong
A two-player game for fans of Pong and the Utah teapot!
Stars: ✭ 24 (+20%)
Mutual labels:  computer-graphics
Texturize
A unified framework for example-based texture synthesis, developed alongside my master's thesis.
Stars: ✭ 15 (-25%)
Mutual labels:  computer-graphics
Pulp-Fiction-ARKit
An experiment using Volume to reconstruct Pulp Fiction's dance scene in Augmented Reality
Stars: ✭ 46 (+130%)
Mutual labels:  computer-graphics
ALIGNet
code to train a neural network to align pairs of shapes without needing ground truth warps for supervision
Stars: ✭ 58 (+190%)
Mutual labels:  computer-graphics
creative-coding-notebooks
🎨 An authorial collection of fundamental recipes on Creative Coding and Recreational Programming.
Stars: ✭ 17 (-15%)
Mutual labels:  computer-graphics
ST-CGAN
Dataset and Code for our CVPR'18 paper ST-CGAN: "Stacked Conditional Generative Adversarial Networks for Jointly Learning Shadow Detection and Shadow Removal"
Stars: ✭ 64 (+220%)
Mutual labels:  computer-graphics
Shader-Playgrounds
A WebGL shaders editor for beginners and otherwise.
Stars: ✭ 28 (+40%)
Mutual labels:  computer-graphics
racket-vulkan
Racket integration with all things Vulkan 💥
Stars: ✭ 40 (+100%)
Mutual labels:  computer-graphics
visionmagic
Collection of vision & graphics algorithms
Stars: ✭ 39 (+95%)
Mutual labels:  computer-graphics
SoftwareRenderer
Soft-only 3d renderer.
Stars: ✭ 12 (-40%)
Mutual labels:  computer-graphics
cinema4d py sdk extended
The official Python API examples for Cinema 4D.
Stars: ✭ 95 (+375%)
Mutual labels:  computer-graphics
-
图形学书单
Stars: ✭ 84 (+320%)
Mutual labels:  computer-graphics
DeepSIM
Official PyTorch implementation of the paper: "DeepSIM: Image Shape Manipulation from a Single Augmented Training Sample" (ICCV 2021 Oral)
Stars: ✭ 389 (+1845%)
Mutual labels:  computer-graphics
DeepCAD
code for our ICCV 2021 paper "DeepCAD: A Deep Generative Network for Computer-Aided Design Models"
Stars: ✭ 74 (+270%)
Mutual labels:  computer-graphics
unity-raymarcher
Real-time ray marching shaders in Unity
Stars: ✭ 28 (+40%)
Mutual labels:  computer-graphics
Metu-CENG
All the homeworks, studies and projects I've done at Metu-CENG
Stars: ✭ 32 (+60%)
Mutual labels:  computer-graphics
Im2Vec
[CVPR 2021 Oral] Im2Vec Synthesizing Vector Graphics without Vector Supervision
Stars: ✭ 229 (+1045%)
Mutual labels:  computer-graphics
SynergyNet
3DV 2021: Synergy between 3DMM and 3D Landmarks for Accurate 3D Facial Geometry
Stars: ✭ 179 (+795%)
Mutual labels:  computer-graphics
svbrdf-estimation
SVBRDF Estimation using a Physically-based Differentiable Renderer
Stars: ✭ 16 (-20%)
Mutual labels:  computer-graphics

NIvsCG

Distinguishing Between Natural and Computer-Generated Images Using Convolutional Neural Networks



Preparing the Workspace

Make sure you have the project structured as follows:

├── checkpoints
├── logs
├── models
├── results
├── src
   ├── model.py
   ├── voting.py
   ├── patchesTestAcc.py
├── utils
   ├── mps
   ├── imageMpsCrop.m
   ├── makePatches.m
   └── imageNamesFileMaker.py
└── datasets
   ├── full
       ├── personal
           ├── 000001.jpg 
           └── ...
       └── prcg
           ├── 000001.jpg 
           └── ...
   └── patches
       ├── train
           ├── personal
              ├── patch-001.bmp 
              └── ...
           └── prcg
              ├── patch-001.bmp 
              └── ...
       ├── valid
           ├── personal
              ├── patch-001.bmp 
              └── ...
           └── prcg
              ├── patch-001.bmp 
              └── ...
       ├── test
           ├── personal
              ├── patch-001.bmp 
              └── ...
           └── prcg
              ├── patch-001.bmp 
              └── ...
       └── test-majority-voting
           ├── all
              ├── patch-001.bmp 
              └── ...
           └── filenames.txt

Dataset

We used the Personal and PRCG datasets for our two classes. Images of each class were split into 3:1:1 ratio (train:valid:test). And it was taken into account each image's category. For example, PRCG images fall into multiple categories (Archticture, nature, object, etc..) We split the images so each dataset (train, valid, test) has images from every category. Then made 200 crops of each image using the MPS algorithm to get the patches. All of this is done using the makePatches.m script.

  • Google and PRCG datasets can be downloaded here.
  • Personal dataset can be downloaded here.

Training the Model

The code for the CNN design described by the paper can be found in model.py. Image patches used as training and validation data have to be cropped using the MPS algorithm implemented here.

Majority Voting

The code for the majority voting algorithm is in voting.py. A trained .h5 model from model.py is needed in order to run the majority voting algorithm and get the test accuracy.

Results

So far we're able to achieve 95% 96.88% 97.18% accuracy on image classification. We take 200 patches that cover the whole image from each test sample using the MPS algorithm, and take the majority vote of these 200 patches to decide that test image's class.

You can download the trained model here.

Contributers

Abdulellah Abualshour

Abdulmajeed Aljaloud

References

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].