Front-End Upload media with category

Maybe you can assign attachment to those categories after upload? Check this example.

function add_category_automatically($post_ID) {
    $attach = get_post($post_ID);
    if ($attach->post_parent) {
        $cats = get_the_category()($attach->post_parent);
        foreach ($cats as $cat) {
            wp_set_object_terms($post_ID, $cat->slug, 'category', true);
        }
    }
}
add_action('add_attachment', 'add_category_automatically');

Source