File size: 3,121 Bytes
cbf42df
 
 
 
3739f98
 
7c1422d
 
 
 
 
cbf42df
 
 
 
 
 
7c1422d
 
cbf42df
 
 
e45c573
cbf42df
7c1422d
 
 
 
 
 
8ea9d7e
7c1422d
 
3739f98
cbf42df
 
 
 
 
 
 
 
8ea9d7e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cbf42df
 
7c1422d
cbf42df
8ea9d7e
cbf42df
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
---
license: apache-2.0
base_model: facebook/convnextv2-nano-22k-384
tags:
- image-classification
- vision
- boulderspot
- climbing
- aerial imagery
- remote sensing
- bouldering
metrics:
- accuracy
- f1
- precision
- recall
- matthews_correlation
datasets:
- pszemraj/boulderspot
---


# convnextv2-nano-22k-384-boulderspot


This is a model fine-tuned to classify whether an aerial/satellite image contains a climbing area or not.

You can find some images to test inference with [in this old repo from the original project](https://github.com/pszemraj/BoulderAreaDetector/tree/cbb22bdb3373b4b72d798dedfcb28543c0dc769d/test_images)



## Model description

This model is a fine-tuned version of [facebook/convnextv2-nano-22k-384](https://huggingface.co/facebook/convnextv2-nano-22k-384) on the pszemraj/boulderspot dataset.
It achieves the following results on the evaluation set:
- Loss: 0.0340
- Accuracy: 0.9883
- F1: 0.9883
- Precision: 0.9883
- Recall: 0.9883
- Matthews Correlation: 0.8962

## example usage

```py
import requests
from PIL import Image
from transformers import pipeline

pipe = pipeline(
    "image-classification",
    model="pszemraj/convnextv2-nano-22k-384-boulderspot",
)

url = "https://huggingface.co/pszemraj/convnextv2-nano-22k-384-boulderspot/resolve/main/test_img_magic_wood.png?download=true"
image = Image.open(requests.get(url, stream=True).raw)
result = pipe(image)[0]
print(result)
# image.show()
```

## Intended uses & limitations

Classification of aerial/satellite imagery, ideally with spacial resolution 10-25 cm (_i.e. for 10 cm, each pixel in the image corresonds to approx. 10 cm x 10 cm area on the ground_). It may be suitable outside of that, but should be validated as other resolutions were not present in the training data.


## Training procedure

### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 2e-05
- train_batch_size: 16
- eval_batch_size: 16
- seed: 7890
- gradient_accumulation_steps: 4
- total_train_batch_size: 64
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: cosine
- lr_scheduler_warmup_ratio: 0.05
- num_epochs: 5.0

### Training results

| Training Loss | Epoch | Step | Validation Loss | Accuracy | F1     | Precision | Recall | Matthews Correlation |
|:-------------:|:-----:|:----:|:---------------:|:--------:|:------:|:---------:|:------:|:--------------------:|
| 0.1102        | 1.0   | 203  | 0.0431          | 0.9839   | 0.9840 | 0.9841    | 0.9839 | 0.8590               |
| 0.0559        | 2.0   | 406  | 0.0476          | 0.9839   | 0.9845 | 0.9858    | 0.9839 | 0.8709               |
| 0.0402        | 3.0   | 609  | 0.0464          | 0.9810   | 0.9817 | 0.9831    | 0.9810 | 0.8468               |
| 0.0334        | 4.0   | 813  | 0.0348          | 0.9868   | 0.9869 | 0.9870    | 0.9868 | 0.8846               |
| 0.0445        | 4.99  | 1015 | 0.0340          | 0.9883   | 0.9883 | 0.9883    | 0.9883 | 0.8962               |


### Framework versions

- Transformers 4.39.2
- Pytorch 2.4.0.dev20240328+cu121
- Datasets 2.18.0
- Tokenizers 0.15.2