Message Boards Message Boards

1
|
3691 Views
|
3 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Help with contructing a simple demo network

I wonder if someone could give some hint on constructing a simple demo program for class identification, more concretely a network which can identify a so-called "two phase flow regime". I believe the problem is not complicated, but I am a complete novice of using Wolfram codes for such a purpose, this is the only hinder. The various types of two phase flow of water in a heated channel are usually divided into four classes depending on the topology of the flow, called "bubbly", "slug", "churn-turbulent" and "annular". See an illustration below. The four regimes of a two-phase flow in a pipe

My idea, following a webinar by Jon McLoone recently, was to start with downloading an already existing code for image identification from the Wolfram Neural Network Repository (Wolfram ImageIdentify Net V1), then re-train the network with my data. Here is a screenshot of the attempt I made: The attempt along which I tried to go However, in this form it does not work, because the repository network has an output vector of size 4315, with labels which do not contain mine, i.e. "bubbly" etc. What I would need is to re-define the size of the output vector, and define the four classes which I want to use. Is this possible? If so, any hint on how? Or, is there a network in the repository, which is more suited to such a task? I would need this to make a small demonstration of pattern recognition with neural networks in a course which is about how to solve inverse tasks in diagnostics of industrial processes. Any input would be highly appreciated.

POSTED BY: Imre Pazsit
3 Replies

Hi Rohit, I wrote the reply below and for some reason it did not get posted. However, since I wrote the unsent message, I took the example you suggested, simply changed the classes from "cats" and "dogs" to "bubbly", "slug", "churn-turbulent" and "annular", and it worked! I only used single images for each class so far, both for the training and the identification, but I will generate more training data. As I said, this is just a demo, not a real application. Thanks a lot! =========And this is the unsent message=================== Many thanks for quick help. I will check the solution that you suggested. I am of course well aware that one needs a (much) larger training set. This is not a problem, I can easily generate such, but I just wanted to illustrate the problem in my post, this is why I only used one example for each class. Thanks again! Imre

POSTED BY: Imre Pazsit
Posted 3 years ago

Hi Imre,

The Wolfram ImageIdentify NN was not trained with the types of images you are trying to classify. If you want to use it, you will have to use transfer learning which involves some net surgery. Drop the last two layers in the network, and chain a linear and non linear layer to the end and use a custom class decoder. Set the learning rate multipliers to None for all but the new layers and re-train. If you get stuck, post the code you have tried and I can help further.

There is an example in the documentation here.

With just one example from each class it is unlikely the network will perform well.

POSTED BY: Rohit Namjoshi

Hi Rohit, Many thanks for quick help. I will check the solution that you suggested. I am of course well aware that one needs a (much) larger training set. This is not a problem, I can easily generate such, but I just wanted to illustrate the problem in my post, this is why I only used one example for each class. Thanks again! Imre

POSTED BY: Imre Pazsit
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract