Price Predictions for NFT Images
An NFT is an image in the form of a digital token. These tokens are then sold online. AN NFT can be anything in digital form. Every NFT image has its own price and we implement Machine learning techniques to predict the price for the NFT images.
For implementing this problem statement we collected the images and related prices using selenium script around 5000 images from Multiple sources. To extract the information from all the images we used OpenCV and NumPy and collected thir pixel intensities. In RGB color space, we converted 3-dimensional data into one dimensional, which works as independent data for machine learning Algorithms and Prices of each image as a dependent feature.
Techniques used
• Numpy
• Pandas
• Seaborn
• Matplotlib
• Statistics
• OpenCV
• Machine learning Supervised techniques
Using NumPy and pandas we removed the unwanted image that does not carry any kindof information. Now we have independent features. We used Machine learning supervised techniques Like regression and classification_regression Algorithms.
Algorithms used
• Multiple Linear Regression
• KNN Regressor
• Support Vector machine Regressor
• Adaboost Regressor
• Decision Tree
To train the data for ML algorithms, we split the data into train and test, where the training part has 80% of the data and the test part has 20% of the data.
We trained KNN Regressor, support vector Regressor, Decision tree, and Adaboost Regressor. But unfortunately, the results were not so good because KNN needs to collect perfect k-values. The problem is Regression, not a classification so due to the distribution range of values from independent data is too high.
For the support vector machine, due to high dimensionality in the data marginal distance and support, vectors are very close to each other. So we are facing an over-fitting problem while implementing the support vector machine.
Multiple Linear Regression
Multiple linear regression is a regression technique, and the results are going better compared to KNN-R and SVM-R. Initially, the train accuracy for the MLR model was 91 and 82 for the test.
So we improved the performance of the model using feature engineering and Regularization techniques.
Handling Outliers for MLR
As the data features are more in size, there is no option to select the best features because each and every pixel is important and it carries some information. Using sci-kit learn and feature engine, we handled outliers using the 5th quantile and 95th quantile area to remove the small amount of data that are far away from the remaining data points.
Feature scaling for MLR:
We clear the outliers. There are some features following skewness and some features not following Normal Distribution. Using the feature engine framework, we can scale down the pixel values using standardization. Using Yeo-Johnson transformation, we handled skewness to follow Normal Distribution. As Yeo-Johnson transformation has no impact on the negative values, this technique helps us to handle data.
Even though we handled outliers and skewness of the data, the increase in the test accuracy is not so high. Therefore we collected more images and increased the data size. To check whether the newly added data gives better results, we adjusted r2 techniques to check the model performance before and after adding the data. Adding the data helps us but not to a big scale. So we went to handle the overfitting problems using regularization techniques like L1 and L2 techniques.
Using this Ridge and Lasso regression we reduced the bias on a small scale and increased variance on a small scale by updating the coefficient values. Updating the values of the coefficients and making errors close to Zero increased the model Performance.
In the end accuracy value for train and test is
• Training Accuracy = 98.052948845
• Test Accuracy = 89.674529872
To check whether our Model is working well or not, we collected some NFT images and predicted the prices. The below table has the complete results for our test images.
Useful Information
References
Blog: https://www.bluetickconsultants.com/price-predictions-for-nft-images.html
GitHub code: https://github.com/bluetickconsultants/NFT_price_prediction
Other Projects
Open Source Projects: https://www.bluetickconsultants.com/open-source.html
GitHub Open Source repos: https://github.com/orgs/bluetickconsultants/repositories
Author:
Bluetick Consultants LLP — https://www.bluetickconsultants.com