Code Monkey home page Code Monkey logo

dual-atme's Introduction

Dual-ATME

Dual-ATME: Dual-branch Attention Network for Micro-Expression Recognition paper

Haoliang Zhou, Shucheng Huang, Jingting Li, SuJing Wang

Abstract

Micro-expression recognition (MER) is challenging due to the difficulty of capturing the instantaneous and subtle motion changes of micro-expressions (MEs). Early works based on hand-crafted features extracted from prior knowledge showed some promising results, but have recently been replaced by deep learning methods based on attention mechanism. However, with limited ME sample size, features extracted by these methods lack discriminative ME representations, in yet-to-be improved MER performance. This paper proposes the Dual-branch Attention Network (Dual-ATME) for MER to address the problem of ineffective single-scale features representing MEs. Specifically, Dual-ATME consists of two components: Hand-crafted Attention Region Selection (HARS) and Automated Attention Region Selection (AARS). HARS uses prior knowledge to manually extract features from regions of interest (ROIs). Meanwhile, AARS is based on attention mechanisms and extracts hidden information from data automatically. Finally, through similarity comparison and feature fusion, the dual-scale features could be used to learn ME representations effectively. Experiments on spontaneous ME >datasets (including CASME II, SAMM, SMIC) and their composite dataset MEGC2019-CD show that Dual-ATME achieves better or more competitive performance than the state-of->the-art MER methods.

Data preparation

Following RCN, the data lists are reorganized as follow:

data/
├─ MEGC2019/
│  ├─ v_cde_flow/
│  │  ├─ 006_test.txt
│  │  ├─ 006_train.txt
│  │  ├─ 007_test.txt
│  │  ├─ ...
│  │  ├─ sub26_train.txt
│  │  ├─ subName.txt
  1. There are 3 columns in each txt file:
/home/user/data/samm/flow/006_006_1_2_006_05588-006_05562_flow.png 0 1

In this example, the first column is the path of the optical flow image for a particular ME sample, the second column is the label (0-2 for three emotions), and the third column is the database type (1-3 for three databases).

  1. There are 68 raws in subName.txt:
006
...
037
s01
...
s20
sub01
...
sub26

Represents ME samples divided by MEGC2019, as described in here ahd here.

Citation

If you find this repo useful for your research, please consider citing the paper

@Article{zhou2023dualatme,
AUTHOR = {Zhou, Haoliang and Huang, Shucheng and Li, Jingting and Wang, Su-Jing},
TITLE = {Dual-ATME: Dual-Branch Attention Network for Micro-Expression Recognition},
JOURNAL = {Entropy},
VOLUME = {25},
YEAR = {2023},
ISSN = {1099-4300},
DOI = {10.3390/e25030460}
}

dual-atme's People

Contributors

haoliangzhou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

happyliu-666

dual-atme's Issues

Image preprocessing

Hello author, can you provide the code for image preprocessing? These include face alignment and cropping, manual extraction and reorganization of ROI regions, and extraction of optical flow features

求大神解答,万分感谢

我下载了项目并运行显示没有result文件也没有文件下的txt所以我补充了如果没有文件就创建文件的代码接着报错D:\Dual-ATME-master\venv\Scripts\python.exe D:\Dual-ATME-master\ModelTrain_MERoI_flow_3ls_cde2019.py
PyTorch Version: 2.2.2+cpu
Torchvision Version: 0.17.2+cpu
False
Subject Name: 006

data\MEGC2019\v_cde_flow\006_train.txt
Creating deep model....
Epoch 0/59
----------
Traceback (most recent call last):
File "D:\Dual-ATME-master\ModelTrain_MERoI_flow_3ls_cde2019.py", line 316, in
main()
File "D:\Dual-ATME-master\ModelTrain_MERoI_flow_3ls_cde2019.py", line 224, in main
model_ft = train_model(model_ft, dataloader_train, cosine_sim, criterion, optimizer_ft, device, num_epochs=num_epochs)
File "D:\Dual-ATME-master\ModelTrain_MERoI_flow_3ls_cde2019.py", line 50, in train_model
for j, samples in enumerate(dataloaders):
File "D:\Dual-ATME-master\venv\lib\site-packages\torch\utils\data\dataloader.py", line 631, in next
data = self._next_data()
File "D:\Dual-ATME-master\venv\lib\site-packages\torch\utils\data\dataloader.py", line 1346, in _next_data
return self._process_data(data)
File "D:\Dual-ATME-master\venv\lib\site-packages\torch\utils\data\dataloader.py", line 1372, in _process_data
data.reraise()
File "D:\Dual-ATME-master\venv\lib\site-packages\torch_utils.py", line 722, in reraise
raise exception
FileNotFoundError: Caught FileNotFoundError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "D:\Dual-ATME-master\venv\lib\site-packages\torch\utils\data_utils\worker.py", line 308, in _worker_loop
data = fetcher.fetch(index)
File "D:\Dual-ATME-master\venv\lib\site-packages\torch\utils\data_utils\fetch.py", line 51, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "D:\Dual-ATME-master\venv\lib\site-packages\torch\utils\data_utils\fetch.py", line 51, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "D:\Dual-ATME-master\Datasets.py", line 54, in getitem
img = Image.open("".join(self.imgPath[idx]), 'r').convert('RGB')
File "D:\Dual-ATME-master\venv\lib\site-packages\PIL\Image.py", line 3277, in open
fp = builtins.open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'D:\home\zhouhl\Documents\data\samm\flow\033_033_2_2_033_2149-033_2117_flow.png'

这里不知道要怎么修改了,没有找到这个文件,看readme也没有提到,球球大神教我一下,非常感谢

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.