What files to edit for retraining binary classifier as multi-class classifier

Hi, If I want to use this covid19 classification model and train it from scratch on multiple classes (not fine_tune) am I correct in saying that we only need to make changes in the dataset.json file? I don’t find any reference on the #classes in the train.sh script or train_config.json files.
The new dataset.json will then look like "label_format": [4], not making use of one-hot encoding as it’s done in this xray_classification model.

Hi
You are partially correct.
The Xray classification was N-hot problem with 15 independent binary classes so that why it was encoded as

"label_format": [1,1,1....,1]

then the data was labeled as below showing an image can have 2 or more classes turned set to true

label:[1,0,1,0....,1] 
or 
label:[0,0,0,1,...1]

in your case if you have a 1-hot class that can take 5 values (0-4) then you would do

"label_format": [5]

then the data was labeled as

label:[0]  --> for class 0  
or 
label:[1] --> for class 1
or 
label:[2] --> for class 2 
or 
label:[4] --> for class 4 

Hope that helps

Maybe in the same line as my other post here but could you also explain how to get performance validation metrics (AUC and accuracy) on this multi-class classifier example? Also, is there an option to plot ROC’s and confusion matrices?

I actually tried the 1-hot encoding on my multi-class classifier and it worked well. Is it the case that 1-hot encoding should be used for non-mutually exclusive classes (such as in your example of chest xray classifier) and n-hot should be used for mutually exclusive classes (no overlap)?

Hi
Just to clarify AUC is calculated as in ROC so it is for binary classification.
In our Chest Xray example there are multiple (15) classes. each of them are binary so you can do AUC for each of them
if you want to calculate accuracy for multiclass you could add the following in the train config

    "aux_ops": [
      {
        "name": "ComputeMulticlassAccuracy",
        "args": {
          "tag": "multiclass_accuracy"
	    }
      }
    ],

then in the metric section in the validatation section add

  "validate": {
    "pre_transforms": [ 
     ....
    ],
    "metrics": [
      {
        "name": "ComputeAverage",
        "args": {
          "name": "valid_mean_multiclass_accuracy",
          "field": "multiclass_accuracy"
        }
      },

Hope that helps