A Scalable Approach to Reducing Gender Bias in Google Translate



Machine learning (ML) models for language translation can be skewed by societal biases reflected in their training data. One such example, gender bias, often becomes more apparent when translating between a gender-specific language and one that is less-so. For instance, Google Translate historically translated the Turkish equivalent of “He/she is a doctor” into the masculine form, and the Turkish equivalent of “He/she is a nurse” into the feminine form.

In line with Google’s AI Principles, which emphasizes the importance to avoid creating or reinforcing unfair biases, in December 2018 we announced gender-specific translations. This feature in Google Translate provides options for both feminine and masculine translations when translating queries that are gender-neutral in the source language. For this work, we developed a three-step approach, which involved detecting gender-neutral queries, generating gender-specific translations and checking for accuracy. We used this approach to enable gender-specific translations for phrases and sentences in Turkish-to-English and have now expanded this approach for English-to-Spanish translations, the most popular language-pair in Google Translate.
Left: Early example of the translation of a gender neutral English phrase to a gender-specific Spanish counterpart. In this case, only a biased example is given. Right: The new Translate provides both a feminine and a masculine translation option.
But as this approach was applied to more languages, it became apparent that there were issues in scaling. Specifically, generating masculine and feminine translations independently using a neural machine translation (NMT) system resulted in low recall, failing to show gender-specific translations for up to 40% of eligible queries, because the two translations often weren’t exactly equivalent, except for gender-related phenomena. Additionally, building a classifier to detect gender-neutrality for each source language was data intensive.

Today, along with the release of the new English-to-Spanish gender-specific translations, we announce an improved approach that uses a dramatically different paradigm to address gender bias by rewriting or post-editing the initial translation. This approach is more scalable, especially when translating from gender-neutral languages to English, since it does not require a gender-neutrality detector. Using this approach we have expanded gender-specific translations to include Finnish, Hungarian, and Persian-to-English. We have also replaced the previous Turkish-to-English system using the new rewriting-based method.

Rewriting-Based Gender-Specific Translation
The first step in the rewriting-based method is to generate the initial translation. The translation is then reviewed to identify instances where a gender-neutral source phrase yielded a gender-specific translation. If that is the case, we apply a sentence-level rewriter to generate an alternative gendered translation. Finally, both the initial and the rewritten translations are reviewed to ensure that the only difference is the gender.
Top: The original approach. Bottom: The new rewriting-based approach.
Rewriter
Building a rewriter involved generating millions of training examples composed of pairs of phrases, each of which included both masculine and feminine translations. Because such data was not readily available, we generated a new dataset for this purpose. Starting with a large monolingual dataset, we programmatically generated candidate rewrites by swapping gendered pronouns from masculine to feminine, or vice versa. Since there can be multiple valid candidates, depending on the context — for example the feminine pronoun “her” can map to either “him” or “his” and the masculine pronoun “his” can map to “her” or “hers” — a mechanism was needed for choosing the correct one. To resolve this tie, one can either use a syntactic parser or a language model. Because a syntactic parsing model would require training with labeled datasets in each language, it is less scalable than a language model, which can learn in an unsupervised fashion. So, we select the best candidate using an in-house language model trained on millions of English sentences.
This table demonstrates the data generation process. We start with the input, generate candidates and finally break the tie using a language model.
The above data generation process results in training data that goes from a masculine input to a feminine output and vice versa. We merge data from both these directions and train a one-layer transformer-based sequence-to-sequence model on it. We introduce punctuation and casing variants in the training data to increase the model robustness. Our final model can reliably produce the requested masculine or feminine rewrites 99% of the time.

Evaluation
We also devised a new method of evaluation, named bias reduction, which measures the relative reduction of bias between the new translation system and the existing system. Here “bias” is defined as making a gender choice in the translation that is unspecified in the source. For example, if the current system is biased 90% of the time and the new system is biased 45% of the time, this results in a 50% relative bias reduction. Using this metric, the new approach results in a bias reduction of ≥90% for translations from Hungarian, Finnish and Persian-to-English. The bias reduction of the existing Turkish-to-English system improved from 60% to 95% with the new approach. Our system triggers gender-specific translations with an average precision of 97% (i.e., when we decide to show gender-specific translations we’re right 97% of the time).
We’ve made significant progress since our initial launch by increasing the quality of gender-specific translations and also expanding it to 4 more language-pairs. We are committed to further addressing gender bias in Google Translate and plan to extend this work to document-level translation, as well.

Acknowledgements:
This effort has been successful thanks to the hard work of many people, including, but not limited to the following (in alphabetical order of last name): Anja Austermann, Jennifer Choi‎, Hossein Emami, Rick Genter, Megan Hancock, Mikio Hirabayashi‎, Macduff Hughes, Tolga Kayadelen, Mira Keskinen, Michelle Linch, Klaus Macherey‎, Gergely Morvay, Tetsuji Nakagawa, Thom Nelson, Mengmeng Niu, Jennimaria Palomaki‎, Alex Rudnick, Apu Shah, Jason Smith, Romina Stella, Vilis Urban, Colin Young, Angie Whitnah, Pendar Yousefi, Tao Yu

Source: Google AI Blog


YouTube Originals announces slate of new content amidst COVID-19 #WithMe initiatives

YouTube Originals today announced a new slate of projects aimed to support, entertain and educate viewers around the world. Among the announcements, celebrities and educators come together to energize distance learning in “Celebrity Substitute” including Karlie Kloss working through a coding problem and Ken Jeong giving a Biology lesson; a weekly series “Stay Home With: YUNGBLUD,” following the UK recording artist and his band as they adjust to a remote lifestyle while creating music; a short-form family series, “Create Together #WithMe,” hosted by Joseph Gordon-Levitt featuring the creations of everyday people collaborating to make art on HITRECORD and YouTube while being at home; and “The Secret Life of Lele Pons” which gives an intimate look at battling Tourette Syndrome and OCD while juggling life in the spotlight.

In addition, engaging new content will come directly from notable YouTube personalities who will be able to leverage the global platform’s quality livestream capabilities from a safe space. Kicking off this new wave of content is a first-of-its-kind global live event, "The Creator Games Presented by MrBeast," hosted by top Creator and philanthropist MrBeast (34M subscribers) on April 25, where he will challenge some of the platform’s biggest stars to remotely go head-to-head in a battle of stay-at-home games where there can be only one winner. The proceeds will go to a COVID-19-related charitable organization.

"YouTube’s greatest strength is its ability as a global platform to build community and connection among people from all walks of life,” said Susanne Daniels, Global Head of Original Content for YouTube. "We’re working to develop exciting new original content that is relevant, useful, and entertaining in order to deepen those connections and give people an outlet to come together."

Also, as part of YouTube’s continued commitment to families, beginning in May, several new kids & family Originals will launch and be available on YouTube and YouTube Kids. These new Originals will help inspire kids’ curiosity, creativity, resourcefulness and resiliency during these unusual times.

Below is the current list of planned new Originals rolling out within the next few months:

"Money Talks: Taxes" — Streaming now!


In this new Learning Playlist, a roundtable of leading female financial experts provide answers to the questions surrounding personal finances that we are all desperate to know. Offering a step by step guide for viewers, this first series of videos covers pressing questions about filing taxes and the COVID-19 stimulus check. “Money Talks” is produced by Refinery29.

"The Creator Games Presented by MrBeast" — Live stream premieres April 25 at 6:00 p.m. ET / 3:00 p.m. PT


A global LIVE event where popular YouTube creator, MrBeast (34M subscribers), challenges the platform’s biggest stars to remotely go head-to-head in a first-of-its-kind battle of stay-at-home games where there can be only one winner. “The Creator Games Presented by MrBeast” will encourage viewers to donate to support COVID-19-related charitable organizations and is produced by Night Media and Fly On the Wall.

"Stay Home With: YUNGBLUD" — Series premieres April 27


This weekly episodic series follows UK recording artist, YUNGBLUD, through a month at a rental apartment in L.A. Along with four friends - his manager, videographer and two bandmates with whom he is quarantined - YUNGBLUD attempts to shoot a music video, write new songs, cook meals and stay connected to his UK-based family and avid global fanbase, all within the disconcerting shelter-at-home restrictions. “Stay Home With: YUNGBLUD” will encourage viewers to donate to support No Kid Hungry and is produced by Stick Figure Entertainment.

"#MoveWithMe" — Global Dance Event premieres April 29


In celebration of International Dance Day (April 29), this special will feature acclaimed choreographer Matt Steffanina as host, and talented dancers and choreographers from across the globe as they come together to provide dance-lovers with high octane performances to today’s chart topping songs in a way that can only be done on YouTube. Choreographers and dancers including LaurieAnn Gibson, WilldaBeast Adams, Chachi Gonzales, Kasia Jukowska, Vale Merino, Sonali Bhadauria, FitDance, Kaelynn KK Harris, Twist And Pulse, D-trix and more will be featured. “#MoveWithMe” will encourage viewers to donate to support the COVID-19 Solidarity Response Fund for WHO during the event and is produced by Den of Thieves.

"Stream #WithMe (UK)" — Live stream premieres April 30


In “Stream #WithMe”, a star-studded crew of some of the UK’s most loved YouTube creators and stars let us in on how they are coping with the lockdown experience in a livestream celebration of solidarity. The all-star group of creators and celebrities will share tips on how to keep entertained, upbeat, and active as they tag-team their way through four hours of joyful unexpected performances and exciting challenges culminating in an almighty stunt for the nation. “Stream #WithMe" will encourage viewers to donate to support NHS Charities Together and is made in partnership with Electric Robin (part of EndemolShine UK).

"Celebrity Substitute" — Series premieres May 7


Around the world, millions of students are joining virtual classrooms as part of the current distance learning initiative and teachers are looking for ways to keep their students engaged and focused to stay on target with their curriculum. In this series, some of the brightest celebrities and educators come together to energize distance learning. In each episode, a celebrity steps in to teach crucial high school lessons with real teachers. Some examples include Karlie Kloss working through a coding problem, or Ken Jeong giving a biology lesson that will be remembered for years to come. Additional celebrity substitutes include: Bill Nye, Camila Mendes, Janelle Monáe, and Terry Crews. “Celebrity Substitute” is produced by B17 Entertainment.

"The Secret Life of Lele Pons" — Series premieres May 19


In this raw and intimate five-part series, internet personality and music artist Lele Pons shares a side to her that no one knows about… Her lifelong struggle with Tourette Syndrome and OCD. Viewers will follow along on her journey of building and expanding her music career while battling what was previously hidden. Link to official trailer HERE. “The Secret Life of Lele Pons” is a Shots Studios Production.

"BookTube - Read with Me Special and Mental Health Episode" — Premieres May 21 and June 2020


The critically-acclaimed monthly book club, “BookTube,” is creating a special “Read With Me” episode premiering May 21. Now more than ever, people around the world are turning to books to help them feel connected. This special episode will feature several celebrities, booktubers, and authors - including Melinda Gates, John Grisham, James Patterson, Elizabeth Gilbert, Nicholas Sparks, Elaine Welteroth, and many more - sharing their current book recommendations. Additionally, the June 2020 episode of “BookTube” will feature authors Dr. Vivek Murthy, former U.S. Surgeon General (author of Together: The Healing Power of Human Connection in a Sometimes Lonely World), Lori Gottlieb (author of Maybe You Should Talk to Someone) and Haemin Sunim (author of The Things You Can Only See When You Slow Down) discussing anxiety, mental health, and advice for self care during these uncertain times. “BookTube” is produced by Boardwalk Pictures.

"Create Together #WithMe" (working title) — Series premieres May 2020


This mini-series, hosted by Joseph Gordon-Levitt, invites friends and families from all over the world who are coping with this unprecedented time of isolation to come together and showcase their creativity and collaboration. Rather than profiling lone artists and showcasing their finished work, each weekly episode will document the creative process as people find each other online and remotely collaborate on a variety of family friendly projects—short films, short documentaries, music videos, and more. Anybody can come be a part of the show on HITRECORD, Gordon-Levitt’s Emmy-winning platform for creative collaboration. “Create Together #WithMe” is produced by Brian Graden Media and HITRECORD.

"Locked Down" (working title) — Scripted series premieres May 2020


A social media mystery in a social distancing era! This scripted event series follows a group of bored teens working together online to solve a mystery involving one of their neighbors. Shot entirely via webcam and smartphone, “Locked Down” is a suspenseful look at how young people stay in touch while having to stay away, as well as what happens when boredom leads to suspicion. The story unfolds almost in real-time as the friend group works together - from a distance - to solve the mystery, while also exploring their own anxieties and frustrations about life during a pandemic. “Locked Down” is created and produced by Toronto-based Sinking Ship Entertainment (Dino Dana, Endlings, Odd Squad).

"Untitled Juanpa and Luisito Project" (LATAM) — Series premieres May 2020


Latin America’s top YouTube creators Juanpa Zurita (10.2M subscribers) and Luisito Communica (30.6M subscribers) come together for the first time to document an unprecedented situation (COVID-19 quarantine) in an unprecedented way. Filmed entirely under quarantine with no physical interaction, viewers will hear first hand personal stories from around the globe, including YouTube creators, health specialists, and everyday people as they reflect on their reality. Their challenges, their hopes, their solutions, their stories of inspiration and most importantly the resilience of human nature. This limited series will give a voice to individuals around the globe to unify us regardless of region or language. This project is produced by DW Entertainment & Media.

These new projects join a robust slate of learning, music and personality-focused original series and specials including “Kevin Hart: What the Fit,” (new episodes premiere each Thursday), YouTube Originals’ first beauty competition series, “Instant Influencer with James Charles” (premiering April 24), “TWICE: Seize the Light,” an 8-part docu-series on the K-pop girl group (premiering April 29 KST) and “Dude Perfect: Backstage Pass” chronicling the YouTube supergroup’s rise to fame (premiering May 11). Personality-driven projects including third seasons of hit scripted series “Cobra Kai” and “Liza on Demand,” “This is Paris” starring Paris Hilton and an unprecedented live event with David Blaine are scheduled to come later this year.

As part of YouTube Originals’ programming strategy, YouTube’s audience of two billion logged-in monthly users will continue to have the opportunity to enjoy new, upcoming original series and specials, focused on music, learning, personalities and kids & families, for free with ads. YouTube’s subscription service, YouTube Premium, will continue to offer ad-free access to all YouTube Originals as well as bingeabilty and exclusive content for select programs behind the paywall.

This news comes on the heels of YouTube’s recent announcements to release popular legacy and kids & family original content in front of the paywall, and the larger global initiative to encourage the world to stay home and save lives through the platform’s At Home #WithMe campaign. The campaign expands upon #WithMe -- a trend continuing to grow on YouTube over the past 15 years -- showcasing how people all around the world find community and engage with one another, especially during this time of crisis. From Emma Chamberlain, Markiplier and The Dolan Twins, to Karlie Kloss, Venus Williams, Sam Smith, Shawn Mendes, Hailee Steinfeld, J Balvin and many more, the campaign features YouTube creators, music artists, athletes and celebrities who have all made a home on YouTube.

Source: YouTube Blog


What you need to know about Device Admin deprecation

Android 10 delivered many helpful features for enterprise admins and users. It also marked the official deprecation of Device Admin-based management, a legacy form of Android management. 


Since our original announcement about this change in 2017 we’ve been encouraging customers to adopt Android Enterprise, which offers a modern management framework for the evolving needs of enterprise customers.


While Android 10 marks the official deprecation of Device Admin, some customers may still be on the legacy management framework because either their devices are not yet upgraded to Android 10 or their Enterprise Mobility Management (EMM) Device Policy Controller is not updated to API level 29. 


However, when Android 11 launches later this year, it is expected EMMs will need to update their DPCs to API level 29 by the fourth quarter of 2020. When this occurs, admins will no longer be able to manage lock screen settings, passwords or disable the camera.


We’ve created a new video that outlines many of the key changes that IT admins can expect and strategies to prepare for a transition to Android Enterprise.

To assist customers with this migration, we’ve created the Android Enterprise Migration Bluebook, which provides detailed steps and best practices for moving from a legacy Device Admin deployment to Android Enterprise. We also encourage reaching out to your organization’s EMM provider for assistance with planning.


For further assistance with your mobility efforts, check out our Android OnAir webinar series where you can hear our experts discuss mobility topics and strategies for using Android to transform your business.

Present high-quality video and audio in Google Meet

What’s changing 

You can now share higher-quality video with audio content in a Meet video call. You can do this through a new present a Chrome tab feature. Now, when you use this feature with video content playing, everyone in the meeting will see and hear the video and audio being shared. This means you can confidently use videos, gifs, animations, and other media in your meetings.

Who’s impacted 

End users

Why it matters 

Videos can be a critical part of meetings and presentations. As more meetings are taking place online, it’s important that presenters can share smooth videos with audio to all attendees, wherever they are. Situations where you may benefit from high-quality video and audio in presentations include:

  • A business meeting to review promotional videos. 
  • An engineering meeting to share pre-recorded product or feature demonstrations. 
  • Teachers sharing videos as part of a lesson plan to students.
  • Presenting slides with embedded videos or GIFs, or with animated transitions between slides. 

Additionally, by adding the ability to present a tab rather than a window or your full screen, we’re providing more control to presenters to make sure they can minimize distractions while they’re presenting.

Additional details 


Present a tab and easily switch between tabs 
With this launch you can now present an individual Chrome tab. When you present a tab, it will be highlighted so you can clearly see which one you’re presenting. If you change your view to a new tab, a pop-up will ask if you want to switch to presenting the new tab or keep presenting the previous tab, making it easy to move between tabs and control what information you share with the meeting. 

Use “present a tab” to share high-quality video and audio 
The high-quality video and audio playback only works when you present an individual tab feature in Chrome (see above) on desktop devices. It does not work if you’re presenting a full window or your whole screen.

Upgrading previous Meet video presentation experience 
Until now, users have been able to play video while presenting in Meet, but may have noticed choppy playback and no audio. Some users chose to use the Cast feature to present audio and video, but that had several limitations as well. This launch will mean users can avoid workarounds and limitations and easily include high-quality video in their meetings.

Users can already present high-quality audio and video to meetings using an HDMI cable with some Meet hardware kits. This will continue to work.

Getting started 

Admins: This feature will be ON by default. There is no admin control for this feature. You may want to review your organization’s Meet video settings.

End users: Visit the Help Center to learn more about presenting videos during meetings.

Rollout pace 


  • This feature is already available for all users. 

Availability 


  • Available to all G Suite customers 

Resources 



Roadmap 


See up to 16 Google Meet participants at once with tiled layout

What’s changing

You can now see up to 16 people at the same time in the tile layout option in Google Meet.
See up to 16 other meeting participants in the tiled layout

Who’s impacted

End users

Why you’d use it

Seeing more people at the same time can help improve the dynamics of larger group meetings and classes. Whether it's seeing everyone's reactions to what's being discussed, or more easily tracking multiple speakers, it can help remote meetings feel more like in-person meetings and encourage participation.

We hope that this helps individuals and teams feel more connected while apart.

Additional details

The layout will adjust to show active speakers. If you’re in a meeting with more than 16 other people, there’s an option to open the list of participants and see who else is in the meeting. As a reminder, all G Suite customers can host meetings with up to 250 participants through September 30, 2020.

This feature is currently only available in Meet on the web. More updates are coming for larger meetings, better presentation layouts, and support across more devices.

Getting started

Admins: There is no admin control for this feature.

End users: To use the tiled layout in a meeting, follow the instructions in the Help Center.

Rollout pace



Availability


  • Available to all G Suite customers

Resources


Findings on COVID-19 and online security threats

Google’s Threat Analysis Group (TAG) is a specialized team of security experts that works to identify, report, and stop government-backed phishing and hacking against Google and the people who use our products. We work across Google products to identify new vulnerabilities and threats. Today we’re sharing our latest findings and the threats we’re seeing in relation to COVID-19.


COVID-19 as general bait

Hackers frequently look at crises as an opportunity, and COVID-19 is no different. Across Google products, we’re seeing bad actors use COVID-related themes to create urgency so that people respond to phishing attacks and scams. Our security systems have detected examples ranging from fake solicitations for charities and NGOs, to messages that try to mimic employer communications to employees working from home, to websites posing as official government pages and public health agencies. Recently, our systems have detected 18 million malware and phishing Gmail messages per day related to COVID-19, in addition to more than 240 million COVID-related daily spam messages. Our machine learning models have evolved to understand and filter these threats, and we continue to block more than 99.9 percent of spam, phishing and malware from reaching our users.

How government-backed attackers are using COVID-19

TAG has specifically identified over a dozen government-backed attacker groups using COVID-19 themes as lure for phishing and malware attempts—trying to get their targets to click malicious links and download files.
Location of users targeted by government-backed COVID-19 related attacks

Location of users targeted by government-backed COVID-19 related attacks

One notable campaign attempted to target personal accounts of U.S. government employees with phishing lures using American fast food franchises and COVID-19 messaging. Some messages offered free meals and coupons in response to COVID-19, others suggested recipients visit sites disguised as online ordering and delivery options. Once people clicked on the emails, they were presented with phishing pages designed to trick them into providing their Google account credentials. The vast majority of these messages were sent to spam without any user ever seeing them, and we were able to preemptively block the domains using Safe Browsing. We’re not aware of any user having their account compromised by this campaign, but as usual, we notify all targeted users with a “government-backed attacker” warning.

We’ve also seen attackers try to trick people into downloading malware by impersonating health organizations:

attackers impersonating health organizations

International and national health organizations are becoming targets 

Our team also found new, COVID-19-specific targeting of international health organizations, including activity that corroborates reporting in Reuters earlier this month and is consistent with the threat actor group often referred to as Charming Kitten. The team has seen similar activity from a South American actor, known externally as Packrat, with emails that linked to a domain spoofing the World Health Organization’s login page. These findings show that health organizations, public health agencies, and the individuals who work there are becoming new targets as a result of COVID-19. We're proactively adding extra security protections, such as higher thresholds for Google Account sign in and recovery, to more than 50,000 of such high-risk accounts.
Contact message from Charming Kitten and packrat phishing page

Left: Contact message from Charming Kitten. Right: Packrat phishing page

Generally, we’re not seeing an overall rise in phishing attacks by government-backed groups; this is just a change in tactics. In fact, we saw a slight decrease in overall volumes in March compared to January and February. While it’s not unusual to see some fluctuations in these numbers, it could be that attackers, just like many other organizations, are experiencing productivity lags and issues due to global lockdowns and quarantine efforts.

Accounts that received a “government-backed attacker” warning in 2020

Accounts that received a “government-backed attacker” warning each month of 2020

When working to identify and prevent threats, we use a combination of internal investigative tools, information sharing with industry partners and law enforcement, as well as leads and intelligence from third-party researchers. To help support this broader security researcher community, Google is providing more than $200,000 in grants as part of a new Vulnerability Research Grant COVID-19 fund for Google VRP researchers who help  identify various vulnerabilities.


As the world continues to respond to COVID-19, we expect to see new lures and schemes. Our teams continue to track these and stop them before they reach people—and we’ll continue to share new and interesting findings.


MediaPipe KNIFT: Template-based Feature Matching

Posted by Zhicheng Wang and Genzhi Ye, MediaPipe team

Image Feature Correspondence with KNIFT

In many computer vision applications, a crucial building block is to establish reliable correspondences between different views of an object or scene, forming the foundation for approaches like template matching, image retrieval and structure from motion. Correspondences are usually computed by extracting distinctive view-invariant features such as SIFT or ORB from images. The ability to reliably establish such correspondences enables applications like image stitching to create panoramas or template matching for object recognition in videos (see Figure 1).

Today, we are announcing KNIFT (Keypoint Neural Invariant Feature Transform), a general purpose local feature descriptor similar to SIFT or ORB. Likewise, KNIFT is also a compact vector representation of local image patches that is invariant to uniform scaling, orientation, and illumination changes. However unlike SIFT or ORB, which were engineered with heuristics, KNIFT is an embedding learned directly from a large number of corresponding local patches extracted from nearby video frames. This data driven approach implicitly encodes complex, real-world spatial transformations and lighting changes in the embedding. As a result, the KNIFT feature descriptor appears to be more robust, not only to affine distortions, but to some degree of perspective distortions as well. We are releasing an implementation of KNIFT in MediaPipe and a KNIFT-based template matching demo in the next section to get you started.

Figure 1: Matching a real Stop Sign with a Stop Sign template using KNIFT.

Training Method

In Machine Learning, loosely speaking, training an embedding means finding a mapping that can translate a high dimensional vector, such as an image patch, to a relatively lower dimensional vector, such as a feature descriptor. Ideally, this mapping should have the following property: image patches around a real-world point should have the same or very similar descriptors across different views or illumination changes. We have found real world videos a good source of such corresponding image patches as training data (See Figure 3 and 4) and we use the well-established Triplet Loss (see Figure 2) to train such an embedding. Each triplet consists of an anchor (denoted by a), a positive (p), and a negative (n) feature vector extracted from the corresponding image patches, and d() denotes the Euclidean distance in the feature space.

Figure 2: Triplet Loss Function.

Figure 2: Triplet Loss Function.

Training Data

The training triplets are extracted from all ~1500 video clips in the publicly available YouTube UGC Dataset. We first use an existing heuristically-engineered local feature detector to detect keypoints and compute the affine transform between two frames with a high accuracy (see Figure 4). Then we use this correspondence to find keypoint pairs and extract the patches around these keypoints. Note that the newly identified keypoints may include those that were detected but rejected by geometric verification in the first step. For each pair of matched patches, we randomly apply some form of data augmentation (e.g. random rotation or brightness adjustment) to construct the anchor-positive pair. Finally, we randomly pick an arbitrary patch from another video as the negative to finish the construction of this triplet (see Figure 5).

Figure 3: An example video clip from which we extract training triplets.

Figure 4: Finding frame correspondence using existing local features.

Figure 5: (Top to bottom) Anchor, positive and negative patches.

Hard-negative Triplet Mining

To improve model quality, we use the same hard-negative triplet mining method used by FaceNet training. We first train a base model with randomly selected triplets. Then we implement a pipeline that uses the base model to find semi-hard-negative samples (d(a,p) < d(a,n) < d(a,p)+margin) for each anchor-positive pair (Figure 6). After mixing the randomly selected triplets and hard-negative triplets, we re-train the model with this improved data.

Figure 6: (Top to bottom) Anchor, positive and semi-hard negative patches.

Model Architecture

From model architecture exploration, we have found that a relatively small architecture is sufficient to achieve decent quality, so we use a lightweight version of the Inception architecture as the KNIFT model backbone. The resulting KNIFT descriptor is a 40-dimensional float vector. For more model details, please refer to the KNIFT model card.

Benchmark

We benchmark the KNIFT model inference speed on various devices (computing 200 features) and list them in Table 1.

Table 1: KNIFT performance benchmark.

Table 1: KNIFT performance benchmark.

Quality-wise, we compare the average number of keypoints matched by KNIFT and by ORB (OpenCV implementation) respectively on an in-house benchmark (Table 2). There are many publicly available image matching benchmarks, e.g. 2020 Image Matching Benchmark, but most of them focus on matching landmarks across large perspective changes in relatively high resolution images, and the tasks often require computing thousands of keypoints. In contrast, since we designed KNIFT for matching objects in large scale (i.e. billions of images) online image retrieval tasks, we devised our benchmark to focus on low cost and high precision driven use cases, i.e. 100-200 keypoints computed per image and only ~10 matching keypoints needed for reliably determining a match. In addition, to illustrate the fine-grained performance characteristics of a feature descriptor, we divide and categorize the benchmark set by object types (e.g. 2D planar surface) and image pair relations (e.g. large size difference). In table 2, we compare the average number of keypoints matched by KNIFT and by ORB respectively in each category, based on the same 200 keypoint locations detected in each image by the oFast detector that comes with the ORB implementation in OpenCV.

Table 2: KNIFT vs ORB average number of matched keypoints.

From Table 2, we can see that KNIFT consistently matches more keypoints than ORB by a large margin in every category. Here we acknowledge the fact that KNIFT (40-d float) is considerably larger than ORB (32-d char) and this can have an effort on matching quality. Nevertheless, most local feature benchmarks do not take descriptor size into account so we will follow the convention here.

To make it easy for developers to try KNIFT in MediaPIpe, we have built a local-feature-based template matching solution (see implementation details using MediaPipe in the next section). As a side effect, we can demonstrate the matching quality between KNIFT and ORB visually in side-by-side comparisons like Figure 7 and 9.

Figure 7: Example of “matching 2D planar surface”. (Left) KNIFT 183/240, (Right) ORB 133/240.

In Figure 7, we choose a typical U.S. Stop Sign image from Google Image Search as the template and attempt to match it with the Stop Sign in this video. This example falls into the “matching 2D planar surface” category in Table 2. Using the same 200 keypoint locations detected by oFast and the same RANSAC setting, we show that KNIFT is successful at matching the Stop Sign in 183 frames out of a total of 240 frames. In comparison, ORB matches 133 frames.

Figure 8: Example of “matching 3D untextured object”. Two template images from different views.

Figure 9: Example of “matching 3D untextured object”. (Left) KNIFT 89/150, (Right) ORB 37/150.

Figure 9 shows another matching performance comparison on an example from the “matching 3D untextured object” category in Table 2. Since this example involves large perspective changes of untextured surfaces, which is known to be challenging for local feature descriptors, we use template images from two different views (shown in Figure 8) to improve the matching performance. Again, using the same keypoint locations and RANSAC setting, we show that KNIFT is successful at matching 89 frames out of a total of 150 frames while ORB matches 37 frames.

KNIFT-based Template Matching in MediaPipe

We are releasing the aforementioned template matching solution based on KNIFT in MediaPipe, which is capable of identifying pre-defined image templates and precisely localizing recognized templates on the camera image. There are 3 major components in the template-matching MediaPipe graph shown below:

  • FeatureDetectorCalculator: a calculator that consumes image frames and performs OpenCV oFast detector on the input image and outputs keypoint locations. Moreover, this calculator is also responsible for cropping patches around each keypoint with rotation and scale info and stacking them into a vector for the downstream calculator to process.
  • TfLiteInferenceCalculator with KNIFT model: a calculator that loads the KNIFT tflite model and performs model inference. The input tensor shape is (200, 32, 32, 1), indicating 200 32x32 local patches. The output tensor shape is (200, 40), indicating 200 40-dimensional feature descriptors. By default, the calculator runs the TFLite XNNPACK delegate, but users have the option to select the regular CPU delegate to run at a reduced speed.
  • BoxDetectorCalculator: a calculator that takes pre-computed keypoint locations and KNIFT descriptors and performs feature matching between the current frame and multiple template images. The output of this calculator is a list of TimedBoxProto, which contains the unique id and location of each box as a quadrilateral on the image. Aside from the classic homography RANSAC algorithm, we also apply a perspective transform verification step to ensure that the output quadrilateral does not result in too much skew or a weird shape.

Figure 10: MediaPipe graph of the demo

Demo

In this demo, we chose three different denominations ($1, $5, $20) of U.S. dollar bills as templates and attempted to match them to various real world dollar bills in videos. We resized each input frame to 640x480 pixels, ran the oFast detector to detect 200 keypoints, and used KNIFT to extract feature descriptors from each 32x32 local image patch surrounding these keypoints. We then performed template matching between these video frames and the KNIFT features extracted from the dollar bill templates. This demo runs at 20 FPS on a Pixel 2 Phone CPU with XNNPACK.

Figure 11: Matching different U.S. dollar bills using KNIFT.

Build Your Own Templates

We have provided a set of built-in planar templates in our demo. To make it easy for users to try their own templates, we also provide a tool to build such an index with user generated templates. index_building.pbtxt is a MediaPipe graph that accepts as its input a directory path containing a set of template images. Users can use this graph to compute KNIFT descriptors for all template images (which will be stored in a single file) by 1) replacing the index_proto_filename field in the main graph and the BUILD file and 2) rebuilding the APK file. For step-by-step instructions on how we created the dollar bill demo shown above, please refer to this documentation.

Acknowledgements

We would like to thank Jiuqiang Tang, Chuo-Ling Chang, Dan Gnanapragasam‎, Howard Zhou, Jianing Wei and Ming Guang Yong for contributing to this blog post.

Stay entertained and informed from home

While spending more time at home, you might find yourself re-watching your favorite classics, doing game nights with the family and catching up on the TV shows you've been missing. From staying informed on the latest news to tuning in to weekly podcasts or finding what to watch, here are a few ideas to keep your whole family entertained while at home:

A faster way to news and entertainment

Many of us are turning to our TVs to stay up to date and entertained while we stay in. To access fresh news and fun entertainment quickly, you’ll now find three new rows from YouTube right on your Android TV home screen:

  • COVID-19 Newsgives you the latest from authoritative publishers and local health authorities to help you stay informed.
  • Stay Home #WithMe features videos that invite you to cook, listen to live music and work out, so you can stay connected, even if you’re home alone.
  • Free movies from YouTube highlights movies you can watch for free with ads, so that you can find something new.
Android-TV-News-Channel.png

Stay informed and entertained with three new rows from YouTube on the Android TV home screen.

Create your own Watchlist in Search

When you’re deciding on a TV show or movie to watch, there are a lot of options out there. And figuring out what content is available across all your subscriptions can be time consuming and overwhelming. You can already find TV and movie recommendations in Search and today we’re adding a new Watchlist tab on mobile, so that you can keep track of what to watch next.

Browse through personalized recommendations by searching “what to watch.” Then, simply tap “Watchlist” in the preview window for any show or movie to add it to your list. You can navigate between your recommendations and the “Watchlist” tab so you won’t lose track of what’s already been saved. You can also add content to your Watchlist whenever you search for a show or movie. To quickly access your full watchlist, search for “my watchlist” or tap on Collections in the Google app.

PIXEL-3_watchlist-1.png

Keep track of what to watch next with the new Watchlist in Search.

Entertainment deals you won’t want to miss

Google Play also has a collection of special deals including offers on apps for movies, TV and comics and fun ways to learn something new. If you’re looking to game with friends, you can #PlayApartTogether and explore these multiplayer games. For a throwback option, we’ve compiled a few retro arcade games to bring back childhood memories. In the U.S., we’ve also extended the free trial for Google Play Pass to 30 days to give you and your family more time to enjoy games and apps without ads or in-app purchases.
Group 3.png

Browse games to #PlayApartTogether with family and friends.

If you’re looking for apps on your big screen, Google Play is adding more collections to Android TV. Your favorite streaming apps are now organized in one row under “Stream the shows and movies you love.” You can also pick up a new hobby or skill with TV apps under “Learn new things.” If gaming on the TV is more your style, you can now find games to “Play with your remote” and “Play with your gamepad.”

Play-Games-Collections (1).png

Find games and apps in Google Play’s collections on Android TV.

We’re offering gamers in 14 countries free access to Stadia Pro for two months, which includes instant access to nine games, including GRID, Destiny 2: The Collection and Thumper. If you’re already a paid Stadia Pro subscriber, you won’t be charged for the next two months.

Get a little help using just your voice

And whether you want to catch up on your favorite podcast or you want to spend some quality time with family or roommates, Google Assistant and Nest have got you covered. 

  • Game night:If you’re looking for trivia or quiz games to play, just say, “Hey Google, let’s play a game.” Or if you already know what you want to play, say, “Hey Google, play Are You Feeling Lucky.”

  • Kick back with a podcast:Search interest in “podcasts” hit an all-time high, worldwide. Ask Google Assistant for a particular podcast by saying, “Hey Google, play [podcast name]” or it will pick one for you if you say “Hey Google, find me a podcast about cooking.” If you have a Nest Mini, Nest Hub or Nest Hub Max, the Ambient IQ feature will automatically adjust the volume when there's background noise.

  • View your home movies easily:Watch videos and slideshows you’ve made in Google Photos using Chromecast. From the Google Photos app you can send videos and pictures to your TV by tapping the cast icon. With a Google Nest speaker you can simply ask, “Hey Google, show my 2018 summer vacation video on my TV.”

Lifestyle_Chromecast_Family_Shot_24_EH-0086_noblur_rgb.png

Ask Google Assistant to cast your family photos and videos to your TV.

These updates and features are already available or coming this week. Check them out to keep the whole family entertained at home.

Source: Search


Stay entertained and informed from home

While spending more time at home, you might find yourself re-watching your favorite classics, doing game nights with the family and catching up on the TV shows you've been missing. From staying informed on the latest news to tuning in to weekly podcasts or finding what to watch, here are a few ideas to keep your whole family entertained while at home:

A faster way to news and entertainment

Many of us are turning to our TVs to stay up to date and entertained while we stay in. To access fresh news and fun entertainment quickly, you’ll now find three new rows from YouTube right on your Android TV home screen:

  • COVID-19 Newsgives you the latest from authoritative publishers and local health authorities to help you stay informed.
  • Stay Home #WithMe features videos that invite you to cook, listen to live music and work out, so you can stay connected, even if you’re home alone.
  • Free movies from YouTube highlights movies you can watch for free with ads, so that you can find something new.
Android-TV-News-Channel.png

Stay informed and entertained with three new rows from YouTube on the Android TV home screen.

Create your own Watchlist in Search

When you’re deciding on a TV show or movie to watch, there are a lot of options out there. And figuring out what content is available across all your subscriptions can be time consuming and overwhelming. You can already find TV and movie recommendations in Search and today we’re adding a new Watchlist tab on mobile, so that you can keep track of what to watch next.

Browse through personalized recommendations by searching “what to watch.” Then, simply tap “Watchlist” in the preview window for any show or movie to add it to your list. You can navigate between your recommendations and the “Watchlist” tab so you won’t lose track of what’s already been saved. You can also add content to your Watchlist whenever you search for a show or movie. To quickly access your full watchlist, search for “my watchlist” or tap on Collections in the Google app.

PIXEL-3_watchlist-1.png

Keep track of what to watch next with the new Watchlist in Search.

Entertainment deals you won’t want to miss

Google Play also has a collection of special deals including offers on apps for movies, TV and comics and fun ways to learn something new. If you’re looking to game with friends, you can #PlayApartTogether and explore these multiplayer games. For a throwback option, we’ve compiled a few retro arcade games to bring back childhood memories. In the U.S., we’ve also extended the free trial for Google Play Pass to 30 days to give you and your family more time to enjoy games and apps without ads or in-app purchases.
Group 3.png

Browse games to #PlayApartTogether with family and friends.

If you’re looking for apps on your big screen, Google Play is adding more collections to Android TV. Your favorite streaming apps are now organized in one row under “Stream the shows and movies you love.” You can also pick up a new hobby or skill with TV apps under “Learn new things.” If gaming on the TV is more your style, you can now find games to “Play with your remote” and “Play with your gamepad.”

Play-Games-Collections (1).png

Find games and apps in Google Play’s collections on Android TV.

We’re offering gamers in 14 countries free access to Stadia Pro for two months, which includes instant access to nine games, including GRID, Destiny 2: The Collection and Thumper. If you’re already a paid Stadia Pro subscriber, you won’t be charged for the next two months.

Get a little help using just your voice

And whether you want to catch up on your favorite podcast or you want to spend some quality time with family or roommates, Google Assistant and Nest have got you covered. 

  • Game night:If you’re looking for trivia or quiz games to play, just say, “Hey Google, let’s play a game.” Or if you already know what you want to play, say, “Hey Google, play Are You Feeling Lucky.”

  • Kick back with a podcast:Search interest in “podcasts” hit an all-time high, worldwide. Ask Google Assistant for a particular podcast by saying, “Hey Google, play [podcast name]” or it will pick one for you if you say “Hey Google, find me a podcast about cooking.” If you have a Nest Mini, Nest Hub or Nest Hub Max, the Ambient IQ feature will adjust the volume for you.

  • View your home movies easily:Watch videos and slideshows you’ve made in Google Photos using Chromecast. From the Google Photos app you can send videos and pictures to your TV by tapping the cast icon. With a Google Nest speaker you can simply ask, “Hey Google, show my 2018 summer vacation video on my TV.”

Lifestyle_Chromecast_Family_Shot_24_EH-0086_noblur_rgb.png

Ask Google Assistant to cast your family photos and videos to your TV.

These updates and features are already available or coming this week. Check them out to keep the whole family entertained at home.

Our data centers now work harder when the sun shines and wind blows

Addressing the challenge of climate change demands a transformation in how the world produces and uses energy. Google has been carbon neutral since 2007, and 2019 marks the third year in a row that we’ve matched our energy usage with 100 percent renewable energy purchases. Now, we’re working toward 24x7 carbon-free energy everywhere we have data centers, which deliver our products to billions of people around the world. To achieve 24x7 carbon-free energy, our data centers need to work more closely with carbon-free energy sources like solar and wind. 

New carbon-intelligent computing platform

Our latest advancement in sustainability, developed by a small team of engineers, is a new carbon-intelligent computing platform. We designed and deployed this first-of-its kind system for our hyperscale (meaning very large) data centers to shift the timing of many compute tasks to when low-carbon power sources, like wind and solar, are most plentiful. This is done without additional computer hardware and without impacting the performance of Google services like Search, Maps and YouTube that people rely on around the clock. Shifting the timing of non-urgent compute tasks—like creating new filter features on Google Photos, YouTube video processing, or adding new words to Google Translate—helps reduce the electrical grid’s carbon footprint, getting us closer to 24x7 carbon-free energy.
Low carbon energy graphic

Visualization of how we shift compute tasks to different times of day to align with the availability of lower-carbon energy. In this illustration, wind energy in the evening and solar energy during the day.

Each day, at every Google data center, our carbon-intelligent platform compares two types of forecasts for the following day. One of the forecasts, provided by our partner Tomorrow, predicts how the average hourly carbon intensity of the local electrical grid will change over the course of a day. A complementary Google internal forecast predicts the hourly power resources that a data center needs to carry out its compute tasks during the same period. Then, we use the two forecasts to optimize hour-by-hour guidelines to align compute tasks with times of low-carbon electricity supply. Early results demonstrate carbon-aware load shifting works. Results from our pilot suggest that by shifting compute jobs we can increase the amount of lower-carbon energy we consume. 

Baseline vs carbon-aware load

Data from our pilot illustrates how the new system shifts compute from our baseline (dashed line) to better align with less carbon-intensive times of the day—such as early morning and late evening (solid line)—when wind energy is most plentiful. Gray shading represents times of day when more carbon-intensive energy is present on the grid.

What’s next

The first version of this carbon-intelligent computing platform focuses on shifting tasks to different times of the day, within the same data center. But, it’s also possible to move flexible compute tasks between different data centers, so that more work is completed when and where doing so is more environmentally friendly. Our plan for the future is to shift load in both time and location to maximize the reduction in grid-level CO2 emissions. Our methodology, including performance results of our global rollout, will be shared in upcoming research publications. We hope that our findings inspire other organizations to deploy their own versions of a carbon-intelligent platform, and together, we can continue to encourage the growth of carbon-free electricity worldwide. Learn more about Google’s progress toward a carbon-free future on our Sustainability site.