0 100029991
0 100029991
DECLARATION
I am the student under the guidance of Ms. Sriya Basu Mallik (Manager), IT
& ERP department, Visakhapatnam, steel plant, hereby declare that the
project entitled “LEAD TIME PREDICTION USING MACHINE
LEARNING” is an original work done at Rashtriya Ispat Nigam Limited
(RINL) Visakhapatnam Steel Plant, submitted in partial fulfilment of the
requirements for the award of Industrial Training project work. I assure that
this project is not submitted in any university or college.
Place:
VISHAKAPATNAM
4
ACKNOWLEDGEMENT
We would like to express our deep gratitude for the valuable guidance of our guide
MS. SRIYA BASU MALIK, MANAGER, IT and ERP department ,Visakhapatnam ,
Steel plant for all her guidance , help and ongoing support throughout the course of this
work by explaining basic concepts of yard management system and their functioning
along with industry requirements. We are immensely grateful to you madam. Without
whose inspiration and valuable support our training would never have taken off.
We sincerely thank the Training and Development centre (T&DC) for their guidance
during safety training and encouragement in successful completion of our training.
Gundubogula Neeraja
Indukuri Sri Surya
Varma Bogineni
Vyshnavi
Devarakonda Sai Sreeja
5
ABSTRACT
Keywords: Machine Learning; Lead time; Random Forest; Logistic; Production; Supply
Chain.
6
CONTENTS
A Brief Overview of Steel Plant......................................07-08
Conclusion.........................................................................46-47
References.........................................................................48
7
Visakhapatnam Steel Plant (VSP) is the integrated steel plant of Rashtriya Ispat
Nigam Limited in Visakhapatnam, founded in 1971. VSP strikes everyone with a
tremendous sense of awe, wonder, and amazement as it presents a wide array of
excellence in all its facets in scenic beauty, technology, human resources,
management, and product quality. On the coast of the Bay of Bengal and by the
side of scenic Gangavaram beach has tall and massive structures of technological
architecture, the Visakhapatnam Steel Plant. Nevertheless, the vistas of excellence
do not rest with the inherent beauty of location over the sophistication of
technology-they march ahead, parading one aspect after another.
VSP has become the first integrated steel plant in the country to be certified to all
the three international standards for quality (ISO -9001), Environment
Management (ISO-14001) & Occupational Health & Safety (OHSAS—18001).
The certificate covers quality systems of all operational, maintenance, and service
units besides purchase systems, Training, and Marketing functions spreading over
4 Regional Marketing offices, 20 branch offices & 22 stockyards located all over
the country. VSP, by successfully installing & operating efficiently Rs.460 crores
worth of pollution and Environment Control Equipment and converting the barren
landscape more than 3 million plants have made the steel plant, steel Township,
and VP export Quality Pig Iron & Steel products Sri Lanka, Myanmar, Nepal,
Middle East, USA. & South East Asia (Pig iron). RINL—VSP was awarded
―Star Trading HOUSE‖ status during 1997-2000. Having established a fairly
dependable export market, VP Plans to make a continuous presence in the export
market.
● Sinter plant
● Blast Furnace
● Rolling mills
Introduction:
Predictive data analytics contains a variety of statistical methods from data
mining, predictive modeling, and ML that analyze historical facts to make
predictions about prospects or unidentified occasions.
―CRISP-DM breaks the process of data mining into six major phases:1) Business
Understanding; 2) Data Understanding; 3) Data Preparation; 4) Modeling; 5)
Evaluation; 6) Deployment‖. The fourth stage (modeling) is where machine
learning (ML) algorithms are engaged to build predictions for Lead time. In
particular, ML is defined as an automated computational method that ―learns‖
and extracts information and patterns directly from (historical) data. There are four
approaches, 1) Supervised, 2) Unsupervised, 3) Semi-Supervised, and 4)
Reinforcement Machine Learning.
replenish inventory and when the order is received. Lead time affects the amount
of stock a company needs to hold at any point in time. When considering the total
amount of time for a purchase order to be delivered from a supplier, factor in the
time taken for the supplier to accept and process the order. Lead time directly
affects your total inventory levels. The longer your lead time the more stock you
will need to hold in your inventory. Longer lead times make deliveries more
unpredictable and force a company to rely heavily on demand forecasts to make
orders. Once you have calculated your lead time, the next step is to employ
corrective measures to reduce it. While there have been improvements to shipping
and freight services in recent years, there are other factors that affect lead times.
Orders may take time to process and be approved within your business, your
suppliers will then need to place orders of their own for the materials to create
your products, and there might be delays due to checks done at the ports by
customs. There are different trade control compliance and regulations for each
country that needs to be factored in an international organization. Traditionally,
lead time calculation could be done using all those factors into consideration. For
all of these factors add to your lead time. Hence, there are several factors required
to be considered to calculate lead time in a specific industry. However, with the
advancement of the technology, predictive analysis techniques can be used to
predict the lead time based on the products supplier.
Methodology:
From the CRISP-DM model, the first three phases related to data processing as
described in Figure 1.The unit MLalgorithm is the modeling phase, and the
evaluation is done in the Results section, where pertinent landscapes have been
picked and the accuracy of the prediction model has been calculated.
“Each item will have its own lead time profile, and one model cannot be
fitted to all the items"
13
1. Lead Time: Lead time is the amount of time it takes for an item to be delivered
or produced after an order has been placed. In different industries and contexts,
lead time can vary significantly depending on factors such as the complexity of the
item, the production process, supply chain efficiency, and other related variables.
2. Lead Time Profile: A lead time profile represents the historical data or pattern
of lead times for a specific item. It includes information about lead time
variability, trends, seasonality, and any other factors that may influence the lead
time for that particular item.
"For each item, various models are applied, and the model with the best
accuracy is considered for that item"
2. Model Selection: Instead of using a single generic model for all items, various
machine learning models are considered. These models could belong to different
families (e.g., linear regression, decision trees, support vector machines, neural
networks) or may have different configurations.
3. Model Training and Evaluation: Each of the selected models is trained on the
historical data of a specific item. The data for each item is used to create a separate
training set for that particular item.
14
6. Application Phase: Once the best model for each item is identified during the
training and validation phase, it is used for predicting outcomes or estimating
characteristics of new, unseen data related to that item.
Item-Specific Models: By using different models for each item, the approach can
capture the unique patterns and characteristics of individual items, leading to more
accurate predictions and better performance.
Adaptability: Different items may have varying levels of complexity and different
relationships between features and outcomes. Using various models allows for
greater adaptability to the diverse nature of the dataset.
Insights and Interpretability: Exploring the results from different models can
also provide valuable insights into the behavior and relationships of each item,
aiding decision-making and process improvement.
However, it's important to note that implementing this approach requires sufficient
data for each item, and it can be computationally intensive when dealing with a
large number of items and complex models. Careful consideration should be given
to the trade-offs between model complexity and interpretability, as well as
practical constraints related to data availability and computational resources.
15
c. Overfitting and Underfitting: Using a single model for all items may lead to
either overfitting or underfitting. Overfitting occurs when the model is too specific
to the training data and cannot generalize well to new data. Underfitting happens
when the model is too simplistic and fails to capture the complexities of different
items.
In conclusion, while using a single machine learning model for predicting lead
times might be simpler, it may not provide optimal results due to the diversity and
complexity of items in a supply chain. Developing item-specific models allows for
16
a more accurate representation of lead time behavior and can lead to better
operational efficiency and planning.
Here's a brief explanation of how this works in the context of machine learning:
1. Dataset and Items: Assume we have a dataset that contains information about
various items, and each item is associated with specific features or attributes, such
as product details, historical records, or relevant characteristics.
3. Filtering Items: Before the machine learning process begins, the system filters
the items based on the minimum transaction threshold. Items that do not meet this
criterion are excluded from further analysis and modeling.
4. Item-Specific Modeling: For each item that meets the minimum transaction
requirement, a separate machine learning model is trained using its relevant
historical data. The model could be chosen based on its performance on the
training data and validation set.
Outliers are detected and removed for each item before applying
models for better prediction accuracy.
1. Outliers: Outliers are data points that are unusually distant from other data
points in the dataset. They can be caused by measurement errors, data
corruption, rare events, or other anomalies in the data. Outliers can distort the
relationships learned by machine learning models and lead to inaccurate
predictions.
4. Outlier Removal: Once outliers are detected, they are removed or treated in a
way that aligns with the specific needs of the modeling task. Depending on the
nature of the outliers and the dataset, different approaches can be employed,
including removal, imputation, or transformation.
5. Model Training: After the outlier removal process, machine learning models
are trained using the cleaned and preprocessed data for each item. The models
can be selected based on their performance during training and validation.
In conclusion, removing outliers from the data of each individual item before
applying machine learning models can lead to improved prediction accuracy,
robustness, and generalization. By focusing on the meaningful patterns in the
majority of the data, the models become better equipped to make accurate
predictions for real-world applications.
19
A linear model is a fundamental and widely used concept in machine learning that
represents a relationship between input variables (features) and an output variable
(target) using a linear equation. The primary idea is to model the data as a linear
combination of features, allowing us to make predictions, estimate relationships,
and interpret the impact of different input variables on the target.
A Decision Tree is a versatile and widely used machine learning algorithm that
can handle both classification and regression tasks. It is a non-parametric
supervised learning method that learns a hierarchical structure of decisions based
on the input features to make predictions. Decision Trees are particularly valuable
because they offer interpretable and intuitive models, making them useful in
various real-world applications.
Data Cleaning:
Here we are importing a few libraries that are necessary to clean the data and we
are importing excel sheet that contain the data provided by the RINL.
22
Model:
25
Predict.py
27
Templates:
28
Output.html:
29
OUTPUT:
30
YOLO
Introduction to YOLO
YOLO (You Only Look Once) is a groundbreaking object detection system that
simplifies the traditional approach to object detection. Object detection involves
identifying objects within an image and drawing bounding boxes around them. Unlike
previous methods that required multiple stages and were computationally expensive,
YOLO transforms object detection into a single, end-to-end regression problem.
Core Concept
The core idea of YOLO is to apply a single convolutional neural network (CNN) to the
full image. This CNN divides the image into an SxS grid and, for each grid cell, predicts
bounding boxes, confidence scores for those boxes, and class probabilities for each box.
The confidence score reflects how confident the model is that the box contains an object
and the accuracy of the box's predicted location. This single-stage detection process
significantly reduces computation time, making YOLO extremely fast compared to its
predecessors.
YOLOv1 (2015)
YOLOv1 was introduced by Joseph Redmon, Santosh Divvala, Ross Girshick, and Ali
Farhadi in 2015. Their paper, "You Only Look Once: Unified, Real-Time Object
Detection," introduced a new paradigm in object detection.
Motivation and Design: Traditional object detection systems like R-CNN, Fast R-CNN,
and Faster R-CNN involve multiple stages, including region proposal and classification,
which are computationally intensive. YOLOv1 proposed a single-stage detection system
that predicts bounding boxes and class probabilities directly from full images in one
evaluation.
31
YOLOv3 (2018)
YOLOv3 brought significant enhancements to the YOLO architecture.
YOLOv4 (2020)
YOLOv4, released in 2020, incorporated cutting-edge techniques to further improve
performance.
32
YOLOv5 (2020)
Developed by Ultralytics, YOLOv5 introduced several new features and improvements.
Single-Stage Detection
YOLO’s key innovation is framing object detection as a single regression problem.
Traditional object detection methods involve multiple stages, such as region proposal,
region refinement, and classification, which are computationally expensive and slow.
YOLO, by contrast, applies a single neural network to the full image, which predicts
bounding boxes and class probabilities simultaneously, drastically simplifying and
speeding up the detection process.
33
Grid-Based Approach
YOLO divides the input image into an SxS grid. Each grid cell is responsible for
predicting a certain number of bounding boxes and their associated confidence scores,
along with class probabilities. This grid-based approach allows YOLO to detect multiple
objects within an image efficiently. The confidence score indicates the likelihood that
the bounding box contains an object and the accuracy of the bounding box's coordinates.
Real-Time Performance
One of YOLO’s most notable advantages is its real-time performance. Thanks to its
single-stage detection process, YOLO can process images at high frame rates, making
it suitable for applications that require quick response times, such as autonomous
driving, video surveillance, and robotics. For instance, YOLOv1 could process images
at 45
frames per second on a standard GPU, with later versions achieving even faster speeds.
Unified Architecture
YOLO’s architecture is unified and streamlined, using a single neural network for
detection. This unification leads to faster and more efficient computations compared to
traditional methods, which often require separate models for region proposal and
classification.
Multi-Scale Detection
Starting from YOLOv3, the model includes multi-scale detection. This means that the
model predicts bounding boxes at three different scales, helping it detect objects of
varying sizes more accurately. This is particularly useful for detecting smaller objects
that might be missed by single-scale detectors.
Applications of YOLO
Autonomous Vehicles
34
In the realm of autonomous driving, YOLO’s real-time detection capabilities are critical.
Self-driving cars need to recognize and react to various objects on the road, such as other
vehicles, pedestrians, traffic signs, and obstacles. YOLO’s speed and accuracy enable it
to process visual data in real-time, making it an ideal choice for this application.
Medical Imaging
In healthcare, YOLO is employed to detect abnormalities in medical images, such as
tumors, lesions, or fractures. This assists doctors in diagnosis and treatment planning.
YOLO’s accuracy and speed make it a valuable tool for analyzing medical imagery
quickly and effectively.
Robotics
Robots equipped with YOLO-based vision systems can navigate environments, avoid
obstacles, and interact with objects. This is particularly useful in industrial automation,
where robots need to perform tasks such as sorting, picking, and assembling with high
precision and efficiency.
Real-Time Performance
35
Generalization
Ensuring that YOLO models generalize well across diverse datasets and real-world
scenarios is another important area of research. Models trained on specific datasets might
not perform well on different types of images or in different environments. Techniques
such as data augmentation, transfer learning, and domain adaptation are being explored to
improve generalization.
Introduction
YOLOv8 represents the latest iteration in the You Only Look Once (YOLO) series,
building on the strengths and lessons learned from its predecessors. As with previous
versions, YOLOv8 aims to deliver state-of-the-art object detection performance,
balancing speed, accuracy, and ease of use. YOLOv8 incorporates cutting-edge
techniques and optimizations to push the boundaries of what is possible in real-time
object detection.
36
Backbone Network: YOLOv8 uses a new and improved backbone network designed
for better feature extraction. This backbone is deeper and more complex than those in
earlier versions, incorporating advanced convolutional layers, normalization techniques,
and
activation functions.
Neck and Head: The neck of YOLOv8 is designed to enhance the flow of information
between the backbone and the detection head. It uses advanced feature pyramid networks
(FPN) and path aggregation networks (PAN) to improve multi-scale feature fusion. The
detection head, responsible for predicting bounding boxes and class probabilities, has
also been optimized for better accuracy and efficiency.
Training Techniques
YOLOv8 employs several advanced training techniques to improve model performance:
Data Augmentation: Extensive data augmentation strategies are used to improve the
model's ability to generalize. Techniques such as mosaic augmentation, mixup, and
CutMix are employed to create diverse training samples.
Label Smoothing: This technique helps to regularize the model by smoothing the
labels during training, which can reduce overfitting and improve generalization.
Advanced Loss Functions: YOLOv8 uses sophisticated loss functions, such as CIoU
(Complete Intersection over Union) loss for bounding box regression and focal loss for
classification. These loss functions are designed to provide better gradients and improve
the convergence of the model.
Performance Optimization
YOLOv8 is designed for high performance, both in terms of speed and accuracy. Key
optimizations include:
Quantization and Pruning: These techniques are used to reduce the size of the model
and improve inference speed without significantly sacrificing accuracy.
Model Scaling: YOLOv8 comes in various sizes, such as YOLOv8s (small), YOLOv8m
(medium), YOLOv8l (large), and YOLOv8x (extra-large). This allows users to choose a
model that best fits their resource constraints and performance requirements.
Convolutional Layers: These layers apply filters to the input image to extract features
such as edges, textures, and shapes.
Normalization Layers: Techniques like batch normalization or group normalization are
used to stabilize and accelerate training.
Activation Functions: Non-linear activation functions like Leaky ReLU or Mish are
used to introduce non-linearity into the model.
Neck
The neck of YOLOv8 connects the backbone to the head and enhances feature
representation:
FPN and PAN: Feature Pyramid Networks (FPN) and Path Aggregation Networks
(PAN) are used to combine features from different layers of the backbone. This multi-
scale
feature representation helps in detecting objects of varying sizes.
Head
The head of YOLOv8 is responsible for making the final predictions:
38
Bounding Box Prediction: The head predicts the coordinates of bounding boxes. It uses
advanced loss functions like CIoU loss to ensure accurate localization.
Class Prediction: The head predicts the class probabilities for each bounding box. It may
use focal loss to handle class imbalance and improve the detection of hard-to-classify
objects.
Training Process
Model Initialization: The model is initialized with pre-trained weights or trained from
scratch, depending on the availability of a suitable pre-trained model.
Optimization: The model is trained using optimization algorithms like Adam or SGD.
Learning rate scheduling, weight decay, and other regularization techniques are
employed to ensure stable and efficient training.
39
TRAINING
The provided code snippet is for training a YOLO (You Only Look Once) model,
specifically using the YOLOv8 architecture, on a custom dataset with three classes:
helmet, head, and person. Here’s a detailed breakdown of the code:
Importing Libraries:
YOLO from ultralytics: This imports the YOLO class from the ultralytics package,
which is used for creating and training YOLO models.
pickle and warnings: These libraries are imported but not used in the snippet. pickle
could be for future use in saving/loading models or data, and warnings is used to filter out
warning messages.
Model Initialization:
model.train(data="C:/Users/HP/Desktop/YOLO/dataset/config.yaml", epochs=15):
This line starts the training process. It specifies the path to the config.yaml file, which
contains the dataset configuration, and sets the number of epochs for training (15 in this
case).
Explanation of config.yaml
The config.yaml file is crucial as it defines the paths to the training, validation, and
testing datasets, as well as the class labels. Here’s an example of what the config.yaml
file looks like and an explanation of each part:
train: ../dataset/train: This specifies the relative path to the directory containing the
training images and annotations. It is relative to the base path defined above.
test: ../dataset/test: This specifies the relative path to the directory containing the testing
images and annotations. It is used for evaluating the model's performance after training.
val: ../dataset/valid: This specifies the relative path to the directory containing the
validation images and annotations. Validation data is used to tune model hyperparameters
and prevent overfitting during training.
42
names: This section maps class indices to their respective class names. Each class used
in the dataset is given a unique index and a corresponding name.
0: head
1: helmet
2: person
Importance of config.yaml
Dataset Organization:
It provides a structured way to organize and reference the dataset. By defining paths to
training, validation, and test sets, it ensures that the model knows where to find the
necessary data.
Class Mapping:
The names section maps numerical labels to human-readable class names. This is crucial
for interpreting the model's outputs and for the training process, as the model needs to
know what each label represents.
Flexibility:
Using a configuration file allows for easy modification and experimentation. You
can change dataset paths, add new classes, or adjust other parameters without
altering the training script.
Consistency:
It ensures consistency across different training runs. By keeping the dataset paths and
class labels in a centralized configuration file, you reduce the risk of errors that
might occur if these parameters were hardcoded in multiple places.
43
Prediction
Video Processing:
The code opens a video file using OpenCV's VideoCapture class. It retrieves properties of
the video such as frame width, height, and frames per second (fps).
Video Writing:
A VideoWriter object is created to write processed frames with bounding boxes and
labels to an output video file. The codec used is mp4v.
Release Resources:
Once all frames have been processed, the video capture (cap) and video writer (out)
objects are released to free up system resources.
Printing Confirmation:
Finally, a message is printed to indicate that the video has been saved successfully with
bounding boxes and labels.
44
45
Output :
46
Conclusion:
In conclusion, our project aimed to predict lead time in a steel plant environment using
machine learning techniques. We meticulously curated features such as order details, raw
material availability, production process parameters, equipment status, workforce
availability, quality control metrics, and environmental factors. These features were
crucial in training our models to accurately estimate lead times.
For future work, we recommend exploring outlier detection techniques, addressing class
imbalance through resampling methods, and implementing online learning algorithms for
adaptive predictions. Collaboration with domain experts to refine feature selection and
enhance model interpretability could further improve predictive accuracy and applicability
in real-world scenarios.
Overall, this project lays a solid foundation for more efficient lead time prediction in steel
plant operations. By leveraging machine learning, we can optimize production planning,
resource allocation, and ultimately enhance customer satisfaction. Continued research and
development in this area have the potential to drive significant advancements in the
manufacturing sector.
47
YOLO
The presented project harnesses the capabilities of the YOLO (You Only Look Once)
object detection model to annotate and track objects within a video stream. By employing
a pre-trained YOLO model, the code efficiently identifies and labels objects of interest,
including heads, helmets, and persons, in real-time video footage. This project serves as a
testament to the practical application of cutting-edge computer vision techniques in
addressing complex challenges across various domains.
At its core, the YOLO model offers a streamlined approach to object detection by
dividing the image into a grid and predicting bounding boxes and class probabilities for
each grid cell. This enables rapid and accurate detection of multiple objects within a
single pass through the neural network. By integrating YOLO with video processing
techniques, the project showcases how advanced machine learning algorithms can be
seamlessly integrated into real-world applications.
The significance of this project lies in its ability to automate and streamline tasks that
would otherwise require manual intervention. In scenarios such as video surveillance,
safety monitoring, and crowd analysis, the automated detection and tracking of objects
can greatly enhance efficiency and accuracy. For instance, in surveillance applications,
the ability to quickly identify and track individuals, including those wearing safety
helmets, can improve security measures and response times.
References:
YOLO
GitHub - ultralytics/ultralytics: NEW - YOLOv8 ◻ in PyTorch > ONNX > OpenVINO >
CoreML > TFLite