Advanced AI Explainability for computer vision. Support for CNNs, Vision Transformers, Classification, Object detection, Segmentation, Image similarity and more.
This report summarizes scanner evidence for jacobgil/pytorch-grad-cam, a Python project with 12,996 GitHub stars. SynthScan examined 4,968 lines of code across 61 source files, recording 129 pattern matches distributed across 8 syntactic categories. The legacy adjusted pattern signal is 29.3 (Elevated pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 40 finding(s).
Are imports declared and package/API names verified? 83 finding(s).
Are wrappers, guards, and repeated structures necessary? 42 finding(s).
Which changes need focused human review? 129 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 129 distinct pattern matches across 8 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | cam.py | 17 | CODE | |
| LOW | cam.py | 17 | CODE | |
| LOW | cam.py | 87 | CODE | |
| LOW | usage_examples/clip_example.py | 7 | CODE | |
| LOW | usage_examples/vit_example.py | 16 | CODE | |
| LOW | pytorch_grad_cam/ablation_cam_multilayer.py | 1 | CODE | |
| LOW | pytorch_grad_cam/shapley_cam.py | 1 | CODE | |
| LOW | pytorch_grad_cam/shapley_cam.py | 1 | CODE | |
| LOW | pytorch_grad_cam/shapley_cam.py | 1 | CODE | |
| LOW | pytorch_grad_cam/shapley_cam.py | 1 | CODE | |
| LOW | pytorch_grad_cam/shapley_cam.py | 3 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 1 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 2 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 3 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 4 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 5 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 6 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 7 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 7 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 7 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 8 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 9 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 10 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 11 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 12 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 13 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 14 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 15 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 16 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 17 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 18 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 19 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 20 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 21 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 22 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 23 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 23 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 24 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 25 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 26 | CODE | |
| LOW | pytorch_grad_cam/__init__.py | 27 | CODE | |
| LOW | pytorch_grad_cam/hirescam.py | 1 | CODE | |
| LOW | pytorch_grad_cam/metrics/cam_mult_image.py | 3 | CODE | |
| LOW | pytorch_grad_cam/metrics/cam_mult_image.py | 3 | CODE | |
| LOW | pytorch_grad_cam/utils/__init__.py | 1 | CODE | |
| LOW | pytorch_grad_cam/utils/__init__.py | 2 | CODE | |
| LOW | pytorch_grad_cam/utils/__init__.py | 3 | CODE | |
| LOW | pytorch_grad_cam/utils/__init__.py | 4 | CODE | |
| LOW | pytorch_grad_cam/utils/model_targets.py | 1 | CODE | |
| LOW | …am/feature_factorization/deep_feature_factorization.py | 4 | CODE | |
| LOW | …am/feature_factorization/deep_feature_factorization.py | 4 | CODE | |
| LOW | tests/test_context_release.py | 6 | CODE | |
| LOW | tests/test_context_release.py | 6 | CODE | |
| LOW | tests/test_context_release.py | 6 | CODE | |
| LOW | tests/test_context_release.py | 6 | CODE | |
| LOW | tests/test_context_release.py | 6 | CODE | |
| LOW | tests/test_context_release.py | 6 | CODE | |
| LOW | tests/test_context_release.py | 6 | CODE | |
| LOW | tests/test_context_release.py | 6 | CODE | |
| LOW | tests/test_context_release.py | 16 | CODE | |
| 23 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | pytorch_grad_cam/ablation_cam_multilayer.py | 84 | def set_ablation_layer_batch_indices(self, indices): | CODE |
| LOW | pytorch_grad_cam/ablation_cam_multilayer.py | 88 | def trim_ablation_layer_batch_indices(self, keep): | CODE |
| LOW⚡ | pytorch_grad_cam/guided_backprop.py | 59 | def recursive_replace_relu_with_guidedrelu(self, module_top): | CODE |
| LOW⚡ | pytorch_grad_cam/guided_backprop.py | 65 | def recursive_replace_guidedrelu_with_relu(self, module_top): | CODE |
| LOW | pytorch_grad_cam/ablation_layer.py | 11 | def objectiveness_mask_from_svd(self, activations, threshold=0.01): | CODE |
| LOW | pytorch_grad_cam/ablation_layer.py | 25 | def activations_to_be_ablated( | CODE |
| LOW | pytorch_grad_cam/base_cam.py | 183 | def forward_augmentation_smoothing( | CODE |
| LOW⚡ | pytorch_grad_cam/utils/find_layers.py | 11 | def replace_all_layer_type_recursive(model, old_layer_type, new_layer): | CODE |
| LOW⚡ | pytorch_grad_cam/utils/find_layers.py | 18 | def find_layer_types_recursive(model, layer_types): | CODE |
| LOW⚡ | pytorch_grad_cam/utils/find_layers.py | 24 | def find_layer_predicate_recursive(model, predicate): | CODE |
| LOW | pytorch_grad_cam/utils/reshape_transforms.py | 4 | def fasterrcnn_reshape_transform(x): | CODE |
| LOW | pytorch_grad_cam/utils/image.py | 83 | def show_factorization_on_image( | CODE |
| LOW | pytorch_grad_cam/utils/image.py | 179 | def scale_accross_batch_and_channels(tensor, target_size): | CODE |
| LOW | tests/test_context_release.py | 46 | def test_memory_usage_in_loop(numpy_image, batch_size, width, height, | CODE |
| LOW⚡ | tests/test_finer_cam_correctness.py | 33 | def test_finercam_supports_context_manager(): | CODE |
| LOW⚡ | tests/test_finer_cam_correctness.py | 39 | def test_finercam_runs_on_binary_classifier_without_index_error(): | CODE |
| LOW⚡ | tests/test_finer_cam_correctness.py | 47 | def test_finercam_runs_on_ternary_classifier_without_index_error(): | CODE |
| LOW⚡ | tests/test_finer_cam_correctness.py | 55 | def test_finercam_htcore_is_single_underscore(): | CODE |
| LOW | tests/test_run_all_models.py | 59 | def test_all_cam_models_can_run(numpy_image, batch_size, width, height, | CODE |
| LOW | tests/test_one_channel.py | 30 | def test_memory_usage_in_loop(numpy_image, cam_method): | CODE |
| LOW | tests/test_context_release_cuda.py | 48 | def test_memory_usage_in_loop(numpy_image, batch_size, width, height, | CODE |
| LOW | tests/test_sess.py | 88 | def test_sess_without_targets(numpy_image): | CODE |
| LOW | tests/test_sess.py | 105 | def test_sess_invalid_arguments(): | CODE |
| LOW | tests/test_fasterrcnn_target_device.py | 12 | def test_target_inherits_output_device_cpu(): | CODE |
| LOW | tests/test_fasterrcnn_target_device.py | 27 | def test_target_returns_zero_on_empty_boxes(): | CODE |
| LOW | tests/test_fasterrcnn_target_device.py | 39 | def test_target_preserves_boxes_dtype(): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | usage_examples/clip_example.py | 77 | CODE | |
| LOW | usage_examples/swinT_example.py | 62 | CODE | |
| LOW | usage_examples/vit_example.py | 62 | CODE | |
| LOW | pytorch_grad_cam/ablation_layer.py | 111 | CODE | |
| LOW | pytorch_grad_cam/sess.py | 28 | CODE | |
| LOW | pytorch_grad_cam/utils/reshape_transforms.py | 24 | CODE | |
| LOW | pytorch_grad_cam/utils/reshape_transforms.py | 34 | CODE | |
| LOW | pytorch_grad_cam/utils/image.py | 176 | CODE | |
| LOW | pytorch_grad_cam/utils/image.py | 189 | CODE | |
| LOW | …am/feature_factorization/deep_feature_factorization.py | 134 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | pytorch_grad_cam/guided_backprop.py | 71 | except Exception: | CODE |
| HIGH | pytorch_grad_cam/finer_cam.py | 45 | except Exception: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | README.md | 130 | # In this example grayscale_cam has only one image in the batch: | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | pytorch_grad_cam/guided_backprop.py | 71 | except Exception: | CODE |
| MEDIUM | pytorch_grad_cam/guided_backprop.py | 65 | def recursive_replace_guidedrelu_with_relu(self, module_top): | CODE |
| LOW | pytorch_grad_cam/finer_cam.py | 45 | except Exception: | CODE |
| MEDIUM | pytorch_grad_cam/finer_cam.py | 42 | def __del__(self): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | pytorch_grad_cam/ablation_cam_multilayer.py | 92 | CODE | |
| LOW | pytorch_grad_cam/ablation_cam.py | 75 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | pytorch_grad_cam/metrics/road.py | 1 | # A Consistent and Efficient Evaluation Strategy for Attribution Methods | COMMENT |