Code Monkey home page Code Monkey logo

naver_ai_rush's Introduction

Spam classification

Repo for training a baseline model for the AI Rush Spam classification challenge. The model is just a simple ResNet50v2 model. We first fine-tune the last layer a few epochs and then train the full model until convergence. Note that the dataset has unlabeled data, but to train the baseline model we only use the labeled data.

Important notes

  1. The function that's bind to NSML infer needs to output a dataframe with the two columns filename and y_pred, where filename is the name of the file that's being predicted and y_pred is an integer value of the predicted class.

Repository format

spam/spam_classifier/networks contains the neural network definitions.

spam/spam_classifier/models contains your full model code, this handles things like training, evaluation, instantiation of datasets and neural networks, chaining of different neural networks etc.

spam/spam_classifier/datasets contains logic related to loading data.

spam/training/experiments contains all of your experiment configs, setting things like which model and dataset to use, to parameters related to models and networks.

spam/training/train.py glues everything together with NSML. Loads the experiment config and starts the training.

nsml_train.py This file is just used do make sure that the project runs properly on NSML. It should always be the entrypoint when running nsml run but you can ignore it otherwise.

Run experiment

To run the baseline model training, stand in the airush2020/spam folder and run

nsml run -e nsml_train.py -d spam-1 -m "A good message" -g 1 -a "--experiment_name v1"

Metric

Using a geometric mean over all spam classes.

score = (f1_score_monotone * f1_score_screenshot * f1_score_unknown) ** (1 / 3)

Data

Description

There are four different classes; normal, monotone, screenshot, and unknown. The latter three are spam classes. The mapping between class names and the integer values used in the labels file is normal: 0, monotone: 1, screenshot: 2, unknown: 3, unlabeled: -1.

Normal

Normal review images, that should not be detected as spam.

normal

Monotone

Images that are not real review images, and mostly containing one color.

monotone

Screenshot

Images that are not real review images, and contain screenshots from the Naver shopping website.

screenshot

Unknown

Images that are not real review images, but don't fall under any of the classes above.

unknown

Unlabeled

Images that have not been labeled yet. Can be used to train the model in a semi-supervised way if you want.

Format

See AI Rush dataset documentation.

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.