Comments (5)
Is it whole image clustering or segmentation you are interested in?
Just running data through a network will directly output the cluster probabilities for each input image (or several, if you use sub-heads). For c clusters, this is c per image for whole image clustering and c*h*w per image for segmentation. Simply argmax across the cluster dimension c to get the assigned cluster (per image or pixel). Currently the testing code in the scripts uses cluster_eval
which does this as part of the accuracy evaluation.
You can write your own function to visualise these predictions in any way you like, either called during training or offline on some saved model or predictions. The MNIST visualisation in the paper was done with the save_progression flag.
So yep, all the results for unsupervised IIC were rendered without ground truth, except to determine the cluster to ground truth class mapping (i.e. the colour for each cluster). Which does not matter if you have no labels.
If there are no masks, this is the same as using masks (tensors same size as input) but set to all 1s, which is what is done for Potsdam. You could also edit the codebase for your purposes to remove masks support entirely.
from iic.
Apologies for not looking more closely - I noticed in this issue that the masks were used to isolate the 'stuff' in COCO. So in my case where there are no masks, I should refer to the other implementation correct?
from iic.
I see. I was able to get the code working for the clustering task, and will now try to do the same thing for segmentation. Just so I understand correctly, the uncertainty estimation you describe in the paper is derived from the N point estimates generated by the N sub heads? Could you explain this mathematically a bit more?
from iic.
Also, here is how I modified the accuracy function for anyone who wants to cluster into more groups then there are labels. It is simply the percentage of the dominant class in each cluster, weighted by the cluster size relative to the entire data set. This can also be used in cases where the number of clusters is equal to the number of classes. The code is given below:
def _acc(preds, targets, num_k, verbose=0):
assert (isinstance(preds, torch.Tensor) and
isinstance(targets, torch.Tensor) and
preds.is_cuda and targets.is_cuda)
if verbose >= 2:
print("calling acc...")
assert (preds.shape == targets.shape)
assert (preds.max() < num_k and targets.max() < num_k)
cluster_res = []
for i in list(torch.unique(preds)):
x_unique = targets[np.where(preds == i)].cpu().data.unique(sorted=True)
x_unique_count = torch.stack([(targets[np.where(preds == i)].cpu().data == x_u).sum()
for x_u in x_unique])
print('Sample counts for cluster ' + str(i.item()) + ':')
holder = []
for j in xrange(len(x_unique)):
counter = x_unique_count[j].item()*1.0
tot = x_unique_count.sum().item()*1.0
holder.append(counter)
if (counter / tot) > 0.8:
print('Target class ' + str(x_unique[j].item()) + ', ' + str(x_unique_count[j].item()) + ' total, ' +
str(100 * (counter / tot)) + '% (!!!!!)')
else:
print('Target class ' + str(x_unique[j].item()) +', ' + str(x_unique_count[j].item()) + ' total (' +
str(100*(counter / tot)) + '%)')
cluster_res.append((max(holder)/(x_unique_count.sum().item()*1.0))*((x_unique_count.sum().item()*1.0)/len(preds)))
acc = sum(cluster_res)
return acc
from iic.
the uncertainty estimation you describe in the paper is derived from the N point estimates generated by the N sub heads
The +- uncertainty in table 1 is just the standard deviation of accuracy of the sub-heads. To describe the range in performance.
cluster into more groups then there are labels
I think this is very similar to our "semi-supervised overclustering" setting (commands). The function we used to find the many-to-one mapping is here.
from iic.
Related Issues (20)
- xrange module not found
- Unable to setup environment for IIC: HOT 5
- Question about loss during training HOT 1
- evaluated accuracy seems weird
- batch size integer error HOT 1
- Loss becomes 0 and does not change again HOT 2
- Render CoCo Segmentation Result
- Suggested Fork for Python 3 is still not ready
- Why 128x128 for coco-stuff in segmentation task?
- Computing IID_loss and get a negative result. HOT 2
- How to use own dataset for fully unsupervised learning
- Giving memory error while running unsupervised clustering on Custom Data HOT 1
- Question on calculating C x C matrix
- Auxiliary overclustering is not used in MNIST?
- How to do Conv1d in Cluster?
- What is the base b in paper 4.1 Image Clustering-Architecture.
- How to get transform data with 3d point cloud?
- Some troubles about using IIC
- Frame Segmentation HOT 6
- Convergence into one category HOT 1
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 iic.