Learn practical skills, build real-world projects, and advance your career

DEFINING PROBLEM STATEMENT AND BUSINESS CASE


download.jpg

FAKE INSTAGRAM ACOUNT DETECTOR


UNDERSTANDING THE PROBLEM

  • This project aim is to build and train a deep neural network model to detect fake or spam instagram accounts.

  • These days spam accounts have become a major problem in in all the social media platforms.

  • Many users are creating fake accounts to create an illusion of having many followers to thier personal accounts.

  • Fake accounts are being created to sell fake products and services.

  • They are also being used to impersonate other account users from common people to celebrities in order to influence, criticize, hurt feelings and reputation.


  • There are few key input features which we considered to determine if the account is fake or not.

  • THE INPUT FEATURES ARE:

  1. PROFILE PICTURE - The user has profile picture or not.
  2. NUMS/LENGTH USERNAME - The ratio of number of numerical chars in username to its length.
  3. FULLNAME WORDS - Full name in word tokens
  4. NAME/LENGTH OF FULL NAME - The ratio of number of numerical characters in full name to its length.
  5. NAME == USERNAME - Are username and full name literally the same?
  6. DESCRIPTION LENGTH - Bio length in characters.
  7. EXTERNAL URL - Has external URL or not.
  8. PRIVATE - Private or not.
  9. POSTS - Number of posts.
  10. FOLLOWERS - Number of followers.
  11. FOLLOWS - Number of follows.

TRAINED DETECTOR MODEL:


This model is trained such that it considers the above given features and determines whether a particular account is fake or not. By resulting the output as either 0 or 1 meaning TRUSTED or FAKE respectively. Our intention is to make this software capable of thinking like a human, based on the data it is given and results in maximum probability of success.

HOW TO RUN THE CODE

This is an executable Jupyter notebook hosted on Jovian.ml, a platform for sharing data science projects. You can run and experiment with the code in a couple of ways: using free online resources (recommended) or on your own computer.

Option 1: Running using free online resources (1-click, recommended)

The easiest way to start executing this notebook is to click the "Run" button at the top of this page, and select "Run on Binder". This will run the notebook on mybinder.org, a free online service for running Jupyter notebooks. You can also select "Run on Colab" or "Run on Kaggle".
link text

Option 2: Running on your computer locally
  1. Install Conda by following these instructions. Add Conda binaries to your system PATH, so you can use the conda command on your terminal.

  2. Create a Conda environment and install the required libraries by running required commands on the terminal.

You can now access Jupyter's web interface by clicking the link that shows up on the terminal or by visiting http://localhost:8888 on your browser. Click on the notebook file (it has a .ipynb extension) to open it.

TASK 1


  • LOADING LIBRAIRES

 #installing tensorflow version 2.0
 !pip install tensorflow==2.0
Collecting tensorflow==2.0 Downloading tensorflow-2.0.0-cp37-cp37m-manylinux2010_x86_64.whl (86.3 MB) |████████████████████████████████| 86.3 MB 27 kB/s Requirement already satisfied: astor>=0.6.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow==2.0) (0.8.1) Requirement already satisfied: protobuf>=3.6.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow==2.0) (3.17.3) Collecting tensorboard<2.1.0,>=2.0.0 Downloading tensorboard-2.0.2-py3-none-any.whl (3.8 MB) |████████████████████████████████| 3.8 MB 40.7 MB/s Collecting tensorflow-estimator<2.1.0,>=2.0.0 Downloading tensorflow_estimator-2.0.1-py2.py3-none-any.whl (449 kB) |████████████████████████████████| 449 kB 61.5 MB/s Requirement already satisfied: termcolor>=1.1.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow==2.0) (1.1.0) Requirement already satisfied: absl-py>=0.7.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow==2.0) (0.12.0) Collecting keras-applications>=1.0.8 Downloading Keras_Applications-1.0.8-py3-none-any.whl (50 kB) |████████████████████████████████| 50 kB 8.3 MB/s Requirement already satisfied: keras-preprocessing>=1.0.5 in /usr/local/lib/python3.7/dist-packages (from tensorflow==2.0) (1.1.2) Requirement already satisfied: six>=1.10.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow==2.0) (1.15.0) Requirement already satisfied: google-pasta>=0.1.6 in /usr/local/lib/python3.7/dist-packages (from tensorflow==2.0) (0.2.0) Requirement already satisfied: numpy<2.0,>=1.16.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow==2.0) (1.19.5) Requirement already satisfied: grpcio>=1.8.6 in /usr/local/lib/python3.7/dist-packages (from tensorflow==2.0) (1.41.0) Collecting gast==0.2.2 Downloading gast-0.2.2.tar.gz (10 kB) Requirement already satisfied: wrapt>=1.11.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow==2.0) (1.12.1) Requirement already satisfied: wheel>=0.26 in /usr/local/lib/python3.7/dist-packages (from tensorflow==2.0) (0.37.0) Requirement already satisfied: opt-einsum>=2.3.2 in /usr/local/lib/python3.7/dist-packages (from tensorflow==2.0) (3.3.0) Requirement already satisfied: h5py in /usr/local/lib/python3.7/dist-packages (from keras-applications>=1.0.8->tensorflow==2.0) (3.1.0) Requirement already satisfied: setuptools>=41.0.0 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.1.0,>=2.0.0->tensorflow==2.0) (57.4.0) Requirement already satisfied: requests<3,>=2.21.0 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.1.0,>=2.0.0->tensorflow==2.0) (2.23.0) Requirement already satisfied: google-auth<2,>=1.6.3 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.1.0,>=2.0.0->tensorflow==2.0) (1.35.0) Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.1.0,>=2.0.0->tensorflow==2.0) (3.3.4) Requirement already satisfied: werkzeug>=0.11.15 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.1.0,>=2.0.0->tensorflow==2.0) (1.0.1) Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.1.0,>=2.0.0->tensorflow==2.0) (0.4.6) Requirement already satisfied: cachetools<5.0,>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from google-auth<2,>=1.6.3->tensorboard<2.1.0,>=2.0.0->tensorflow==2.0) (4.2.4) Requirement already satisfied: rsa<5,>=3.1.4 in /usr/local/lib/python3.7/dist-packages (from google-auth<2,>=1.6.3->tensorboard<2.1.0,>=2.0.0->tensorflow==2.0) (4.7.2) Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/local/lib/python3.7/dist-packages (from google-auth<2,>=1.6.3->tensorboard<2.1.0,>=2.0.0->tensorflow==2.0) (0.2.8) Requirement already satisfied: requests-oauthlib>=0.7.0 in /usr/local/lib/python3.7/dist-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.1.0,>=2.0.0->tensorflow==2.0) (1.3.0) Requirement already satisfied: importlib-metadata in /usr/local/lib/python3.7/dist-packages (from markdown>=2.6.8->tensorboard<2.1.0,>=2.0.0->tensorflow==2.0) (4.8.1) Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in /usr/local/lib/python3.7/dist-packages (from pyasn1-modules>=0.2.1->google-auth<2,>=1.6.3->tensorboard<2.1.0,>=2.0.0->tensorflow==2.0) (0.4.8) Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests<3,>=2.21.0->tensorboard<2.1.0,>=2.0.0->tensorflow==2.0) (2.10) Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests<3,>=2.21.0->tensorboard<2.1.0,>=2.0.0->tensorflow==2.0) (3.0.4) Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests<3,>=2.21.0->tensorboard<2.1.0,>=2.0.0->tensorflow==2.0) (2021.5.30) Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests<3,>=2.21.0->tensorboard<2.1.0,>=2.0.0->tensorflow==2.0) (1.24.3) Requirement already satisfied: oauthlib>=3.0.0 in /usr/local/lib/python3.7/dist-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.1.0,>=2.0.0->tensorflow==2.0) (3.1.1) Requirement already satisfied: cached-property in /usr/local/lib/python3.7/dist-packages (from h5py->keras-applications>=1.0.8->tensorflow==2.0) (1.5.2) Requirement already satisfied: typing-extensions>=3.6.4 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata->markdown>=2.6.8->tensorboard<2.1.0,>=2.0.0->tensorflow==2.0) (3.7.4.3) Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata->markdown>=2.6.8->tensorboard<2.1.0,>=2.0.0->tensorflow==2.0) (3.6.0) Building wheels for collected packages: gast Building wheel for gast (setup.py) ... done Created wheel for gast: filename=gast-0.2.2-py3-none-any.whl size=7554 sha256=08e2fb3ae63b4e0a7b04599f5173abf14680a88753de57dda99c366a627c9df8 Stored in directory: /root/.cache/pip/wheels/21/7f/02/420f32a803f7d0967b48dd823da3f558c5166991bfd204eef3 Successfully built gast Installing collected packages: tensorflow-estimator, tensorboard, keras-applications, gast, tensorflow Attempting uninstall: tensorflow-estimator Found existing installation: tensorflow-estimator 2.6.0 Uninstalling tensorflow-estimator-2.6.0: Successfully uninstalled tensorflow-estimator-2.6.0 Attempting uninstall: tensorboard Found existing installation: tensorboard 2.6.0 Uninstalling tensorboard-2.6.0: Successfully uninstalled tensorboard-2.6.0 Attempting uninstall: gast Found existing installation: gast 0.4.0 Uninstalling gast-0.4.0: Successfully uninstalled gast-0.4.0 Attempting uninstall: tensorflow Found existing installation: tensorflow 2.6.0 Uninstalling tensorflow-2.6.0: Successfully uninstalled tensorflow-2.6.0 ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. tensorflow-probability 0.14.1 requires gast>=0.3.2, but you have gast 0.2.2 which is incompatible. Successfully installed gast-0.2.2 keras-applications-1.0.8 tensorboard-2.0.2 tensorflow-2.0.0 tensorflow-estimator-2.0.1