{"id":23691922,"url":"https://github.com/justin900429/pytorch-dssn-mer","last_synced_at":"2025-09-02T20:32:40.566Z","repository":{"id":41307927,"uuid":"389053445","full_name":"Justin900429/PyTorch-DSSN-MER","owner":"Justin900429","description":"PyTorch version for the \"Dual-Dtream Shallow Networks for Facial Micro-Expression Recognition\"","archived":false,"fork":false,"pushed_at":"2023-03-27T07:36:18.000Z","size":1295,"stargazers_count":27,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2023-04-24T15:43:30.831Z","etag":null,"topics":["computer-vision","micro-expression-recognition","paper-implementation","python","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Justin900429.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-24T09:16:27.000Z","updated_at":"2023-04-24T12:20:19.000Z","dependencies_parsed_at":"2023-01-19T04:15:34.083Z","dependency_job_id":null,"html_url":"https://github.com/Justin900429/PyTorch-DSSN-MER","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Justin900429%2FPyTorch-DSSN-MER","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Justin900429%2FPyTorch-DSSN-MER/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Justin900429%2FPyTorch-DSSN-MER/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Justin900429%2FPyTorch-DSSN-MER/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Justin900429","download_url":"https://codeload.github.com/Justin900429/PyTorch-DSSN-MER/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231807357,"owners_count":18429521,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","micro-expression-recognition","paper-implementation","python","pytorch"],"created_at":"2024-12-30T02:59:32.139Z","updated_at":"2024-12-30T02:59:32.665Z","avatar_url":"https://github.com/Justin900429.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# README\n\n## Introduction\nThis is the Pytorch Version for the reimplementation of [Dual-stream Shallow Networks for Facial Micro-Expression Recognition](https://ieeexplore.ieee.org/document/8802965). [[Head to official code]](https://github.com/IcedDoggie/DSSN-MER)\n\n## Files\n* **dataloader**: Function for building custom dataset\n* **network**: Network design\n* **preprocess**: Function for processing the original dataset\n* **save_preprocess_weight**: Save the preprocessed image into npz for repeating usage\n* **train**: Train the model\n* **utils**: Rename the fileanem in SAMM dataset\n\n## Package requirements\nInstall the required packages in this project by:\n```shell\n$ pip install -r requirements.txt\n```\n\n## Usage\n\u003e Note that for SAMM dataset, you should rename the data to fulfill the format in the code. To rename the dataset, see `utils.py`.\n\u003e \n### Preprocessing\nThe preprocessed images can be reused to cut down the training time. The usage is shown below:\n```\nusage: save_process_image.py [-h] --csv_path CSV_PATH --root ROOT --save_path\n                             SAVE_PATH --catego CATEGO\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --csv_path CSV_PATH\n  --root ROOT\n  --catego CATEGO\n```\n\nFor example:\n```shell\n$ python save_process_weight \\\n    --csv_path \u003cpath_to_csv_file\u003e \\\n    --root \u003cPath to images\u003e \\\n    --catego \u003ccategory\u003e\n```\n\n### Training\n```\nusage: train.py [-h] --path PATH --catego CATEGO --img_root IMG_ROOT [--num_classes NUM_CLASSES]\n                [--combination_mode COMBINATION_MODE] [--image_mode IMAGE_MODE [IMAGE_MODE ...]]\n                [--batch_size BATCH_SIZE] [--weight_save_path WEIGHT_SAVE_PATH] [--model MODEL]\n                [--epochs EPOCHS] [--learning_rate LEARNING_RATE]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --path PATH           Path for the csv file for training data\n  --catego CATEGO       SAMM or CASME dataset\n  --img_root IMG_ROOT   Root for the training image\n  --num_classes NUM_CLASSES\n                        Classes to be trained\n  --combination_mode COMBINATION_MODE\n                        Mode to be used in combination\n  --image_mode IMAGE_MODE [IMAGE_MODE ...]\n                        Image type to be used in training\n  --batch_size BATCH_SIZE\n                        Training batch size\n  --weight_save_path WEIGHT_SAVE_PATH\n                        Path for the saving weight\n  --model MODEL         Model to used for training\n  --epochs EPOCHS       Epochs for training the model\n  --learning_rate LEARNING_RATE\n                        Learning rate for training the model\n```\n\nFor example:\n```shell\n$ python train.py \\\n    --path \u003cpath to csv file\u003e \\\n    --img_root \u003cplace for your dataset\u003e \\\n    --catego CASME \\\n    --image_mode F G \\\n    --weight_save_path CASME_DSSN_weight \\\n    --model DSSN\n```\n\nEspecially, user can decide what mode to be used in training. **DSSN** needs two modes for training. On the other hand, **SSSN** only needs to choose one mode.\n```\n# For DSSN\n... \\\n--image_mode F G \\\n...\n\n# For SSSN\n... \\\n--image_mode G\n```\n\n## Pretrained AlexNet\nThe weight was obtained from [YOUSIKI's](https://github.com/YOUSIKI/PyTorch-AlexNet) GitHub repo.\n\n## Metrics\n\n### Model weights\n\n| Model | Paramters |\n| ----- | --------- |\n| SSSN  | 0.63M     |\n| DSSN  | 0.972M    |\n\n## Citation\n```bibtex\n@inproceedings{khor2019dual,\n    title={Dual-stream Shallow Networks for Facial Micro-expression Recognition},\n    author={Khor, Huai-Qian and See, John and Liong, Sze-Teng and Phan, Raphael CW and Lin, Weiyao},\n    booktitle={2019 IEEE International Conference on Image Processing (ICIP)},\n    pages={36--40},\n    year={2019},\n    organization={IEEE}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustin900429%2Fpytorch-dssn-mer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustin900429%2Fpytorch-dssn-mer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustin900429%2Fpytorch-dssn-mer/lists"}