Giter Site home page Giter Site logo

measuring-inequalities-sview's Introduction

measuring-inequalities-sview

Code used for the paper: Measuring social, environmental and health inequalities using deep learning and street imagery

Data preperation

1. Get labels /data-prep/get_labels.py

The initial data download for labels (for each Lower Super Output Area - LSOA) need to be completed from the corresponding websites (as described below with links). The script reads these downloaded files in, and computes the deciles from the input values that are used in training as labels.

2. Exctract features from images /data-prep/vgg_features_extract.py

This script uses VGG16 pre-trained network weights to extract 4096D vectors (i.e. codes) from each of the street level images used.

3. Create HDF5 data for training /data-prep/make_hdf5.py

Creating hdf5 files from VGG16 features and pickle files for labels to be used in training.

Reads in: (i) features (codes) extracted from images using VGG16 (extract_features_gview.py), (ii) metadata containing labels, and input image ids

Outputs: (i) HDF5 file with features (4096D codes extracted from VGG16), (ii) labels file with corresponding variable values

Ordinal classification (deep learning based assignment to deciles)

/classification/ordinal_classification_sview_tboard.py

The assignment of each postcode to an outcome decile is an ordinal classification task, for which we used the network shown below. We used pre-trained weights of the VGG16, and only trained for the weights of the fully connected layers.

Aggregation

/aggregation/get_lsoa_level_predictions.py

Ground truth data for our analysis was only available at the Lower Super Output Area (LSOA) level for the cities we focused on. To test the performance of our networks, we needed predictions at the LSOA level and not image level. The mean continuous output value for each LSOA was computed by averaging postcode-level continuous outputs generated by the final layer of trained networks before the application of the fore-mentioned sigmoid function. The mean value computed for each LSOA was then converted to a decile category, and compared to the LSOA’s actual decile.

Pre-trained models in Tensorflow

Will be made available soon for trained networks using London images

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.