def remove_flickr8k_splits(flickr30k_splits, flickr8k_splits):
    """Remove Flickr 8k images from Flickr 30k train-dev-test splits."""
    flickr8k_all = []
    for _, uids in flickr8k_splits.items():
        flickr8k_all.extend(list(map(lambda uid: uid.split("_")[0], uids)))

    flickr30_removed = {}
    for subset, uids in flickr30k_splits.items():
        uids_removed = []
        for uid in uids:
            if uid not in flickr8k_all:
                uids_removed.append(uid)
        flickr30_removed[subset] = uids_removed

    return flickr30_removed