Using Satellite Imagery to Predict House Prices

Andrew Hah
5 min readSep 26, 2023

--

Leveraging technology to assess and predict the value of assets, stocks, options, etc. is more prevalent than ever before, and house prices are no exception. The conventional approach is to consider tangible attributes such as house size, location, and amenities, but I wanted to go beyond, incorporating a visual context that allows for a more multi-dimensional analysis of properties. In this spirit, I undertook a project to blend machine learning techniques and high-resolution satellite imagery to predict house prices in Chicago.

Data Collection and Preparation:

Dataset Composition: The initial dataset was obtained via web-scraping, sifting through offers on Zillow. The dataset included attributes like latitude, longitude, number of bedrooms, bathrooms, parking spots, square feet, year built, and the house’s list price. This dataset was then cleaned to exclude missing data points and outliers (2% on either end). The resulting dataset contained 7768 houses in total.

Satellite Image Acquisition: Google Cloud Maps Static API was employed to procure satellite images for each property based on coordinates. The images were saved at a size of 640x640 pixels, and the zoom level was set to 19.

Examples of Satellite Images

Data Processing and Exploration:

The data was loaded into a Pandas dataframe, and was normalized to ensure compatibility with neural networks.

data.head()
data.describe()

The data was then split into train and test splits:

Model Development:

Two distinct models were constructed:

a. XGBoost Regressor Model (did not include satellite imagery)

b. Neural Network Model (did not include satellite imagery)

c. Combined Neural Network Model (included satellite imagery): Utilized convolutional layers to process images and fully connected layers for regression outputs, offering sophisticated predictive capabilities.

Initial Models:

Linear Regression, XGB Regressor, Lasso, Random Forest Regressor, Ridge

The respective R² values of the various models (Linear, XGBoost, Lasso, Random Forest, and Ridge) were as follows:

Linear: R² = 0.4847 | XGBoost: R² = 0.8208 | Lasso: R² = 0.4847 | Random Forest: R² = 0.7868 | Ridge: R² = 0.4847

XGBoost had the highest R² value as well as the lowest Mean Square Error Value.

Simple Neural Network:

Simple Neural Network without Satellite Imagery

The model, SimpleNN, consists of three fully connected layers with dropout for regularization, making it adept at learning from the dataset’s structured attributes. The architecture is straightforward, with dimensions gradually decreasing from the input layer to the output layer. To train the model, Mean Squared Error Loss (MSELoss) is used as the loss function, suitable for regression tasks, and the Adam optimizer is employed to minimize the loss. The model is trained in mini-batches, optimizing the weights to predict house prices more accurately.

The SimpleNN resulted in an R² value of 0.8632, which was slightly higher than the previous XGBoost model, and significantly higher than many of the other decision tree models.

Combined Neural Network:

First, the latitude and longitude attributes in the original dataset were converted into a list of tuples called coordinates. This was done so that I could fetch the satellite images from the API.

The function used to fetch the images from the Google Maps Static API looked like this:

After setting the zoom level to 19 and entering my API Key, I used this code to loop through all of the coordinates and save each image to the Google Colab Notebook temporarily:

Once all 7k+ of the images were saved, I saved all of the paths to the images and created a custom dataset of these images.

I then transformed and split the image dataset:

Finally, I created the combined model (original attributes + satellite images):

The CombinedModel class consists of an Inception model to process the image data and two fully connected layers to process the tabular data. The Inception model is a pre-trained convolutional neural network known for its high-level feature extraction capabilities from images.

In the forward pass, the tabular data (x_tabular) goes through a fully connected layer (fc1), and the image data (x_image) is processed by the Inception model (inception). The processed data from both paths are then concatenated and passed through the final layer (fc2). The final loop represents the application of the combined model on the training data. It iterates over batches of tabular and image data, utilizing the model to make predictions (y_pred).

The CombinedModel resulted in an R² value of 0.9712, a 12.5% increase from the simple neural network and an 18.3% increase from the XGBoost model.

Conclusion:

The integration of traditional house attributes with satellite imagery enabled the development of robust models, contributing to a more holistic understanding of house pricing dynamics. The models demonstrated promising capabilities in predicting house prices accurately, thereby offering substantial value to real estate stakeholders.

The project underscores the potential of machine learning in revolutionizing house price predictions by amalgamating diverse data sources. The utilization of satellite imagery provides an innovative approach to understanding and predicting real estate pricing, paving the way for more advanced and reliable solutions in the sector.

--

--