All Projects → Dynmi → Alexnet

Dynmi / Alexnet

Licence: mit
implement AlexNet with C / convolutional nerual network / machine learning / computer vision

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Alexnet

Mmclassification
OpenMMLab Image Classification Toolbox and Benchmark
Stars: ✭ 532 (+261.9%)
Mutual labels:  image-classification, imagenet
Efficientnet
Implementation of EfficientNet model. Keras and TensorFlow Keras.
Stars: ✭ 1,920 (+1206.12%)
Mutual labels:  image-classification, imagenet
Cvat
Powerful and efficient Computer Vision Annotation Tool (CVAT)
Stars: ✭ 6,557 (+4360.54%)
Mutual labels:  image-classification, imagenet
Neural Backed Decision Trees
Making decision trees competitive with neural networks on CIFAR10, CIFAR100, TinyImagenet200, Imagenet
Stars: ✭ 411 (+179.59%)
Mutual labels:  image-classification, imagenet
Tf Mobilenet V2
Mobilenet V2(Inverted Residual) Implementation & Trained Weights Using Tensorflow
Stars: ✭ 85 (-42.18%)
Mutual labels:  image-classification, imagenet
Fishnet
Implementation code of the paper: FishNet: A Versatile Backbone for Image, Region, and Pixel Level Prediction, NeurIPS 2018
Stars: ✭ 533 (+262.59%)
Mutual labels:  image-classification, imagenet
Hrnet Image Classification
Train the HRNet model on ImageNet
Stars: ✭ 633 (+330.61%)
Mutual labels:  image-classification, imagenet
Assembled Cnn
Tensorflow implementation of "Compounding the Performance Improvements of Assembled Techniques in a Convolutional Neural Network"
Stars: ✭ 319 (+117.01%)
Mutual labels:  image-classification, imagenet
Imagenet
Trial on kaggle imagenet object localization by yolo v3 in google cloud
Stars: ✭ 56 (-61.9%)
Mutual labels:  image-classification, imagenet
Divide And Co Training
[Paper 2020] Towards Better Accuracy-efficiency Trade-offs: Divide and Co-training. Plus, an image classification toolbox includes ResNet, Wide-ResNet, ResNeXt, ResNeSt, ResNeXSt, SENet, Shake-Shake, DenseNet, PyramidNet, and EfficientNet.
Stars: ✭ 54 (-63.27%)
Mutual labels:  image-classification, imagenet
Computer Vision
Programming Assignments and Lectures for Stanford's CS 231: Convolutional Neural Networks for Visual Recognition
Stars: ✭ 408 (+177.55%)
Mutual labels:  image-classification, imagenet
Aognet
Code for CVPR 2019 paper: " Learning Deep Compositional Grammatical Architectures for Visual Recognition"
Stars: ✭ 132 (-10.2%)
Mutual labels:  image-classification, imagenet
Rectlabel Support
RectLabel - An image annotation tool to label images for bounding box object detection and segmentation.
Stars: ✭ 338 (+129.93%)
Mutual labels:  image-classification, imagenet
Regnet
Pytorch implementation of network design paradigm described in the paper "Designing Network Design Spaces"
Stars: ✭ 129 (-12.24%)
Mutual labels:  image-classification, imagenet
Rexnet
Official Pytorch implementation of ReXNet (Rank eXpansion Network) with pretrained models
Stars: ✭ 319 (+117.01%)
Mutual labels:  image-classification, imagenet
Label Studio
Label Studio is a multi-type data labeling and annotation tool with standardized output format
Stars: ✭ 7,264 (+4841.5%)
Mutual labels:  image-classification, imagenet
pigallery
PiGallery: AI-powered Self-hosted Secure Multi-user Image Gallery and Detailed Image analysis using Machine Learning, EXIF Parsing and Geo Tagging
Stars: ✭ 35 (-76.19%)
Mutual labels:  imagenet, image-classification
Swin-Transformer
This is an official implementation for "Swin Transformer: Hierarchical Vision Transformer using Shifted Windows".
Stars: ✭ 8,046 (+5373.47%)
Mutual labels:  imagenet, image-classification
Orange3 Imageanalytics
🍊 🎑 Orange3 add-on for dealing with image related tasks
Stars: ✭ 24 (-83.67%)
Mutual labels:  image-classification, imagenet
Petridishnn
Code for the neural architecture search methods contained in the paper Efficient Forward Neural Architecture Search
Stars: ✭ 112 (-23.81%)
Mutual labels:  image-classification, imagenet

Implementation of AlexNet

  • ! ! ! It needs an evaluation on ImageNet

This project is an unofficial implementation of AlexNet, using C Program Language Without Any 3rd Library, according to the paper "ImageNet Classification with Deep Convolutional Neural Networks" by Alex Krizhevsky,et al.

Only support CPU now

Platform support

  • Linux
  • Windows with MinGW-w64(build pass but can not load images yet)

Features

  • Effective matrix multiply, w.r.t L1/L2 cache
  • img2col implementation of convolutional layer
  • Multi-thread CPU Apply MT in operator's forward computation and backward computation to boost speed
  • Efficient Memory Usage & Minimal Memory Occupation Memory is allocated on demand for efficient memory usage. If an array isn't necessary for computations afterward, it's memory will be freed instantly to minimize memory occupation.
  • Modular layer Define each layer seperately

Architecture

----------------------------------------------------------------
            Layer                Output Shape         Param #
================================================================
            Conv2d-1           [N, 64, 55, 55]          23,296
              ReLU-2           [N, 64, 55, 55]               0
         MaxPool2d-3           [N, 64, 27, 27]               0
            Conv2d-4          [N, 192, 27, 27]         307,392
              ReLU-5          [N, 192, 27, 27]               0
         MaxPool2d-6          [N, 192, 13, 13]               0
            Conv2d-7          [N, 384, 13, 13]         663,936
              ReLU-8          [N, 384, 13, 13]               0
            Conv2d-9          [N, 256, 13, 13]         884,992
             ReLU-10          [N, 256, 13, 13]               0
           Conv2d-11          [N, 256, 13, 13]         590,080
             ReLU-12          [N, 256, 13, 13]               0
        MaxPool2d-13            [N, 256, 6, 6]               0
          Dropout-14                 [N, 9216]               0
           Linear-15                 [N, 4096]      37,752,832
             ReLU-16                 [N, 4096]               0
          Dropout-17                 [N, 4096]               0
           Linear-18                 [N, 4096]      16,781,312
             ReLU-19                 [N, 4096]               0
           Linear-20                 [N, 1000]       4,097,000
================================================================
("N" stands for "batch size")
Total params: 61,100,840
Trainable params: 61,100,840
Non-trainable params: 0
----------------------------------------------------------------

Usage

Install

git clone [email protected]:Dynmi/AlexNet.git
cd AlexNet
mkdir build && cd build
cmake .. & make -j8

Train

( The data loader only supports .jpeg and .png$ images now. For image dataset, go to http://www.image-net.org/)

  1. Create file images.list in the directory ./, each line contains info of one image, like this: class_id image_path .

For example:

0 /home/haris/Documents/AlexNet/images/0/1.jpeg
1 /home/haris/Documents/AlexNet/images/1/1.jpeg
2 /home/haris/Documents/AlexNet/images/2/1.jpeg
3 /home/haris/Documents/AlexNet/images/3/1.jpeg
4 /home/haris/Documents/AlexNet/images/4/1.jpeg
5 /home/haris/Documents/AlexNet/images/5/1.jpeg

or you can generate images.list by using cs gen_list.csc <PATH of your Images>

  1. Run the command for training
./alexnet train -batchsize <batch-size> -epochs <epochs> -load_pretrained <weights-path> -save <weights-path>

For example:

./alexnet train -batchsize 8 -epochs 10 -load_pretrained ./alexnet_pretrained.weights -save ./temp.weights 

Inference

$./alexnet inference -input <image-path> -load <weights-path>

For example:

./alexnet inference -input ./0001.jpeg -load ./alexnet_pretrained.weights

Todo List

  • [ ] Try & Compare on ImageNet

  • [ ] CUDA speed boosting

Speed Benchmark for Ops

Experiments were done on a laptop --- Huawei MagicBook14

Conv2D Forward

this DarkNet
Scene1 0.13s 0.44s
Scene2 0.21s 0.66s

Scene1: Input shape [4,224,224,3], weight shape [64,3,11,11]

Scene2: Input shape [4,57,57,128], weight shape [256,128,3,3]

Full-connected Forward

this DarkNet
Scene1 0.07s 0.24s
Scene2 0.11s 0.52s

Scene1: Input shape [4,2048], weight shape [2048,1024]

Scene2: Input shape [4,4096], weight shape [4096,4096]

Original AlexNet Details

divide the learning rate by 10 when the validation error rate stopped improving with the current learning rate. The learning rate was initialized at 0.01 and reduced three times prior to termination. We trained the network for roughly 90 cycles through the training set of 1.2 million images.

Reference

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].