Code Monkey home page Code Monkey logo

nbc-softmax's Introduction

NBC-Softmax : Darkweb Author fingerprinting and migration tracking

License: MIT

This repository contains the PyTorch implementation of "NBC-Softmax", an auxiliary block contrastive loss which only uses the negative samples, to improve traditional softmax. This has achieved state of the art in author style detection. This is the official implementation for the results and work described in our paper NBC-Softmax https://arxiv.org/abs/2212.08184.

TLDR; A simple negative block contrastive loss addition for softmax.

The paper describes the loss function NBC-Softmax. This needs to be used with a dataset and network for deep metric learning. In this repo we only show the NBC-Softmax code. Portions of the contrastive learning code is from PAMC. The data and network, network $f(\theta)$. as mentioned in the paper, is from SYSML contains the datsets, pretrained graph context embeddings and the deep learning. NBCSAuthor is the dark web author fingerprinting model implementation that uses NBC-softmax loss under the hood.

We acknowledge and thank the authors of these works for sharing their code and data.

NBC-softmax theory

Above figure shows the comparison between the traditional softmax loss (left) with NBC-softmax ( on the right). We use similarity of different classes, represented and managed by $\hat{\mu}$ to force apart the weight vectors $W$, instead of imposing any soft or hard margins.

Results

Results

Setup

  • Our code was tested on CUDA 11.3.0, python 3.6.9, pytorch 1.3.1. Please note that some, minimal, changes were needed to get SYSML pl-lightning code to run on the current version.

Usage

  • All parameters are defined in SYSML. additionally we use the following to define the NBS-softmax hyperparameters for --model_params_classwise
SingleDatasetModel
--batch_size 2048   
--model_params_classwise "model_type='COMBO2'|model1_type='sm'|model2_type='proj_contrastiveBC1'|model2_ratio=0.5|proj_dim=0|NOTE='singleW2_0.01_G1_0.5_000_TTC_L5_NEG_0.20_z2048'" 

MultiDatasetModel
--batch_size 2048
--model_params_cross "model_type='COMBO2'|model1_type='sm'|model2_type='proj_contrastiveBC1'|model2_ratio=0.5|proj_dim=0|NOTE='mutiW2_0.01_G1_0.5_000_TTC_L5_NEG_0.30_z2048'"

Citation

@article{kulatilleke2022nbcsoftmax,
  title={NBC-Softmax: Darkweb Author fingerprinting and migration tracking},
  author={Kulatilleke, Gayan K and Chandra, Shekhar S and Portmann, Marius},
  journal={arXiv preprint arXiv:2212.08184},
  year={2022}
}

nbc-softmax's People

Contributors

gayanku avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.