# Gợi ý hướng nghiên cứu bài toán captioning
## 1. Mô tả bài toán
Đầu vào: Bức ảnh RGB
Đầu ra: Một câu mô tả cho bức ảnh.
Hình ảnh ví dụ:

## 2. Cách tiếp cận
Hiện tại, các mô hình captioning thường được thiết kế theo kiểu ENCODER-DECODER.
Lưu ý rằng ENCODER ở đây chính là một mạng trích xuất đặc trưng cho ảnh, và DECODER là một mô hình ngôn ngữ để sinh câu mô tả.
ENCODER có thể là một mạng convolutional neural network
DECODER có thể là mạng RNN, long-short term memory, transformer.
Tuy nhiên, từ năm 2021 trở về sau, người ta thường dùng DECODER là kiến trúc transformer [1] để sinh câu mô tả.
Một lưu ý quan trọng là hiện tại bài toán captioning không huấn luyện mạng ENCODER-DECODER theo kiểu end-to-end. Tức là người ta thường dùng ENCODER để trích xuất đặc trưng trước, lưu vào file .npy, sau đó mới load lên để train DECODER.
**Lý do**: vừa train ENCODER và DECODER tốn rất nhiều thời gian. Hiện tại người ta vẫn đang nghiên cứu cách train end-to-end, nhưng kết quả chưa khả quan.
### 2.1. Trích xuất đặc trưng
Đây là một số repo để trích xuất đặc trưng:
- Bottom-up Top-down [2]: https://github.com/peteanderson80/bottom-up-attention
- Grid features for VQA [3]: https://github.com/facebookresearch/grid-feats-vqa
- VinVL [4]: https://github.com/microsoft/scene_graph_benchmark
### 2.2. Huấn luyện mô hình captioning
Sau khi trích xuất đặc trưng xong, có thể tham khảo các repo sau đây để huấn luyện mô hình captioning:
- M2 Transformer [5]: https://github.com/aimagelab/meshed-memory-transformer
- RSTNet [6]: https://github.com/zhangxuying1004/RSTNet
- MDSANet [7]: https://github.com/Young499/image-captioning-MDSANet
- DLCT [8]: https://github.com/luo3300612/image-captioning-DLCT
- DIFNet [9]: https://github.com/mrwu-mac/DIFNet
### 2.3. Tham khảo các nghiên cứu trước của nhóm:
- UIT-OpenViIC: https://arxiv.org/abs/2305.04166. Bài này đề xuất dataset captioning tiếng Việt và chạy các phương pháp đã đề cập phía trên để kiểm thử.
- EAES: https://ieeexplore.ieee.org/iel7/6287639/6514899/09732974.pdf. Bài này làm về image captioning nhưng có thông tin của scene texts
- VieCap4H challenge: https://jcsce.vnu.edu.vn/index.php/jcsce/article/view/371. Bài này đề xuất solution cho cuộc thi VieCap4H, captioning cho ảnh ngữ cảnh y tế.
- Vi-DRSNet: https://ieeexplore.ieee.org/abstract/document/9924781/. Bài này là model nâng cấp của bài VieCap4H challenge
- Empirical study on feature extraction: https://vjs.ac.vn/index.php/jcc/article/view/17548. Bài này đánh giá khả năng trích xuất đặc trưng của ảnh cho 2 bộ dữ liệu captioning tiếng Việt.
### 2.4. Dữ liệu
- VieCap4H: https://aihub.vn/competitions/40#learn_the_details
- UIT-OpenViIC: updating.
## Tài liệu tham khảo
[1]. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., ... & Polosukhin, I. (2017). Attention is all you need. Advances in neural information processing systems, 30.
[2]. Anderson, P., He, X., Buehler, C., Teney, D., Johnson, M., Gould, S., & Zhang, L. (2018). Bottom-up and top-down attention for image captioning and visual question answering. In Proceedings of the IEEE conference on computer vision and pattern recognition (pp. 6077-6086).
[3]. Jiang, H., Misra, I., Rohrbach, M., Learned-Miller, E., & Chen, X. (2020). In defense of grid features for visual question answering. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition (pp. 10267-10276).
[4]. Zhang, P., Li, X., Hu, X., Yang, J., Zhang, L., Wang, L., ... & Gao, J. (2021). Vinvl: Revisiting visual representations in vision-language models. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition (pp. 5579-5588).
[5]. Cornia, M., Stefanini, M., Baraldi, L., & Cucchiara, R. (2020). Meshed-memory transformer for image captioning. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition (pp. 10578-10587).
[6]. Zhang, X., Sun, X., Luo, Y., Ji, J., Zhou, Y., Wu, Y., ... & Ji, R. (2021). Rstnet: Captioning with adaptive attention on visual and non-visual words. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition (pp. 15465-15474).
[7]. Ji, J., Huang, X., Sun, X., Zhou, Y., Luo, G., Cao, L., ... & Ji, R. (2022). Multi-branch distance-sensitive self-attention network for image captioning. IEEE Transactions on Multimedia.
[8]. Luo, Y., Ji, J., Sun, X., Cao, L., Wu, Y., Huang, F., ... & Ji, R. (2021, May). Dual-level collaborative transformer for image captioning. In Proceedings of the AAAI conference on artificial intelligence (Vol. 35, No. 3, pp. 2286-2293).
[9]. Wu, M., Zhang, X., Sun, X., Zhou, Y., Chen, C., Gu, J., ... & Ji, R. (2022). Difnet: Boosting visual information flow for image captioning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (pp. 18020-18029).