lix-byte / Image-classification

deep-learning image classification resnet50

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Image-classification fine-tuned ResNet50

Use fine-tuned ResNet50 to classify brain tumors. ResNet50 is pre-trained on ImageNet. The fully connected layer of the model is changed. DropOut is used in the fully connected layer to prevent overfitting. In addition, the loss function uses cross entropy, which is added Label Smoothing.The project can realize the category prediction of a single picture. This is just a small exercise for classification and prediction tasks, there are many shortcomings, welcome to discuss

Dataset structure

  • Brain Tumor Classification
    • train
      • glioma_tumor
        • 001.jpg
        • 002.jpg
        • ...
      • meningioma_tumor
      • no_tumor
      • pituitary_tumor
    • val
      • glioma_tumor
      • meningioma_tumor
      • no_tumor
      • pituitary_tumor

Project structure

  • loss_acc: Store the accuracy and loss curve generated after the training and verification process.
  • models: Store the model when the last training is completed.
  • test: Picture for prediction.
  • If you only have a training set, you can use it to generate a validation set by extracting a portion of the images according to the ratio. A ratio of 0.2 is recommended as the validation set.
  • Add Label Smoothing to the loss function to prevent overfitting.
  • Define the model. The file contains the fine-tuned VGG16 and ResNet50 pre-trained models. You only need to change the number of final output categories.
  • Training and validation.
  • Input a picture, it will tell you the category of the target in the picture.


deep-learning image classification resnet50


Language:Python 100.0%