uav4geo / OpenPointClass

Fast and memory efficient semantic segmentation of 3D point clouds. Runs on Windows, Mac and Linux.
GNU Affero General Public License v3.0
136 stars 21 forks source link

Added extended training statistics and exporting #16

Closed HeDo88TH closed 1 year ago

HeDo88TH commented 1 year ago

Added extended training statistics:

Statistics:
  Global accuracy: 61.233%
  Average accuracy: 42.140%
  Average sensitivity: 63.470%
  Average precision: 65.484%
  Average F1: 0.582

  Labels:

                     Label  |   Accuracy | Sensitivity |  Precision |         F1 |
  ------------------------- | ---------- |  ---------- | ---------- | ---------- |
                     ground |    38.798% |       0.400 |      0.930 |      0.559 |
             low_vegetation |    62.902% |       0.979 |      0.638 |      0.772 |
                   building |    38.148% |       0.816 |      0.417 |      0.552 |
          human_made_object |    28.712% |       0.344 |      0.635 |      0.446 |

The --stats-file switch allows the user to specify where to write the statistics:

{
    "avgAccuracy": 0.4213987197090668,
    "avgF1": 0.5824347254755816,
    "avgPrecision": 0.6548385499638956,
    "avgSensitivity": 0.6346952018424293,
    "globalAccuracy": 0.6123297944158843,
    "labels": {
        "building": {
            "accuracy": 0.3814783649011955,
            "f1": 0.5522755543529327,
            "precision": 0.41739624158896327,
            "sensitivity": 0.8159431070807461
        },
        "ground": {
            "accuracy": 0.38797587955720997,
            "f1": 0.5590527692469432,
            "precision": 0.9298705850867727,
            "sensitivity": 0.3996704554785759
        },
        "human_made_object": {
            "accuracy": 0.2871173171301706,
            "f1": 0.4461400888775913,
            "precision": 0.6345289742795166,
            "sensitivity": 0.34400616009240137
        },
        "low_vegetation": {
            "accuracy": 0.6290233172476911,
            "f1": 0.7722704894248593,
            "precision": 0.6375583989003297,
            "sensitivity": 0.9791610847179939
        }
    }
}

I am still working on this 👍

Plus I added another switch --eval-result which points to a ply file where to write the validation result point cloud

pierotofy commented 1 year ago

Thanks, but before you go any further, can we please disable code linting? I can't review anything if you continue to change code formatting.

Also stop cleaning up stuff at random. If you want to cleanup the code, do so as part of a separate PR.

HeDo88TH commented 1 year ago

Thanks, but before you go any further, can we please disable code linting? I can't review anything if you continue to change code formatting.

Also stop cleaning up stuff at random. If you want to cleanup the code, do so as part of a separate PR.

The cmake file had indentation inconsistencies: half of the file was 2 spaces, the other half was 4, and some parts had none at all. I will deactivate the linter for the most perfluous things 👍

pierotofy commented 1 year ago

And revert the formatting/refactoring changes.

HeDo88TH commented 1 year ago

https://github.com/uav4geo/OpenPointClass/pull/16/commits/4ccc93109f3277e85b63416cabe180024cae4958 and https://github.com/uav4geo/OpenPointClass/pull/16/commits/e2d2daa6e9e97d27580a15a9ec60b54bfcae23bf moved to #17

HeDo88TH commented 1 year ago

Stats explanation:

  1. Accuracy Accuracy is the proportion of correctly classified points (both true positives and true negatives) to the total number of points in the dataset. It is a common metric to evaluate the overall performance of a classification model. However, accuracy may not always be the best metric, especially when there's a class imbalance (one class has significantly more points than the other). Accuracy = (True Positives + True Negatives) / (True Positives + True Negatives + False Positives + False Negatives)

  2. Precision Precision, also known as positive predictive value, measures the proportion of true positives (correctly classified points of a specific class) to the total number of points predicted as that class (both true positives and false positives). In other words, it quantifies how well the classifier correctly identifies a specific class without including false positives. Precision = True Positives / (True Positives + False Positives)

  3. Sensitivity Sensitivity, also known as recall or true positive rate, measures the proportion of true positives to the total number of actual positives (both true positives and false negatives). It quantifies the ability of the classifier to find all the relevant points of a specific class. Sensitivity = True Positives / (True Positives + False Negatives)

  4. F1 Score In point cloud classification, precision and sensitivity are often used together to provide a more comprehensive understanding of the classifier's performance. This is because they provide complementary information: precision is focused on reducing false positives, while sensitivity is focused on capturing all true positives. To balance these two metrics, you can use the F1 score, which is the harmonic mean of precision and sensitivity: F1 Score = 2 * (Precision * Sensitivity) / (Precision + Sensitivity)

pierotofy commented 1 year ago

Not quite; just look at this diff https://github.com/uav4geo/OpenPointClass/pull/16/files

pierotofy commented 1 year ago

I can't make changes:

 ! [remote rejected] HeDo88TH/main -> HeDo88TH/main (permission denied)
error: failed to push some refs to 'https://github.com/HeDo88TH/OpenPointClass'
pierotofy commented 1 year ago

Modifications: https://github.com/pierotofy/OpenPointClass/tree/stats

pierotofy commented 1 year ago

Closing via #18