# ConCon Challenge — Data

来源：https://www.kaggle.com/competitions/concon/data

本地 Meta Kaggle 快照；不是本次实时页面。

# Dataset Description

# Concon Dataset Structure

Concon contains three image datasets—`unconf`, `disjoint`, and `strict`—designed for training, validation, and testing machine learning models. Each dataset is structured with folders for `train`, `test`, and `val` sets (where applicable) and contains PNG images organized by tasks.

## Overview of Datasets

### unconf
The `unconf` dataset is *unconfounded* and generated using only the ground truth rule. Across all tasks, this rule is present in positive images and absent in negative images. This dataset is intended to provide models with data that is free of any confounding factors for accurate testing. It is structured as follows:

- `test`: Contains images for testing, structured with tasks, such as:
  - `images/t0`: Images for testing under task `t0`.

### disjoint
The `disjoint` dataset is a *confounded* dataset split into training, validation, and testing sets. In this dataset, **confounders from any task do not reappear across tasks**. This means that the confounders are fully separated, making it useful for evaluating model performance when trained on data with distinctive confounding factors across tasks.

- `train`: Contains images for training, divided into tasks:
  - `images/t0`: Images for task `t0`, further divided into `0`, `1`, etc., subdirectories.
  - `images/t1`: Images for task `t1`.
  - `images/t2`: Images for task `t2`.
- `test` and `val`: Follow the same structure as `train`, with tasks `t0`, `t1`, etc.

### strict
The `strict` dataset is another *confounded* dataset, following the same structure as `disjoint`. Here, **only the specific confounders are avoided in negative samples for each respective task**, creating a stricter confounding setup. This setup allows for a nuanced test of model performance when some but not all confounding factors are present.

- `train`, `test`, and `val`: Each contains images for tasks (`t0`, `t1`, etc.), following the same format as `disjoint`.

---

## Folder Structure

Below is the structure of the datasets, illustrating the organization of subdirectories within each dataset.

```plaintext
root_directory/
├── unconf
│   └── test
│       └── images
│           └── t0
├── disjoint
│   ├── train
│   │   └── images
│   │       ├── t0
│   │       │   ├── 0
│   │       │   └── 1
│   │       ├── t1
│   │       └── t2
│   ├── test
│   │   └── images
│   └── val
│       └── images
└── strict
    ├── train
    │   └── images
    ├── test
    │   └── images
    └── val
        └── images
```


### Folder Descriptions

- **`unconf/test/images/t0`**: Contains PNG images for unconfounded testing under `t0`.

- **`disjoint/train/images`**: Holds confounded images for training, with further subdivision by tasks (`t0`, `t1`, `t2`). Within `t0`, subdirectories `0` and `1` may represent different categories or splits within task `t0`.

- **`disjoint/test/images` and `disjoint/val/images`**: Structured similarly to `train/images`, containing confounded test and validation images divided by tasks.

- **`strict/train`, `strict/test`, and `strict/val`**: Follow the same format as `disjoint`, with separate images for each task to simulate confounded conditions.


## Additional Details on Dataset Design

- **unconf (Unconfounded)**:
  - This dataset contains only the ground truth rule for each task.
  - The rule appears in positive images and is absent in negative images.
  - These images are used for testing the trained models.

- **disjoint (Confounded)**:
  - Confounders are completely disjoint across tasks, meaning no confounders reappear between tasks.
  - Suitable for training models where confounding effects are separated by tasks.
  - All positive images `(subdirectory 1)` adhere to the groud truth rule as well as have the `disjoint` property and negative images `(subdirectory 0)` do not.

- **strict (Confounded)**:
  - Confounders specific to each task are avoided in the negative samples only for that task.
  - Ideal for testing models under stricter confounding conditions.
  - All positive images `(subdirectory 1)` adhere to the groud truth rule as well as have the `strict` property and negative images `(subdirectory 0)` do not.

## File Types

All images are stored in **PNG format**. Each task folder contains images relevant to specific tasks, enabling model testing on task-specific data under different configurations (unconfounded, confounded).

---

### Usage Instructions

1. **Loading the Datasets**:
   - Use `unconf` for testing models on unconfounded data.
   - Use `disjoint` and `strict` for training and testing models on confounded data.

2. **Navigating Tasks**:
   - To begin with, either select `disjoint` or `strict` variant of the dataset.  
   - Train a model on `t0` &#10230; `t1` &#10230; `t2` i.e. in a sequential manner. 
   - Each task folder (e.g., `t0`, `t1`, `t2`) represents a different subset of data. Subfolders like `0` and `1` within each task represent negative and positive labels.

---

This dataset organization is designed to support comprehensive experiments on unconfounded and confounded datasets, providing a range of task-specific data under conditions where confounders change over time to facilitate testing machine learning models.


### License 
The dataset is made available under the BSD 2-Clause "Simplified" License (see https://opensource.org/license/bsd-2-clause)