Comments (18)
Hey, I managed to get ~61% accuracy using Tensorflow on the A->W task, which I believe is good enough. I wrote a blog post about the tricks
TF code here: https://github.com/qinenergy/alexnet-finetune-office-31
Here are a few things I noticed that might effect performance:
Conv paddings: They are defined differently in TF and Caffe which can hurt performance when loading pretrained caffe weights.
lrn layer: Since I use pretrained caffe weights, I have to use lrn layers with the same parameters.
Data preprocessing: cv2.resize(256) -> randomcrop(227) I found that following the eact pipeline boosts the performance. I mean exact, use cv2, even tf.image could hurt performance.
Lr setting: I am not sure whether this helps, but I followed the eact lr settings of the GRL paper, which means 1x for pretrained kernels, 2x for pretrained biases, 10x for fc(31), 20x for fc(31) bias.
I don’t use PyTorch, so I am not sure the problems I encountered are the same as yours. Hope this helps.
from transferlearning.
@qinenergy Thank you for your reply! I will try your parameter setting to see what results I get. Keep in touch.
from transferlearning.
@qinenergy Could you please explain to me why your network has 9 layers? AlexNet has 8 layers with the final layers as fc6, fc7, and fc8.
from transferlearning.
@jindongwang IMHO, fc(128) is bottleneck layer, many DA papers using bottleneck layer in finetune.
from transferlearning.
@wogong But it is only the results of train on source, and test on target. There is no adaptation. Why bottleneck?
from transferlearning.
emmm, my mistake. I thought this is talking about adaptation. I agree that there is no need for bottleneck layer in source-only baseline.
from transferlearning.
@jindongwang Hey, I agree with you that it is unnecessary to have a bottleneck layer in the source only case.
from transferlearning.
@qinenergy @wogong Then it's mysterious for the Office dataset. We can only consider using other popular datasets. This dataset is so awkward.
from transferlearning.
@jindongwang Have you tried Long's Xlearn repo https://github.com/thuml/Xlearn for reproducing the alexnet finetune results?
They use very different data pre-process code, like custom defined crop in the PyTorch part.
I am working on domain adaptation using PyTorch right now and come across the same problem as you. Nearly all current algorithms cannot get claimed accuracy on Office dataset using PyTorch implementations.
from transferlearning.
@wogong Long's data processing step can only help a little, which can be ignored.
It looks like no one can successfully reimplement the results of AlexNet and ResNet using Pytorch.
from transferlearning.
@jindongwang I use Resize(227) instead of Resize(256) and RandomResizedCrop(227) and get ~0.51 acc, which is really weird. I am not sure the reason but clearly data processing effect can not be ignored.
from transferlearning.
@wogong That's much better than what I got. Could you please modify the code in this repo to replace with your parameter settings?
from transferlearning.
@jindongwang I tried but failed to get the code run correctly. 😂
You can try my released repo https://github.com/wogong/pytorch-office_finetune.
from transferlearning.
BTW, I found this link in PyTorch forum. https://discuss.pytorch.org/t/pytorch-alexnet-not-as-good-as-original-alexnet-implementation/16680
Maybe the problem lies on torchvision's pretrained AlexNet model.
from transferlearning.
@wogong I also couldn't run your code successfully...
I know the LRN thing in AlexNet, but it seems doesn't help. A lot of people have demonstrated that LRN is not helping.
I tried your resize 227, it really works. Now my accuracy is above 50%.
I do not understand your code: why are there train-eval and test-eval dataset in loading the data?
And, have you tried ResNet?
from transferlearning.
@jindongwang emmm, I have not clear my code, so it may be confusing. src_eval and tgt_train is unnecessary. I'll try ResNet later.
from transferlearning.
@wogong @qinenergy I think we are making mistakes about the results from other papers. The evaluation protocol is different.
According to existing work (DDC, DAN, JAN, RTN, DCORAL etc.), the accuracy of AlexNet and ResNet are 61% and 80%. However, they are using different protocols: they take 20 samples per class (or 8 for dslr) as the source and target domains (we call it down-sample). Ours use the whole domain data (we call it full-training). This is quite different.
Actually, almost all the deep transfer learning methods are following this down-sampled protocol. Some research used the full-training protocol, but they just copy the results from the down-sample papers. Finally, they confuse us.
from transferlearning.
@wogong @qinenergy I checked the results again. They are using the full-training protocol. Still, we can't reproduce the results. Maybe it's time to give up Office.
from transferlearning.
Related Issues (20)
- Deep DG HOT 9
- MMD距离 backward问题 HOT 3
- BDA代码中的数据集的问题 HOT 2
- 关于TransferNet中source_clf计算的疑问 HOT 1
- 关于复现 HOT 1
- 对比算法的复现缺少部分流程 HOT 1
- 程序显示没有loss_funcs模块 HOT 1
- Our new test-time adaptation algorithm for segmentation HOT 3
- 关于transferlearning/code /DeepDA的模型代码读取 HOT 2
- How to use DIFEX for single domain generalization? HOT 2
- code add HOT 2
- 有关于在使用DG中DANN方法中遇到的问题
- Office-31 webcam域上微调模型丢失 HOT 1
- 是否需要进行微调? HOT 2
- 作者您好!请问AdaRNN的对比实验中,MMD-RNN和DANN-RNN是如何实现的,MMD-RNN的源域和目标域是如何定义的,AdaRNN相比这两个对比模型进步在哪里? HOT 1
- Feature Request:添加ADDA的代码以及与其他方法的比较。 HOT 1
- 王老师您好,Domain Generalization for Activity Recognition via Adaptive Feature Fusion请问这篇论文的代码具体在哪个文件夹里?找了很久没找到 HOT 1
- Time series domain adaptation benchmark and datasets HOT 1
- DIVERSIFY: A General Framework for Time Series Out-of-distribution Detection and Generalization中的cross_dataset的文件 HOT 1
- BDA中A-distance问题
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from transferlearning.