Giter Site home page Giter Site logo

hasanimason / matlab_convolutional_neural_net Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 14 KB

Matlab code for training CNNs to classify images, hyperparameter optimization, cross validation, handling imbalanced classes, semisupervised/ active learning, and model recalibration.

MATLAB 100.00%

matlab_convolutional_neural_net's Introduction

Matlab Code for Image Classification

This repo contains several Matlab programs which can be used for building convolutional neural networks for image classification. The included code contains several features:

  • Handling imbalanced datasets via weighted Bagging (Bootstrap Aggregation)
  • K-fold Cross Validation
  • Hyperparameter Optimization
  • Finding poorly predicted instances
  • Classifying unlabelled data (semi-supervised or active learning)
  • Recalibrating CNNs with new data (effectively transfer learning)

The code is organized into six stages. Only the 3rd Stage is required: it contains the basic code needed to build CNNs. The first two stages are used for hyperaprameter optimization. The 4th through 6th stages are used for validation and handling new data. The stages are:

  1. Optimize the hyperparameters to maximize accuracy over a single partition of the dataset.
  2. Further refine the hyperparameters and ensure that the optimizations produce consistent results over all the data partitions via reverse Cross-Validation.
  3. Build deployment-ready CNNs via Cross-Validation.
  4. Find instances that the deployment-ready CNNs failed to consistently classify via a voting schema.
  5. Classify unlabelled data (for semi-supervised or active learning).
  6. Recalibrate built models to incorporate new data.

In order for the code to work, each class of images must be in their own folder. Additionally, it is recommended to resize all the images prior to running the code and to keep the resized images separate from the full sized images. An example structure is shown below.

  • /full_size_class_1
  • /full_size_class_2
  • /working/class_1 (may call working whatever you want, just make it the active path)
  • /working/class_2

When recalibrating or classifying unlabeled images, the additional folders are needed.

  • /temp/ (contains unlabelled data)
  • /temp_resize/ (contains resized unlabelled data)
  • /class_1 (will contain output from Stage 5)
  • /class_2
  • /recalibration/class_1 (for stage 6, may call recalibration whatever, just make it the active path)
  • /recalibration/class_2

matlab_convolutional_neural_net's People

Stargazers

 avatar Camellia avatar

Watchers

James Cloos avatar Hasani avatar

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.