tensorflow / tcav

Code for the TCAV ML interpretability project
Apache License 2.0
633 stars 150 forks source link

Choose random images #95

Closed LordDoggo closed 3 years ago

LordDoggo commented 3 years ago

hi,

if i test cavs on human face detection, what random images should i use? e.g. if my concept is women, do i need random images of faces without women, to train the linear classifier properly? or should i take completely random images?

jameswex commented 3 years ago

You can train a standard CAV by having those concept images versus a totally random sample, or you can train a relative CAV by having those concept images versus a set of images of another class, such as male faces. Both approaches have advantages and it might be worth trying both out to see what results you get. It often depends on what images you expect your classifier to see and what exactly you want to accomplish through your CAV.

LordDoggo commented 3 years ago

Thanks, i tried both and still getting confusing results (male people getting higher tcav-scores for concept women, female for concept men, ...). Not sure what i'm doing wrong. this is the network i'm using https://github.com/rcmalli/keras-vggface/blob/master/visualize/resnet50.png are the add layers the right bottleneck layers?

Or are my results correct? I mean, can the concept glasses for example have a high tcav score on images of a person without glasses. This means, its importent for the decision that the person has no glasses?

LordDoggo commented 3 years ago

Found "relative tcav option" and read the paper again, answered my questions. Thanks