Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions about the squeeze-and-exicitation module in PPHGNet series model #3023

Closed
thsno02 opened this issue Oct 30, 2023 · 1 comment
Closed

Comments

@thsno02
Copy link
Contributor

thsno02 commented Oct 30, 2023

Q: Is there any justification for using the ESE module instead of the SE module in PPHGNetv1?

The design of PPHGNetv1 strikes a balance between computational efficiency and model performance. However, the ESE module has more parameters than the SE module. The ESE module consists of a fully connected layer without dimension reduction, resulting in a parameter size of $C * C$. In contrast, the SE module includes two fully connected layers with a dimension reduction ratio of $r$, leading to a parameter size of $C * C / r + C/r * C$, which simplifies to $2 * C * C / r$. If $r$ is greater than 2, the SE module has fewer parameters. The original paper recommends setting $r$ to 161.

When considering the model's inference performance, it appears that using the ES module would be faster. So, why opt for the ESE2 module in v1? Additionally, v2 employs an ES module with a ratio of 2 (if I understand correctly3). Would the performance of the ES module be superior while maintaining a consistent number of parameters?

From my perspective, the SE module may have an advantage in capturing inter-channel dependencies, given its utilization of dimension reduction as a form of compression. On the other hand, the ESE module might not be as effective in this regard.

Footnotes

  1. https://arxiv.org/abs/1709.01507

  2. https://github.com/PaddlePaddle/PaddleClas/blob/e35611697a3514f24289f170e115a12399f6a342/ppcls/arch/backbone/legendary_models/pp_hgnet.py#L74-L84

  3. https://github.com/PaddlePaddle/PaddleClas/blob/2bc2fc0348e5778291362d64781830b142e9d85e/ppcls/arch/backbone/legendary_models/pp_hgnet_v2.py#L299-L312

@cuicheng01
Copy link
Collaborator

Hello, thank you for your interest in PP-HGNet. In PP-HGNetV1, we did consider that ESE module takes less inference time than SE module without reducing accuracy, so we adopted the ESE module. However, we further found that the ESE module or SE module did not significantly improve object detection, semantic segmentation, and other tasks. Therefore, in PP-HGNetV2, we removed this module. In summary, there is neither SE module nor ESE module in PP-HGNetV2.

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

No branches or pull requests

2 participants