Skip to content

Single class detection is yielding strange results #14

Description

@FadelMamar

Hello Alexandre,

Thank you for open-sourcing this amazing work. I have tried to train HerdNet for single class detection (i.e. only 1 class for wildlife) but the evaluation results are a bit strange.

Image

I am using the same pipeline as described in the tutorials:

  • num classes: 2 # including background
  • learning rate: 1e-4
  • epochs: 30
  • image_size: 800
  • batchsize: 32
  • down_ratio: 2
  • target cls heatmap: 20
  • cross entropy weight: None
  • stitcher: None
  • evaluation radius for PointsMetrics class is 20
  • dataset type: FolderDataset for both training and validation
  • Validation dataset has 10 time more negative samples than positive samples
  • HerdNetLMDS arguments are default

Here is how I'm loading the data:

Thanks,
Fadel

patch_size=image_size # 800 in my case
transforms=dict()
transforms["train"] = (
                [
                    A.Resize(width=patch_size, height=patch_size, p=1.0),
                    A.VerticalFlip(p=0.5),
                    A.HorizontalFlip(p=0.5),
                    A.RandomRotate90(p=0.5),
                    A.RandomBrightnessContrast(
                        brightness_limit=0.2, contrast_limit=0.2, p=0.2
                    ),
                    A.Blur(blur_limit=15, p=0.2),
                    A.Normalize(
                        normalization=normalization,
                        p=1.0,
                        mean=(0.485, 0.456, 0.406),
                        std=(0.229, 0.224, 0.225),
                    ),
                ],
                [
                    MultiTransformsWrapper(
                        [
                            FIDT(num_classes=num_classes, down_ratio=down_ratio),
                            PointsToMask(
                                radius=2,
                                num_classes=num_classes,
                                squeeze=True,
                                down_ratio=int(patch_size // (16 * patch_size / 512)),
                            ),
                        ]
                    )
                ],
            )
            transforms["val"] = (
                [
                    A.Resize(width=patch_size, height=patch_size, p=1.0),
                    A.Normalize(
                        normalization=normalization,
                        p=1.0,
                        mean=(0.485, 0.456, 0.406),
                        std=(0.229, 0.224, 0.225),
                    ),
                ],
                [
                    DownSample(down_ratio=down_ratio, anno_type="point"),
                ],
            )

split='val'
dataset = FolderDataset(  
            csv_file=df_annotations,
            root_dir="",
            albu_transforms=transforms[split][0],
            end_transforms=transforms[split][1],
            images_paths=selected_images, # I am overriding root_dir arguments and assigning directly FolderDataset.folder_images
        )

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions