A logistic regression should suffice in this case. I happen to have some similar data I can use to demonstrate.
The data contain the level of herbicide applied to a group of plants, the total number of plants in the replicate, and the number of plants which died. Here is a representation of the proportion of plants which died for each concentration of herbicide. Each concentration has 3 replicates. The highest and lowest concentrations see all and no plants die respectively, which means the 3 dots are right on top of one another.
To analyze the relationship, we can use logistic regression (see the statsmodels package in python).
The imbalance/balance between groups is not an issue here. The goal here is estimation rather than classification, so the fact that groups may be imbalanced is actually a good thing. Once you fit your model, you will be able to output summaries of the model. Here is the summary for the model fit to my data
We can see here that that the effect of increasing the herbicide by one unit results in a 2.65 unit increase in the log odds of the plant dying.
I'm not prepared to walk through a detailed example of how to use logistic regression for estimation in this manner. Many examples exist on this site, several of which I have authored. This should set you down the right path. Look up the documentation for Logistic Regression in statsmodels (see here) to start.