Giter Site home page Giter Site logo

konstantinosf / classification-of-hyperspectral-image Goto Github PK

View Code? Open in Web Editor NEW
184.0 12.0 74.0 7.96 MB

Classification of the Hyperspectral Image Indian Pines with Convolutional Neural Network

License: MIT License

Jupyter Notebook 100.00%
remote-sensing deeplearning hyperspectral-image-classification land-cover keras

classification-of-hyperspectral-image's Issues

Input size of image

In the training of the CNN, the input is of size (5,5,30) instead of (30,5,5) and as a result the model handles the input as an image of size 30x5 with 5 channels instead of a 5x5 image with 30 channels.

Classification-of-Hyperspectral-Image

In TrainTheModel file
Line number [5]

Reshape into (numberofsumples, channels, height, width)

X_train = np.reshape(X_train, (X_train.shape[0],X_train.shape[3], X_train.shape[1], X_train.shape[2]))


IndexError Traceback (most recent call last)
in ()
1 # Reshape into (numberofsumples, channels, height, width)
----> 2 X_train = np.reshape(X_train, (X_train.shape[0],X_train.shape[3], X_train.shape[1], X_train.shape[2]))

IndexError: tuple index out of range

Build the classification maps

Hi, thanks a lot for such a helpful repository. I see the code does not classify the marginal pixels when building the classification maps. Would you fix it later?

FileNotFoundError

How can I solve it? Thank you very much.

FileNotFoundError: [Errno 2] No such file or directory: '/home/deeplearning/Desktop/GITHUB/XtrainWindowSize5PCA30testRatio0.25.npy'

Regarding the corrections

Firstly, thanks for this amazing code. It is very nice and I learned a lot from this. However, I saw your datasets are corrected. Can you please tell me how did you do the corrections and please give me the link of the code you are using? TIA

"NameError: name 'numComponents' is not defined",

hello,
I tried the code, the frist two-CreatetheDatasets and TrainTheModel all run successfully, but when I run the last code-validation, the sentence "file_name = 'report'+"WindowSize" + str(windowSize) + "PCA" + str(numComponents) + "testRatio" + str(testRatio) +".txt"" represent the question, said "NameError: name 'numComponents' is not defined",
This mean it can't find the corresponding file and data, which means I didn't save some training results?
I don't know how to slove, can you help me?
thanks a lot

A question

Thanks for the work, I have tried the code, but it can not reach a high accuracy result as posted in the original paper.
image
The following are my results:
image
Train on 29685 samples, validate on 2563 samples
Epoch 1/15
29685/29685 [==============================] - 8s 258us/step - loss: 2.5315 - acc: 0.2048 - val_loss: 2.4267 - val_acc: 0.3531
Epoch 2/15
29685/29685 [==============================] - 7s 239us/step - loss: 1.9284 - acc: 0.4615 - val_loss: 1.8825 - val_acc: 0.5099
Epoch 3/15
29685/29685 [==============================] - 7s 240us/step - loss: 1.4118 - acc: 0.5917 - val_loss: 1.3746 - val_acc: 0.6278
Epoch 4/15
29685/29685 [==============================] - 7s 239us/step - loss: 1.0785 - acc: 0.6655 - val_loss: 1.1172 - val_acc: 0.6859
Epoch 5/15
29685/29685 [==============================] - 7s 240us/step - loss: 0.8887 - acc: 0.7122 - val_loss: 0.9545 - val_acc: 0.7323
Epoch 6/15
29685/29685 [==============================] - 7s 240us/step - loss: 0.7718 - acc: 0.7483 - val_loss: 0.8611 - val_acc: 0.7554
Epoch 7/15
29685/29685 [==============================] - 7s 240us/step - loss: 0.6798 - acc: 0.7747 - val_loss: 0.7822 - val_acc: 0.7706
Epoch 8/15
29685/29685 [==============================] - 7s 241us/step - loss: 0.6123 - acc: 0.7953 - val_loss: 0.7271 - val_acc: 0.7799
Epoch 9/15
29685/29685 [==============================] - 7s 240us/step - loss: 0.5648 - acc: 0.8120 - val_loss: 0.6752 - val_acc: 0.7936
Epoch 10/15
29685/29685 [==============================] - 7s 240us/step - loss: 0.5189 - acc: 0.8262 - val_loss: 0.6337 - val_acc: 0.8053
Epoch 11/15
29685/29685 [==============================] - 7s 241us/step - loss: 0.4804 - acc: 0.8420 - val_loss: 0.5988 - val_acc: 0.8092
Epoch 12/15
29685/29685 [==============================] - 7s 240us/step - loss: 0.4488 - acc: 0.8496 - val_loss: 0.5717 - val_acc: 0.8174
Epoch 13/15
29685/29685 [==============================] - 7s 242us/step - loss: 0.4181 - acc: 0.8618 - val_loss: 0.5408 - val_acc: 0.8205
Epoch 14/15
29685/29685 [==============================] - 7s 243us/step - loss: 0.3959 - acc: 0.8701 - val_loss: 0.5088 - val_acc: 0.8283
Epoch 15/15
29685/29685 [==============================] - 7s 241us/step - loss: 0.3730 - acc: 0.8765 - val_loss: 0.5010 - val_acc: 0.8221
Can you tell me what is the reason? Thanks in advance.

PCA

  1. in [16] X,pca = applyPCA(X,numPCAcomponents) numPCAcomponents is 30 but applyPCA function takes numComponents=75
    Please give difference between numPCAcomponents and numComponents
    Also how standartizeData function is used in the project

Issue with reshaping the patches for prediction

Hello, @KonstantinosF, thank you for sharing. I was trying the code and was getting an error when doing the final prediction. It seems image_patch=Patch(X,i,j) gives out a none type object.
X_test_image = image_patch.reshape(1,image_patch.shape[2],image_patch.shape[0],image_patch.shape[1]).astype('float32')

AttributeError: 'NoneType' object has no attribute 'reshape'

unnecessary code

function: CreatetheDataSets.AugmentData

patch2 = flipped_patch
X_train[i,:,:,:] = patch2

These two lines of code are unnecessary as flipped_patch and X_train all point to the same object.

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.