As shown in the diagram above, when content gets created on LinkedIn, we trigger classification within LinkedIn while at the same time triggering a classification request with Content Moderator via a different service that coordinates this system call. Once a response arrives from Content Moderator, the two answers are posted through our Kafka stream processing framework to result in the final classification of the content.
The next step was to incorporate LinkedIn’s classifiers into the Content Moderator service. The LinkedIn Relevance team primarily uses TensorFlow to create deep learning models. However, Cognitive Services uses the Microsoft Cognitive Tool Kit (CNTK) as its backbone for classification. The two libraries utilize different model specification formats, and a conversion from TensorFlow to CNTK was necessary. Fortunately, this turned out to be possible using the Model Management Deep Neural Network library that allows easy conversion between different deep learning libraries.
While converting these models from TensorFlow to CNTK, we needed to be confident that model behavior remained unchanged after conversion. In other words, we needed to ensure that the same image, when fed to the TensorFlow-formatted model or the CNTK one, resulted in the same model scores and labels. To ensure this, we spent the most amount of our time in testing.
While working with images (or any data for that matter), you have to ensure that preprocessing steps like image resizing and normalization operations are equivalent between the two model formats as well as to the model behavior. Without this, minor differences in such data preparation steps may lead to a significant score disparity between the different libraries. As a first integration, the testing was done manually by comparing scores output from the TensorFlow codebase and the CNTK codebase and making sure that they matched.
The final step was to ensure that the serving-time classification scores matched those we saw while running our classifiers offline on the same test images. While we confirmed this through manual verification, we plan to make sure that the two libraries integrate more seamlessly by writing common libraries for preprocessing, unit testing, and benchmarking the behavior of classifiers.
As follow-up work, we will need to ensure that as we scale up our integrations and onboard more classifiers on to Content Moderator, we will continue to meet classification latency requirements for the LinkedIn site, keep member data safe, and ensure seamless cross-platform diagnostics, tracking, and telemetry.
There are efforts already underway in several of these areas. We look forward to writing more blog posts in the months to come about the corresponding work.
Work we described here is part of a multi-team collaborative effort involving several organizations across LinkedIn and Microsoft. We would like to acknowledge the following leaders and their teams that empower UCF and Content Moderator services.
At LinkedIn, this includes the Trust Engineering team members, Chandramouli Mahadevan, Sachin Kakkar; Trust Product team members Karthik Viswanathan, Anindita Gupta, and Madhu Gupta; Tim Jurka from the Feed AI team, David Max from Content Ingestion, and Vivek Nandakumar from Trust and Safety.