Add image data representation for CNN backbones#892
Draft
sevmag wants to merge 1 commit into
Draft
Conversation
Draft
Introduce a new `data_representation/images/` module that lets detectors be represented as multi-channel 3D image tensors rather than graphs, as required by CNN backbones. Components: - `ImageRepresentation` base class — analogue of `GraphDefinition` for image-shaped inputs. Builds per-channel image tensors from raw pulse data using a `GridDefinition` that maps each DOM to a voxel. - `GridDefinition` — abstract mapping from DOM string/dom indices to a 3D grid. `IC86GridDefinition` covers the IceCube IC86 array (main array + upper/lower DeepCore), `ExamplePrometheusGridDefinition` covers the Prometheus example geometry. Mapping tables live in `cnn_mapping_tables.py` as Python literals (no parquet files). - `IC86Image` and `ExamplePrometheusImage` — concrete image representations bundling a detector and its grid definition. Also adds: - `TEST_IMAGE_DIR` and the three `TEST_IC86*_IMAGE` constants in `graphnet.constants` for the new test fixtures. - `.npy` test fixtures for the IC86 main array and the two DeepCore sub-arrays. - Unit tests for `GridDefinition` and `ImageRepresentation`. No model code yet — that lands in follow-up PRs (`IceCubeDNN`, `LCSC`). Split from graphnet-team#813.
fc40d44 to
d97b394
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Second in the series of PRs being carved out of #813 (see the split tracking comment for the plan). This is the foundation for the CNN work — it adds an image-shaped data representation analogous to
GraphDefinition, with no model code yet. PRs 3–4 (the actual CNN models) will build on this.What's new
ImageRepresentationbase class — analogue ofGraphDefinitionfor image-shaped inputs. Builds per-channel image tensors from raw pulse data using aGridDefinitionthat maps each DOM to a voxel.GridDefinition— abstract mapping from DOMstring/dom_numberto a 3D grid index. Two concrete subclasses:IC86GridDefinition— IceCube IC86 array (main array + upper/lower DeepCore).ExamplePrometheusGridDefinition— Prometheus example geometry.Mapping tables live in
cnn_mapping_tables.pyas Python literals (no parquet files).IC86ImageandExamplePrometheusImage— concrete image representations bundling a detector and its grid definition.TEST_IMAGE_DIR/TEST_IC86*_IMAGEconstants and.npytest fixtures for IC86 main array + DeepCore sub-arrays.GridDefinitionandImageRepresentation(3 tests, all passing).What's not in this PR
IceCubeDNN) and PR 4 (LCSC).Notes for review
src/graphnet/constants.pyto add 4 test-data path constants, anddata_representation/__init__.pyto re-export the new image classes).cnn_mapping_tables.py).Test plan
black,flake8,docformatter,pydocstyle,mypy, EOL/whitespace)pytest tests/models/test_grid_definition.py tests/models/test_image_representation.py— 3 passedSplit from #813.
🤖 Generated with Claude Code