Giter Site home page Giter Site logo

eric-ai-lab / mitigate-gender-bias-in-image-search Goto Github PK

View Code? Open in Web Editor NEW
12.0 3.0 1.0 14 KB

Code for the EMNLP 2021 Oral paper "Are Gender-Neutral Queries Really Gender-Neutral? Mitigating Gender Bias in Image Search" https://arxiv.org/abs/2109.05433

License: MIT License

Python 100.00%
fairness-ml gender-bias image-search multimodality vision-language

mitigate-gender-bias-in-image-search's Introduction

Mitigate Gender Bias in Image Search

Internet search affects people's cognition of the world, so mitigating biases in search results and learning fair models is imperative for social good. We study a unique gender bias in image search in this work: the search images are often gender-imbalanced for gender-neutral natural language queries. We diagnose and mitigate two typical image search models, the specialized model trained on in-domain datasets and the generalized representation model pre-trained on massive image and text data across the internet.For more details, please see our EMNLP 2021 Oral paper Are Gender-Neutral Queries Really Gender-Neutral? Mitigating Gender Bias in Image Search.

Data

The image search data for occupations can be acquired here. The gender-neutral captions used as MS-COCO and Flicker30K queries are available here.

Running the code

This repo contains the following code:

  • clip_coco.py : quantify and mitigate the gender bias by post-processing
  • fairsample.py : mitigate the gender bias with fair sampling
  • occupational_gender_bias.py : evaluate and mitigate the similarity bias in realistic image search results

Reference

If you find this repository helpful for your research, please cite our publication:

@InProceedings{Wang2021MitigateGenderBiasInImageSearch,
  author={Wang, Jialu and Liu, Yang and Wang, Xin Eric},
  title={Are Gender-Neutral Queries Really Gender-Neutral? Mitigating Gender Bias in Image Search},
  booktitle={EMNLP},
  year={2021}
}

mitigate-gender-bias-in-image-search's People

Contributors

eric-xw avatar faldict avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

Forkers

tf369

mitigate-gender-bias-in-image-search's Issues

Data to reproduce clip_coco.py

Hi, thanks for sharing your code.
I'd like to use the clipping method you proposed. However, I couldn't find the male_word_bank.txt, female_word_bank.txt, coco_precomp/testall_ids.txt, coco_testall_caps.txt, data/gender_coco.npy files used in the clip_coco.py.
I also checked the https://github.com/mjskay/gender-in-image-search repo mentioned in README, but I couldn't find the data in the repo. Could you please guide and share the data needed to run clip_coco.py? Thanks!

Reproducing results

Hi, I'm having problems while trying to reproduce the numeric results using your code.
For CLIP I'm getting R1:29.66 R5:54.14 R10:65.24, which is different but very close to the results presented in the paper.
But for CLIP-clip I'm getting R1:23.82 R5:46.5 R10:56.56, which is much worse.

Thanks.

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.