Skip to content

GatorSense/Histogram_Layer

Repository files navigation

Histogram Layer:

Histogram Layers for Texture Analysis

Joshua Peeples, Weihuang Xu, and Alina Zare

Note: If this code is used, cite it: Joshua Peeples, Weihuang Xu, & Alina Zare. (2020, March 25). GatorSense/Histogram_Layer: Initial Release (Version v2.0). Zenodo. https://doi.org/10.5281/zenodo.3731417 DOI

[IEEE Transactions on AI]

[arXiv]

[BibTeX]

In this repository, we provide the paper and code for histogram layer models from "Histogram Layers for Texture Analysis."

Installation Prerequisites

This code uses python, pytorch, and barbar. Please use [Pytorch's website] to download necessary packages. Barbar is used to show the progress of model. Please follow the instructions [here] to download the module.

Demo

Run demo.py in Python IDE (e.g., Spyder) or command line. To evaluate performance, run View_Results.py (if results are saved out).

Main Functions

The histogram layer model (HistRes_B) runs using the following functions.

  1. Intialize model

model, input_size = intialize_model(**Parameters)

  1. Prepare dataset(s) for model

dataloaders_dict = Prepare_Dataloaders(**Parameters)

  1. Train model

train_dict = train_model(**Parameters)

  1. Test model

test_dict = test_model(**Parameters)

Parameters

The parameters can be set in the following script:

Demo_Parameters.py

Inventory

https://github.com/GatorSense/Histogram_Layer

└── root dir
    ├── demo.py   //Run this. Main demo file.
    ├── Demo_Parameters.py // Parameters file for demo.
    ├── Prepare_Data.py  // Load data for demo file.
    ├── Prepare_Data_Results.py // Load data for results file.
    ├── Texture_Information.py // Class names and directories for datasets.
    ├── View_Results.py // Run this after demo to view saved results.
    ├── papers  // Links to related publications.
    └── Utils  //utility functions
        ├── Compute_FDR.py  // Compute Fisher Discriminant Ratio for features.
        ├── Confusion_mats.py  // Generate confusion matrices.
        ├── Generate_TSNE_visual.py  // Generate TSNE visualization for features.
        ├── Histogram_Model.py  // Generate HistRes_B models.
        ├── Network_functions.py  // Contains functions to initialize, train, and test model. 
        ├── RBFHistogramPooling.py  // Create histogram layer. 
        ├── Save_Results.py  // Save results from demo script.
     

License

This source code is licensed under the license found in the LICENSE file in the root directory of this source tree.

This product is Copyright (c) 2020 J. Peeples, W. Xu, and A. Zare. All rights reserved.

Citing Histogram Layer

If you use the histogram layer code, please cite the following reference using the following entry.

Plain Text:

Peeples, J., Xu, W., & Zare, A. (2021). "Histogram Layers for Texture Analysis," in IEEE Transactions on Artificial Intelligence, DOI 10.1109/TAI.2021.3135804.

BibTex:

@Article{Peeples2021Histogram,
Title = {Histogram Layers for Texture Analysis},
Author = {Peeples, Joshua and Xu, Weihuang  and Zare, Alina},
Journal = {IEEE Transactions on Artificial Intelligence},
Volume = {},
Year = {2021},
number={}
pages={1-1}
doi={10.1109/TAI.2021.3135804}
}

About

Histogram layer code for "Histogram Layers for Texture Analysis" (https://arxiv.org/abs/2001.00215).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages