Giter VIP home page Giter VIP logo

Comments (14)

karaposu avatar karaposu commented on June 15, 2024

i just saw your prediction function . can you explain these codes?

 % Error Phase
    min_error = 1:10;
    for i = 1:10
        v = targets(i,:);
        errora = v - outo;
        errorf = errora.^2;
        errorf = 0.5 * errorf;
        error = sum(errorf);
        min_error(i) = error;
    end
    [~,k] = min(min_error);
    k = k-1;
    %disp(min_error)

from digit-recognition.

karaposu avatar karaposu commented on June 15, 2024

and also prediction function is not producing right answers either....

from digit-recognition.

shivang8 avatar shivang8 commented on June 15, 2024

from digit-recognition.

shivang8 avatar shivang8 commented on June 15, 2024

from digit-recognition.

shivang8 avatar shivang8 commented on June 15, 2024

from digit-recognition.

karaposu avatar karaposu commented on June 15, 2024

Thank you for your response ; i am using your preprocessed network also .. the only thing i am doing different is using external images. (still mnist data tho)

from digit-recognition.

karaposu avatar karaposu commented on June 15, 2024
clear all  
close all
clc

% %%   Begin training -  NO NEED SINCE THERE IS PREPROCESSED DATA ..
% 
% % Calling Initilization.m Script
% initilization
% 
% % Calling Training.m Script
% for epoc = 1:200
%     
%     msg=['new epoch number : ',num2str(epoc)];
%     msg2=['training continues...'];
%     disp(msg)
%        disp(msg2)
%     alpha = 1/(epoc^0.5);
%     %alpha = 0.5;
%     training
% 	
% 	
% end
% 
% Accuracy
% 
% save 'C:\Users\acer\Desktop\Digit Recognition\data_epoc200.mat'
%%   Ready data load

nn = load('data_epoc200.mat');
%neural_net = nn.net;

% 
% Picture_set_1=imread(char(join( (test_folder)+"\"+files_1(4).name ) ) );
% Picture_set_2=imread(char(join( (test_folder)+"\"+files_1(6).name ) ) );
% 
% s = row_and_col_values_of_img(Picture_set_1);
% 
% s2 = row_and_col_values_of_img(Picture_set_2);

% t1=binary_convertor(s2) ;



%% lOAD External TEST PIC HERE 


test_folder = 'C:\Users\enesk\Desktop\w-s\nn-matlab\50piksel\28piksel'; % test image folder on my computer... you need to change this to where your image is..
files_1 = dir(fullfile(test_folder));   % list files in that directory...

Picture_set_1=imread(char(join( (test_folder)+"\"+files_1(4).name ) ) );    % open files_1 in matlab workspace and find out your image's order
                                                                            %in directory.because directory  has items like "." and ".." so it starts from 3.  Check it out
imshow(Picture_set_1)  %show the image  
  
t = binary_convertor(Picture_set_1)   %use it if it is a non binary image . i have tried with non binary and binary images. same result. 

s = row_and_col_values_of_img(t);  %this is my function to create  1x784 vector of image piksels. this is how mnist data was created. it says row-wise in this official site...


% get what you need to use prediction function .
weight1= nn.weight1;
weight2=nn.weight2;
target=nn.target;
bias1= nn.bias1;
bias2=nn.bias2;

 %% prediction
    
     %s=~s ;
    k = prediction(s, weight1, weight2, bias1, bias2, target)

from digit-recognition.

karaposu avatar karaposu commented on June 15, 2024
%This is my function  for calculating 1x724  vector of image  

function [s] = row_and_col_values_of_img(test_picture)

   s=zeros(1,784) ;
    I =(test_picture)  ;
          for j=1:28  %
                for i=1:28  %
             s(1, i+ 28*(j-1) )=I(j,i); 
                 end

          end
            
          
end

% 
% quick check to see if it is truly calculates ...
%     
% at first  j =1   
%     
%                 for i=1:28  %
%              s(1, i )=I(j,i); 
%                  end
% so it just copy first row to s   ...
%     
% then   j =2
%                  for i=1:28  %
%              s(1, i+ 28) )=I(2,i); 
%                  end
%                  
%     so it copies second row to  s ; starting from s(1, 29)  until  s(1, 56)         
%     
%     
%     then   j =28
%     
%      for i=1:28  %
%              s(1, i+ 28*(27) )=I(28,i); 
%                  end
%                  
%   it copies 28th row to s  starting from s(1, (28*27) -1)  until  s(1, 28*28)...
    

from digit-recognition.

karaposu avatar karaposu commented on June 15, 2024

now you can import external picture and predict it is value.. here some of my images :
p3

3

p2

from digit-recognition.

karaposu avatar karaposu commented on June 15, 2024

cant upload .bmp files directly to github so i uploaded it to this link

https://uploadfiles.io/bq1t4

from digit-recognition.

shivang8 avatar shivang8 commented on June 15, 2024

Thanks for pointing it out. I am working on it will respond at the earliest.

from digit-recognition.

shivang8 avatar shivang8 commented on June 15, 2024

With respect to the image you provided i.e. https://uploadfiles.io/bq1t4
The thickness of the image is too thin which does not match our training data. As the MNSIT dataset consists of atleast 45% of the character in the entire image.

This is the improved version of your image https://ufile.io/nt3iu

This may also happen due to the reason that the Neural Network is trained by a particular dataset thus it does not have enough knowledge of multiple handwritings. You need to train it with more dataset for best results.

If you have any additional dataset kindly send it to me for effective training.

from digit-recognition.

karaposu avatar karaposu commented on June 15, 2024

from digit-recognition.

shivang8 avatar shivang8 commented on June 15, 2024

I would sure have look and thanks for pointing it out.

from digit-recognition.

Related Issues (1)

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.