2

I am doing a project on CBIR using DWT and neural network. I have extracted color and texture features and trained the normalized values of the extracted features. I have used neural network tool in matlab to implement the image classification. All of these are done successfully.

My question is - are there any ways to insert the trained image values into the ms access database automatically?

Thanks.

Kach
  • 111
  • 1
  • 1
  • 7
  • Just guessing here, but I can see from the documentation that ODBC drivers are available, so what do you mean by automatically? – Fionnuala Jul 28 '12 at 18:54
  • yes i configure ODBC in my project. just want to know every time i run my neural network how the values will be inserted into my database. thanks for the reply. – Kach Jul 28 '12 at 21:29

1 Answers1

1

Neural network objects have properties you can access to get the network weights. Example:

net = feedforwardnet();       %# or the obsolete functions: newff, newpr, ..
net.b     %# bias vectors
net.IW    %# input weight matrices
net.LW    %# layer weight matrices

Refer to the documentation to know the meaning of each. You could check out this answer for an example how to use them to compute the network output yourself.

In addition there is a GETWB convenience function to get all weights as a vector:

weights = getwb(net);

You would save those values in the database. You can set the weights back with the SETWB function.

See here for an overview how to interact with database in MATLAB (here is one example of interacting with MS Access database).

Community
  • 1
  • 1
Amro
  • 123,847
  • 25
  • 243
  • 454
  • thanks. this is really helpful. now one more question - i am using feed forward multilayer perceptron for similarity measurement. my question is what values need to be inserted into the database and how these can be used for similarity measurement after performing the neural network tool? actually i am new in matlab and stuck on this problem about a week. thanks in advance. – Kach Jul 29 '12 at 16:22
  • @Kach: Neural networks can be characterized by two things: network architecture (number of layers, number of neurons per layer, activation functions used, etc..), and the network weights. So if you keep the architecture fixed, and simply save the weights, you could always reconstruct it later by loading up those parameters and building the network again without re-training. You could always just forget using databases, and simply save the network object to a regular MAT-file: `save mynetwork.mat net` just as you export any other MATLAB variables.. – Amro Jul 29 '12 at 16:31
  • that means i could retrieve images or search images from these saved values from the file. am i right? – Kach Jul 29 '12 at 17:01
  • @Kach: I assume you already developed your image classifier: Given an input image, you extract features, run them through the trained network (with the weights found by back-propagation), and it should output some class label (like classifying it as a car, or a duck, etc..). That's the basics of any machine learning classifier – Amro Jul 29 '12 at 17:13