Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prediction issue while training on my custom dataset #3

Open
rrsc1234 opened this issue May 15, 2021 · 2 comments
Open

Prediction issue while training on my custom dataset #3

rrsc1234 opened this issue May 15, 2021 · 2 comments

Comments

@rrsc1234
Copy link

rrsc1234 commented May 15, 2021

Hi Pratyush Tripathy. By using your code as reference I am trying to do citrus crop mapping. In the following link I have attached my input files along with the predicted output.

"https://drive.google.com/file/d/1C0TCQkK-aqebJrhF_AO9jSSgmKI3fiMX/view?usp=sharing"

After running your complete code, I got following as output before going to "model.predict("Validation Image.tif")".

2021-05-15 14:34:11.825573: I tensorflow/compiler/jit/xla_cpu_device.cc:41] Not creating XLA devices, tf_xla_enable_xla_devices not set
2021-05-15 14:34:11.828208: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2021-05-15 14:34:44.084186: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:116] None of the MLIR optimization passes are enabled (registered 2)
51819/51819 [==============================] - 56s 1ms/step - loss: 0.0214 - accuracy: 0.9970
Epoch 2/2
51819/51819 [==============================] - 48s 923us/step - loss: 0.0138 - accuracy: 0.9974
Confusion matrix: for 14 nodes
 [[1102562       0]
 [   2894       0]]

P-Score: 0.000, R-Score: 0.000

As you can see all the pixels in the predicted image is classified as true positives and false negatives. Even though in the training class image there are no. of pixels with both classes viz. 0 & 1. Can you let me know what is the issue.

@jotafmr
Copy link

jotafmr commented Nov 30, 2021

I got the same issue.... Did u get any solution for that?

@PratyushTripathy
Copy link
Owner

@rrsc1234 @jotafmr This can happen when your classes are highly imbalanced. In this case, one of the classes has only about 0.2% samples of the other class, which the model will fail to learn. Try balancing the classes, see example in this article. You may need to downsample majority class and upsample (by duplicating) minority class. Let me know here how it goes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants