Two category project

Solutions

As a whole, transfer learning is used to train the neural network, the InceptionV3 structure is used, and the framework uses keras.

Specific ideas:

  1. Read the picture data and save it in a .npyformat to facilitate subsequent loading
  2. The label is in one-hot format. Since the label is hidden in the folder naming, you need to add the label yourself and save it to the .npyfile for subsequent loading
  3. Divide data into training set, validation set, and test set
  4. Use keras to build the basic model of InceptionV3, excluding the top layer, use pre-training weights, customize several layers of neural networks on the basis of the basic model, get the final model, and train the model
  5. Optimize the model, adjust hyperparameters, and improve accuracy
  6. Evaluate the model on the test set, using precision and recall
  7. Make predictions on a single picture and output the probability of each category

    Summary of knowledge points

  • How to load the actual data, how to save it as an npy file, how to scramble the data, how to divide the data, how to cross-validate
  • How to use keras for transfer learning
  • The use of data enhancement and callback function in keras. The callback function involves: learning rate adjustment, saving the best model, tensorboard visualization
  • How to use sklearn to calculate accuracy, precision, recall, F1_score
  • How to predict a single picture and print the classification probability
  • How to specify specific GPU training and how to specify the memory usage of GPU

Guess you like

Origin blog.csdn.net/yanyiting666/article/details/94601550