GithubHelp home page GithubHelp logo

hlamba28 / offline-signature-verification-using-siamese-network Goto Github PK

View Code? Open in Web Editor NEW
47.0 47.0 28.0 481 KB

Identifying forged signatures using convolutional siamese networks implemented in Keras

Jupyter Notebook 100.00%
convolutional-neural-networks keras-tensorflow one-shot-learning siamese-network signature-verification

offline-signature-verification-using-siamese-network's People

Contributors

hlamba28 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

offline-signature-verification-using-siamese-network's Issues

requirements.txt

please write requirements.txt as many tensorflow functions are deprecated and will be removed in future versions. by this file we can make a virtual environment for the project so that it runs well.
please tell me if there is a way to extract feature of these signature pic as this is really huge data.

TypeError: ('Keyword argument not understood:', 'init')

I use file SigNet-BHSig260.ipynb on Google Colab, but when i ran code:

network definition

base_network = create_base_network_signet(input_shape)

input_a = Input(shape=(input_shape))
input_b = Input(shape=(input_shape))

because we re-use the same instance base_network,

the weights of the network

will be shared across the two branches

processed_a = base_network(input_a)
processed_b = base_network(input_b)

Compute the Euclidean distance between the two vectors in the latent space

distance = Lambda(euclidean_distance, output_shape=eucl_dist_output_shape)([processed_a, processed_b])

model = Model(input=[input_a, input_b], output=distance)

==>

TypeError Traceback (most recent call last)
in ()
1 # network definition
----> 2 base_network = create_base_network_signet(input_shape)
3
4 input_a = Input(shape=(input_shape))
5 input_b = Input(shape=(input_shape))

5 frames
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/utils/generic_utils.py in validate_kwargs(kwargs, allowed_kwargs, error_message)
806 for kwarg in kwargs:
807 if kwarg not in allowed_kwargs:
--> 808 raise TypeError(error_message, kwarg)
809
810

TypeError: ('Keyword argument not understood:', 'init')
###############################################################################
And this is ''create_base_network_signet'' fuction:

def create_base_network_signet(input_shape):
'''Base Siamese Network'''

seq = Sequential()
seq.add(Conv2D(96, kernel_size=(11, 11), activation='relu', name='conv1_1', strides=4, input_shape= input_shape, 
                    init='glorot_uniform', dim_ordering='tf'))
seq.add(BatchNormalization(epsilon=1e-06, mode=0, axis=1, momentum=0.9))
seq.add(MaxPooling2D((3,3), strides=(2, 2)))    
seq.add(ZeroPadding2D((2, 2), dim_ordering='tf'))

seq.add(Conv2D(256, kernel_size=(5, 5), activation='relu', name='conv2_1', strides=1, init='glorot_uniform',  dim_ordering='tf'))
seq.add(BatchNormalization(epsilon=1e-06, mode=0, axis=1, momentum=0.9))
seq.add(MaxPooling2D((3,3), strides=(2, 2)))
seq.add(Dropout(0.3))# added extra
seq.add(ZeroPadding2D((1, 1), dim_ordering='tf'))

seq.add(Conv2D(384, kernel_size=(3, 3), activation='relu', name='conv3_1', strides=1, init='glorot_uniform',  dim_ordering='tf'))
seq.add(ZeroPadding2D((1, 1), dim_ordering='tf'))

seq.add(Conv2D(256, kernel_size=(3, 3), activation='relu', name='conv3_2', strides=1, init='glorot_uniform', dim_ordering='tf'))    
seq.add(MaxPooling2D((3,3), strides=(2, 2)))
seq.add(Dropout(0.3))# added extra
seq.add(Flatten(name='flatten'))
seq.add(Dense(1024, W_regularizer=l2(0.0005), activation='relu', init='glorot_uniform'))
seq.add(Dropout(0.5))

seq.add(Dense(128, W_regularizer=l2(0.0005), activation='relu', init='glorot_uniform')) # softmax changed to relu

return seq

###########################################################################

How can I fix this error? Thank you so much!

Getting 50% test accuracy on Hindi Signatures

Hello hlamba28,

I have trained the code on 2 dataset CEDAR and BHSig260. I have created train, validation and test set with following partition

Dataset Total (# writers) Train Validation Test
CEDAR 55 45 5 5
BHSig260 (Bengali) 100 70 10 20
BHSig260 (Hindi) 160 110 15 35

There are total 276 (genuine - genuine) signature pairs and 276 (genuine - forged) signature pairs per users for all the dataset.

I am getting results as shown below

Dataset Accuracy
CEDAR 100%
BHSig260 (Bengali) 50%
BHSig260 (Hindi) 50%

Why accuracy on Bengali and Hindi signatures is low ?

You claimed Accuracy = 81.71% and Threshold = 0.55 for Hindi Signatures, but I am getting only 50% I tried changing train, validation and test size but test accuracy is stuck 50% not less not more

gpu

hello. i am just curious if the same code will work well if i happen to use gpu~

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.