How to use a trained neural network in GUIDE?

5 views (last 30 days)
Malina Balint
Malina Balint on 31 Mar 2021
Answered: Prasanna on 25 Apr 2024 at 5:43
I trained a convolutional neural network using the pre-trained network ResNet50 for medical image classification. Now I want to create a user interface in GUIDE where a user can upload a picture of a skin tumor and the net will classify it and return the label for the image. My problem is I'm not sure where should I put the network in the interface code. I am using axes for the image and a push button for the upload function, and I was thinking of using another push button for the classification.

Answers (1)

Prasanna
Prasanna on 25 Apr 2024 at 5:43
Hi Malina,
To create a UI in GUIDE and integrate the pre-trained network with the same: You can load the network, set up the GUI to handle image uploads, and classify the uploaded images upon a button press. Some further instructions on the above steps include:
  • Load the Pre-trained Network: Load your pre-trained network when the GUI initializes. This can be done in the OpeningFcn of your GUIDE-generated .m file, which is executed before the GUI becomes visible.
  • Upload and Display the Image: In the callback for your upload button, you can implement functionality to upload and display the image within the axes you've designed.
  • Classify the Uploaded Image: For the classification button, you can set up a callback that processes the uploaded image according to the input requirements of your pre-trained network (e.g., resizing), performs classification, and then displays or returns the classification result.
You can refer the following documentation for more information on writing callbacks in GUIDE:
Hope this helps.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!