ritesh313 commited on
Commit
6493d39
·
verified ·
1 Parent(s): e1f97ff

Upload ResNet-18 genus model (epoch 3)

Browse files
Files changed (4) hide show
  1. README.md +76 -0
  2. classification_report.csv +58 -0
  3. config.json +84 -0
  4. model.safetensors +3 -0
README.md ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ library_name: deepforest
4
+ pipeline_tag: image-classification
5
+ tags:
6
+ - deepforest
7
+ - crop-model
8
+ - tree-genus
9
+ - ecology
10
+ - neon
11
+ ---
12
+
13
+ # Tree Genus Classification (CropModel)
14
+
15
+ Classifies tree crowns detected by [DeepForest](https://github.com/weecology/DeepForest) into 54 genera. Trained on RGB imagery from 29 [NEON](https://www.neonscience.org/) sites across North America.
16
+
17
+ Trained with [NeonTreeClassification](https://github.com/GatorSense/NeonTreeClassification).
18
+
19
+ ## Usage
20
+
21
+ ```python
22
+ from deepforest import main
23
+ from deepforest.model import CropModel
24
+
25
+ detector = main.deepforest()
26
+ detector.load_model("weecology/deepforest-tree")
27
+
28
+ genus_model = CropModel.load_model("weecology/cropmodel-tree-genus")
29
+
30
+ results = detector.predict_tile(path="tile.tif", crop_model=genus_model)
31
+ # results has columns: cropmodel_label, cropmodel_score
32
+ ```
33
+
34
+ ## Results (Test Set)
35
+
36
+ | Metric | Value |
37
+ |---|---|
38
+ | Accuracy | 44.0% |
39
+ | Macro F1 | 0.25 |
40
+ | Weighted F1 | 0.44 |
41
+ | Classes | 54 |
42
+
43
+ Full per-class precision/recall/F1 in [`classification_report.csv`](classification_report.csv).
44
+
45
+ ## Training
46
+
47
+ | Parameter | Value |
48
+ |---|---|
49
+ | Architecture | ResNet-18 (torchvision, ImageNet pretrained) |
50
+ | Input | 224x224 RGB, ImageNet normalization |
51
+ | Resize interpolation | nearest-neighbor |
52
+ | Optimizer | AdamW (lr=2.5e-4, weight_decay=1e-4) |
53
+ | Scheduler | ReduceLROnPlateau |
54
+ | Max epochs | 500 (early stopping patience=15) |
55
+ | Best epoch | 3 (val_loss=2.22) |
56
+ | Batch size | 256 |
57
+ | Class weights | sqrt inverse-frequency |
58
+ | Seed | 42 |
59
+
60
+ ## Dataset
61
+
62
+ 16,348 deduplicated tree crowns from 29 NEON sites. One sample per unique individual, rare species (<6 samples) removed. Labels from NEON Vegetation Structure Taxonomy (VST) field surveys. RGB crown crops extracted at 0.1m resolution.
63
+
64
+ | Split | Samples |
65
+ |---|---|
66
+ | Train (70%) | 11,443 |
67
+ | Val (15%) | 2,452 |
68
+ | Test (15%) | 2,453 |
69
+
70
+ Split method: stratified random, seed=42.
71
+
72
+ **Sites**: ABBY, BART, BONA, CLBJ, DEJU, DELA, GRSM, GUAN, HARV, HEAL, JERC, KONZ, LENO, MLBS, MOAB, NIWO, ONAQ, OSBS, PUUM, RMNP, SCBI, SERC, SJER, SOAP, TALL, TEAK, UKFS, UNDE, WREF
73
+
74
+ ## License
75
+
76
+ MIT
classification_report.csv ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ,precision,recall,f1-score,support
2
+ Abies (0),0.3672,0.4159,0.39,113.0
3
+ Acer (1),0.3586,0.4424,0.3961,278.0
4
+ Alnus (2),0.0,0.0,0.0,4.0
5
+ Amelanchier (3),0.125,0.2632,0.1695,19.0
6
+ Arctostaphylos (4),0.0,0.0,0.0,1.0
7
+ Betula (5),0.641,0.2525,0.3623,99.0
8
+ Bourreria (6),1.0,1.0,1.0,3.0
9
+ Bucida (7),1.0,0.5,0.6667,2.0
10
+ Bursera (8),1.0,1.0,1.0,2.0
11
+ Calocedrus (9),0.4667,0.6667,0.549,21.0
12
+ Carpinus (10),0.0909,0.0333,0.0488,30.0
13
+ Carya (11),0.2329,0.3953,0.2931,43.0
14
+ Celtis (12),0.1538,0.0426,0.0667,47.0
15
+ Cercis (13),0.3,0.5,0.375,6.0
16
+ Cornus (14),0.1111,0.1667,0.1333,6.0
17
+ Diospyros (15),0.0,0.0,0.0,1.0
18
+ Fagus (16),0.2621,0.5094,0.3462,53.0
19
+ Fraxinus (17),0.2326,0.2,0.2151,50.0
20
+ Gleditsia (18),0.0,0.0,0.0,3.0
21
+ Gymnocladus (19),0.0,0.0,0.0,1.0
22
+ Halesia (20),0.0,0.0,0.0,3.0
23
+ Ilex (21),0.0,0.0,0.0,1.0
24
+ Juglans (22),0.2632,0.4545,0.3333,11.0
25
+ Juniperus (23),0.2162,0.4211,0.2857,19.0
26
+ Larix (24),0.0,0.0,0.0,4.0
27
+ Liquidambar (25),0.2407,0.2321,0.2364,56.0
28
+ Liriodendron (26),0.3448,0.5085,0.411,59.0
29
+ Maclura (27),0.1111,0.1429,0.125,7.0
30
+ Magnolia (28),0.1667,0.3333,0.2222,6.0
31
+ Metrosideros (29),1.0,0.7143,0.8333,7.0
32
+ Morus (30),0.0,0.0,0.0,6.0
33
+ Nyssa (31),0.0,0.0,0.0,26.0
34
+ Ostrya (32),0.0,0.0,0.0,1.0
35
+ Oxydendrum (33),0.1579,0.1579,0.1579,19.0
36
+ Picea (34),0.7692,0.65,0.7046,200.0
37
+ Pinaceae (35),0.0,0.0,0.0,2.0
38
+ Pinus (36),0.6012,0.6293,0.6149,321.0
39
+ Pisonia (37),0.6667,0.6667,0.6667,3.0
40
+ Platanus (38),0.5,0.1429,0.2222,7.0
41
+ Populus (39),0.6173,0.5814,0.5988,86.0
42
+ Prunus (40),0.0,0.0,0.0,9.0
43
+ Pseudotsuga (41),0.5806,0.63,0.6043,200.0
44
+ Quercus (42),0.5315,0.3665,0.4338,322.0
45
+ Robinia (43),0.0,0.0,0.0,5.0
46
+ Sassafras (44),0.5,0.1667,0.25,6.0
47
+ Sideroxylon (45),0.0,0.0,0.0,1.0
48
+ Symphoricarpos (46),0.0,0.0,0.0,2.0
49
+ Taxus (47),0.0,0.0,0.0,4.0
50
+ Thuja (48),0.0,0.0,0.0,6.0
51
+ Tilia (49),0.0,0.0,0.0,2.0
52
+ Triadica (50),0.0,0.0,0.0,2.0
53
+ Tsuga (51),0.4,0.3889,0.3944,216.0
54
+ Ulmus (52),0.1818,0.4615,0.2609,39.0
55
+ Unknown (53),0.0,0.0,0.0,13.0
56
+ accuracy,0.4403,0.4403,0.4403,0.4403
57
+ macro avg,0.2628,0.2599,0.2475,2453.0
58
+ weighted avg,0.454,0.4403,0.4358,2453.0
config.json ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cropmodel": {
3
+ "architecture": "resnet18",
4
+ "batch_size": 4,
5
+ "num_workers": 0,
6
+ "lr": 0.0001,
7
+ "scheduler": {
8
+ "type": "ReduceLROnPlateau",
9
+ "params": {
10
+ "mode": "min",
11
+ "factor": 0.5,
12
+ "patience": 5,
13
+ "threshold": 0.0001,
14
+ "threshold_mode": "rel",
15
+ "cooldown": 0,
16
+ "min_lr": 0,
17
+ "eps": 1e-08
18
+ }
19
+ },
20
+ "balance_classes": false,
21
+ "resize": [
22
+ 224,
23
+ 224
24
+ ],
25
+ "resize_interpolation": "nearest",
26
+ "expand": 0,
27
+ "label_dict": {
28
+ "Abies": 0,
29
+ "Acer": 1,
30
+ "Alnus": 2,
31
+ "Amelanchier": 3,
32
+ "Arctostaphylos": 4,
33
+ "Betula": 5,
34
+ "Bourreria": 6,
35
+ "Bucida": 7,
36
+ "Bursera": 8,
37
+ "Calocedrus": 9,
38
+ "Carpinus": 10,
39
+ "Carya": 11,
40
+ "Celtis": 12,
41
+ "Cercis": 13,
42
+ "Cornus": 14,
43
+ "Diospyros": 15,
44
+ "Fagus": 16,
45
+ "Fraxinus": 17,
46
+ "Gleditsia": 18,
47
+ "Gymnocladus": 19,
48
+ "Halesia": 20,
49
+ "Ilex": 21,
50
+ "Juglans": 22,
51
+ "Juniperus": 23,
52
+ "Larix": 24,
53
+ "Liquidambar": 25,
54
+ "Liriodendron": 26,
55
+ "Maclura": 27,
56
+ "Magnolia": 28,
57
+ "Metrosideros": 29,
58
+ "Morus": 30,
59
+ "Nyssa": 31,
60
+ "Ostrya": 32,
61
+ "Oxydendrum": 33,
62
+ "Picea": 34,
63
+ "Pinaceae": 35,
64
+ "Pinus": 36,
65
+ "Pisonia": 37,
66
+ "Platanus": 38,
67
+ "Populus": 39,
68
+ "Prunus": 40,
69
+ "Pseudotsuga": 41,
70
+ "Quercus": 42,
71
+ "Robinia": 43,
72
+ "Sassafras": 44,
73
+ "Sideroxylon": 45,
74
+ "Symphoricarpos": 46,
75
+ "Taxus": 47,
76
+ "Thuja": 48,
77
+ "Tilia": 49,
78
+ "Triadica": 50,
79
+ "Tsuga": 51,
80
+ "Ulmus": 52,
81
+ "Unknown": 53
82
+ }
83
+ }
84
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5947b83bc5d186b7069439c6dcfbf885cf151a04f25ed766456784f758584c71
3
+ size 44866920