Ports Inspection Data Capture and Risk Management System Overview

Kayode John Olusola
October 17, 2018

Ports Inspection Directorate
National Agency for Food and Drug Administration and Control (NAFDAC)

Background

  • The National Agency for Food and Drug Administration and Control (NAFDAC) in Nigeria is the Food and Drug Regulatory Agency of the Government of Nigeria.
  • NAFDAC by law is mandated to regulate and control amongst other things, the import and export of Food, Drugs, Chemicals, Cosmetics, Medical Devices and their raw materials.
  • These products are usually referred to as NAFDAC Regulated products

Background (Cont'd)

  • Importers of NAFDAC Regulated Products are expected to process licenses from NAFDAC before they import these products into Nigeria.
  • When products are imported, NAFDAC needs to ensure that products are licensed and the products imported are those licensed.
  • NAFDAC also ensures that the products imported are safe, wholesome and of the right quality.
  • This is an enormous task due to the volume of imports of NAFDAC regulated products into Nigeria.

Background (Cont'd)

  • In other to facilitate trade, NAFDAC collaborates with the Nigeria Customs Service with integration into the Nigeria Integrated Customs Information System (NICIS)
  • This provides access to the import data of declaration of products with NAFDAC Regulated HS Codes.
  • The data obtained from NICIS is routinely processed in combination with data generated from Agency specific activities to enhance our operations.

Introduction

  • The Ports Inspection Data Capture and Risk Management System (PIDCARMS) was built with R Language and hosted online.
  • The many libraries available in R has enabled us to build a robust system that processes data, provides activity dashboards as well as intelligence reporting real-time to our officers on the field all over the country in order to improve our operations.
  • Data science has provided open source tools for processing our large datasets and generating useful information.

Introduction (Cont'd)

  • PIDCARMS captures and processes data generated from the following PID routine process:
    • Assessment/Invoicing
    • Payment Receipts Management
    • First Endorsement/Stamping
    • Violations Handling
    • Fast Track Scheduling
    • HOLD Assignment
    • Fast Track Inspection Reporting
    • Post-Clearance Audits
    • Statistical Reporting


Introduction (Cont'd)

  • Data processing is key function of the application. Enormous R codes used for cleaning raw data obtained from our different data sources are coded as helper functions that run when new data is uploaded for cleaning the data and storing them in our databases.
  • Text processing is performed, transaction classification is done using decision trees and some ML tools
  • Risk is computed at regular intervals with R code running as cron jobs on our servers and this guides our actions at the ports as well as our post clearance audit processes.

PIDCARMS R Libraries

The following are some of the libraries are employed for data processing.

  • library(tm)
  • library(quanteda)
  • library(Rpoppler)
  • library(dplyr)
  • library(stringr)
  • library(tidyr)
  • library(zoo)

The following libraries were used to build the web framework and interactivity of the application.

  • library(shiny)
  • library(shinythemes)
  • library(shinycssloaders)
  • library(shinyjs)
  • library(V8)
  • library(sendmailR)

PIDCARMS R Libraries (Cont'd)

The application also supports authentication of users and the following library was used to encrypt sensitive data

  • library(digest)

Persistent data storage for the shiny app was implemented with MariaDB in secured cloud virtual private servers and the following libraries were used to manage the DB interface and implement queries

  • library(RMySQL)
  • library(DBI)

PIDCARMS R Libraries (Cont'd)

Transactions are usually displayed in interactive tables achieved through the data table in the following library

  • library(DT)

The application also features dashboards that displays interactive plots implemented through the following libraries

  • library(plotly)
  • library(ggplot2)
  • library(ggfortify)

PIDCARMS Dashboards - Compliance monitor

PIDCARMS Dashboards - Activity Summary

PIDCARMS Dashboards - Activity Monitor

PIDCARMS: Benefits

Amongst many benefits, the deployment of the PIDCARMS for NAFDAC has led to

  • Improvement in client compliance to regulatory requirements for import of NAFDAC Regulated products.
  • Provision of comprehensive information for post clearance audits.
  • Improvement in accountability and transparency of clearance operations of NAFDAC Regulated Products

PIDCARMS: Challenges

  • Cost and competencies required to develop and maintain robust IT systems
    • Taking advantage of open source tools is a great way to leverage technology to improve operations internally in organizations.
  • The issues of false declarations as a means of evading regulation by unscrupulous importers make predictions from data unreliable.
  • The unavailability of clean datasets for training ML tools.
    • The data available can be cleaned and features carefully extracted from the datasets that may be used for prediction.

PIDCARMS: Propects

  • Data analysis to understand importers clearance behaviour and more accurately predict risk of individual imports so as to improve clearance operations.
  • Attempting to find trends that can predict risk from pre-declaration data can help detect false declarations early before they are actually done.

Some areas to consider can include:

  • Analysis of the product description
  • Consignee Details
  • Source of import
  • Details of transportation
  • Time intervals: arrival, declaration etc
  • Plausibility of declaration: type, size, weight etc.


Please Take Note

Find this Presentation Online at:

http://rpubs.com/jkayode/pidcarms