Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.0%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: CanZhang01
- License: mit
- Language: Python
- Default Branch: main
- Size: 12 MB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
Adaptive sparse attention module based on reciprocal nearest neighbors
Zhonggui Sun, Can Zhang, Mingzhu Zhang.
submitted to Journal of Electronic Imaging (JEI).
This code is based on the MMsegmentation from OpenMMlab
Contents - Abstract - Brief Introduction - Usage - Results - Quantitative Results - Qualitative Results - Citation - Acknowledgments
Abstract
The attention mechanism has become a crucial technique in deep feature representation for computer vision tasks. Using a similarity matrix, it enhances the current feature point with global context from the feature map of the network. However, the indiscriminate utilization of all information can easily introduce some irrelevant contents, inevitably hampering performance. In response to this challenge, sparsing, a common information filtering strategy, has been applied in many related studies. Regrettably, their filtering processes often lack reliability and adaptability. To address this issue, we first define an adaptive-reciprocal nearest neighbors (ARNN) relationship. In identifying neighbors, it gains flexibility through learning adaptive thresholds. In addition, by introducing a reciprocity mechanism, the reliability of neighbors is ensured. Then, we use A-RNN to rectify the similarity matrix in the conventional attention module. In the specific implementation, to distinctly consider nonlocal and local information, we introduce two blocks: the non-local sparse constraint block and the local sparse constraint block. The former utilizes A-RNN to sparsify non-local information, whereas the latter uses adaptive thresholds to sparsify local information. As a result, an adaptive sparse attention (ASA) module is achieved, inheriting the advantages of flexibility and reliability from A-RNN. In the validation for the proposed ASA module, we use it to replace the attention module in NLNet and conduct experiments on semantic segmentation benchmarks including Cityscapes, ADE20K and PASCAL VOC 2012. With the same backbone(ResNet101), our ASA module outperforms the conventional attention module and its some state-of-the-art variants.
Introduction


Our contributions are as follows: 1) We define an adaptive reciprocal nearest neighbors (A-RNN) relationship that is both reliable and flexible. 2) We propose an ASA module. Its similarity matrix is obtained via two designed blocks: NLSCB and LSCB. The former utilizes A-RNN to sparsify non-local information, whereas the latter sparsifies local information with adaptive thresholds. 3) Preliminary experiments on semantic segmentation validate the effectiveness of the proposed ASA module.

Usage
Please refer to MMsegmentation help documentation.
Result
Quantitative Results


Qualitative Results

Acknowledgments :heart:
The authors would like to express their great thankfulness to the Associate Editor and the anonymous reviewers for their valuable comments and constructive suggestions. At the same time, they would like to express their sincere gratitude to the open-source semantic segmentation library MMSegmentation from openmmlab.
Owner
- Login: CanZhang01
- Kind: user
- Repositories: 1
- Profile: https://github.com/CanZhang01
Citation (CITATION.cff)
cff-version: 1.2.0 message: "If you use this software, please cite it as below." authors: - name: "MMSegmentation Contributors" title: "OpenMMLab Semantic Segmentation Toolbox and Benchmark" date-released: 2020-07-10 url: "https://github.com/open-mmlab/mmsegmentation" license: Apache-2.0
GitHub Events
Total
- Watch event: 2
Last Year
- Watch event: 2
Dependencies
- docutils ==0.16.0
- myst-parser *
- sphinx ==4.0.2
- sphinx_copybutton *
- sphinx_markdown_tables *
- mmcv >=2.0.0rc4
- mmengine >=0.5.0,<1.0.0
- cityscapesscripts *
- nibabel *
- mmcv >=2.0.0rc1,<2.1.0
- mmengine >=0.4.0,<1.0.0
- prettytable *
- scipy *
- torch *
- torchvision *
- matplotlib *
- numpy *
- packaging *
- prettytable *
- scipy *
- codecov * test
- flake8 * test
- interrogate * test
- pytest * test
- xdoctest >=0.10.0 test
- yapf * test