Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

Machine Learning Model for Prediction of

Smartphone Addiction

Name: Neha Bhatage

Department of Master of Computer Applications


Jain College of Engineering (JCE), Belagavi
2024-2025
Abstract

• Face recognition is a method in Machine Learning to recognize objects in a


picture or video. Humans have a memory to recognize other people and
recognize some objects like animals, plants, living objects, and non-living objects.
However, how does the computer do that although it has memory? Machine
Learning is the technique or method in Computer Vision that can be used, so
computers can understand one person's face of another person contained in the
image or video. In this paper, the author proposes testing some popular
Convolutional Neural Network (CNN) Model Architecture to see which one is
better to recognize the person face dataset in disguise. The author uses the
“Recognizing Disguised Faces” dataset to distinguish 75 classes of faces and then
tries to train and test how accurately they can be recognized by the machine.

• Where it will be useful to anyone who needs to explore and develop an


Architecture of Deep Learning. This paper is expected to contribute to the field
of Machine Learning algorithms that is used to solve problems in image
classification. The experimental results show significant improvement using
transfer learning in VGG Models. We then conclude that ImageNet weight is best
used for face-recognizing using VGG Models.
Introduction

• Purpose: In the field of Machine Learning, there are many areas and methods
for recognizing something, whether what is detected is a non-living (object) or
living thing (human, animal, and even plant). For biometric identification, the
face of a person is often used in identifying someone else.
• We, humans can identify someone else from one another because we have
memory and brain to process our thinking. But machines cannot do that itself,
thus a field that makes machine thinking is Machine Learning which is pioneered
by Arthur Samuel.
• Transfer learning differs from traditional machine learning because it involves
using a pre-trained model as a springboard to start a secondary task.

• In this paper, we compare some popular Pre-Trained CNN Model Architecture


provided by Keras which is an opensource neural network library written in
Python .
• The architecture we used is VGG16, VGG19, ResNet50, ResNet152 v2,
InceptionV3 and Inception-ResNet V2. Then, we divide into two parts: using the
vector to train the classifier model, and evaluating the accuracy and cost function
of the classifier model From this research, we expected to see the best PreTrained
Architecture model with the highest level of accuracy, and the lowest cost
function in the optimal hyperparameter state.
• There are many elements of the processing units in ANN which commonly called
neurons, units, cells, or nodes.
Lecture Review:
[1]Multi-scale object detection in remote sensing imagery with
convolutional neural networks.
Automatic detection of multi-class objects in remote sensing images is a fundamental
but challenging problem faced for remote sensing image analysis. Traditional
methods are based on hand-crafted or shallow-learning-based features with limited
representation power. Recently, deep learning algorithms, especially Faster region
based CNN, has shown their much stronger detection power in computer vision field.
However, several challenges limit the applications of FRCN in multi-class objects
detection from remote sensing images: Objects often appear at very different scales
in remote sensing images, and FRCN with a fixed receptive field cannot match the
scale variability of different objects.
Object recognition is a method in the computer vision to identify and recognize
objects in the picture or video. When humans see photos or watch videos, they can
quickly recognize some object like a car, bus, human, cat, food, and other visual
artifacts. However, how do we apply it to the computer? Classification is the
technique or method in object recognition that can be used on a computer to
distinguish one object from another object contained in the image or video. In this
paper, the author proposes about testing some popular image binary classification
algorithms used along with the results of the performance matrix of each algorithm,
among these are Logistic Regression with Perceptron, Multi-Layer Perceptron (MLP),
Deep Multi-Layer Perceptron, and Convolutional Neural Network.
Video pornography detection through deep learning techniques and motion
information.. Recent literature has explored automated pornographic detection – a
bold move to replace humans in the tedious task of moderating online content.
Unfortunately, on scenes with high skin exposure, such as people sunbathing and
wrestling, the state of the art can have many false alarms. This paper is based on the
premise that incorporating motion information in the models can alleviate the
problem of mapping skin exposure to pornographic content, and advances the bar on
automated pornography detection with the use of motion information and deep
learning architectures. Deep Learning, especially in the form of Convolutional Neural
Networks, have striking results on computer vision, but their potential for
pornography detection is yet to be fully explored through the use of motion
information.
Requirement Specifications:

Data Collection
Sources:

Smartphone usage tracking applications.

Surveys and questionnaires.

Wearable devices (optional).

Data Types:

Quantitative data: screen time, app usage statistics, number of unlocks.

Qualitative data: self-reported anxiety, stress levels, social interactions.

Demographic data: age, gender, educational background.

Data Preprocessing
Cleaning:

Remove duplicate entries.

Handle missing values through imputation or deletion.

Correct inconsistencies in the dataset.

Normalization:

Scale features to a uniform range using techniques such as Min-Max scaling or Z-


score normalization.

Feature Selection:

Identify relevant features using correlation analysis and domain knowledge.


Non-Functional Requirements:

Performance

Scalability:

The system should handle large datasets and a growing number of users.

Speed:

The model should provide real-time or near real-time predictions.

Accuracy:

The model should achieve high accuracy, precision, recall, and F1 score.

Usability

User Interface:

The application should be easy to navigate with a clear display of predictions and insights.

Accessibility:

The system should be accessible to users with varying levels of technical expertise.
Reliability

Robustness:

The model should handle incomplete or noisy data gracefully.

Availability:

The system should be available with minimal downtime.


Security

Data Privacy:

Implement data encryption and anonymization techniques.

User Consent:

Ensure users provide consent for data collection and usage.


Existing System:

Data Privacy Concerns:

Collecting sensitive data on user behavior and mental health raises privacy issues.

Generalizability:

Models trained on specific populations may not generalize well to other demographics or
cultures.

Real-time Analysis:

Many existing systems do not provide real-time predictions or feedback.

Comprehensive Feature Sets:

Some models may lack comprehensive feature sets, omitting important behavioral or
psychological variables.

Data Collection

Sources:

Usage Tracking Applications: Apps like RescueTime, Moment, and QualityTime track
detailed smartphone usage, including screen time, app usage, and number of unlocks.

Surveys and Questionnaires: Instruments such as the Smartphone Addiction Scale (SAS) and
Internet Addiction Test (IAT) provide self-reported data on smartphone usage and its
psychological effects.

Wearable Devices: Some systems incorporate data from wearables that monitor physical
activity and correlate it with smartphone use.

Types of Data:

Quantitative Data: Screen time, number of unlocks, frequency and duration of app usage.

Qualitative Data: Self-reported psychological metrics like anxiety, depression, and social
interaction quality.
Software Requirements:

• Operating System : Windows 7/8/10


• Server side Script : Python, Anaconda
• IDE : Pycharm
• Libraries Used :Numpy, IO, OS, Pillow, keras, tkinter
• Technology : Python 3.6+
• Accessories : Webcam.

Hardware Requirements:

H/W Configuration:
• Processor - I3/Intel Processor
• Hard Disk -160GB
• Key Board - Standard Windows Keyboard
• Mouse - Two or Three Button Mouse
• Monitor - SVGA
• RAM - 8Gb
Proposed System:
• Face recognition is an important biometric that is used to uniquely identify an
individual. However, the presence of various disguises in the face will diminish the
performance of any facial recognition system. Disguised face recognition problem
becomes extremely challenging when important facial features get covered up.
Because of the increase in popularity and success of deep learning in computer
vision problems, features learned by Convolutional Neural Networks (CNN) can
be used for face recognition. In this paper, a novel method for identifying and
recognizing people who hide their identity by covering face using scarves has
been proposed. Recognition is done by using a pre-trained Convolutional Neural
Network (Alex-Net Model) for facial feature extraction which is followed by a
multi-class Support Vector Machine (SVM) algorithm for performing the
classification task. A new dataset of covered faces has also been introduced for
training the deep network. This indeed is very useful for law enforcement and
other organizations as it would help to identify criminals, Protestants or anyone
who hides their identity.

Proposed Method :
1. System Design

The system design for the machine learning model to predict smartphone addiction consists of
several components that work together to process data, train the model, and make predictions.
The main components include:

1. Data Collection Module


2. Data Preprocessing Module
3. Feature Engineering Module
4. Model Training and Tuning Module
5. Model Evaluation and Validation Module
6. Prediction Module
7. User Interface

1.1 Data Collection Module

• Sources: Smartphone usage logs, demographic surveys, psychological assessments.


• Tools: APIs for data extraction, mobile apps for logging usage data, survey forms.
• Storage: Database (e.g., SQL, NoSQL) for storing raw data.

1.2 Data Preprocessing Module

• Cleaning: Handle missing values, remove duplicates, and filter irrelevant data.
• Transformation: Normalize and scale features, encode categorical variables.
• Tools: Python libraries like Pandas, NumPy, and Scikit-learn.

1.3 Feature Engineering Module

• Feature Selection: Choose relevant features such as screen time, app usage patterns, frequency
of phone checks.
• Feature Creation: Create new features based on raw data (e.g., average session duration).
• Tools: Python libraries like Pandas, NumPy.

1.4 Model Training and Tuning Module

• Algorithms: Logistic Regression, Decision Trees, Random Forests, Support Vector Machines,
Neural Networks.
• Hyperparameter Tuning: Use grid search and cross-validation to optimize model parameters.
• Tools: Scikit-learn, TensorFlow, Keras.

1.5 Model Evaluation and Validation Module

• Metrics: Accuracy, Precision, Recall, F1-score, ROC-AUC.


• Validation: Split data into training and testing sets, use k-fold cross-validation.
• Tools: Scikit-learn, Matplotlib, Seaborn.

1.6 Prediction Module

• Deployment: Serve the model using APIs for real-time predictions.


• Tools: Flask or Django for building RESTful APIs, Docker for containerization.
1.7 User Interface

• Frontend: Web or mobile interface for users to input data and view predictions.
• Backend: Connects the UI to the prediction module.
• Tools: React.js or Angular for frontend, Flask or Django for backend.

2. Implementation

2.1 Data Collection

• Example Data Schema:

{
"user_id": "12345",
"screen_time": 180, // in minutes
"app_usage": {
"social_media": 90,
"productivity": 30,
"entertainment": 60
},
"phone_checks": 50,
"demographics": {
"age": 25,
"gender": "Female"
},
"psychological_assessments": {
"anxiety_score": 7,
"depression_score": 5
}
}

2.2 Data Preprocessing

• Python Code:

import pandas as pd
from sklearn.preprocessing import StandardScaler, OneHotEncoder
from sklearn.impute import SimpleImputer

# Load data
data = pd.read_csv('smartphone_usage_data.csv')

# Handle missing values


imputer = SimpleImputer(strategy='mean')
data['screen_time'] = imputer.fit_transform(data[['screen_time']])

# Normalize numerical features


scaler = StandardScaler()
data[['screen_time', 'phone_checks']] = scaler.fit_transform(data[['screen_time', 'phone_checks']])

# Encode categorical features


encoder = OneHotEncoder()
demographics_encoded = encoder.fit_transform(data[['gender']]).toarray()

2.3 Feature Engineering

• Python Code:

# Feature creation
data['social_media_ratio'] = data['app_usage_social_media'] / data['screen_time']
data['productivity_ratio'] = data['app_usage_productivity'] / data['screen_time']
data['entertainment_ratio'] = data['app_usage_entertainment'] / data['screen_time']

# Select features
features = data[['screen_time', 'phone_checks', 'social_media_ratio', 'productivity_ratio',
'entertainment_ratio']]
labels = data['addiction_label']

2.4 Model Training and Tuning

• Python Code:

from sklearn.model_selection import train_test_split, GridSearchCV


from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import classification_report

# Split data
X_train, X_test, y_train, y_test = train_test_split(features, labels, test_size=0.2, random_state=42)

# Train model
model = RandomForestClassifier()
param_grid = {'n_estimators': [50, 100, 200], 'max_depth': [10, 20, 30]}
grid_search = GridSearchCV(model, param_grid, cv=5, scoring='accuracy')
grid_search.fit(X_train, y_train)

# Evaluate model
best_model = grid_search.best_estimator_
y_pred = best_model.predict(X_test)
print(classification_report(y_test, y_pred))
2.5 Model Evaluation and Validation

• Python Code:

from sklearn.metrics import roc_auc_score, roc_curve


import matplotlib.pyplot as plt

# Calculate ROC-AUC
roc_auc = roc_auc_score(y_test, best_model.predict_proba(X_test)[:, 1])
fpr, tpr, _ = roc_curve(y_test, best_model.predict_proba(X_test)[:, 1])

# Plot ROC curve


plt.figure()
plt.plot(fpr, tpr, label='ROC curve (area = %0.2f)' % roc_auc)
plt.plot([0, 1], [0, 1], 'k--')
plt.xlim([0.0, 1.0])
plt.ylim([0.0, 1.0])
plt.xlabel('False Positive Rate')
plt.ylabel('True Positive Rate')
plt.title('Receiver Operating Characteristic')
plt.legend(loc="lower right")
plt.show()

2.6 Prediction Module

• Python Code (Flask API):

from flask import Flask, request, jsonify


import pickle

# Load the trained model


model = pickle.load(open('smartphone_addiction_model.pkl', 'rb'))

app = Flask(__name__)

@app.route('/predict', methods=['POST'])
def predict():
data = request.get_json(force=True)
features = [data['screen_time'], data['phone_checks'], data['social_media_ratio'],
data['productivity_ratio'], data['entertainment_ratio']]
prediction = model.predict([features])
return jsonify({'prediction': prediction[0]})

if __name__ == '__main__':
app.run(debug=True)
3. Conclusion

The design and implementation of the "Machine Learning Model for Prediction of Smartphone
Addiction" project involve a comprehensive approach to data collection, preprocessing, feature
engineering, model training, evaluation, and deployment. By following these steps, we can build
an efficient and effective system to predict smartphone addiction, providing valuable insights for
early intervention and prevention.

You might also like